Diffusion model-based guidable indoor scene generation method and system

By introducing the cost function of physical constraints and design principles into the diffusion model, and using gradients to guide the generation process, the problems of insufficient scene generation diversity and low customizability in the existing technology are solved, and the quality and diversity of indoor scene generation are improved. , reducing the need for manual labeling.

CN118570403APending Publication Date: 2024-08-30SHANDONG UNIV
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202410639938.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-22
Publication Date
2024-08-30

Smart Images

  • Figure CN118570403A
    Figure CN118570403A
Patent Text Reader

Abstract

The invention provides an indoor scene generation method and system capable of being guided based on a diffusion model, and relates to the technical field of machine vision and scene generation, and the method comprises the steps: obtaining a boundary image of a to-be-generated room scene and a current furniture scene state, and determining a maximum time step corresponding to the complete generation of the room scene; inputting the boundary image and the current furniture scene state into a diffusion model, introducing a cost function in a scene generation process of the diffusion model, setting a function constraint, and calculating a gradient of a cost function value in the current furniture scene state with respect to a furniture pose in the current scene state; using the diffusion model to predict and output furniture pose distribution of the previous time step; and adjusting and predicting the furniture pose distribution of the previous time step according to the gradient of the furniture pose in the current scene state until the time step reaches 0, outputting a finally generated scene, and rendering a bit scene graph. According to the diffusion model, different results can be generated, so that the problem of insufficient diversity is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of machine vision and scene generation, and in particular to a method and system for generating indoor scenes that can be guided based on a diffusion model. Background Art

[0002] The statements in this section merely provide background information related to the present disclosure and do not necessarily constitute prior art.

[0003] With the rise of AIGC (artificial intelligence) technology, deep learning models are widely used in various generation tasks, such as generating images, generating 3D models, generating music, and generating scenes, etc. Such models greatly reduce the workload of scene designers and improve work efficiency.

[0004] There are many existing scene generation methods. For example, relevant furniture (such as beds and bedside tables) is extracted from the dataset based on the number of co-occurrences and relative positions of furniture, and the input furniture is divided into several groups. The furniture with strong correlation is in the same group. The relative positions of the furniture in the group and the positions of the functional groups are then iteratively optimized to generate the final result. This method is completely based on a cost formula for optimization, so the generated results are prone to lose diversity and it is difficult to generate multiple solutions for the same room. Another example is to generate scenes represented by edge graphs through training conditions. The problem with this method is that it is not highly customizable because the generative adversarial network itself does not have the ability to flexibly add guidance. Another example is to generate scenes by placing objects first and then detecting whether the robot can move normally on the task trajectory. However, this method places objects in a more arbitrary way and does not have other optimization operations, so it is difficult to ensure the quality of the generated scenes.

[0005] In summary, the existing scene generation methods still have the following problems:

[0006] 1) The method based on the optimization cost formula tends to lose diversity in the generated results, and it is difficult to generate multiple solutions for the same room;

[0007] 2) The generative adversarial network used by the neural network-based method does not have the ability to flexibly add guidance, and its customizability and guidance are not high;

[0008] 3) The image data-based method requires manual annotation of semantic information and layout information for each image in the image dataset, which requires a lot of manpower.

[0009] 4) Robot trajectory-based methods lack optimization operations, making it difficult to ensure the quality of the generated scenes. Summary of the invention

[0010] In order to solve the above problems, the present invention proposes a method and system for generating indoor scenes that can be guided by a diffusion model. The method quantifies the physical constraints and design principles of scene generation, defines the cost function of the scene, and guides the diffusion model to generate customized room scene placement by using the gradient of the cost function for the object pose in the current scene.

[0011] According to some embodiments, the present disclosure adopts the following technical solutions:

[0012] The indoor scene generation method guided by the diffusion model includes:

[0013] Obtain random noise as the furniture scene state of the initial room scene to be generated, receive the room boundary image, and take the time step corresponding to the initial furniture scene state as the maximum time step;

[0014] The furniture scene state, boundary image and current time step are converted into vector sequences, which are input into the diffusion model denoiser, the furniture scene state is converted into vector sequences, and the vector sequences are used to predict and output the furniture posture distribution of the previous time step;

[0015] In the process of scene generation by diffusion model, cost function is introduced, function constraints are set, and the gradient of cost function value under the current furniture scene state with respect to the furniture posture under the current scene state is calculated;

[0016] The furniture posture distribution of the previous time step is moved according to the gradient of the furniture posture under the current scene state to obtain a new furniture posture distribution, and sampling is performed on the new furniture posture distribution to obtain the predicted furniture posture of the previous time step;

[0017] Iterate continuously according to the time step until the time step reaches 0, output the final generated scene, and render it as a scene graph.

[0018] According to some embodiments, the present disclosure adopts the following technical solutions:

[0019] The indoor scene generation system guided by the diffusion model includes:

[0020] A data acquisition module, used for acquiring random noise as the furniture scene state of the initial room scene to be generated, receiving the room boundary image, and taking the time step corresponding to the initial furniture scene state as the maximum time step;

[0021] The diffusion model encoding and denoising module is used to convert the furniture scene state, boundary image and current time step into a vector sequence, input it into the diffusion model denoiser, convert the furniture scene state into a vector sequence, and use the vector sequence to predict and output the furniture posture distribution of the previous time step;

[0022] A generation guidance module is used to introduce a cost function in the process of generating a scene using a diffusion model, set function constraints, and calculate the gradient of the cost function value under the current furniture scene state with respect to the furniture posture under the current scene state;

[0023] The furniture posture distribution of the previous time step is moved according to the gradient of the furniture posture under the current scene state to obtain a new furniture posture distribution, and sampling is performed on the new furniture posture distribution to obtain the predicted furniture posture of the previous time step;

[0024] Iterate continuously according to the time step until the time step reaches 0, and output the final generated scene;

[0025] The scene rendering module renders the generated scene state into a scene graph.

[0026] According to some embodiments, the present disclosure adopts the following technical solutions:

[0027] A non-transitory computer-readable storage medium is used to store computer instructions. When the computer instructions are executed by a processor, the method for generating indoor scenes that can be guided based on a diffusion model is implemented.

[0028] According to some embodiments, the present disclosure adopts the following technical solutions:

[0029] An electronic device comprises: a processor, a memory and a computer program; wherein the processor is connected to the memory, the computer program is stored in the memory, and when the electronic device is running, the processor executes the computer program stored in the memory so that the electronic device executes the indoor scene generation method guided by the diffusion model.

[0030] Compared with the prior art, the present invention has the following beneficial effects:

[0031] The disclosed indoor scene generation method based on diffusion model guidance can obtain a cost function of a scene by quantifying the physical constraints of scene generation (such as generated furniture should not overlap or exceed the boundary, etc.) and the design experience of the designer (such as design principles such as "the bed in the bedroom should face the TV", etc.), and guide the generation process of the diffusion model through the gradient of the cost function with respect to the object posture in the current scene, so that the finally generated room is more in line with human ergonomics, and improves rationality and living experience. This feature can also be used to improve the customizability of the generated room.

[0032] The disclosed method for generating indoor scenes guided by a diffusion model uses a diffusion model as a starting point to generate a randomly sampled normal noise, and has the ability to generate different samples. For the same scene, the diffusion model can generate different results, thereby solving the problem of insufficient diversity. By introducing an artificially defined cost function, the gradient of the cost function is used to guide the generation at each step in the diffusion model generation process, so that the final generated result can have certain customizable characteristics. The disclosed model does not use an image data set, but directly uses a 3D scene data set for training, so that no manual labeling is required, thereby solving the problem of wasted manpower. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] The accompanying drawings constituting a part of the present disclosure are used to provide a further understanding of the present disclosure. The illustrative embodiments of the present disclosure and their descriptions are used to explain the present disclosure and do not constitute an improper limitation on the present disclosure.

[0034] Figure 1 A network structure diagram of a diffusion model denoiser according to an embodiment of the present disclosure;

[0035] Figure 2 A process diagram for generating a scenario for guidance of an embodiment of the present disclosure;

[0036] Figure 3 This is an illustration of a situation in which a physical constraint is violated in an embodiment of the present disclosure;

[0037] Figure 4 This is an illustration of a situation in which interactivity is violated in an embodiment of the present disclosure;

[0038] Figure 5 A schematic diagram of calculating the cost value of watching TV activity according to an embodiment of the present disclosure;

[0039] Figure 6 A schematic diagram of calculating the desktop work cost value according to an embodiment of the present disclosure;

[0040] Figure 7 A schematic diagram of a process of encoding a scene object into a vector according to an embodiment of the present disclosure;

[0041] Figure 8 It is a schematic diagram of a process of encoding scene boundaries and denoising time steps into vectors according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0042] The present disclosure is further described below in conjunction with the accompanying drawings and embodiments.

[0043] It should be noted that the following detailed descriptions are all illustrative and are intended to provide further explanation of the present disclosure. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present disclosure belongs.

[0044] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present disclosure. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprising" and / or "including" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.

[0045] Example 1

[0046] In one embodiment of the present disclosure, a method for generating an indoor scene based on a diffusion model is provided, and the specific implementation process includes the following steps:

[0047] Step 1: Obtain the boundary image and scene object data of the room scene, and determine the maximum time step corresponding to the complete generation of the room scene;

[0048] Step 2: Input the boundary image and the current furniture scene state into the diffusion model, use the denoiser of the diffusion model to add noise to obtain scenes with different degrees of noise, and use the noisy scenes to train the denoiser so that it can generate clean scenes from noisy data;

[0049] Step 3: When a scene needs to be generated, randomly sample a pure noise as the initial state of the scene, and the time step corresponding to this state is the maximum time step;

[0050] Step 4: Input the scene state and boundary image into the denoiser of the diffusion model, convert the furniture scene state into a vector sequence, and use the vector sequence to predict and output the furniture posture distribution at the previous time step;

[0051] Step 5: Introduce the cost function in the process of scene generation by the diffusion model, set function constraints, and calculate the gradient of the cost function value under the current furniture scene state with respect to the furniture posture under the current scene state; move the furniture posture distribution of the previous time step according to the gradient of the furniture posture under the current scene state to obtain a new furniture posture distribution, sample the new furniture posture distribution, and obtain the predicted furniture posture of the previous time step;

[0052] Step 6: Continue to iterate according to the time step until the time step reaches 0, output the final generated scene, and render it as a scene graph.

[0053] As an embodiment, the specific implementation process of a method for generating an indoor scene based on a diffusion model guide disclosed in the present invention is as follows:

[0054] Step 1: Train a conditionally generated diffusion model;

[0055] Specifically, the diffusion model is trained based on the 3D-FRONT dataset. The 3D-FRONT dataset contains 6813 complete interior design scenes, each of which corresponds to a complete suite. To improve the effect, the model is trained separately for different room types. Bedrooms, living rooms, dining rooms, and study rooms are extracted separately from the indoor scene data, resulting in a total of 11,575 bedrooms, 6,692 living rooms, 5,708 dining rooms, and 1,585 study rooms. Abnormal data is filtered out, including:

[0056] (1) In a room where the overlapping projection area of ​​furniture exceeds 30% of the projection area of ​​one of the overlapping furniture;

[0057] (2) Rooms where furniture attributes have null values;

[0058] (3) Rooms containing furniture that is obviously too small;

[0059] (4) Rooms containing furniture that extends beyond the room boundaries;

[0060] (5) A room that does not contain at least one door and one window.

[0061] Since the amount of data after filtering is greatly reduced (for example, the number of bedrooms is reduced to 5005), it will affect the generalization performance of the network, and the data needs to be augmented. Each room is flipped by 0°, 90°, 180°, and 270° to obtain 4 times the amount of data, and then each room is mirrored left and right to obtain 8 times the data.

[0062] Furthermore, the augmented data is used to train the diffusion model. The denoiser of the diffusion model adds normal noise to the original data step by step, so that the distribution of the noisy data gradually approaches a normal noise when the time step is large. The denoiser is different from the denoiser and is not a neural network, so it does not need to be trained. The noisy data processed by the denoiser will be used to train the denoiser, so that the denoiser can obtain the ability to gradually reduce the noise from a pure noise to obtain a clean sample. Specifically, in the present disclosure, each scene object has four attributes: category, position, orientation and size. The category describes the classification of an object, such as "TV", "chair", etc.; the position is described by the relative coordinates of the object relative to the center of the room, which is a three-dimensional vector; the orientation is represented by the direction vector of the object's forward direction, which is a three-dimensional vector; the size is represented by the length, width and height of the object's bounding box, which is a three-dimensional vector. In the present disclosure, the category is not processed, but the three attributes of position, orientation and size are denoised. For each attribute x to be denoised, the state before the noise is added is recorded as x 0 , the state after adding noise t steps is recorded as x t , the noise addition process at each step is consistent with the original diffusion model and can be expressed as

[0063]

[0064] Among them, 1-α t Corresponding to the variance of the normal noise added in step t, the size of the variance term can be freely selected as long as it can ensure that the data distribution obtained after the noise addition is close to a normal distribution. ε t is a multivariate normal noise sampled from a multivariate standard normal distribution N~(0,I). The normal noise used in this disclosure has a mean of 0, a variance that varies linearly from 0.0001 to 0.02, and a maximum time step of 1000 steps for adding noise.

[0065] After obtaining the data of different rooms at different time steps by adding noise at each time step, a denoiser is trained using this data. By predicting the noise added during denoising, the model has the ability to gradually restore the original data from a normal noise. This ability enables the denoiser of the diffusion model to generate high-quality samples from randomly sampled noise.

[0066] Step 2: Use the noisy data to train the diffusion model denoiser

[0067] In this disclosure, the scene will be encoded as a vector sequence to facilitate processing by the denoiser network.

[0068] The scene boundary information and the current time step will be encoded into a vector such as Figure 8 As shown; the boundary of the scene is rendered as a binary image based on the scene boundary vertex information provided by the dataset. The part covered by the ground will be set to 1, and the part not covered by the ground will be set to 0. The image will be extracted through the convolutional neural network ResNet and output a 2k-dimensional feature vector. In this disclosure, the ResNet integrated in the PyTorch toolkit is used to achieve this; the value of the current time step is converted into a 2k-dimensional feature vector by querying a trainable embedding vector table; the feature vector representing the scene boundary information and the feature vector representing the current time step will be concatenated to become the first element S in the sequence 0 .

[0069] Each object in the scene will be encoded as a vector, such as Figure 7 As shown in the figure. Each furniture category will be converted into a k-dimensional feature vector by querying the trainable embedding vector table; the position, orientation and size of each furniture will be converted into a k-dimensional feature vector respectively through a multi-layer perceptron; these four feature vectors will be concatenated into a vector, corresponding to the second to the last element in the sequence, respectively denoted as S 1 ,...,S n .

[0070] The denoiser architecture and processing used are as follows Figure 1 As shown. The network will accept a vector sequence as input and produce a vector sequence of the same length as output. The encoder layer can learn the interaction between elements in the collection through the self-attention mechanism, thereby learning the relative position relationship between furniture. The two encoder layers are connected by residuals to avoid the problem of feature disappearance caused by the network being too deep. The encoder is a conventional Transformer encoder, which has been integrated in the PyTorch toolkit. Its principle is to use three trainable parameter matrices W for linear transformation Q ,W K ,W V , applying these three transformations to each element in the sequence, we will get the Q vector, K vector, and V vector corresponding to each element. The dot product of the Q vector of the i-th element and the K vector of the j-th element will be used to measure the attention value of the i-th element to the j-th element. The normalized attention value is multiplied by the V vector representing the semantic information of the element to obtain the feature vector that combines the information of each element in the sequence, achieving the effect of information aggregation.

[0071] Input the vector sequence of length n+1 into the denoiser to obtain a new feature vector sequence of length n+1, each element of which is denoted as S' 0 ,S' 1 ,S' 2 .... Discard S' corresponding to the input scene boundary 0 , decode the remaining feature vectors of the feature sequence to get the predicted value of the diffusion model noise. Calculate the mean square loss between the predicted value and the real noise sampled in the diffusion stage to optimize the denoiser parameters. The details are as follows:

[0072]

[0073]

[0074]

[0075] L=αL t +βL r +γL s

[0076] Where f is the decoder function that decodes position noise from the feature vector, g is the decoder function that decodes orientation noise from the feature vector, and h is the decoder function that decodes size noise from the feature vector. All three decoders are implemented using a multi-layer perceptron. i is the true value of the noise added to the position of the i-th furniture in the scene, r i is the true value of the noise added to the orientation of the i-th furniture in the scene, s iis the true value of the noise added to the size of the i-th furniture in the scene. Use different constants α, β, and γ to weight the losses of these three attributes to form the final loss function L. The gradient of the loss function to the denoiser parameters can be calculated, and the denoiser can be trained by the gradient descent method, so that the denoiser can achieve noise reduction by predicting noise. The trained denoiser will be able to gradually generate a clean scene from a pure noise.

[0077] Step 3: Define the cost function and calculate the scene cost value

[0078] The trained diffusion model can only randomly generate a reasonable scene. In order to further improve the quality of scene generation and improve the customizability of scene generation, physical constraints and customized guidance are implemented by defining a cost function.

[0079] Specifically, the cost function of the present disclosure includes the following parts.

[0080] 1) Physical constraints

[0081] A basic requirement for scene generation is that the placed furniture cannot collide. Let the projection of the i-th object on the ground be G i , the physical constraint cost of the room can be defined as

[0082]

[0083] Among them, ∩ represents the intersection operation, and || represents the area operation. This formula calculates the ratio of the overlapping area of ​​each object's projection on the ground to the sum of the projection areas of all furniture on the ground. The value range of this cost function is [0,1]. The more serious the overlap of furniture in the room, the larger the value of this cost function.

[0084] 2) Boundary Constraints

[0085] Another basic requirement for scene generation is that the generated objects cannot cross the scene boundary. Directly calculating the area of ​​each object crossing the scene boundary is relatively complicated and is not conducive to parallel execution of programs. The present disclosure makes an improvement by using the degree of intersection between the edge of the object's two-dimensional bounding box and the edge of the scene to determine the degree to which the object crosses the scene boundary.

[0086] Assume that the object bounding box edge A is currently being determined o B o A with the scene edge (wall) b B b Any point on the edge of the bounding box can be parameterized as

[0087] P=(1-α)A o +αB o 0≤α≤1

[0088] Similarly, any point on the edge of the scene can be parameterized as

[0089] P=(1-β)A b +βB b 0≤β≤1

[0090] The intersection parameters can be obtained by solving (1-α)A o +αB o =P = (1-β)A b +βB b The solution is

[0091]

[0092] Obviously, when both α and β in the solution are in the range [0,1], the two edges intersect. Therefore, for a single edge, the cost function of the boundary constraint can be defined as

[0093]

[0094] Among them, α is the value between the two vertices A of the bounding box. o B o The parameters used to locate a point P on a determined straight line are obtained according to the method provided by the above formula; β is the distance between two vertices A at the boundary of a scene b B b The parameters used to locate a point P on a determined straight line are obtained using the method provided by the above formula.

[0095] The boundary constraint cost for the entire scene, defined as the average of all edge costs.

[0096] In the early stage of denoising, the furniture placement is randomly sampled from the noise, so there is a high probability that it will exceed the scene boundary. At this time, it is meaningless to use ordinary boundary constraints to guide. Therefore, in the early stage of denoising, the scene boundary is widened by a certain value, and the boundary is gradually tightened as the denoising time step changes, and completely shrunk to the original scene boundary when the denoising time step is 0.

[0097] 3) Interactivity

[0098] For most types of furniture, we need interactive space around the furniture. For example, space needs to be left in front of the wardrobe for human operation, and space needs to be left on one side of the bed for people to touch the bed. Let the projection of the i-th object on the ground be G i , the projection of the required interactive space on the ground is I i , the furniture interactivity cost of a room can be defined as

[0099]

[0100] That is, the ratio of the required range of the covered interaction to the sum of the interaction ranges of all furniture. The value range of this cost function is [0,1]. The worse the interactivity of the furniture in the room, the larger the value of this cost function.

[0101] 4) Activity cost: watching TV

[0102] When there is a TV-type furniture in the scene, there needs to be a piece of furniture for people to sit or lie on, placed directly opposite the TV. For each piece of furniture that can be sat on in the scene, calculate the degree to which it faces the TV, and use this as the activity cost. This cost can be defined as

[0103]

[0104] Where r sit is the orientation vector of the sitable furniture, and v is the direction vector from the sitable furniture to the TV.

[0105] 5) Activity Cost: Desk Work

[0106] Tables and chairs in a scene usually need to appear in pairs, and there may be a one-to-one or one-to-many situation between tables and chairs. For a table and a chair in a scene, the distance between them needs to be close enough to function, so the accessibility cost value is defined as follows

[0107]

[0108] Another important factor for desk work is lighting. When the occupant is doing desk work, they need to have light from behind and above, and avoid the influence of light directly in front. The lighting cost value is defined as follows

[0109]

[0110] Where u is the direction vector from the seatable furniture to the tabletop, and v is the direction vector from the light source (such as a lamp, window, etc.) to the tabletop.

[0111] The final cost value for the desk job can be defined as the average of the accessibility cost and the lighting cost.

[0112] For the case where there are multiple pairs of tables and chairs in a scene, weighting is performed in the same way as the cost value of watching TV.

[0113] 6) Total cost of the scenario

[0114] The total cost of the scene is obtained by weighting the above five costs. The weights can be specified as needed. For example, if the user emphasizes the interactivity of the furniture, the interactivity cost of the scene can be given a larger weight. Suppose the weights specified by the user for the above five costs are w 1 ,w 2 ,w3 ,w 4 ,w 5 , then the total cost of the scene is L Scene The calculation formula is

[0115] L Scene =w 1 L collide +w 2 L boundary +w 3 L access +w 4 L tv +w 5 L work

[0116] It should be noted that users can still define other costs to achieve guidance for different purposes. For example, if the user wants the bed in the generated room to be placed in a specific position, they only need to use the distance between the bed in the current state of the scene and the specific position as the cost function. This definition of cost makes scene generation more customizable. Using different weights can make the generated results biased in different directions. For example, increasing the weight of the activity cost of watching TV will make the TV in the generated result be placed closer to the opposite side of the sitable furniture.

[0117] Step 4: Use the cost function to guide the generation process

[0118] The above scene cost calculation is implemented in parallel and differentiably using the pytorch framework. Because each step of calculating the scene cost is differentiable, the automatic derivation mechanism of pytorch can be used to simply obtain the gradient value of the scene cost value with respect to the pose of the scene objects, thereby obtaining information on how to move the furniture to reduce the scene cost value.

[0119] Specifically, the guided generation process is as follows: using the denoiser of the diffusion model to denoise the furniture scene state at the current time step, inputting the noisy scene state and the boundary image into the denoiser of the diffusion model, converting the furniture scene state at the current time step into a vector sequence, and using the vector sequence to predict and output the furniture posture distribution at the previous time step;

[0120] The furniture pose distribution of the previous time step is moved according to the gradient of the furniture pose in the current scene state to obtain a new furniture pose distribution, and the new furniture pose distribution is upsampled to obtain the predicted furniture pose of the previous time step;

[0121] Iterate continuously according to the time step until the time step reaches 0, output the final generated scene, and render the scene graph.

[0122] Furthermore, the furniture posture distribution is the distribution center and variance.

[0123] Specifically, the maximum time step corresponding to the complete generation of the room scene is determined to be t, and when the diffusion model predicts the mean of the previous time step, an offset is added to the mean. Specifically, the denoiser of the diffusion model inputs the current (set to time step t) scene state, and its denoiser predicts the noise in the current scene, which is used to calculate the mean of the scene at time step 0. The means of time step t and time step 0 are weighted by a fixed coefficient of the diffusion model to obtain the scene mean μ at time step t-1. t-1 At this time, the mean is subtracted by a constant times the gradient of the cost function described in (3) with respect to the object posture to achieve guidance. The formula is defined as follows:

[0124] μ′ t-1 =μ t-1 -sL scene

[0125] x t-1 =sample(N(μ' t-1 ,σ t-1 ))

[0126] In the formula, μ t-1 μ' is the mean of the scene distribution at time step t-1 before adding guidance. t-1 is the mean of the scene distribution at time step t-1 after adding the guide. Finally, the scene at time step t-1 is in μ' t-1 is the mean and is sampled from a normal distribution with a certain constant established by the diffusion model as the variance.

[0127] The complete scenario generation process will iterate the above process of generating the t-1 time step scenario from the t time step scenario until the time step t reaches 0.

[0128] Step 5: Rendering the scene

[0129] When the scene generation is finished, the present invention performs rendering by receiving the camera position input by the user. The 3D model with the smallest size difference (measured by L2 distance) from the generated size value is selected in the model data set as the model to be placed in the scene. The Python script is used to interact with Blender, dynamically add these models to the Blender scene, and adjust the poses of these models according to the generated position, orientation, and size, and then call the Blender rendering engine through the Python script for rendering.

[0130] Example 2

[0131] In one embodiment of the present disclosure, a system for generating indoor scenes based on a diffusion model is provided, including:

[0132] A data acquisition module, used for acquiring random noise as the furniture scene state of the initial room scene to be generated, receiving the room boundary image as input, and taking the time step corresponding to the initial furniture scene state as the maximum time step;

[0133] The diffusion model encoding and denoising module is used to convert the furniture scene state, boundary image and current time step into a vector sequence, input it into the diffusion model denoiser, convert the furniture scene state into a vector sequence, and use the vector sequence to predict and output the furniture posture distribution of the previous time step;

[0134] A generation guidance module is used to introduce a cost function in the process of generating a scene using a diffusion model, set function constraints, and calculate the gradient of the cost function value under the current furniture scene state with respect to the furniture posture under the current scene state;

[0135] The furniture posture distribution of the previous time step is moved according to the gradient of the furniture posture under the current scene state to obtain a new furniture posture distribution, and sampling is performed on the new furniture posture distribution to obtain the predicted furniture posture of the previous time step;

[0136] Iterate continuously according to the time step until the time step reaches 0, and output the final generated scene;

[0137] The scene rendering module renders the generated scene state into a scene graph.

[0138] Example 3

[0139] In one embodiment of the present disclosure, a non-transitory computer-readable storage medium is provided, wherein the non-transitory computer-readable storage medium is used to store computer instructions. When the computer instructions are executed by a processor, the method for generating indoor scenes that can be guided based on a diffusion model is implemented.

[0140] Example 4

[0141] In one embodiment of the present disclosure, an electronic device is provided, including: a processor, a memory, and a computer program; wherein the processor is connected to the memory, the computer program is stored in the memory, and when the electronic device is running, the processor executes the computer program stored in the memory, so that the electronic device executes the indoor scene generation method guided by the diffusion model.

[0142] The present disclosure is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present disclosure. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0143] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0144] Although the above describes the specific implementation methods of the present disclosure in conjunction with the accompanying drawings, it is not intended to limit the scope of protection of the present disclosure. Technical personnel in the relevant field should understand that on the basis of the technical solution of the present disclosure, various modifications or variations that can be made by those skilled in the art without creative work are still within the scope of protection of the present disclosure.

Claims

1. A method for generating indoor scenes guided by a diffusion model, characterized in that: include: Obtain random noise as the furniture scene state of the initial room scene to be generated, receive the room boundary image, and take the time step corresponding to the initial furniture scene state as the maximum time step; The furniture scene state, boundary image and current time step are converted into vector sequences, which are input into the diffusion model denoiser, the furniture scene state is converted into vector sequences, and the vector sequences are used to predict and output the furniture posture distribution of the previous time step; In the process of scene generation by diffusion model, cost function is introduced, function constraints are set, and the gradient of cost function value under the current furniture scene state with respect to the furniture posture under the current scene state is calculated; The furniture posture distribution of the previous time step is moved according to the gradient of the furniture posture under the current scene state to obtain a new furniture posture distribution, and sampling is performed on the new furniture posture distribution to obtain the predicted furniture posture of the previous time step; Iterate continuously according to the time step until the time step reaches 0, output the final generated scene, and render it as a scene graph.

2. The method for generating indoor scenes based on a diffusion model as claimed in claim 1, characterized in that: The furniture scene state includes attribute data of the furniture, including furniture category, location, orientation, and size.

3. The method for generating indoor scenes based on a diffusion model as claimed in claim 1, characterized in that: The noise adder of the diffusion model is used to add noise to the furniture scene state at the current time step, including: The position attribute, orientation attribute and size attribute in the furniture attribute data are denoised, but the category attribute is not denoised.

4. The method for generating indoor scenes based on a diffusion model as claimed in claim 1, characterized in that: The denoiser uses a Transformer architecture without positional encoding and accepts a vector sequence as input, so the state of the current scene is converted into a vector sequence at each denoising time step, including: The scene boundary image is input into the ResNet18 network, the boundary feature vector of the scene boundary is extracted, the current time step is converted into a time feature vector of the same dimension as the boundary feature vector through an embedding operation, the time feature vector is added to the boundary feature vector to form the first element of the vector sequence, and the four attributes of each furniture are converted into four feature vectors through different embedding methods and spliced ​​into a feature vector to form each element in the vector sequence.

5. The method for generating indoor scenes based on a diffusion model as claimed in claim 4, characterized in that: The formed vector sequence is input into the Transformer architecture. After the vector sequence is re-encoded, the first vector element corresponding to the input scene boundary is discarded, the other vector sequences are decoded, and the furniture posture distribution of the previous time step is predicted and output.

6. The method for generating indoor scenes based on a diffusion model as claimed in claim 1, characterized in that: The cost function includes physical constraints, boundary constraints, interactivity constraints, activity costs and total scene costs. The total scene cost is obtained by weighted sum of physical constraints, boundary constraints, interactivity constraints and activity costs. The cost calculation is parallel and differentiable to obtain the gradient value of the scene cost value with respect to the posture of the scene objects.

7. The method for generating indoor scenes based on a diffusion model as claimed in claim 1, characterized in that: The furniture posture distribution of the previous time step is moved according to the gradient of the furniture posture in the current scene state, including: the diffusion model predicts the mean of the furniture posture distribution of the previous time step, an offset is added to the mean, the denoiser of the diffusion model inputs the scene state at the current time step t, the denoiser predicts the furniture posture in the current scene, the furniture posture in the current scene is used to calculate the mean of the scene at time step 0, the means of time step t and time step 0 are weighted by a fixed coefficient of the diffusion model to obtain the scene mean of time step t-1, and the mean is subtracted by a constant times the gradient of the cost function with respect to the object posture to achieve guidance.

8. A system for generating indoor scenes based on a diffusion model, characterized in that: include: A data acquisition module, used for acquiring random noise as the furniture scene state of the initial room scene to be generated, receiving the room boundary image, and taking the time step corresponding to the initial furniture scene state as the maximum time step; The diffusion model encoding and denoising module is used to convert the furniture scene state, boundary image and current time step into a vector sequence, input it into the diffusion model denoiser, convert the furniture scene state into a vector sequence, and use the vector sequence to predict and output the furniture posture distribution of the previous time step; A generation guidance module is used to introduce a cost function in the process of generating a scene using a diffusion model, set function constraints, and calculate the gradient of the cost function value under the current furniture scene state with respect to the furniture posture under the current scene state; The furniture posture distribution of the previous time step is moved according to the gradient of the furniture posture under the current scene state to obtain a new furniture posture distribution, and sampling is performed on the new furniture posture distribution to obtain the predicted furniture posture of the previous time step; Iterate continuously according to the time step until the time step reaches 0, and output the final generated scene; The scene rendering module renders the generated scene state into a scene graph.

9. A non-transitory computer-readable storage medium, characterized in that: The non-transitory computer-readable storage medium is used to store computer instructions, and when the computer instructions are executed by the processor, the diffusion model-guided indoor scene generation method according to any one of claims 1 to 7 is implemented.

10. An electronic device, characterized in that: include: A processor, a memory and a computer program; wherein the processor is connected to the memory, the computer program is stored in the memory, and when the electronic device is running, the processor executes the computer program stored in the memory so that the electronic device executes the indoor scene generation method guided by the diffusion model as described in any one of claims 1 to 7.

Citation Information

Cited By

  • Complex indoor scene generation method and system based on natural language

    CN119359932A

  • Indoor scene layout generation method and device and electronic equipment

    CN121147440A

  • Three-dimensional indoor scene layout generation method and system based on scene graph control

    CN121564225A