Method for constructing controllable three-dimensional scene stylized framework based on three-dimensional Gaussian

Through the controllable stylization framework of three-dimensional Gaussian, combined with the loss function of mask matching and image feature alignment, the problems of inaccurate stylization and information loss in traditional 3D scene stylization are solved, and high-quality and fine-grained stylization are achieved Effect.

CN118887344AActive Publication Date: 2024-11-01EAST CHINA NORMAL UNIV

Patent Information

Application Number
CN202411039332.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-31
Publication Date
2024-11-01
Estimated Expiration
2044-07-31

AI Technical Summary

Technical Problem

Traditional three-dimensional scene stylization lacks the ability to precisely control the stylized region, and the style transfer method based on implicit neural radiation fields is difficult to be faithful to the complete stylistic image, resulting in insufficient quality of the stylized results.

Method used

Adopting a controllable 3D scene stylized framework based on three-dimensional Gaussian, the precise matching of the region within the scene and the style image is achieved through the mask matching module, a style transfer loss function based on image feature alignment is designed, and a scene geometry and content protection module are set to retain it. Original information.

Benefits of technology

Accurate and controllable three-dimensional scene stylization is achieved, and the style transfer results are faithful to the complete style image, and high-quality stylized results are obtained in a short period of time, while protecting the scene's geometric and content information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118887344A_ABST
    Figure CN118887344A_ABST
Patent Text Reader

Abstract

The invention discloses a method for constructing a controllable three-dimensional scene stylization framework based on three-dimensional Gaussian. According to the method, a mask matching module, a color conversion module, a style migration loss function based on image feature alignment, a scene geometry and content protection module and a three-dimensional Gaussian scene stylization module are provided. The mask matching module firstly obtains a mask matching group of the same semantic tag; the color conversion module aligns color distribution of the content image, the style image and the three-dimensional Gaussian; the style migration loss function based on image feature alignment is used for realizing scene style migration; the scene geometry and content protection module can keep scene geometry information and content information in the style migration process; and the three-dimensional Gaussian scene stylization module optimizes three-dimensional Gaussian parameters to realize scene stylization. The framework constructed by the method is controllable and high in fine granularity, and meanwhile, high-quality three-dimensional scene stylization is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer vision and computer graphics three-dimensional scene style transfer, and in particular to a framework construction method for accurately and controllably transferring the style of a three-dimensional scene based on three-dimensional Gaussian. Background Art

[0002] In recent years, driven by the rapid development of fields such as virtual reality, augmented reality, and video games, the demand for 3D stylization technology has increased significantly. 3D stylization allows artists and developers to convert 2D artworks with unique visual styles into 3D models, thereby maintaining the consistency of the style while providing users with an immersive three-dimensional experience. The introduction of neural radiance fields (NeRF) has greatly promoted the progress of novel view synthesis and promoted the development of 3D stylization. Subsequently, a large number of NeRF-based 3D style transfer techniques have surfaced.

[0003] After that, most optimization-based NeRF stylization methods adopted the nearest neighbor feature matching (NNFM) loss. The optimization process is as follows: for each feature vector of the rendered image in the feature map, the nearest feature vector in the feature map of the style image is first identified by nearest neighbor feature matching. Subsequently, the distance between the two feature vectors is minimized. This method achieves high-quality stylization results. However, simply minimizing the distance between neighboring features does not take into account the global information of the image. This practice may cause the scene to only adopt local style features of the style image, resulting in some loss of artistic style in the transfer process.

[0004] Neural Radiance Fields (NeRF) uses a multi-layer perceptron (MLP) to represent the color and volume density of each point in the scene, which makes it challenging to separate the scene's appearance from its geometry. Scene stylization affects the appearance while geometric information may be compromised. In addition, since NeRF is an implicit representation, it is challenging to perform high-precision, fine-grained scene editing. Recently, a novel 3D representation called 3D Gaussian Splattering (3DGS) was introduced to address multiple tasks, including novel view synthesis. 3DGS achieves higher rendering quality with shorter training time and supports real-time rendering through a fast differentiable rasterizer. Due to the explicit nature of the Gaussian, 3DGS is particularly advantageous for scene editing, however, existing methods generally rely on textual cues for scene editing, which poses a challenge for stylization. Abstract artistic style is difficult to express in words, which often results in sub-high-quality stylization when using text-based descriptions. Summary of the invention

[0005] The purpose of the present invention is to address the following problems: a) traditional three-dimensional scene stylization does not have the ability to accurately control the stylized area; b) the migration results of traditional three-dimensional scene style transfer methods are difficult to be faithful to the complete style image; c) to solve the problems described in a) and b), it is necessary to accurately match the style features of the scene area with the style image, and the style transfer method based on implicit neural radiation field is difficult to solve these problems. A method for constructing a controllable three-dimensional scene style transfer framework based on three-dimensional Gaussian is proposed, and the constructed framework is used to achieve accurate and controllable three-dimensional scene stylization. Different from the previous method based on neural radiation field, the framework constructed by the present invention uses explicit three-dimensional Gaussian to achieve controllable scene stylization.

[0006] The correspondence between style content and three-dimensional scene plays an important role in controllable scene stylization. Therefore, the present invention introduces a mask matching module to achieve precise control effect. At the same time, a color conversion module is set to convert the color distribution of the content image and the three-dimensional Gaussian into the color distribution of the corresponding style image area.

[0007] Most of the existing 3D scene style transfer loss functions are based on nearest neighbor feature matching, which only transfers the local style of the style image. Therefore, a style transfer loss function based on image feature alignment is designed to make the style transfer result faithful to the complete style image. In addition, in order to preserve the geometry and content information of the original scene, a scene geometry and content protection module is set up that introduces multiple loss functions and Gaussian regularization terms. Finally, a 3D Gaussian scene stylization module is set up to optimize the 3D Gaussian parameters.

[0008] The specific technical solution for achieving the purpose of the present invention is:

[0009] A method for constructing a controllable three-dimensional scene stylization framework based on three-dimensional Gaussian, characterized in that the framework is used to achieve accurate and controllable three-dimensional scene stylization, and the construction method includes the following specific steps:

[0010] Step 1: Set up the mask matching module

[0011] The user inputs a prompt phrase for segmenting the content image and the style image into the mask matching module. The module calls the SAM segmentation method to obtain the 2D semantic segmentation mask of the content image and the style image, and selects the correspondence between the scene content and the style area. Then, the semantic label of the semantic segmentation mask is back-projected onto the 3D Gaussian to determine the semantic label of each 3D Gaussian. The content image, style image and 3D Gaussian with the same semantic label are matched together to obtain the mask matching relationship.

[0012] Step 2: Set up the color conversion module

[0013] According to the mask matching relationship obtained in step 1, the linear color conversion parameters of the original scene content image and the color distribution of the three-dimensional Gaussian in the scene are calculated to be converted into the style image area matching them, and the color distribution of the content image and the three-dimensional Gaussian is converted into the color distribution of the corresponding style image area;

[0014] Step 3: Set the style transfer loss function based on image feature alignment

[0015] According to the mask matching relationship obtained in step 1, the affinity matrix between the rendering feature map and the style feature map is calculated; the alignment matrix for aligning the rendering feature map to the style feature map is calculated through the affinity matrix, and then the aligned feature map is obtained using the alignment matrix; the loss function is set using the rendering feature map and the aligned feature map;

[0016] Step 4: Set up scene geometry and content protection module

[0017] The depth loss is calculated by using the initial depth map of the three-dimensional Gaussian before rendering optimization and the depth map obtained by Gaussian rendering in the optimization stage. At the same time, the regularization items of the Gaussian scale parameter and opacity parameter are set to protect the scene geometry information. The content loss function and the total variational loss are set to protect the scene content information.

[0018] Step 5: Set up the 3D Gaussian scene stylization module

[0019] The 3D Gaussian scene stylization module includes optimizing Gaussian parameters using a reconstruction loss function to obtain a consistent expression; optimizing the 3D Gaussian parameters in the scene using multiple loss functions and regularization terms set in steps three and four to achieve controllable 3D scene stylization based on 3D Gaussian.

[0020] Further, the mask matching module, in which the user inputs the content image I c 、Style Image I s and two prompt phrases Text used to segment the content image and style image respectively c and Text s , the module uses the SAM segmentation method to obtain the content image semantic mask M c and style image semantic mask M s ; At the same time, enter the prompt phrase Text c and Text s The prompt words with the same index in are used as a pair of matching prompt words to match the corresponding mask area, and M is obtained. c and M s The mask matching relationship of c The semantic label of is back-projected onto the Gaussian to obtain the semantic label corresponding to the Gaussian. Specifically, the weight of the jth semantic label of the i-th Gaussian is first calculated:

[0021]

[0022] in, represents the weight of the jth semantic label of the i-th Gaussian, and p is the mask M c The pixel on i is the weight for alpha blending, T i is the transmittance of the back-projected semantic label when it reaches the i-th Gaussian;

[0023] Next, by setting a threshold and comparing it with the calculated semantic label weight, the semantic label corresponding to the Gaussian is determined; for the zth semantic label, its corresponding mask matching group is obtained in is the mask area whose semantic label is the zth semantic label in the semantic mask of the style image, is the mask area whose semantic label is the zth semantic label in the semantic mask of the content image, G z is a three-dimensional Gaussian with the zth semantic label in the scene.

[0024] Furthermore, the color conversion module aims to convert the color domain of the scene representation into the color domain of the style image; specifically, is the set of all pixel colors in the content image region to be recolored, and let is the set of all pixel colors in the style image area; by matching the content color set {p c} and style color set {p s} to calculate the linear color conversion weights and bias:

[0025] p ct =Ap c +b,c ct =Ac+b,

[0026] stE[p ct ]=E[p s ],Cov[p ct ]=Cov[p s ],

[0027] Among them, c is the original Gaussian color set, p ct and c ct They represent the content image color set and Gaussian color set after linear color conversion, A is the weight parameter of linear color conversion, and b is the bias parameter of linear color conversion. The weight and bias parameters of linear color conversion are obtained by solving the above formula, and color conversion is performed on the content image and the three-dimensional Gaussian in the scene.

[0028] Furthermore, the style transfer loss function based on image feature alignment converts the rendered image I r and style image I s Through the same VGG-16 network, the rendering feature map F is extracted respectively r and style feature map F s ; Among them, the rendered image is obtained by rendering the three-dimensional Gaussian in the scene using a fast differentiable rasterizer. The specific formula is as follows:

[0029]

[0030] Among them, C represents the color of the rendered pixel, c i Indicates the color of the i-th Gaussian rendering the pixel;

[0031] For the zth semantic label, based on the mask matching group Ω obtained in step 1 z , extract the feature vector set corresponding to the rendered image and style image in the feature map and In order to set the feature vector and Alignment, calculate the alignment matrix P z To transform the rendering feature vector set Subsequently, the normalized cross-correlation between features is used as a similarity measure to construct an affinity matrix to make up for the lack of semantic information in image features. The affinity matrix of rendering and style features is represented as A z , the specific calculation formula is as follows:

[0032]

[0033] in Indicates A z The value of position (i, j) in express The i-th eigenvector in , express The j-th eigenvector of ; express With the feature vector set Each eigenvector of Calculate the k nearest neighbor set obtained by normalized cross correlation; express With the feature vector set Each eigenvector of The k nearest neighbor set obtained by calculating the normalized cross correlation; s(x, y) is expressed as the normalized cross correlation of the feature vectors x and y, where x and y are and The normalized feature vector is obtained; using the affinity matrix A z, feature alignment is achieved by combining highly correlated features more closely together within the two feature distributions in the feature subspace; the objective function for achieving alignment is expressed as follows:

[0034]

[0035] Where N pair represents the number of nearest neighbor pairs, and Respectively and The number of eigenvectors in; By solving the objective function, the alignment matrix P is obtained z , get the rendering feature vector set The corresponding aligned feature vector set The feature vector set corresponding to the z semantic labels By splicing according to the original pixel position, the aligned feature map F can be obtained. rs ; Let F r (i, j) represents the feature map F r The feature vector at the pixel position (i, j), F rs (i, j) represents the feature map F after feature alignment rs The feature vector at the pixel position (i, j) of , the style loss function is written as follows:

[0036]

[0037] Among them, N F Represents the rendering feature map F r The number of pixels, dist(F r (i, j), F rs (i, j)) is used to calculate the eigenvector F r (i, j) and the eigenvector F rs The cosine similarity between (i, j).

[0038] Furthermore, the scene geometry and content protection module protects scene geometry information through depth constraints and Gaussian parameter regularization; the depth constraint uses a fast differentiable rasterizer to render the depth map D, and the specific formula is as follows:

[0039]

[0040] Among them, d i Represents the depth value of the i-th Gaussian; depth loss The initial depth map D is obtained by calculating the original Gaussian rendering init And the rendered depth map D obtained using Gaussian rendering in the current optimization stage rThe depth loss between them is obtained, let N D is the number of pixels in the depth map, and the specific calculation formula for the depth loss is:

[0041]

[0042] Gaussian parameter regularization, in order to prevent overfitting during the scene stylization process, the Gaussian scale parameter and opacity parameter are regularized, and N G is the number of Gaussians in the scene, and the specific calculation formula of the regularization term is:

[0043]

[0044] At the same time, by calculating the content loss That is, the perceptual loss between the rendered feature map and the feature map of the original content view is used to protect the content information of the scene; noise will affect the image quality and cause the content information to be damaged, so the total variation loss is introduced Reduce high-frequency noise in the image while preserving its overall structure; the above-mentioned loss function is implemented as follows:

[0045]

[0046] Where N I To render the image I r The number of pixels, F c The content feature map extracted by the VGG-16 network for the content image.

[0047] Furthermore, the three-dimensional Gaussian scene stylization model uses a reconstruction loss function to optimize Gaussian parameters to obtain a consistent expression; the reconstruction loss function used for optimization The formula is as follows:

[0048]

[0049] Where λ is the weight balance coefficient between loss functions; and Represents the rendered image I r and content image I c The average pixel value of the rendered image I r and content image I c The pixel value variance of Represents the rendered image I r and content image I c The pixel value covariance of C 1 and C 2 A constant for stable division calculation;

[0050] Use the multiple loss functions and regularization terms set in steps 3 and 4 to optimize the three-dimensional Gaussian parameters in the scene. The specific calculation formula is as follows:

[0051]

[0052] Among them, L tot is the overall loss function of the 3D Gaussian scene stylization module; prefix coefficient λ s ,λ dep ,λ sca ,λ opa ,λ con ,λ tv is a pre-set hyperparameter coefficient, the setting of which is demonstrated through multiple experiments; the three-dimensional Gaussian scene is optimized using the overall loss function to obtain a stylized three-dimensional scene representation.

[0053] The framework constructed by the present invention can realize accurate and controllable three-dimensional scene stylization.

[0054] To this end, a mask matching module is designed. Users can control the matching of scene content and style image areas by inputting prompt phrases and adjusting the order of prompt words in the prompt phrases, thereby achieving controllable and highly fine-grained scene stylization.

[0055] In addition, in order to improve the quality of scene stylization, a color conversion module is set up to perform linear color conversion on the content image and scene Gaussian according to the mask matching group obtained by the mask matching module, so that their color domain is aligned with the color domain of the corresponding style image area, laying the foundation for subsequent stylization.

[0056] In addition, to address the problem that the results obtained by the existing scene style transfer loss function are difficult to be faithful to the complete style image, a style transfer loss function based on image feature alignment is designed to align the feature distribution of the rendered image and the feature distribution of the style image to obtain high-quality style transfer results that are faithful to the complete style image.

[0057] At the same time, the scene style transfer process is accompanied by the loss of scene geometry and content information. In order to alleviate this problem, a scene geometry and content protection module is set up. By introducing depth constraints, Gaussian parameter regularization terms, content loss and total variation loss, the scene geometry and content information are protected while ensuring the quality of scene stylization.

[0058] Finally, the 3D Gaussian scene stylization module is set to optimize the Gaussian parameters. In the first part, the reconstruction loss function is used to optimize the 3D Gaussian parameters so that the 3D Gaussian expression in the content view and the scene is consistent. In the second part, the 3D Gaussian parameters are optimized using the previously set style transfer loss function based on image feature alignment and multiple loss functions and regularization terms in the scene geometry and content protection module to achieve high-quality 3D scene stylization.

[0059] Beneficial Effects

[0060] 1) The present invention constructs a 3D scene stylization framework based on 3D Gaussian, which can achieve accurate and controllable high-quality scene stylization results in a short time.

[0061] 2) By leveraging the explicit properties of 3D Gaussians, we implement a mask matching module and a color conversion module, which lay the foundation for precise and controllable scene stylization.

[0062] 3) In order to make the stylized results faithful to the complete style image, a style transfer loss function based on image feature alignment is designed to achieve high-quality stylized results.

[0063] 4) By setting up scene geometry and content protection modules, the geometry information and content information of the original scene are protected while the scene is stylized. BRIEF DESCRIPTION OF THE DRAWINGS

[0064] Figure 1 This is a diagram of the architecture of the present invention applied to three-dimensional scene style transfer;

[0065] Figure 2 A schematic diagram of calculating the style migration loss function based on image feature alignment in the present invention;

[0066] Figure 3 It is a schematic diagram of the controllability and effectiveness of the method of the present invention. DETAILED DESCRIPTION

[0067] The present invention is described in detail below with reference to the accompanying drawings and embodiments.

[0068] Example

[0069] See also Figure 1 , this embodiment includes the following specific steps:

[0070] Step 1. Set up the mask matching module

[0071] In order to achieve fine-grained and controllable 3D scene stylization, it is necessary to match the style region to be transferred with the content of the scene. Using the explicit features of Gaussian, the purpose of this module is to obtain a mask matching group of style image region, content image region and scene Gaussian. Figure 1As shown, the user inputs the content image I c 、Style Image I s and two prompt phrases Text used to segment the content image and style image respectively c and Text s , the module uses the SAM segmentation method to obtain the content image semantic mask M c and style image semantic mask M s ; At the same time, enter the prompt phrase Text c and Text s The prompt words with the same index in are used as a pair of matching prompt words to match the corresponding mask area, and M is obtained. c and M s Then, M c The semantic label of is back-projected onto the Gaussian to obtain the semantic label corresponding to the Gaussian. Specifically, the weight calculation method of the jth semantic label of the i-th Gaussian is first calculated as follows:

[0072]

[0073] in, represents the weight of the jth semantic label of the i-th Gaussian, and p is the mask M c The pixel on i is the weight for alpha blending, T i is the transmittance of the back-projected semantic label when it reaches the i-th Gaussian. Next, by setting a certain threshold and comparing it with the calculated semantic label weight, the semantic label corresponding to the Gaussian is determined. For the z-th semantic label, its corresponding mask matching group can be obtained

[0074] Step 2. Set up the color conversion module

[0075] In order to enhance the stylization effect, it is necessary to ensure that the color domain of the stylized scene is consistent with the color domain of the style image. Figure 1 As shown in , according to the obtained mask matching group, the color conversion of the corresponding area can be performed to obtain the content image and scene Gaussian aligned with the color domain, laying a solid foundation for the subsequent scene stylization. For each mask matching group, let is the set of all pixel colors in the style image area; by aligning the content color set {p c} and style color set {p s} to calculate the linear color conversion weights and bias:

[0076] p ct =Ap c +b,c ct =Ac+b,

[0077] stE[p ct ]=E[p s ],Cov[p ct ]=Cov[p s ],

[0078] Among them, c is the original Gaussian color set, p ct and c ct They respectively represent the content image color set and Gaussian color set after linear color conversion. According to the above formula, the weight and bias parameters of linear color conversion can be solved.

[0079] Step 3. Set up the style transfer loss function based on image feature alignment

[0080] Most of the existing optimization-based 3D scene style transfer methods use the nearest neighbor feature matching loss function to optimize the scene, and the style transfer results obtained are difficult to be faithful to the complete style image. Figure 2 As shown, the loss function based on image feature alignment is used to render image I r 、Style Image I s and mask matching group as input, where the rendered image is obtained by rendering the three-dimensional Gaussian in the scene using a fast differentiable rasterizer, and the specific formula is as follows:

[0081]

[0082] Among them, C represents the color of the rendered pixel, c i Indicates the color of the i-th Gaussian rendering the pixel;

[0083] After that, the rendered image I r and style image I s Through the same VGG-16 network, the rendering feature map F is extracted respectively r and style feature map F s For the zth mask matching group Ω z , extract the feature vector set corresponding to the rendered image and style image in the feature map and In order to set the feature vector and Alignment, calculate the alignment matrix P z To transform the rendering feature vector set Subsequently, the normalized cross-correlation between features is used as a similarity measure to construct an affinity matrix to make up for the lack of semantic information in image features. Specifically, the affinity matrix of rendering and style features is represented as A z , the specific calculation formula is as follows:

[0084]

[0085] in Indicates A z The value of position (i, j) in express The i-th eigenvector in , express The j-th eigenvector of ; express With the feature vector set Each eigenvector of Calculate the k nearest neighbor set obtained by normalized cross correlation; express With the feature vector set Each eigenvector of The k nearest neighbor set obtained by calculating the normalized cross correlation is taken as k = 5; s(x, y) is represented by the normalized cross correlation of the feature vectors x and y, where x and y are and The normalized feature vector is obtained; using the affinity matrix A z , feature alignment is achieved by combining highly correlated features more closely together within the two feature distributions in the feature subspace; specifically, the objective function for achieving alignment is expressed as follows:

[0086]

[0087] Where N pair represents the number of nearest neighbor pairs, and Respectively and The number of corresponding eigenvectors; By solving the objective function, the alignment matrix P is obtained z , we can get the rendering feature vector set The corresponding aligned feature vector set The feature vector set corresponding to the z semantic labels By splicing according to the original pixel position, the aligned feature map F can be obtained. rs ; Let F r (i, j) represents the feature map F r The feature vector at the pixel position (i, j), F rs (i, j) represents the feature map F after feature alignment rs The feature vector at the pixel position (i, j) of , the style loss function is written as follows:

[0088]

[0089] Among them, N F Represents the rendering feature map Fr The number of pixels, dist(F r (i, j), F rs (i, j)) is used to calculate the eigenvector F r (i, j) and the eigenvector F rs The cosine similarity between (i, j). Figure 2 As shown, the feature map F will be rendered r To the aligned feature map F rs By optimizing, style transfer can be achieved. The alignment process is done through an alignment matrix P z Therefore, the feature distribution of the original rendered image is preserved. At the same time, due to the alignment to the entire style feature, the style transfer result is faithful to the complete style image.

[0090] Step 4. Set up scene geometry and content protection module

[0091] In the process of style transfer, scene geometry and content information will be affected. Figure 1 As shown in Figure 1, in the process of optimizing the Gaussian parameters of the scene, depth loss, Gaussian parameter regularization term, content loss and total variation loss are introduced. For depth loss, the 3D Gaussian can use a fast differentiable rasterizer to render the depth map D. The specific formula is as follows:

[0092]

[0093] Among them, d i Represents the depth value of the i-th Gaussian. Depth loss The initial depth map D is obtained by calculating the original Gaussian rendering init And the rendered depth map D obtained using Gaussian rendering in the current optimization stage r The depth loss between them is obtained, let N D is the number of pixels in the depth map, and the specific calculation formula for the depth loss is:

[0094]

[0095] In terms of Gaussian parameter regularization, in order to prevent overfitting during scene stylization, the Gaussian scale parameter and opacity parameter are regularized. G is the number of Gaussians in the scene, and the specific calculation formula of the regularization term is:

[0096]

[0097] At the same time, by calculating the content loss That is, the perceptual loss between the rendered feature map and the feature map of the original content view is used to protect the content information of the scene; noise will affect the image quality and cause the content information to be damaged, so the total variation loss is introduced Reduce high-frequency noise in the image while preserving its overall structure. The above-mentioned loss function is implemented as follows:

[0098]

[0099] Where N I To render the image I r The number of pixels, F c The content feature map extracted by the VGG-16 network for the content image.

[0100] Step 5. Set up the 3D Gaussian scene stylization module

[0101] In the first part, since the expression of the 3D Gaussian in the content view and the scene is inconsistent after the linear color conversion in step 2, we re-optimize to obtain a consistent expression and optimize the reconstruction loss function used. The formula is as follows:

[0102]

[0103]

[0104] Where λ is the weight balance coefficient between loss functions; and Represents the rendered image I r and content image I c The average pixel value of the rendered image I r and content image I c The pixel value variance of Represents the rendered image I r and content image I c The pixel value covariance of C 1 and C 2 A constant to stabilize the division calculation.

[0105] In the second part, the three-dimensional Gaussian parameters in the scene are optimized using multiple loss functions and regularization terms set in steps three and four. The specific calculation formula is as follows:

[0106]

[0107] Among them, L tot is the overall loss function of the second part of the 3D Gaussian scene stylization module; the prefix coefficient λ s ,λde p ,λ sca ,λopa ,λ con ,λ tv is a pre-set hyperparameter coefficient, and its setting will be demonstrated through multiple experiments. The three-dimensional Gaussian scene is optimized using this overall loss function to obtain a stylized three-dimensional scene representation.

[0108] See also Figure 3 The method of the present invention can realize the scene style transfer of a complete single style map, the scene style transfer of a semantically-aware single style map, and the scene style transfer of a combination of multiple style maps, achieving a controllable and fine-grained high-quality stylization effect.

Claims

1. A method for constructing a controllable three-dimensional scene stylization framework based on three-dimensional Gaussian, characterized in that: The framework is used to achieve accurate and controllable three-dimensional scene stylization, and its construction method includes the following specific steps: Step 1: Set up the mask matching module The user inputs a prompt phrase for segmenting the content image and the style image into the mask matching module. The module uses the SAM segmentation method to obtain the 2D semantic segmentation mask of the content image and the style image, and selects the correspondence between the scene content and the style area. Then, the semantic label of the semantic segmentation mask is back-projected onto the 3D Gaussian to determine the semantic label of each 3D Gaussian, and the content image, style image and 3D Gaussian with the same semantic label are matched together to obtain the mask matching relationship; Step 2: Set up the color conversion module According to the mask matching relationship obtained in step 1, the linear color conversion parameters of the original scene content image and the color distribution of the three-dimensional Gaussian in the scene are calculated to be converted into the style image area matching them, and the color distribution of the content image and the three-dimensional Gaussian is converted into the color distribution of the corresponding style image area; Step 3: Set the style transfer loss function based on image feature alignment According to the mask matching relationship obtained in step 1, the affinity matrix between the rendering feature map and the style feature map is calculated; The affinity matrix is ​​used to calculate the alignment matrix for aligning the rendering feature map to the style feature map, and then the alignment matrix is ​​used to obtain the aligned feature map. Set the loss function using the rendered feature map and the aligned feature map; Step 4: Set up scene geometry and content protection module The depth loss is calculated by using the initial depth map of the three-dimensional Gaussian before rendering optimization and the depth map obtained by Gaussian rendering in the optimization stage. At the same time, the regularization items of the Gaussian scale parameter and opacity parameter are set to protect the scene geometry information. The content loss function and the total variational loss are set to protect the scene content information. Step 5: Set up the 3D Gaussian scene stylization module The 3D Gaussian scene stylization module includes optimizing Gaussian parameters using a reconstruction loss function to obtain a consistent expression; optimizing the 3D Gaussian parameters in the scene using multiple loss functions and regularization terms set in steps three and four to achieve controllable 3D scene stylization based on 3D Gaussian.

2. The construction method according to claim 1, characterized in that: The mask matching module, in which the user inputs the content image I c 、Style Image I s and two prompt phrases Text used to segment the content image and style image respectively c and Text s , the module uses the SAM segmentation method to obtain the content image semantic mask M c and style image semantic mask M s ; At the same time, enter the prompt phrase Text c and Text s The prompt words with the same index in are used as a pair of matching prompt words to match the corresponding mask area, and M is obtained. c and M s The mask matching relationship of Then, M c The semantic label of is back-projected onto the Gaussian to obtain the semantic label corresponding to the Gaussian. Specifically, the weight of the jth semantic label of the i-th Gaussian is first calculated: in, represents the weight of the jth semantic label of the i-th Gaussian, and p is the mask M c The pixel on i is the weight for alpha blending, T i is the transmittance of the back-projected semantic label when it reaches the i-th Gaussian; Next, by setting a threshold and comparing it with the calculated semantic label weight, the semantic label corresponding to the Gaussian is determined; for the zth semantic label, its corresponding mask matching group is obtained in is the mask area whose semantic label is the zth semantic label in the semantic mask of the style image, is the mask area whose semantic label is the zth semantic label in the semantic mask of the content image, G z is a three-dimensional Gaussian with the zth semantic label in the scene.

3. The construction method according to claim 1, characterized in that: The color conversion module aims to convert the color domain of the scene representation into the color domain of the style image; specifically, is the set of all pixel colors in the content image region to be recolored, and let is the set of all pixel colors in the style image area; by matching the content color set {p c } and style color set {p s } to calculate the linear color conversion weights and bias: p ct =Ap c +b,c ct =Ac+b, step ct ]=E[p s ], Cov[p ct ]=Cov[p s ], Among them, c is the original Gaussian color set, p ct and c ct They represent the content image color set and Gaussian color set after linear color conversion, A is the weight parameter of linear color conversion, and b is the bias parameter of linear color conversion. The weight and bias parameters of linear color conversion are obtained by solving the above formula, and color conversion is performed on the content image and the three-dimensional Gaussian in the scene.

4. The construction method according to claim 1, characterized in that: The style migration loss function based on image feature alignment converts the rendered image I r and style image I s Through the same VGG-16 network, the rendering feature map F is extracted respectively r and style feature map F s ; Among them, the rendered image is obtained by rendering the three-dimensional Gaussian in the scene using a fast differentiable rasterizer. The specific formula is as follows: Among them, C represents the color of the rendered pixel, c i Indicates the color of the i-th Gaussian rendering the pixel; For the zth semantic label, based on the mask matching group Ω obtained in step 1 z , extract the feature vector set corresponding to the rendered image and style image in the feature map and In order to set the feature vector and Alignment, calculate the alignment matrix P z To transform the rendering feature vector set Subsequently, the normalized cross-correlation between features is used as a similarity measure to construct an affinity matrix to make up for the lack of semantic information in image features. The affinity matrix of rendering and style features is represented as A z , the specific calculation formula is as follows: in Indicates A z The value of position (i,j) in express The i-th eigenvector in , express The j-th eigenvector of ; express With the feature vector set Each eigenvector of Calculate the k nearest neighbor set obtained by normalized cross correlation; express With the feature vector set Each eigenvector of The k nearest neighbor set obtained by calculating the normalized cross correlation; s(x,y) is expressed as the normalized cross correlation of the feature vectors x and y, where x and y are and The normalized feature vector is obtained; using the affinity matrix A z , feature alignment is achieved by combining highly correlated features more closely together within the two feature distributions in the feature subspace; the objective function for achieving alignment is expressed as follows: Where Npair represents the number of nearest neighbor pairs. and Respectively and The number of eigenvectors in; By solving the objective function, the alignment matrix P is obtained z , get the rendering feature vector set The corresponding aligned feature vector set The feature vector set corresponding to the z semantic labels By splicing according to the original pixel position, the aligned feature map F can be obtained. rs ; Let Fr(i,j) represent the feature map F r The feature vector at the pixel position (i, j), F rs (i,j) represents the feature map F after feature alignment rs The feature vector at the pixel position (i, j) of , the style loss function is written as follows: Among them, N F Represents the rendering feature map F r The number of pixels, dist(F r (i,j),F rs (i,j)) is used to calculate the eigenvector F r (i,j) and the eigenvector F rs The cosine similarity between (i,j).

5. The construction method according to claim 1, characterized in that: The scene geometry and content protection module protects scene geometry information through depth constraints and Gaussian parameter regularization; depth constraints use a fast differentiable rasterizer to render the depth map D, and the specific formula is as follows: Among them, d i Represents the depth value of the i-th Gaussian; depth loss The initial depth map D is obtained by calculating the original Gaussian rendering init And the rendered depth map D obtained using Gaussian rendering in the current optimization stage r The depth loss between them is obtained, let N D is the number of pixels in the depth map, and the specific calculation formula for the depth loss is: Gaussian parameter regularization, in order to prevent overfitting during the scene stylization process, the Gaussian scale parameter and opacity parameter are regularized, and N G is the number of Gaussians in the scene, and the specific calculation formula of the regularization term is: At the same time, by calculating the content loss That is, the perceptual loss between the rendered feature map and the feature map of the original content view is used to protect the content information of the scene; noise will affect the image quality and cause the content information to be damaged, so the total variation loss is introduced Reduce high-frequency noise in the image while preserving its overall structure; the aforementioned loss function is implemented as follows: Where N I To render the image I r The number of pixels, F c The content feature map extracted by the VGG-16 network for the content image.

6. The construction method according to claim 1, characterized in that: The three-dimensional Gaussian scene stylization model uses a reconstruction loss function to optimize Gaussian parameters to obtain a consistent expression; the reconstruction loss function used for optimization The formula is as follows: Where λ is the weight balance coefficient between loss functions; and Represents the rendered image I r and content image I c The average pixel value of Represents the rendered image I r and content image I c The pixel value variance of Represents the rendered image I r and content image I c The pixel value covariance of ; C1 and C2 are constants for stable division calculation; Use the multiple loss functions and regularization terms set in steps 3 and 4 to optimize the three-dimensional Gaussian parameters in the scene. The specific calculation formula is as follows: Among them, L tot is the overall loss function of the 3D Gaussian scene stylization module; prefix coefficient λ s ,λ dep ,λ sca ,λ opa ,λ con ,λ tv is a pre-set hyperparameter coefficient, the setting of which is demonstrated through multiple experiments; the three-dimensional Gaussian scene is optimized using the overall loss function to obtain a stylized three-dimensional scene representation.

Citation Information

Patent Citations

  • Three-dimensional scene consistency stylization method and system based on neural radiation field

    CN114926553A

  • Three-dimensional scene style migration method, three-dimensional scene style migration system and computer equipment

    CN117274042A

  • Three-dimensional processing method and apparatus for two-dimensional image, device, and computer readable storage medium

    WO2022042062A1

Cited By

  • Single-domain generalization remote sensing target detection method based on multiple styles and feature alignment

    CN121147614A

  • Long-tail data generation method based on feed-forward stylized reconstruction

    CN121904281A

  • A long tail data generation method based on feedforward stylization reconstruction

    CN121904281B

  • 3D Gaussian splash style migration method based on learning orthogonal color base

    CN122312370A

  • A 3D gaussian splash style transfer method based on learning orthogonal color bases

    CN122312370B