A method for generating 3D digital core with multiple constraints based on diffusion model

Through a multi-condition constraint three-dimensional digital core generation method based on the diffusion model, using the 3dUnet network and custom noise constraints, the problem of poor quality of three-dimensional digital core samples is solved, and the accurate acquisition and authenticity of the rock pore structure are achieved.

CN117830510BActive Publication Date: 2024-10-15CHINA UNIV OF PETROLEUM (EAST CHINA)
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202311651346.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-05
Publication Date
2024-10-15
Estimated Expiration
2043-12-05

AI Technical Summary

Technical Problem

The quality of three-dimensional digital core samples in the existing technology is low, it is difficult to convert noise into generated samples in one step through the generator, and it is difficult to accurately control the authenticity of three-dimensional digital cores under multiple conditions.

Method used

A multi-condition constrained three-dimensional digital core generation method based on the diffusion model is adopted. By introducing random noise and customized porosity, average pore diameter value and pore diameter standard deviation value, the 3dUnet network is used to build a multi-condition three-dimensional digital core generation model, and multiple deletions are carried out. Noise processing to generate multi-condition constrained three-dimensional digital cores of real formations.

Benefits of technology

It improves the quality and authenticity of three-dimensional digital core samples, achieves accurate acquisition of the internal pore structure of rocks, and provides a basis for reservoir research. Compared with traditional models, it has better quality and more stable operation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117830510B_ABST
    Figure CN117830510B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for generating a three-dimensional digital core with multiple conditional constraints based on a diffusion model, and specifically relates to the field of digital core technology. The present invention obtains multiple three-dimensional digital core samples and marks labels as training samples to form a digital core training set, then constructs a three-dimensional digital core generation model with multiple conditional constraints based on a 3dUnet network, uses the training samples in the digital core training set to train the three-dimensional digital core generation model with multiple conditional constraints to generate a three-dimensional digital core, and uses the trained three-dimensional digital core generation model to generate a three-dimensional digital core with multiple conditional constraints according to random noise and customized porosity, average pore size value and pore size standard deviation value. The present invention truly restores the internal pore structure of the rock by subjecting the generated three-dimensional digital core to multiple conditional constraints, improves the quality of the three-dimensional digital core generated by the model, and provides technical support for reservoir research.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of digital core technology, and in particular to a method for generating three-dimensional digital cores with multiple condition constraints based on a diffusion model. Background Art

[0002] As a cutting-edge tool for simulating pore structure and physical properties, digital core technology has been widely used in geophysics and oil and gas science and technology as my country's oil and gas enters an important stage of unconventional exploration and development. Limited by the difficulty of deep sample extraction in actual field and the high cost of sample experimental analysis, digital core technology has become the main means of microscopic pore structure analysis instead of rock physics experiments.

[0003] Traditional digital core methods mostly use statistical modeling methods (for example, multi-point statistical modeling, etc.) to construct digital cores. However, traditional digital core methods require large computing power and have poor flexibility, making it necessary to study new digital core intelligent digital generation methods.

[0004] With the development of deep learning networks and computer vision technology, researchers have generated three-dimensional digital cores through generative adversarial models (GANs) and variational autoencoders (VAEs). However, due to the simple structure of the deep learning model used in the prior art, the quality of the generated digital core samples is low. Although subsequent technical personnel have conducted a lot of research on the improvement of GAN and VAE models, it is still impossible to generate a digital core with multi-condition controlled three-dimensional characteristics through the mechanism of converting noise into generated samples in one step by the generator, and it is difficult to accurately control the authenticity of the three-dimensional digital core under multi-condition constraints. Therefore, it is urgent to propose a multi-condition constrained three-dimensional digital core generation method based on a diffusion model, which uses the diffusion model to remove the normal distribution noise multiple times in the reverse process to generate a multi-condition constrained three-dimensional digital core that can reflect the core samples in the real formation. Summary of the invention

[0005] In order to solve the problem of poor quality of three-dimensional digital core samples generated by the prior art, the present invention proposes a multi-condition constraint three-dimensional digital core generation method based on a diffusion model. By introducing random noise and customized porosity, average pore size value and pore size standard deviation value, multiple condition constraints are imposed on the generated three-dimensional digital core, which effectively improves the quality of the generated three-dimensional digital core samples and provides a basis for truly reflecting the internal pore structure distribution of the rock.

[0006] The present invention adopts the following technical solutions:

[0007] The method for generating three-dimensional digital core with multiple condition constraints based on diffusion model specifically includes the following steps:

[0008] Step 1, obtaining three-dimensional digital core samples of multiple core samples, marking labels on each three-dimensional digital core sample as a training sample, and constructing a digital core training set;

[0009] Step 2, constructing a multi-condition three-dimensional digital core generation model based on the 3dUnet network;

[0010] Step 3, training the multi-condition three-dimensional digital core generation model using the training samples in the digital core training set to obtain a trained multi-condition three-dimensional digital core generation model;

[0011] Step 4: input the random noise and the customized porosity, average pore size value and pore size standard deviation value into the trained multi-conditional three-dimensional digital core generation model, and use the trained multi-conditional three-dimensional digital core generation model to generate a multi-conditional constrained three-dimensional digital core.

[0012] Preferably, in step 1, after threshold segmentation, sliding block cutting and slicing processing are performed on the three-dimensional digital core sample based on the Python platform, a three-dimensional digital core sample with a dimension of 64×64×64 is obtained, and the three-dimensional digital core sample is marked with a label, and the label records the porosity, average pore size value and pore size standard deviation value of the three-dimensional digital core sample.

[0013] Preferably, the multi-condition three-dimensional digital core generation model constructed based on the 3dUnet network includes a downsampling layer, an intermediate layer and an upsampling layer;

[0014] The downsampling layer includes a first downsampling layer, a second downsampling layer and a third downsampling layer connected in sequence from top to bottom, each downsampling layer is provided with a conditional residual module and a three-dimensional convolution layer, wherein the conditional residual module is used to add random noise and constraint conditions to the three-dimensional digital core sample, and includes a three-dimensional convolution block, a time coding layer, a conditional coding layer and a self-attention mechanism layer connected in sequence, wherein the three-dimensional convolution block includes a group normalization layer, an activation function layer and a three-dimensional convolution layer; the three-dimensional convolution layer is used to enhance the nonlinear ability of the feature vector without changing the dimension and the number of channels of the feature vector;

[0015] The number of channels of the conditional residual module in the first downsampling layer is set to c, and the dimension of the output feature vector f1 after processing by the first downsampling layer is Where L is the length of the feature vector, W is the width of the feature vector, and H is the height of the feature vector; the number of channels of the conditional residual module in the second downsampling layer is set to 2C, and the dimension of the output feature vector F2 after the second downsampling layer is The number of channels of the conditional residual module in the third downsampling layer is set to 4C, and the dimension of the output feature vector F3 after the third downsampling layer is

[0016] The intermediate layer includes a first intermediate layer and a second intermediate layer connected in sequence, and the first intermediate layer and the second intermediate layer are both set as conditional residual blocks; the number of channels of the first intermediate layer is set to 4C, and the dimension of the output feature vector F4 after processing by the first intermediate layer is The number of channels of the second intermediate layer is set to 4C, and the dimension of the output feature vector F5 after processing by the second intermediate layer is

[0017] The upsampling layer is provided with a third upsampling layer, a second upsampling layer and a first upsampling layer from bottom to top, and each upsampling layer is provided with a three-dimensional transposed convolution layer and a conditional residual module; the number of channels of the conditional residual module in the third upsampling layer is set to 4C, and the dimension of the output feature vector F6 after the third upsampling layer is processed is The number of channels of the conditional residual module in the second upsampling layer is set to 2C, and the dimension of the output feature vector F7 after processing by the second upsampling layer is The number of channels of the conditional residual module in the first upsampling layer is set to C, and the dimension of the output feature vector F8 after processing by the first upsampling layer is L×W×H.

[0018] Preferably, when the three-dimensional digital core sample is input into the multi-condition three-dimensional digital core generation model, the multi-condition three-dimensional digital core generation model converts the porosity, average pore size value and pore size standard deviation value in the three-dimensional digital core sample and the label into an original feature vector F with a dimension of L×W×H, and then inputs the original feature vector F into the downsampling layer, and after being processed by the first downsampling layer, the second downsampling layer and the third downsampling layer in sequence, a feature vector F with a dimension of The eigenvector F3;

[0019] Then the feature vector F3 is input into the middle layer, and after being processed by the first and second middle layers, the dimension is obtained. The eigenvector F5;

[0020] Finally, the feature vector F5 is input to the upsampling layer, and is processed by the third upsampling layer, the second upsampling layer, and the first upsampling layer in sequence; when the feature vector F5 is input to the third upsampling layer, the feature vector F5 is upsampled and concatenated with the feature vector F3 output by the third downsampling layer, and then input to the third upsampling layer, and the dimension is obtained after processing by the third upsampling layer. The feature vector F6 is then upsampled and concatenated with the feature vector F2 output by the second downsampling layer and input into the second upsampling layer. After being processed by the second upsampling layer, the dimension is The feature vector F7 is then upsampled and concatenated with the feature vector F1 output by the first downsampling layer and input into the first upsampling layer. After processing by the first upsampling layer, a feature vector F8 with a dimension of L×W×H is obtained. The feature vector F8 is output, and a multi-condition constrained three-dimensional digital core generated by the multi-condition three-dimensional digital core generation model is obtained.

[0021] Preferably, in the self-attention mechanism layer, the attention mechanism is set as:

[0022]

[0023] In the formula, Attention(·) is the attention mechanism, Q is the query vector, K is the relevance vector, V is the queried information vector; softmax(·) is the normalized exponential function, T is the transposed matrix, d K is the square root of the correlation vector.

[0024] Preferably, the step 3 specifically includes the following steps:

[0025] Step 3.1, setting the hyperparameters, training batches, time step N and preset accuracy values ​​of the multi-conditional three-dimensional digital core generation model;

[0026] Step 3.2, randomly extracting multiple training samples from the digital core training set according to the training batch and inputting them into the multi-condition three-dimensional digital core generation model, and using the multi-condition three-dimensional digital core generation model as a noise approximator for training, the training process includes a diffusion stage, a denoising stage and a noise prediction stage;

[0027] In the diffusion stage, Gaussian noise is added to the three-dimensional digital core sample in each training sample for multiple times, wherein the number of times t of adding Gaussian noise is a random number and the value range of t is [0, N]. The training sample after adding t times of noise is:

[0028]

[0029] In the formula, x t is the three-dimensional digital core sample after the t-th Gaussian noise is added to the training sample, and x0 is the three-dimensional digital core sample before the Gaussian noise is added to the training sample; is the Gaussian noise control parameter, Among them, a t is the tth Gaussian noise control factor; ∈ is Gaussian noise;

[0030] In the denoising stage, the three-dimensional digital core sample after the t-th addition of Gaussian noise in each training sample is restored to the state of the three-dimensional digital core sample after the t-1-th addition of Gaussian noise. According to the preset time step N, the three-dimensional digital core sample after the t-th addition of Gaussian noise in each training sample is subjected to N denoising processes, and the added Gaussian noise is restored to the three-dimensional digital core, wherein the denoising process formula is:

[0031]

[0032] In the formula, x t-1 is the state of the three-dimensional digital core sample after adding Gaussian noise for the t-1th time, ∈ θ (x t ,t,y) is the function value of the noise approximator when the input random number t and the input condition y, y is the input condition, σ t is a constant, z is random noise, which is used to increase the randomness of the noise approximator;

[0033] In the noise prediction stage, the loss function is used to calculate the difference between the noise generated by the noise approximator and the added Gaussian noise to obtain a loss function value. When the loss function value is less than the preset accuracy value, step 3.3 is entered. Otherwise, step 3.2 is returned to continue training the multi-condition three-dimensional digital core generation model.

[0034] Step 3.3, obtain the trained multi-condition three-dimensional digital core generation model.

[0035] Preferably, in step 3.1, the training batch is the number of training samples input into the multi-conditional three-dimensional digital core generation model during each training.

[0036] Preferably, the loss function is a mean square error function, as shown in formula (3):

[0037] Closs=||∈-∈ θ (x t ,t,y)|| 2 (4)

[0038] In the formula, Closs is the loss function value;

[0039] The loss function value is weighted attenuated by the optimizer, and the learning rate of the multi-condition three-dimensional digital core generation model decreases with the increase of the number of training times, so that the loss function value of the multi-condition three-dimensional digital core generation model gradually tends to be stable.

[0040] The present invention has the following beneficial effects:

[0041] The present invention proposes a method for generating three-dimensional digital cores with multi-conditional constraints based on a diffusion model. The multi-conditional three-dimensional digital core generation model is constructed using a 3dUnet network. The multi-conditional three-dimensional digital core generation model is trained with training samples in a digital core training set to generate three-dimensional digital cores, thereby achieving accurate acquisition of the real pore structure inside the core and providing a basis for reservoir research.

[0042] At the same time, the multi-condition three-dimensional digital core generation model constructed by the method of the present invention based on the 3dUnet network has better quality and more stable operation than the traditional adversarial network model. In addition, the present invention also imposes multiple conditional constraints on the generated three-dimensional digital core by introducing random noise and customized porosity, average pore size value and pore size standard deviation value, so that the pore structure in the generated three-dimensional digital core is more realistic, which solves the problem of poor quality of the three-dimensional digital core samples generated by the model and improves the sample quality and authenticity of the three-dimensional digital core. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 It is a schematic diagram of the method for generating three-dimensional digital cores with multiple condition constraints based on the diffusion model of the present invention.

[0044] Figure 2 This is a structural schematic diagram of the multi-condition three-dimensional digital core generation model built based on the 3dUnet network.

[0045] Figure 3 Schematic diagram of the structure of the conditional residual module.

[0046] Figure 4 Schematic diagram of the structure of the three-dimensional convolution block.

[0047] Figure 5 Schematic diagram of the denoising stage in the training process of the multi-conditional 3D digital core generation model.

[0048] Figure 6 Generate a 3D digital core for the model generated by the trained multi-condition 3D digital core. DETAILED DESCRIPTION

[0049] The specific embodiments of the present invention are further described below in conjunction with the accompanying drawings:

[0050] The present invention proposes a method for generating three-dimensional digital cores with multiple constraints based on a diffusion model. Figure 1 As shown, the specific steps include:

[0051] Step 1: Obtain 10 carbonate rock samples with a dimension of 300×300×300 in the study area A as three-dimensional digital core samples. Perform threshold segmentation processing on the three-dimensional digital core samples based on the Opencv library of the Python platform to obtain binary three-dimensional data of each three-dimensional digital core sample. The pores in the binary three-dimensional data are represented as 0 and the skeleton is represented as 1. Then use the Numpy library of the Python platform to perform sliding cutting and slicing processing. Cut the 10 three-dimensional digital core samples in the length, width and height directions respectively to obtain 532 three-dimensional digital core samples with a dimension of 64×64×64. Finally, use the Numpy library of the Python platform to calculate the porosity, average pore size and pore size standard deviation of each three-dimensional digital core sample, generate labels and mark them on the corresponding three-dimensional digital core samples to form training samples, and construct a digital core training set.

[0052] In this embodiment, the threshold segmentation processing process is to divide the three-dimensional digital core sample according to the pixel value of the three-dimensional digital core sample in combination with a preset threshold, and divide the voxel area in the three-dimensional digital core sample whose pixel value is greater than the preset threshold into a skeleton, and divide the voxel area in the three-dimensional digital core sample whose pixel value does not exceed the preset threshold into a pore.

[0053] The label marked on the three-dimensional digital core sample records the porosity, average pore size value and pore size standard deviation value of the three-dimensional digital core sample, wherein the porosity is the ratio of the volume of the pore area in the three-dimensional digital core sample to the total volume of the three-dimensional digital core sample, the average pore size value is the average value of the minimum inscribed sphere diameter of the pore connected domain, and the pore size standard deviation value is the standard deviation of the minimum inscribed sphere diameter of the pore connected domain, and the connected domain is a set of adjacent pixels (voxels) of the three-dimensional digital core sample with the same pixel value (voxel value).

[0054] Step 2: construct a multi-condition three-dimensional digital core generation model based on the 3dUnet network.

[0055] In this embodiment, a multi-condition three-dimensional digital core generation model is constructed based on the 3dUnet network, such as Figure 2 As shown, it includes downsampling layers, intermediate layers and upsampling layers.

[0056] The downsampling layer includes a first downsampling layer, a second downsampling layer and a third downsampling layer connected in sequence from top to bottom. Each downsampling layer halves the length, width and height of the three-dimensional feature vector and adopts a multiplication model to transfer the number of parameter channels, so that the input three-dimensional digital core sample is abstracted into a low-size high-latitude feature.

[0057] Each downsampling layer is provided with a conditional residual module and a three-dimensional convolution layer, wherein the conditional residual module is used to add random noise and constraints to the three-dimensional digital core sample, such as Figure 3 As shown, it includes three-dimensional convolution blocks, temporal encoding layers, conditional encoding layers and self-attention mechanism layers connected in sequence.

[0058] The three-dimensional convolution block is as follows Figure 4 As shown, it includes a group normalization layer, an activation function layer and a three-dimensional convolution layer. The three-dimensional convolution layer is used to enhance the nonlinear ability of the feature vector and is only used to increase the complexity of the multi-conditional three-dimensional digital core generation model, but does not change the dimension and number of channels of the feature vector.

[0059] The number of channels of the conditional residual module in the first downsampling layer is set to C, and the dimension of the output feature vector F1 after processing by the first downsampling layer is Wherein, L is the length of the feature vector, W is the width of the feature vector, and H is the height of the feature vector. In this embodiment, the number of channels C is set to 16, the length L of the feature vector is set to 64, the width W of the feature vector is set to 64, and the height H of the feature vector is set to 64; the number of channels of the conditional residual module in the second downsampling layer is set to 2C, and the dimension of the output feature vector F2 after the second downsampling layer is processed is The number of channels of the conditional residual module in the third downsampling layer is set to 4C, and the dimension of the output feature vector F3 after the third downsampling layer is

[0060] The intermediate layer includes a first intermediate layer and a second intermediate layer connected in sequence, and the first intermediate layer and the second intermediate layer are both set as conditional residual blocks; the number of channels of the first intermediate layer is set to 4C, and the dimension of the output feature vector F4 after processing by the first intermediate layer is The number of channels of the second intermediate layer is set to 4C, and the dimension of the output feature vector F5 after processing by the second intermediate layer is

[0061] The upsampling layer includes a third upsampling layer, a second upsampling layer and a first upsampling layer, which are arranged in sequence from bottom to top. Each upsampling layer restores the size of the three-dimensional digital core sample from the high-latitude features output by the intermediate layer by doubling the length, width and height of the three-dimensional feature vector and halving the number of model transmission parameter channels.

[0062] Each upsampling layer is provided with a three-dimensional transposed convolution layer and a conditional residual module; the number of channels of the conditional residual module in the third upsampling layer is set to 4C, and the dimension of the output feature vector F6 after the third upsampling layer is processed is The number of channels of the conditional residual module in the second upsampling layer is set to 2C, and the dimension of the output feature vector F7 after processing by the second upsampling layer is The number of channels of the conditional residual module in the first upsampling layer is set to C, and the dimension of the output feature vector F8 after processing by the first upsampling layer is L×W×H.

[0063] The temporal coding layer is a position coding structure proposed by the attention mechanism network, and its purpose is to embed random noise into the multi-conditional three-dimensional digital core generation model. At the same time, since the porosity, average pore size value and pore size standard deviation value of the three-dimensional digital core sample are not text conditions, conditional unique hot coding cannot be used at this time, so the method of the present invention adopts a linear embedding method to integrate the porosity, average pore size value and pore size standard deviation value into the multi-conditional three-dimensional digital core generation model, that is, the linear embedding is a linear layer, and the dimensions of the porosity, average pore size value and pore size standard deviation value of the three-dimensional digital core sample are adjusted to facilitate embedding into the multi-conditional three-dimensional digital core generation model.

[0064] In the self-attention mechanism layer, the attention mechanism is set to:

[0065]

[0066] In the formula, Attention(·) is the attention mechanism, Q is the query vector, K is the relevance vector, V is the queried information vector; softmax(·) is the normalized exponential function, T is the transposed matrix, d K is the square root of the correlation vector.

[0067] In this embodiment, when the three-dimensional digital core sample is input into the multi-condition three-dimensional digital core generation model, the multi-condition three-dimensional digital core generation model converts the porosity, average pore size value and pore size standard deviation value in the three-dimensional digital core sample and the label into an original feature vector F with a dimension of L×W×H, and then inputs the original feature vector F into the downsampling layer, and after being processed by the first downsampling layer, the second downsampling layer and the third downsampling layer in sequence, a feature vector F with a dimension of L×W×H is obtained. The eigenvector F3.

[0068] Then the feature vector F3 is input into the middle layer, and after being processed by the first and second middle layers, the dimension is obtained. The eigenvector F5.

[0069] Finally, the feature vector F5 is input to the upsampling layer, and is processed by the third upsampling layer, the second upsampling layer, and the first upsampling layer in sequence; when the feature vector F5 is input to the third upsampling layer, the feature vector F5 is upsampled and concatenated with the feature vector F3 output by the third downsampling layer, and then input to the third upsampling layer, and the dimension is obtained after processing by the third upsampling layer. The feature vector F6 is then upsampled and concatenated with the feature vector F2 output by the second downsampling layer and input into the second upsampling layer. After being processed by the second upsampling layer, the dimension is The feature vector F7 is then upsampled and concatenated with the feature vector F1 output by the first downsampling layer and input into the first upsampling layer. After processing by the first upsampling layer, a feature vector F8 with a dimension of L×W×H is obtained. The feature vector F8 is output, and a multi-condition constrained three-dimensional digital core generated by the multi-condition three-dimensional digital core generation model is obtained.

[0070] Step 3, using the training samples in the digital core training set to train the multi-conditional three-dimensional digital core generation model to obtain the trained multi-conditional three-dimensional digital core generation model, specifically includes the following steps:

[0071] Step 3.1, set the hyperparameters, training batches, time step N and preset accuracy values ​​of the multi-conditional three-dimensional digital core generation model.

[0072] In this embodiment, the training batch is set to 12, that is, 12 training samples are selected each time as a batch of data and input into the multi-condition three-dimensional digital core generation model for training; the time step N is set to 1000, and the preset accuracy value is 0.001.

[0073] Step 3.2, randomly extract multiple training samples from the digital core training set according to the training batch and input them into the multi-conditional three-dimensional digital core generation model, and use the multi-conditional three-dimensional digital core generation model as a noise approximator for training. The training process includes a diffusion stage, a denoising stage, and a noise prediction stage.

[0074] In the diffusion stage, Gaussian noise is added to the three-dimensional digital core sample in each training sample for multiple times, wherein the number of times t of adding Gaussian noise is a random number and the value range of t is [0,1000]. The training sample after adding t times of noise is:

[0075]

[0076] In the formula, x t is the three-dimensional digital core sample after the t-th Gaussian noise is added to the training sample, and x0 is the three-dimensional digital core sample before the Gaussian noise is added to the training sample; is the Gaussian noise control parameter, Among them, a t is the tth Gaussian noise control factor; ∈ is Gaussian noise.

[0077] In the denoising stage, the three-dimensional digital core sample after the t-th addition of Gaussian noise in each training sample is restored to the state of the three-dimensional digital core sample after the t-1-th addition of Gaussian noise. According to the preset time step N, the three-dimensional digital core sample after the t-th addition of Gaussian noise in each training sample is subjected to N denoising processes, and the added Gaussian noise is restored to the three-dimensional digital core, wherein the denoising process formula is:

[0078]

[0079] In the formula, x t-1 is the state of the three-dimensional digital core sample after adding Gaussian noise for the t-1th time, ∈ θ (x t ,t,y) is the function value of the noise approximator when the input random number t and the input condition y, y is the input condition, σ t is a constant, and z is random noise, which is used to increase the randomness of the noise approximator.

[0080] In the noise prediction stage, the loss function is used to calculate the difference between the noise generated by the noise approximator and the added Gaussian noise to obtain the loss function value. When the loss function value is less than the preset accuracy value, step 3.3 is entered; otherwise, step 3.2 is returned to continue training the multi-conditional three-dimensional digital core generation model.

[0081] The loss function is a mean square error function, as shown in formula (3):

[0082] Closs=||∈-∈ θ (x y ,t,y)|| 2 (4)

[0083] Where Closs is the loss function value.

[0084] The purpose of training the multi-conditional 3D digital core generation model in this embodiment is to enable the multi-conditional 3D digital core generation model to learn the pore distribution information in the 3D digital core in the diffusion stage, and to restore the Gaussian noise to the 3D digital core by adding Gaussian noise and given conditions in the denoising stage, such as Figure 5 As shown in the figure, the loss function value obtained during the training process is weighted attenuated by the optimizer. In this embodiment, the attenuation coefficient during the weight attenuation process is 5×10 -2 ,The learning rate of the multi-condition 3D digital core generation model decreases dynamically with the increase of training times, and the loss function value gradually stabilizes with the increase of training times.

[0085] Step 3.3, obtain the trained multi-condition three-dimensional digital core generation model.

[0086] Step 4: input the random noise and the customized porosity, average pore size value and pore size standard deviation value into the trained multi-conditional three-dimensional digital core generation model, and use the trained multi-conditional three-dimensional digital core generation model to generate a multi-conditional constrained three-dimensional digital core.

[0087] In this embodiment, 12 random noises (size is 643), 12 porosity conditions (set as random numbers in the interval range [0.05, 0.06]), 12 pore diameter averages (set as random numbers in the interval range [4, 5]), and 12 pore diameter standard deviations (set as random numbers in the interval range [3, 4]) are input into the multi-conditional three-dimensional digital core generation model, and the trained multi-conditional three-dimensional digital core generation model is used to generate three-dimensional digital cores, and 12 multi-conditional constrained three-dimensional digital cores are obtained, such as Figure 6 shown.

[0088] Depend on Figure 6 It can be seen that the method of the present invention solves the problem of poor quality of three-dimensional digital core sample generation in the prior art by introducing random noise and multiple constraints into the three-dimensional digital core generation process, realizes the true restoration of the internal structure of rock pores, and improves the authenticity of the three-dimensional digital core.

[0089] Of course, the above description is not a limitation of the present invention, and the present invention is not limited to the above examples. Changes, modifications, additions or substitutions made by technicians in this technical field within the essential scope of the present invention should also fall within the protection scope of the present invention.

Claims

1. A three-dimensional digital core generation method with multiple condition constraints based on a diffusion model, characterized in that: The specific steps include: Step 1, obtaining three-dimensional digital core samples of multiple core samples, marking labels on each three-dimensional digital core sample as a training sample, and constructing a digital core training set; Step 2, constructing a multi-condition three-dimensional digital core generation model based on the 3dUnet network; Step 3, training the multi-condition three-dimensional digital core generation model using the training samples in the digital core training set to obtain a trained multi-condition three-dimensional digital core generation model; Step 4, inputting random noise and the customized porosity, average pore size value and pore size standard deviation value into the trained multi-condition three-dimensional digital core generation model, and using the trained multi-condition three-dimensional digital core generation model to generate a multi-condition constrained three-dimensional digital core; A multi-conditional three-dimensional digital core generation model is constructed based on the 3dUnet network, including downsampling layer, middle layer and upsampling layer; The downsampling layer includes a first downsampling layer, a second downsampling layer and a third downsampling layer connected in sequence from top to bottom, each downsampling layer is provided with a conditional residual module and a three-dimensional convolution layer, wherein the conditional residual module is used to add random noise and constraint conditions to the three-dimensional digital core sample, and includes a three-dimensional convolution block, a time coding layer, a conditional coding layer and a self-attention mechanism layer connected in sequence, wherein the three-dimensional convolution block includes a group normalization layer, an activation function layer and a three-dimensional convolution layer; the three-dimensional convolution layer is used to enhance the nonlinear ability of the feature vector without changing the dimension and the number of channels of the feature vector; The number of channels of the conditional residual module in the first downsampling layer is set to C, and the dimension of the output feature vector F1 after processing by the first downsampling layer is Where L is the length of the feature vector, W is the width of the feature vector, and H is the height of the feature vector; the number of channels of the conditional residual module in the second downsampling layer is set to 2C, and the dimension of the output feature vector F2 after the second downsampling layer is The number of channels of the conditional residual module in the third downsampling layer is set to 4C, and the dimension of the output feature vector F3 after the third downsampling layer is The intermediate layer includes a first intermediate layer and a second intermediate layer connected in sequence, and the first intermediate layer and the second intermediate layer are both set as conditional residual blocks; the number of channels of the first intermediate layer is set to 4C, and the dimension of the output feature vector F4 after processing by the first intermediate layer is The number of channels of the second intermediate layer is set to 4C, and the dimension of the output feature vector F5 after processing by the second intermediate layer is The upsampling layer is provided with a third upsampling layer, a second upsampling layer and a first upsampling layer from bottom to top, and each upsampling layer is provided with a three-dimensional transposed convolution layer and a conditional residual module; the number of channels of the conditional residual module in the third upsampling layer is set to 4C, and the dimension of the output feature vector F6 after the third upsampling layer is processed is The number of channels of the conditional residual module in the second upsampling layer is set to 2C, and the dimension of the output feature vector F7 after the second upsampling layer is The number of channels of the conditional residual module in the first upsampling layer is set to C, and the dimension of the output feature vector F8 after processing by the first upsampling layer is L×W×H; When the three-dimensional digital core sample is input into the multi-condition three-dimensional digital core generation model, the multi-condition three-dimensional digital core generation model converts the porosity, average pore size value and pore size standard deviation value in the three-dimensional digital core sample and label into an original feature vector F with a dimension of L×W×H, and then inputs the original feature vector F into the downsampling layer. After being processed by the first downsampling layer, the second downsampling layer and the third downsampling layer in sequence, the dimension of The eigenvector F3; Then the feature vector F3 is input into the middle layer, and after being processed by the first and second middle layers in turn, the dimension is obtained. The eigenvector F5; Finally, the feature vector F5 is input to the upsampling layer, and is processed by the third upsampling layer, the second upsampling layer, and the first upsampling layer in sequence; when the feature vector F5 is input to the third upsampling layer, the feature vector F5 is upsampled and concatenated with the feature vector F3 output by the third downsampling layer, and then input to the third upsampling layer, and the dimension is obtained after processing by the third upsampling layer. The feature vector F6 is then upsampled and concatenated with the feature vector F2 output by the second downsampling layer and input into the second upsampling layer. After being processed by the second upsampling layer, the dimension is The feature vector F7 is then upsampled and concatenated with the feature vector F1 output by the first downsampling layer and then input into the first upsampling layer. After being processed by the first upsampling layer, a feature vector F8 with a dimension of L×W×H is obtained. The feature vector F8 is output to obtain a multi-condition constrained three-dimensional digital core generated by the multi-condition three-dimensional digital core generation model. In the self-attention mechanism layer, the attention mechanism is set to: In the formula, Attention(·) is the attention mechanism, Q is the query vector, K is the relevance vector, V is the queried information vector; softmax(·) is the normalized exponential function, T is the transposed matrix, d K is the square root of the correlation vector; The step 3 specifically includes the following steps: Step 3.1, setting the hyperparameters, training batches, time step N and preset accuracy values ​​of the multi-conditional three-dimensional digital core generation model; Step 3.2, randomly extracting multiple training samples from the digital core training set according to the training batch and inputting them into the multi-condition three-dimensional digital core generation model, and using the multi-condition three-dimensional digital core generation model as a noise approximator for training, the training process includes a diffusion stage, a denoising stage and a noise prediction stage; In the diffusion stage, Gaussian noise is added to the three-dimensional digital core sample in each training sample for multiple times, wherein the number of times t of adding Gaussian noise is a random number and the value range of t is [0, N]. The training sample after adding t times of noise is: In the formula, x t is the three-dimensional digital core sample after the t-th Gaussian noise is added to the training sample, and x0 is the three-dimensional digital core sample before the Gaussian noise is added to the training sample; is the Gaussian noise control parameter, Among them, a t is the tth Gaussian noise control factor; ∈ is Gaussian noise; In the denoising stage, the three-dimensional digital core sample after the t-th addition of Gaussian noise in each training sample is restored to the state of the three-dimensional digital core sample after the t-1-th addition of Gaussian noise. According to the preset time step N, the three-dimensional digital core sample after the t-th addition of Gaussian noise in each training sample is subjected to N denoising processes, and the added Gaussian noise is restored to the three-dimensional digital core, wherein the denoising process formula is: In the formula, x t-1 is the state of the three-dimensional digital core sample after adding Gaussian noise for the t-1th time, ∈ θ (x t ,t,y) is the function value of the noise approximator when the input random number t and the input condition y, y is the input condition, σ t is a constant, z is random noise, which is used to increase the randomness of the noise approximator; In the noise prediction stage, the loss function is used to calculate the difference between the noise generated by the noise approximator and the added Gaussian noise to obtain a loss function value. When the loss function value is less than the preset accuracy value, step 3.3 is entered. Otherwise, step 3.2 is returned to continue training the multi-condition three-dimensional digital core generation model. Step 3.3, obtain the trained multi-condition three-dimensional digital core generation model.

2. The method for generating three-dimensional digital cores with multiple constraints based on a diffusion model according to claim 1, characterized in that: In the step 1, after threshold segmentation, sliding block cutting and slicing processing are performed on the three-dimensional digital core sample based on the Python platform, a three-dimensional digital core sample with a dimension of 64×64×64 is obtained. The three-dimensional digital core sample is marked with a label, and the label records the porosity, average pore size value and pore size standard deviation value of the three-dimensional digital core sample.

3. The method for generating three-dimensional digital cores with multiple constraints based on a diffusion model according to claim 1, characterized in that: In step 3.1, the training batch is the number of training samples input into the multi-conditional three-dimensional digital core generation model during each training.

4. The method for generating three-dimensional digital cores with multiple constraints based on a diffusion model according to claim 3 is characterized in that: The loss function is a mean square error function, as shown in formula (4): Closs=||∈-∈ θ (x t ,t,y)|| 2 (4) In the formula, Closs is the loss function value; The loss function value is weighted attenuated by the optimizer, and the learning rate of the multi-condition three-dimensional digital core generation model decreases with the increase of the number of training times, so that the loss function value of the multi-condition three-dimensional digital core generation model gradually tends to be stable.

Citation Information

Cited By

  • Three-dimensional digital core generation method

    CN120279192A

  • A method for generating three-dimensional digital core

    CN120279192B