A method, device and medium for generating a three-dimensional model of solid rock containing multiphase flow based on a diffusion model
Through a diffusion model-based method, multiphase flow segmentation of rock samples and training of 3D UNet diffusion generator networks solves the problem that the existing technology is difficult to reconstruct the distribution structure of rocks, and realizes high-fidelity three-dimensional model reconstruction.
Patent Information
- Application Number
- CN202510163014.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-14
- Publication Date
- 2025-04-22
- Estimated Expiration
- 2045-02-14
AI Technical Summary
The prior art is difficult to effectively reconstruct the multiphase flow distribution structure inside the rock, especially in generating high-fidelity multiphase medium images.
Using a diffusion model-based method, a diffusion generator network of 3D UNet structure is constructed by performing multiphase flow segmentation and normalization of real rock samples, forward diffusion and reverse generation training are carried out, and the multiphase flow rock structure is gradually denoised and inverted.
The high-fidelity three-dimensional model reconstruction of solid rocks containing multiphase flow is realized, which improves image quality and structural authenticity, and can effectively capture the multiphase distribution characteristics inside the rock.
Smart Images

Figure CN119648945B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of rock multiphase flow structure reconstruction and image generation, and in particular to a method, device and medium for generating a three-dimensional model of solid rock containing multiphase flow based on a diffusion model. Background Art
[0002] In oil and gas development and geological analysis, the complex pore structure and multiphase flow distribution inside the rock are of great significance for reservoir evaluation, permeability prediction, reserve calculation, etc. Traditional acquisition methods mainly rely on micron- or nanometer-scale CT scanning, core slicing, and SEM imaging, but these methods have problems such as difficulty in sample acquisition, high time cost, and limited resolution and scale.
[0003] Existing numerical reconstruction and generation methods (such as GAN) can simulate and reconstruct the rock skeleton structure, but have difficulty in simultaneously generating images of multiphase flow distribution in pores. Most generation methods only focus on the solid skeleton and single-phase pore space, and it is difficult to restore the complex distribution of multiphase media (such as oil-water-gas) with high fidelity. This problem stems from the higher complexity and nonlinear relationship of multiphase distribution, and traditional generation methods lack stability and controllability in capturing microstructure and details of different phase interfaces.
[0004] In the prior art, the Chinese invention patent with application number CN 119131290A discloses a method, system and storage medium for three-dimensional reconstruction of rock pores based on an adaptive hierarchical cube algorithm, which relates to the field of rock structure measurement technology, and is intended to solve the problems of low extraction execution efficiency, ambiguity and poor reconstruction accuracy of the existing moving cube algorithm. The invention is based on the RefineNet image segmentation model, which uses three 3x3 convolution cascades to replace the 7x7 convolution, and introduces a coordinate attention mechanism after each k of the encoder to improve the segmentation accuracy and efficiency of key areas; the saddle point-adaptive hierarchical downward subdivision method is used to divide the cube into tetrahedrons, calculate the intersection coordinates and normal vectors, and construct triangular facet indexes; and a cube lookup table is used to determine the shape of the isosurface passing through the cube, and all the triangles of the tetrahedron are merged to form a complete isosurface; the vertices of the edge of the hole and the newly generated vertices are used to create new triangular facets, and the holes are repaired to obtain accurately reconstructed three-dimensional rock pores. But in fact, they did not use the new model of diffusion model to reconstruct porous media, and more importantly, this method has no way to reconstruct multiphase flow solids.
[0005] In the prior art, the application number is CN202411077497.7, which is a twin digital core and saturation model construction method using deep learning. The patent belongs to the field of oil and gas exploration technology, and particularly relates to a method for augmenting digital cores and constructing saturation models. The invention first selects representative core samples to construct a three-dimensional digital core, inputs the three-dimensional digital core into the constructed generative adversarial network, and reconstructs the digital core using machine learning to obtain the first augmented data set; then, simulates the oil and water distribution in the pores of the digital core, constructs digital cores with different water saturations, and assigns multiple arbitrary saturations to each digital core to obtain the second augmented data set; the number of samples is increased by two augmentations, providing data support for the construction of the saturation model and making up for the lack of experimental data. Finally, all reconstructed digital cores are saturated with water, and the resistivity is simulated by the finite element method to construct an F-φ cross-plot; the resistivity of digital cores with different water saturations is simulated to construct an RI-Sw cross-plot. The constructed models can better reflect their respective advantages, and the saturation model is more reliable. In fact, in practical applications, we can clearly find that the effect of generative adversarial networks in constructing digital cores is poor. It is difficult to construct digital cores containing multiphase flow solids, especially for the image reconstruction of rocks with complex pore structures. Therefore, it cannot support subsequent research.
[0006] Therefore, a method, device and medium for generating a three-dimensional model of solid rock containing multiphase flow based on a diffusion model are proposed to solve the above problems. Summary of the invention
[0007] In view of this, the object of the present invention is to provide a method for generating a three-dimensional model of solid rock containing multiphase flow based on a diffusion model, so as to at least solve the above problems.
[0008] The technical solution adopted in the first aspect of the present invention is as follows:
[0009] A method for generating a three-dimensional model of solid rock containing multiphase flow based on a diffusion model, comprising:
[0010] Based on the steps of multiphase flow segmentation and normalization processing of real rock samples, the multiphase pore structure, rock skeleton and different fluid phases in the pores are labeled and separated to obtain a three-dimensional rock data set with multiphase labeling information;
[0011] Sub-volume partitioning of the three-dimensional rock data set is performed, that is, the whole rock sample is divided into a plurality of sub-volume samples with a first three-dimensional spatial size, wherein the first three-dimensional spatial size is selected by statistically analyzing multi-point geological characteristics and multiphase flow distribution correlation functions, including two-point and higher-order correlation functions, to ensure that the sub-volume can capture representative pore structures and multiphase characteristic distributions at the size;
[0012] Performing data enhancement processing on the sub-volume samples, including rotation, flipping and perturbation operations for maintaining consistency of multiphase labels, so as to construct a sub-sample data group with rich multiphase flow structure, and normalizing each sub-sample in the sub-sample data group, and randomly dividing the normalized sub-sample data into a training set and a validation set;
[0013] The generator network is constructed based on the diffusion model framework, including the forward diffusion process and the reverse generation process:
[0014] Forward diffusion process: Gaussian noise is gradually added to the real sub-volume samples from the initial distribution to form a noise increase sequence, so that the model learns how to reconstruct multiphase rock structure from pure noise;
[0015] Reverse generation process: Train a parameterized model to learn the mapping relationship between Gaussian noise and the real rock sub-volume distribution, so that when a pure Gaussian noise input is given, the model can invert the multiphase flow rock sub-volume image close to the real distribution through step-by-step denoising;
[0016] The diffusion model is trained using the training set, including optimizing the diffusion steps, noise intensity, UNet network structure, attention mechanism, and feature fusion layer in the model parameters, so that the model can accurately estimate the noise distribution at each diffusion stage and gradually reconstruct the multiphase flow rock structure details;
[0017] The performance of the trained diffusion model is evaluated in the validation set, and the quality of model generation is evaluated by comparing with the real sub-samples in terms of porosity, permeability, multiphase distribution characteristics, scale curvature, Euler number, and multi-point statistical characteristic parameters;
[0018] The trained diffusion model is applied to random noise input of target size, and a multiphase flow rock 3D model matching the target rock scale is generated through continuous iterative denoising inversion. The model output is multiphase labeled floating point tensor data.
[0019] The floating-point data output by the model are binarized and segmented between phases using thresholds and multiphase classification strategies, and the voids and isolated areas are cleaned and refined in combination with morphological operations, ultimately obtaining a three-dimensional discrete model of solid rock containing multiphase flow.
[0020] Furthermore, the method for determining the first three-dimensional space size includes:
[0021] By calculating multi-point statistical characteristics, two-point and higher-dimensional correlation functions, and comparing the porosity, permeability and pore distribution stability at different sub-volume sizes based on core CT scan or micro-CT sample data, a sub-volume size that is sufficient to represent the rock sample characteristics is selected.
[0022] Furthermore, data enhancement processing includes:
[0023] The subvolume samples are randomly rotated and mirror-flipped, where the random rotation is performed in steps of 90 degrees;
[0024] Consistency enhancement is performed based on multiphase labeling information to ensure that the position and morphology of the multiphase interface remain reasonably distributed during the data enhancement process, avoiding non-physical dislocation of the multiphase separation interface.
[0025] Furthermore, the network structure of the diffusion model adopts a 3D diffusion generator based on UNet, which specifically includes:
[0026] Downsampling path: Use multiple layers of 3D convolution and normalization layers, combined with attention modules to extract and compress multi-phase features;
[0027] Upsampling path: adopts a 3D transposed convolution structure that is symmetrical to downsampling, and performs Skip-Connection fusion with the downsampling features at the corresponding resolution level;
[0028] Diffusion step embedding: adding a time step or noise step embedding to each diffusion step introduces temporal information into the network, allowing the network to reconstruct specific noise patterns under different diffusion stage conditions;
[0029] Multiphase condition control: Through additional conditional encoding or embedding layers, the skeleton and pore fluid phase category distribution in the prior information of multiphase flow distribution is input into the diffusion model to achieve conditional generation.
[0030] Furthermore, the model training process includes:
[0031] Using stochastic gradient descent or AdamW optimizer, the diffusion model parameters are iteratively updated to minimize the noise prediction error;
[0032] Generator loss, validation error, and porosity, permeability, and saturation deviations in multiphase structural parameters are continuously monitored on the validation set;
[0033] The number of diffusion steps and the linear, cosine, or adaptive noise scheduling strategy are adjusted according to the validation metric to strike a balance between model stability and generation accuracy.
[0034] Furthermore, after obtaining the final three-dimensional multiphase rock model, the following verification steps are further included:
[0035] Calculate the porosity, permeability, specific surface area, mean curvature, Euler characteristic number and multi-point correlation function of the generated results;
[0036] The above parameters are compared and analyzed with the real rock sample data to evaluate the consistency of the generated model in terms of structural similarity and hydraulic properties, and the model parameters or diffusion steps are re-fine-tuned according to the deviation results.
[0037] The second aspect of the present invention provides a device for generating a three-dimensional model of a solid rock containing multiphase flow based on a diffusion model, the device is used to execute the method for generating a three-dimensional model of a solid rock containing multiphase flow based on a diffusion model proposed in the first aspect, the device comprising:
[0038] A sample segmentation module, used for cutting a real rock sample to obtain a plurality of sub-volume samples having a first three-dimensional spatial size, and performing multi-phase labeling separation on the sub-volume samples;
[0039] An enhancement and normalization module, used for performing data enhancement and normalization processing on the sub-volume samples, and randomly dividing the processed sub-samples into a training set and a validation set;
[0040] Diffusion model building module, which is used to build a diffusion generator network based on the 3D UNet structure and configure the diffusion steps, conditional embedding, and multi-phase prior feature input channels;
[0041] A training module, used for performing forward diffusion and reverse denoising training on the diffusion model on the training set, and optimizing the model parameters so that the model can reconstruct a rock subvolume with a multiphase flow structure from pure Gaussian noise;
[0042] The generation module is used to input the pure noise corresponding to the target size into the diffusion model, iteratively reversely generate the final multiphase rock three-dimensional data, and perform thresholding and morphological operations on the generated results to remove noise points;
[0043] The verification module is used to perform parameter calculation and multi-point statistical testing on the finally generated multiphase rock model to evaluate its structural similarity and hydraulic property approximation with the real sample.
[0044] Furthermore, the training module further includes a noise scheduling unit for dynamically adjusting the diffuse noise adding cosine noise scheduling strategy during the training process to improve the training stability;
[0045] The verification module can perform statistical analysis on the deviation between the porosity and permeability in the calculated parameters and the real data. If the deviation is too large, it will be fed back to the diffusion model construction module and the training module to update the model architecture or train hyperparameters.
[0046] The third aspect of the present invention proposes a computer-readable storage medium, which stores instructions. When the instructions are executed by a computing device, a method for generating a three-dimensional model of solid rock containing multiphase flow based on a diffusion model proposed in the first aspect is executed.
[0047] Compared with the prior art, the present invention has the following beneficial effects:
[0048] 1. Use the watershed algorithm to segment the grayscale rock image to ensure the accuracy of multiphase distribution labeling, which is conducive to the model learning the structural characteristics of the interface between multiphases;
[0049] 2. The diffusion model learns complex multiphase distributions through a reverse process of stepwise denoising, which is conducive to the stable generation of highly realistic rock internal structures;
[0050] 3. Compared with the traditional model that can only generate the skeleton, the method of the present invention can directly generate the pore structure containing multiphase flow, realizing the reproduction of richer geological features;
[0051] 4. Through morphological denoising and post-processing steps, the final image quality is higher, which is conducive to subsequent physical parameter simulation and reservoir evaluation;
[0052] 5. The model has good scalability and stability, and can maintain the generation quality at different scales and rock types, providing a general tool for multiphase media research. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only preferred embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0054] Figure 1 The flowchart of the method of this embodiment is shown;
[0055] Figure 2 The flowchart of the method of this embodiment is shown;
[0056] Figure 3 A schematic diagram of the effect of a three-dimensional rock model generated according to an embodiment of the present invention;
[0057] Figure 4 A schematic diagram of the structure of a device for establishing a three-dimensional rock model is provided for this embodiment. DETAILED DESCRIPTION
[0058] The principles and features of the present invention are described below in conjunction with the accompanying drawings. The enumerated embodiments are only used to explain the present invention and are not used to limit the scope of the present invention.
[0059] Embodiment 1
[0060] A method for generating a three-dimensional model of solid rock containing multiphase flow based on a diffusion model, comprising:
[0061] Based on the steps of multiphase flow segmentation and normalization processing of real rock samples, the multiphase pore structure, rock skeleton and different fluid phases in the pores are labeled and separated to obtain a three-dimensional rock data set with multiphase labeling information;
[0062] Sub-volume partitioning of the three-dimensional rock data set is performed, that is, the whole rock sample is divided into a plurality of sub-volume samples with a first three-dimensional spatial size, wherein the first three-dimensional spatial size is selected by statistically analyzing multi-point geological characteristics and multiphase flow distribution correlation functions, including two-point and higher-order correlation functions, to ensure that the sub-volume can capture representative pore structures and multiphase characteristic distributions at the size;
[0063] Performing data enhancement processing on the sub-volume samples, including rotation, flipping and perturbation operations for maintaining consistency of multiphase labels, so as to construct a sub-sample data group with rich multiphase flow structure, and normalizing each sub-sample in the sub-sample data group, and randomly dividing the normalized sub-sample data into a training set and a validation set;
[0064] The generator network is constructed based on the diffusion model framework, including the forward diffusion process and the reverse generation process:
[0065] Forward diffusion process: Gaussian noise is gradually added to the real sub-volume samples from the initial distribution to form a noise increase sequence, so that the model learns how to reconstruct multiphase rock structure from pure noise;
[0066] Reverse generation process: Train a parameterized model to learn the mapping relationship between Gaussian noise and the real rock sub-volume distribution, so that when a pure Gaussian noise input is given, the model can invert the multiphase flow rock sub-volume image close to the real distribution through step-by-step denoising;
[0067] The diffusion model is trained using the training set, including optimizing the diffusion steps, noise intensity, UNet network structure, attention mechanism, and feature fusion layer in the model parameters, so that the model can accurately estimate the noise distribution at each diffusion stage and gradually reconstruct the multiphase flow rock structure details;
[0068] The performance of the trained diffusion model is evaluated in the validation set, and the quality of model generation is evaluated by comparing with the real sub-samples in terms of porosity, permeability, multiphase distribution characteristics, scale curvature, Euler number, and multi-point statistical characteristic parameters;
[0069] The trained diffusion model is applied to random noise input of target size, and a multiphase flow rock 3D model matching the target rock scale is generated through continuous iterative denoising inversion. The model output is multiphase labeled floating point tensor data.
[0070] The floating-point data output by the model are binarized and segmented between phases using thresholds and multiphase classification strategies, and the voids and isolated areas are cleaned and refined in combination with morphological operations, ultimately obtaining a three-dimensional discrete model of solid rock containing multiphase flow.
[0071] The method for determining the first three-dimensional space size includes:
[0072] By calculating multi-point statistical characteristics, two-point and higher-dimensional correlation functions, and comparing the porosity, permeability and pore distribution stability at different sub-volume sizes based on core CT scan or micro-CT sample data, a sub-volume size that is sufficient to represent the rock sample characteristics is selected.
[0073] Data enhancement processing includes:
[0074] The subvolume samples are randomly rotated and mirror-flipped, where the random rotation is performed in steps of 90 degrees;
[0075] Consistency enhancement is performed based on multiphase labeling information to ensure that the position and morphology of the multiphase interface remain reasonably distributed during the data enhancement process, avoiding non-physical dislocation of the multiphase separation interface.
[0076] The network structure of the diffusion model adopts a 3D diffusion generator based on UNet, which includes:
[0077] Downsampling path: Use multiple layers of 3D convolution and normalization layers, combined with attention modules to extract and compress multi-phase features;
[0078] Upsampling path: adopts a 3D transposed convolution structure that is symmetrical to downsampling, and performs Skip-Connection fusion with the downsampling features at the corresponding resolution level;
[0079] Diffusion step embedding: adding a time step or noise step embedding to each diffusion step introduces temporal information into the network, allowing the network to reconstruct specific noise patterns under different diffusion stage conditions;
[0080] Multiphase condition control: Through additional conditional encoding or embedding layers, the skeleton and pore fluid phase category distribution in the prior information of multiphase flow distribution is input into the diffusion model to achieve conditional generation.
[0081] The model training process includes:
[0082] Using stochastic gradient descent or AdamW optimizer, the diffusion model parameters are iteratively updated to minimize the noise prediction error;
[0083] Generator loss, validation error, and porosity, permeability, and saturation deviations in multiphase structural parameters are continuously monitored on the validation set;
[0084] The number of diffusion steps and the linear, cosine, or adaptive noise scheduling strategy are adjusted according to the validation metric to strike a balance between model stability and generation accuracy.
[0085] After obtaining the final three-dimensional multiphase rock model, further verification steps are included:
[0086] Calculate the porosity, permeability, specific surface area, mean curvature, Euler characteristic number and multi-point correlation function of the generated results;
[0087] The above parameters are compared and analyzed with the real rock sample data to evaluate the consistency of the generated model in terms of structural similarity and hydraulic properties, and the model parameters or diffusion steps are re-fine-tuned according to the deviation results.
[0088] For example, see Figure 1-3 ,in, Figure 1 and Figure 2 The flowchart of the method of this embodiment is shown respectively. Figure 3 The following is a schematic diagram of the effect of a three-dimensional rock model generated according to an embodiment of the present invention. Through this method, starting from a small amount of original rock image data, through multiphase segmentation, sub-image sampling, diffusion model training and inference, the final generated three-dimensional image simultaneously presents the characteristic structure of the rock skeleton and the multiphase flow distribution in the pores.
[0089] S10: Subsample extraction and feature scale determination
[0090] First, the obtained rock sample is subjected to sub-sample cutting to obtain a plurality of sub-samples of a first three-dimensional space size. The first three-dimensional space size is determined by a two-point correlation function and associated statistical analysis, so that the sub-sample size is sufficient to capture the typical structural characteristics of the rock sample.
[0091] In one example, a Berea sandstone sample with a voxel resolution of 2.0 μm and a size of about 1200³ voxels can be selected as the basic data source. The two-point correlation function analysis of the sample shows that the sub-sample size of about 128³ is sufficient to express the key characteristics of its pore structure. The sliding window method is used to extract multiple 128³ sub-samples with partial overlap from the original sample, thereby providing rich basic data for subsequent model training.
[0092] S20: Data enhancement and multi-phase segmentation preprocessing
[0093] Before analyzing the sub-samples, in order to realize the annotation and feature extraction of the multiphase flow solid rock image, the original grayscale image needs to be segmented into multiple phases. In this embodiment, the watershed algorithm is preferably used to divide the grayscale image into multiple phase interfaces, and the rock skeleton and the multiple fluid phases (such as oil phase, water phase or gas phase) that may exist in the pores are separated and marked. Through this watershed segmentation step, a multi-channel or multi-label sub-sample data set can be obtained, so that the model can learn the multiphase distribution during training.
[0094] After obtaining sub-samples with multi-phase labels, data augmentation is performed on these sub-samples, including 90°, 180°, and 270° rotations, as well as flipping operations along the x, y, and z axes. In this way, thousands of transformed samples can be obtained from a limited number of initial sub-samples, which helps the diffusion model to be better generalized and robust during training.
[0095] S30: Normalization and data set division
[0096] After multi-phase segmentation and data augmentation, the sub-samples are normalized to map the grayscale values or multi-phase label values to a uniform interval of [0, 1]. Normalization helps to improve the numerical stability and convergence speed of the diffusion model during the training phase. After normalization, the entire dataset is randomly split into a training set and a validation set, for example, 80% for the training set and 20% for the validation set. The validation set is used to regularly evaluate the model performance and generalization ability during the training process to prevent the model from overfitting to a specific local structure.
[0097] S40: Building and training a diffusion model
[0098] The core of the present invention is to use the diffusion model to gradually denoise pure Gaussian noise and reconstruct a true rock image rich in multiphase information. Diffusion model training usually includes two main processes: forward diffusion and reverse generation.
[0099] 1. Model structure design:
[0100] The basic framework of the diffusion model can be implemented based on 3D U-Net or other 3D convolutional neural network structures. The model receives feature embeddings with time or diffusion step information and noise-perturbed samples as input and predicts the noise distribution added to the current sample.
[0101] During the training phase, the forward diffusion process gradually adds Gaussian noise to the real subsamples, forming a series of intermediate distributions from the noise-free state to the near-pure noise state; the reverse generation process trains the model to remove noise step by step from the high-noise state, and finally restores the structure consistent with the real multiphase flow rock image. By introducing multiphase labeling conditions (for example, multiphase segmentation information is input as an additional channel or condition), the model can learn the skeleton and multiphase distribution information at the same time.
[0102] 2. Training strategy and loss function:
[0103] Unlike adversarial training, the training of the diffusion model does not require a discriminator component, but learns the denoising mapping by minimizing the mean square error (MSE) between the predicted noise and the real added noise. In each training iteration, a real subsample is selected from the training set, and a known Gaussian noise is added to it at a specific diffusion step t, and the corresponding noise tensor is used as the training target. The diffusion model predicts the noise and calculates the MSE error with the real noise:
[0104] L(θ) = E_t,x,ε[‖ε - ε_θ(x_t, t)‖²]
[0105] Where x_t represents the sample state at the tth diffusion step, ε is the actual Gaussian noise added, and ε_θ is the noise predicted by the model. By minimizing this error, the model gradually acquires the ability to recover noise-free multiphase rock images from any diffusion stage.
[0106] 3. Training process and parameter selection:
[0107] In one example, a workstation with an NVIDIA Quadro RTX 5000 GPU can be used for model training. The Adam or AdamW optimizer (β1=0.9, β2=0.999) and the initial learning rate of 0.0003 are selected, and the learning rate decay strategy is adopted during training. The batch size of training can be 16-32, and each epoch includes iterative updates of hundreds to thousands of subsamples. During the training process, the model checkpoints are saved every several epochs (for example, 50 epochs), and the model performance is evaluated on the validation set.
[0108] In addition, the number of diffusion steps (such as T = 1000 steps) and the noise scheduling strategy (linear, cosine or adaptive) can be tuned. Through continuous experiments, it is ensured that the model can produce high-fidelity multiphase structure reconstruction results in a small number of iterations.
[0109] 4. Physical characteristics evaluation and stopping conditions:
[0110] During the training process, in addition to measuring the image similarity of the validation set, the deviation of key physical parameters (such as porosity and permeability) between the generated samples and the real data can also be calculated to ensure that the model is not only close to the real rock in visual structure, but also reasonably consistent in physical properties. When the performance of the validation set and the physical parameter evaluation indicators tend to be stable, the training can be terminated and the best model checkpoint can be selected as the final generated model.
[0111] S50: Target size image generation
[0112] When the diffusion model is trained, a pure Gaussian random noise tensor (e.g., a random noise field whose size matches the target resolution) can be input into the trained diffusion model. Through the step-by-step reverse diffusion process, the model starts from pure noise, removes noise step by step, and finally generates a floating-point array of multiphase rock images with a range between [0,1].
[0113] This step does not require a discriminator to judge, because the diffusion model itself has learned the mapping from noise to true distribution during training. Compared with traditional GAN, this method can improve the stability and controllability of the generated results. If a rock model of a larger size (such as 300³ or 2200³) is required, it is only necessary to increase the size of the input noise tensor accordingly and repeat the reverse diffusion process. In one example, the present invention can generate a three-dimensional multiphase rock model at the centimeter scale (2200³ voxel level), providing a powerful tool for large-scale porous media research.
[0114] S60: Binarization and morphological denoising
[0115] The generated floating point 3D image can be binarized according to a preset threshold (e.g. 0.5), and voxels with values less than 0.5 are judged as pores or fluid phases (assigned a value of 1), and those greater than or equal to 0.5 are regarded as solid skeletons (assigned a value of 0). For isolated small areas or noise points, morphological operations (such as opening and closing operations) can be applied to remove isolated areas with a size of less than 100 voxels, thereby obtaining a smoother, coherent and realistic binary 3D multiphase rock model.
[0116] S70: Key parameter inspection and structure verification (not shown)
[0117] After obtaining the final binary 3D model, in order to further verify the rationality and credibility of the generated model, key parameters including porosity, permeability, specific surface area, average curvature and Euler characteristic number can be calculated and compared with the real core data. Statistical parameters such as two-point correlation function can also be calculated to verify the fidelity of the generated model at the multi-scale structural level. If the generated model maintains a high degree of consistency with the real sample in multiple parameter indicators, it can be considered that this diffusion model method has successfully reproduced the real structural characteristics of multiphase flow solid rock.
[0118] In the above examples, by adjusting the diffusion steps, noise scheduling strategy and model structure, this method still has high applicability and stability in different types of rock samples and different scales. Compared with the traditional technology that can only generate skeleton images, this method successfully solves the problem of being unable to simultaneously generate rock structure images including multiphase flow distribution.
[0119] Embodiment 2
[0120] A device for generating a three-dimensional model of a solid rock containing multiphase flow based on a diffusion model, the device is used to execute a method for generating a three-dimensional model of a solid rock containing multiphase flow based on a diffusion model proposed in Example 1, the device comprising:
[0121] A sample segmentation module, used for cutting a real rock sample to obtain a plurality of sub-volume samples having a first three-dimensional spatial size, and performing multi-phase labeling separation on the sub-volume samples;
[0122] An enhancement and normalization module, used for performing data enhancement and normalization processing on the sub-volume samples, and randomly dividing the processed sub-samples into a training set and a validation set;
[0123] Diffusion model building module, which is used to build a diffusion generator network based on the 3D UNet structure and configure the diffusion steps, conditional embedding, and multi-phase prior feature input channels;
[0124] A training module, used for performing forward diffusion and reverse denoising training on the diffusion model on the training set, and optimizing the model parameters so that the model can reconstruct a rock subvolume with a multiphase flow structure from pure Gaussian noise;
[0125] The generation module is used to input the pure noise corresponding to the target size into the diffusion model, iteratively reversely generate the final multiphase rock three-dimensional data, and perform thresholding and morphological operations on the generated results to remove noise points;
[0126] The verification module is used to perform parameter calculation and multi-point statistical testing on the finally generated multiphase rock model to evaluate its structural similarity and hydraulic property approximation with the real sample.
[0127] The training module further includes a noise scheduling unit for dynamically adjusting the diffuse noise adding cosine noise scheduling strategy during the training process to improve the training stability;
[0128] The verification module can perform statistical analysis on the deviation between the porosity and permeability in the calculated parameters and the real data. If the deviation is too large, it will be fed back to the diffusion model construction module and the training module to update the model architecture or train hyperparameters.
[0129] For example, see Figure 4The device can be implemented on an electronic device (such as a workstation or server) having a central processing unit and a GPU, and includes:
[0130] Sample cutting module 81: used for cutting the rock sample into a plurality of sub-samples satisfying the first three-dimensional space size requirement to capture characteristic structures.
[0131] Enhancement module 82: used to perform data enhancement such as rotation and flipping on the sub-samples, and to perform multiphase flow segmentation on the grayscale image in combination with the watershed algorithm to form a sub-sample group containing multiphase labels.
[0132] Normalization module 83: normalizes the processed sub-samples and randomly divides them into a training set and a validation set.
[0133] Training module 84: used to train parameters based on the diffusion model framework, including forward diffusion and reverse denoising processes, using the MSE loss function to learn the mapping relationship of restoring the real multiphase rock distribution from Gaussian noise to obtain trained diffusion model parameters.
[0134] Floating point array generation module 85: After the training is completed, a random noise tensor matching the target size is input to the trained diffusion model, and a floating point array in the interval [0,1] is output through a multi-step reverse diffusion process.
[0135] Rock model acquisition module 86: performs threshold segmentation and morphological denoising processing on the floating point array to obtain a high-fidelity binary multiphase rock model.
[0136] (Optional) Verification module 87: Calculate parameters such as porosity, permeability and two-point correlation function to verify the structural similarity and practical application value of the generated model.
[0137] The implementation process and effect of this device are the same or similar to the method described in Example 1, and will not be repeated here.
[0138] Embodiment 3
[0139] This embodiment provides a computer-readable storage medium, in which instructions are stored. When the instructions are executed on a computing device (such as a PC, a server), all or part of the steps of the method for establishing a three-dimensional multiphase rock model described in the first embodiment above can be executed, thereby achieving technical effects and application values similar to those of the aforementioned method.
[0140] It should be noted that, without departing from the essence and spirit of the present invention, those skilled in the art may make appropriate adjustments and modifications to the above embodiments and drawings. For example, fine-tuning the structural selection of the diffusion model, the noise scheduling scheme and the post-processing threshold all fall within the scope of protection of the present invention. The term "include" or "comprising" is an open expression in the present invention, and does not exclude other unmentioned features or steps.
[0141] In summary, the method, device and medium provided by the present invention can reconstruct a three-dimensional rock internal structure image containing multiphase flow distribution from pure Gaussian noise based on a diffusion model, which not only significantly improves image quality and structural authenticity, but also demonstrates strong flexibility and applicability in multiphase pore characterization, physical parameter calculation and cross-scale generation.
[0142] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for generating a three-dimensional model of solid rock containing multiphase flow based on a diffusion model, characterized in that: include: Based on the steps of multiphase flow segmentation and normalization processing of real rock samples, the multiphase pore structure, rock skeleton and different fluid phases in the pores are labeled and separated to obtain a three-dimensional rock data set with multiphase labeling information; Sub-volume partitioning of the three-dimensional rock data set is performed, that is, the whole rock sample is divided into a plurality of sub-volume samples with a first three-dimensional spatial size, wherein the first three-dimensional spatial size is selected by statistically analyzing multi-point geological characteristics and multiphase flow distribution correlation functions, including two-point and higher-order correlation functions, to ensure that the sub-volume can capture representative pore structures and multiphase characteristic distributions at the size; Performing data enhancement processing on the sub-volume samples, including rotation, flipping and perturbation operations for maintaining consistency of multiphase labels, so as to construct a sub-sample data group with rich multiphase flow structure, and normalizing each sub-sample in the sub-sample data group, and randomly dividing the normalized sub-sample data into a training set and a validation set; The generator network is constructed based on the diffusion model framework, including the forward diffusion process and the reverse generation process: Forward diffusion process: Gaussian noise is gradually added to the real sub-volume samples from the initial distribution to form a noise increase sequence, so that the model learns how to reconstruct multiphase rock structure from pure noise; Reverse generation process: Train a parameterized model to learn the mapping relationship between Gaussian noise and the real rock sub-volume distribution, so that when a pure Gaussian noise input is given, the model can invert the multiphase flow rock sub-volume image close to the real distribution through step-by-step denoising; The diffusion model is trained using the training set, including optimizing the diffusion steps, noise intensity, UNet network structure, attention mechanism, and feature fusion layer in the model parameters, so that the model can accurately estimate the noise distribution at each diffusion stage and gradually reconstruct the multiphase flow rock structure details; The performance of the trained diffusion model is evaluated in the validation set, and the quality of model generation is evaluated by comparing with the real sub-samples in terms of porosity, permeability, multiphase distribution characteristics, scale curvature, Euler number, and multi-point statistical characteristic parameters; The trained diffusion model is applied to random noise input of target size, and a multiphase flow rock 3D model matching the target rock scale is generated through continuous iterative denoising inversion. The model output is multiphase labeled floating point tensor data. The floating-point data output by the model are binarized and segmented between phases using thresholds and multiphase classification strategies, and the voids and isolated areas are cleaned and refined in combination with morphological operations, ultimately obtaining a three-dimensional discrete model of solid rock containing multiphase flow.
2. The method for generating a three-dimensional model of solid rock containing multiphase flow based on a diffusion model according to claim 1, characterized in that: The method for determining the first three-dimensional space size includes: By statistically analyzing multi-point geological features, two-point and higher-order correlation functions, and based on core CT scan or microCT sample data, the porosity, permeability and pore distribution stability at different sub-volume sizes are compared to select a sub-volume size that is sufficient to represent the rock sample characteristics.
3. The method for generating a three-dimensional model of solid rock containing multiphase flow based on a diffusion model according to claim 1, characterized in that: Data enhancement processing includes: The subvolume samples are randomly rotated and mirror-flipped, where the random rotation is performed in steps of 90 degrees; Consistency enhancement is performed based on multiphase labeling information to ensure that the position and morphology of the multiphase interface remain reasonably distributed during the data enhancement process, avoiding non-physical dislocation of the multiphase separation interface.
4. The method for generating a three-dimensional model of solid rock containing multiphase flow based on a diffusion model according to claim 1, characterized in that: The network structure of the diffusion model adopts a 3D diffusion generator based on UNet, which includes: Downsampling path: Use multiple layers of 3D convolution and normalization layers, combined with attention modules to extract and compress multi-phase features; Upsampling path: adopts a 3D transposed convolution structure that is symmetrical to downsampling, and performs Skip-Connection fusion with the downsampling features at the corresponding resolution level; Diffusion step embedding: adding a time step or noise step embedding to each diffusion step introduces temporal information into the network, allowing the network to reconstruct the noise pattern under different diffusion stage conditions; Multiphase condition control: Through additional conditional encoding or embedding layers, the skeleton and pore fluid phase category distribution in the prior information of multiphase flow distribution is input into the diffusion model to achieve conditional generation.
5. The method for generating a three-dimensional model of solid rock containing multiphase flow based on a diffusion model according to claim 1, characterized in that: The model training process includes: Using stochastic gradient descent or AdamW optimizer, the diffusion model parameters are iteratively updated to minimize the noise prediction error; Generator loss, validation error, and porosity, permeability, and saturation deviations in multiphase structural parameters are continuously monitored on the validation set; The number of diffusion steps and the linear, cosine, or adaptive noise scheduling strategy are adjusted according to the validation metric to strike a balance between model stability and generation accuracy.
6. The method for generating a three-dimensional model of solid rock containing multiphase flow based on a diffusion model according to claim 1, characterized in that: After obtaining the final three-dimensional multiphase rock model, further verification steps are included: Calculate the porosity, permeability, specific surface area, mean curvature, Euler characteristic number and multi-point correlation function of the generated results; The above parameters are compared and analyzed with the real rock sample data to evaluate the consistency of the generated model in terms of structural similarity and hydraulic properties, and the model parameters or diffusion steps are re-fine-tuned according to the deviation results.
7. A device for generating a three-dimensional model of solid rock containing multiphase flow based on a diffusion model, characterized in that: The device is used to execute a method for generating a three-dimensional model of solid rock containing multiphase flow based on a diffusion model as described in any one of claims 1 to 6, and the device comprises: A sample segmentation module, used for cutting a real rock sample to obtain a plurality of sub-volume samples having a first three-dimensional spatial size, and performing multi-phase labeling separation on the sub-volume samples; An enhancement and normalization module, used for performing data enhancement and normalization processing on the sub-volume samples, and randomly dividing the processed sub-samples into a training set and a validation set; Diffusion model building module, which is used to build a diffusion generator network based on the 3D UNet structure and configure the diffusion steps, conditional embedding, and multi-phase prior feature input channels; A training module, used for performing forward diffusion and reverse denoising training on the diffusion model on the training set, and optimizing the model parameters so that the model can reconstruct a rock subvolume with a multiphase flow structure from pure Gaussian noise; The generation module is used to input the pure noise corresponding to the target size into the diffusion model, iteratively reversely generate the final multiphase rock three-dimensional data, and perform thresholding and morphological operations on the generated results to remove noise points; The verification module is used to perform parameter calculation and multi-point statistical testing on the finally generated multiphase rock model to evaluate its structural similarity and hydraulic property approximation with the real sample.
8. The device for generating a three-dimensional model of solid rock containing multiphase flow based on a diffusion model according to claim 7, characterized in that: The training module further includes a noise scheduling unit for dynamically adjusting the diffuse noise adding cosine noise scheduling strategy during the training process to improve the training stability; The verification module can perform statistical analysis on the deviation between the porosity and permeability in the calculated parameters and the real data. If the deviation is too large, it will be fed back to the diffusion model construction module and the training module to update the model architecture or train hyperparameters.
9. A computer-readable storage medium, characterized in that: The storage medium stores instructions, and when the instructions are executed by a computing device, a method for generating a three-dimensional model of solid rock containing multiphase flow based on a diffusion model as described in any one of claims 1 to 6 is executed.
Citation Information
Patent Citations
Deep learning-based twinborn digital core and saturation model construction method
CN119001914A
Rock pore three-dimensional reconstruction method and system based on adaptive hierarchical cube algorithm, and storage medium
CN119131290A
Simulation method for percolation characteristics of porous medium of sandstone digital core based on CT scanning and multiphase physics field coupling
CN117892654A
Evaluating source rock permeability using 3D model
US20220317015A1