Random medium reconstruction method based on generative adversarial network (3DESGAN)
By using a reconstruction method based on generative adversarial networks (3DESGAN), the problems of high computational complexity and high resource consumption in random medium reconstruction are solved, and efficient and controllable random medium image reconstruction is achieved, with the generated results conforming to specific physical properties.
Patent Information
- Application Number
- CN202510578974.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-07
- Publication Date
- 2025-08-08
AI Technical Summary
Existing technologies suffer from high computational complexity, low reconstruction efficiency, limited feature capture capabilities, and difficulty in accurately reproducing complex pore topology and multi-scale correlation features in random medium reconstruction. Furthermore, they consume high training resources and lack interpretability and dynamic adjustment capabilities in the generation process.
A reconstruction method based on generative adversarial networks (3DESGAN) is adopted, including generator, discriminator, interpreter and Transformer modules. By combining StyleGAN style transfer, WGAN-GP loss and gradient penalty term with XAI technology, a deep learning network model is constructed to achieve efficient reconstruction of random medium images.
It improves the controllability and interpretability of reconstruction results, reduces training costs, and can generate random medium images that satisfy specific physical properties.
Smart Images

Figure CN120451472A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of random medium reconstruction technology, and in particular to a random medium reconstruction method based on a generative adversarial network (3DESGAN). Background Art
[0002] The microstructure of random media (such as porous rocks and composite materials) directly influences their macroscopic physical properties (such as permeability and thermal conductivity). Traditional reconstruction methods rely on numerical simulations (such as multi-point geostatistics and simulated annealing), which suffer from the following drawbacks: 1) High computational complexity: Traditional methods require iterative optimization of statistical features, resulting in low reconstruction efficiency; 2) Limited feature capture: Accurately reproducing complex pore topologies and multi-scale correlations is difficult; 3) Inadequate control over randomness: The generated results are prone to deviating from the physical properties of the real data (such as porosity distribution).
[0003] Although deep learning-based generative adversarial networks (GANs) have performed well in the field of image generation, they still face challenges: 1) Training relies on a large amount of labeled data, while the cost of obtaining real core scanning data is high; 2) The generation process lacks interpretability, making it difficult to dynamically adjust the generation results; 3) The model has a large number of parameters and consumes a lot of training resources.
[0004] As mentioned above, we designed a random medium reconstruction method based on generative adversarial network (3DESGAN) to solve the above problems. Summary of the Invention
[0005] The purpose of the present invention is to address the shortcomings of the prior art and propose a random medium reconstruction method based on a generative adversarial network (3DESGAN).
[0006] In order to achieve the above object, the present invention adopts the following technical solutions:
[0007] A random medium reconstruction method based on a generative adversarial network (3DESGAN) comprises the following steps:
[0008] Step S1, obtaining three-dimensional random medium image data;
[0009] Step S2, performing binarization or segmentation preprocessing on the three-dimensional random medium image data of step S1;
[0010] Step S3: construct a deep learning network model, which is based on a generative adversarial network architecture and includes a generator, a discriminator, an interpreter, and a Transformer module, wherein:
[0011] The Transformer module is built based on the attention mechanism;
[0012] The generator is built based on StyleGAN and is used to generate random medium images;
[0013] The discriminator is built based on a deep convolutional neural network to distinguish between real images and generated images;
[0014] The interpreter is built based on XAI technology and is used to interpret the pixel importance of the generated image;
[0015] Step S4: training the generative adversarial network model to obtain a random medium reconstruction network model; wherein,
[0016] The training set of the generator is the input random medium image;
[0017] The training set of the discriminator is real images and generated images;
[0018] Step S5: input the random medium image to be reconstructed into the trained random medium reconstruction network model, and output the reconstructed image.
[0019] Preferably, the data preprocessing in step S2 includes:
[0020] Crop the dataset to 64×64×64 pixels;
[0021] 64 images are used as input data and their porosity distribution is extracted.
[0022] Preferably, the generative adversarial network architecture includes the following features:
[0023] StyleGAN style transfer: decompose the input vector into multiple style parameters, which control different levels of image features respectively;
[0024] WGAN-GP loss control: Wasserstein distance is used as the loss function, and a gradient penalty term is applied, where the gradient penalty coefficient λ = 10.
[0025] Preferably, the StyleGAN style transfer method of the generative adversarial network architecture is:
[0026] Step s1: The porosity distribution in the input image data is called conditional data, denoted by c, and represents the porosity distribution of the two-dimensional cross section in the Z direction in the three-dimensional digital rock;
[0027] Step s2: Use 8 fully connected nonlinear mapping networks to generate an intermediate latent space W, which contains detailed information about the microstructure by controlling the generator through adaptive instance normalization; it is defined as:
[0028]
[0029] Step s3: The converter encodes the input W to generate W+, which contains multiple style vectors, each of which represents a specific style of the image;
[0030] Step s4: Input the style vector in W+ into the generator, and the generator will generate images of different styles based on the style vector;
[0031] Step s5: Through iterative training, we randomly generate images with porosity close to the target.
[0032] Preferably, the loss function of the generative adversarial network architecture is:
[0033]
[0034] Among them, P r is the real data distribution, P g To generate data distribution; represents the mathematical expectation when the discriminator evaluates the generated samples as input; Represents the mathematical expectation when the discriminator evaluates the real sample as input; GP is the gradient penalty;
[0035] When the generator generates a new result, the porosity sequence c' of the reconstructed result in the Z direction is obtained by calculating the porosity of each two-dimensional cross section in the Z direction. In order to ensure that the porosity distribution in the reconstructed image is similar, a classifier is added after the discriminator Q to control the reconstruction error by minimizing the error between the true porosity sequence c and the reconstructed porosity sequence c', which is defined as follows:
[0036]
[0037] Where f(·) is the function for calculating the porosity sequence; f(G(z,c)) is the reconstructed porosity sequence, i.e., c' = f(G(z,c)).
[0038] Preferably, the interpreter module working process includes:
[0039] The sample I=G(z) generated by the generator is input to the discriminator D; the discriminator classifies the generated sample as Sc(I), where c is the target category; the gradient of the classification score Sc(I) with respect to the input image I is then calculated by backpropagation:
[0040]
[0041] Where w is the gradient vector, which has the same dimension as the input image I; the gradient value w,i,j,k,c represents the importance of pixel (i,j,k) on channel c;
[0042] For a three-dimensional image, each pixel contains the gradient values of three channels. The maximum absolute value of the gradient of each channel is taken as the total importance of the pixel. Then normalization is performed to normalize the value of M to the range of [0, 1]:
[0043]
[0044] After normalization, the closer the M value in the matrix is to 1, the greater the influence of the corresponding pixel on the discriminator classification;
[0045] Finally, the matrix M is combined with the gradient of the generator Perform Hadamard product (element-wise multiplication):
[0046]
[0047] This operation enables the generator to focus on pixel areas that the discriminator considers important when updating parameters, thereby improving the generation quality.
[0048] Preferably, the output of the discriminator is the image authenticity probability and the porosity distribution error.
[0049] Compared with the prior art, the present invention has the following beneficial effects:
[0050] 1. The present invention proposes a random medium reconstruction method based on a generative adversarial network (3DESGAN), which can effectively improve the controllability of the reconstruction results. The conditional data constrains the pore distribution, and the generated results can be directionally adjusted to meet specific physical property requirements.
[0051] 2. The present invention proposes a random medium reconstruction method based on generative adversarial network (3DESGAN), which can effectively accelerate the training process and reduce training costs through the interpreter system. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] Figure 1 This is a schematic diagram of the overall process of a random medium reconstruction method based on a generative adversarial network (3DESGAN) according to one embodiment of the present invention;
[0053] Figure 2 Schematic diagram of the network structure of a random medium reconstruction method based on a generative adversarial network (3DESGAN) according to one embodiment of the present invention;
[0054] Figure 3 This is a comparison chart of the reconstruction results of the Berea sandstone dataset using the random medium reconstruction method based on the generative adversarial network (3DESGAN) described in one embodiment of the present invention. DETAILED DESCRIPTION
[0055] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments.
[0056] This paper proposes a generative adversarial network (3DESGAN) based on an explainer and conditional simulation. By integrating explainable artificial intelligence (XAI) with conditional data constraints, it achieves high-quality and efficient random medium reconstruction. This solves the problems of high training resource consumption and excessive randomness in the reconstruction results during random medium reconstruction.
[0057] To achieve the above objectives, the present invention provides the following technical solutions:
[0058] Technical Solution 1: The present invention provides a random medium reconstruction method based on a generative adversarial network (3DESGAN), comprising the following steps:
[0059] Step S1, obtaining three-dimensional random medium image data;
[0060] Step S2, performing binarization or segmentation preprocessing on the image in step 1;
[0061] Step S3: construct a deep learning network model based on a generative adversarial network architecture, including a generator, a discriminator, an interpreter, and a Transformer module; the Transformer module is constructed based on an attention mechanism; the generator is constructed based on StyleGAN; the discriminator is constructed based on a deep convolutional neural network; and the interpreter is constructed based on XAI technology;
[0062] Step S4: training a generative adversarial network model to obtain a random medium reconstruction network model; wherein the training set of the generator is the input random medium image, and the training set of the discriminator is the real image and the generated image;
[0063] Step S5: Take the random medium image as input, reconstruct the random medium generative adversarial network model obtained in step S4, and output the reconstructed image.
[0064] Technical Solution 2 based on Technical Solution 1: The loss function of the generative adversarial network model during training is:
[0065]
[0066] Among them, P r is the real data distribution, P g To generate data distribution; represents the mathematical expectation when the discriminator evaluates the generated samples as input; Represents the mathematical expectation when the discriminator evaluates the real sample as input; GP is the gradient penalty;
[0067] When the generator generates new results, we calculate the porosity of each two-dimensional cross section in the Z direction to obtain the porosity sequence c' of the reconstructed result in the Z direction. To ensure that the porosity distribution in the reconstructed image is similar, we add a classifier after the discriminator Q to control the reconstruction error by minimizing the error between the true porosity sequence c and the reconstructed porosity sequence c', which is defined as follows:
[0068]
[0069] Where f(·) is the function for calculating the porosity sequence; f(G(z,c)) is the reconstructed porosity sequence, i.e., c' = f(G(z,c)).
[0070] Technical Solution 3 based on Technical Solution 2: The working process of the interpreter module in the generative adversarial network model is as follows:
[0071] The sample I=G(z) generated by the generator is input to the discriminator D; the discriminator classifies the generated sample as Sc(I), where c is the target category; the gradient of the classification score Sc(I) with respect to the input image I is then calculated by backpropagation:
[0072]
[0073] Where w is the gradient vector, and its dimension is the same as the input image I. The gradient value w,i,j,k,c represents the importance of pixel (i,j,k) on channel c;
[0074] For a three-dimensional image, each pixel contains the gradient values of three channels; the maximum absolute value of the gradient of each channel is taken as the total importance of the pixel; this step ensures that the importance of each pixel is determined by the channel that has the greatest impact on its classification; then normalization is performed to normalize the value of M to the range of [0,1]:
[0075]
[0076] After normalization, the closer the M value in the matrix is to 1, the greater the influence of the corresponding pixel on the discriminator classification;
[0077] Finally, the matrix M is combined with the gradient of the generator Perform Hadamard product (element-wise multiplication):
[0078]
[0079] This operation enables the generator to focus on pixel areas that the discriminator considers important when updating parameters, thereby improving the generation quality.
[0080] Technical Solution 4 based on Technical Solution 3: The process of conditional data in the generative adversarial network model is as follows:
[0081] An intermediate latent space W is generated using 8 fully connected nonlinear mapping networks, and the generator is controlled by adaptive instance normalization, which contains specific information about the microstructure; it is defined as:
[0082]
[0083] The converter encodes the input W and generates W+, which contains multiple style vectors, each of which represents a specific style of the image; then, the style vectors in W+ are input into the generator, which generates images of different styles based on the style vectors; finally, through iterative training, we randomly generate images close to the target porosity.
[0084] Example
[0085] Reference Figure 1 and Figure 2 , as one embodiment of the present invention, provides a flowchart of a random medium reconstruction method based on a generative adversarial network (3DESGAN) and a generative adversarial network model architecture. This method reconstructs a reconstructed image with similar physical properties such as pore structure and porosity based on existing random medium image data. The specific steps are as follows:
[0086] Step S1, obtaining three-dimensional random medium image data;
[0087] Step S2: Binarize the image in step 1, then trim the dataset to 64*64*64 pixels, and use 64 images as input data; extract the porosity distribution of the 64 images as conditional data;
[0088] Step S3: construct a deep learning network model based on a generative adversarial network architecture, including a generator, a discriminator, an interpreter, and a Transformer module; the Transformer module is constructed based on an attention mechanism; the generator is constructed based on StyleGAN; the discriminator is constructed based on a deep convolutional neural network; and the interpreter is constructed based on XAI technology;
[0089] The structure and parameter settings of the generator are shown in the following table:
[0090]
[0091]
[0092] Continued:
[0093]
[0094] The structure and parameter settings of the discriminator are shown in the following table:
[0095]
[0096]
[0097] Continued:
[0098]
[0099] Step S4: training a generative adversarial network model to obtain a random medium reconstruction network model; wherein the training set of the generator is the input random medium image, and the training set of the discriminator is the real image and the generated image;
[0100] Step S5: Take the random medium image as input, reconstruct the random medium generative adversarial network model obtained in step S4, and output the reconstructed image.
[0101] The loss function of the generative adversarial network model during training is:
[0102]
[0103] Among them, P r is the real data distribution, P g To generate data distribution; represents the mathematical expectation when the discriminator evaluates the generated samples as input; Represents the mathematical expectation when the discriminator evaluates the real sample as input; GP is the gradient penalty;
[0104] When the generator generates new results, we calculate the porosity of each two-dimensional cross section in the Z direction to obtain the porosity sequence c' of the reconstructed result in the Z direction. To ensure that the porosity distribution in the reconstructed image is similar, we add a classifier after the discriminator Q to control the reconstruction error by minimizing the error between the true porosity sequence c and the reconstructed porosity sequence c', which is defined as follows:
[0105]
[0106] Where f(·) is the function for calculating the porosity sequence; f(G(z,c)) is the reconstructed porosity sequence, i.e., c' = f(G(z,c)).
[0107] The working process of the interpreter module in the generative adversarial network model is as follows:
[0108] The sample I=G(z) generated by the generator is input to the discriminator D; the discriminator classifies the generated sample as Sc(I), where c is the target category; the gradient of the classification score Sc(I) with respect to the input image I is then calculated by backpropagation:
[0109]
[0110] Where w is the gradient vector, and its dimension is the same as the input image I. The gradient value w,i,j,k,c represents the importance of pixel (i,j,k) on channel c;
[0111] For a three-dimensional image, each pixel contains the gradient values of three channels; the maximum absolute value of the gradient of each channel is taken as the total importance of the pixel; this step ensures that the importance of each pixel is determined by the channel that has the greatest impact on its classification; then normalization is performed to normalize the value of M to the range of [0,1]:
[0112]
[0113] After normalization, the closer the M value in the matrix is to 1, the greater the influence of the corresponding pixel on the discriminator classification;
[0114] Finally, the matrix M is combined with the gradient of the generator Perform Hadamard product (element-wise multiplication):
[0115]
[0116] This operation enables the generator to focus on pixel areas that the discriminator considers important when updating parameters, thereby improving the generation quality.
[0117] The process of conditional data in the generative adversarial network model is as follows:
[0118] An intermediate latent space W is generated using 8 fully connected nonlinear mapping networks, and the generator is controlled by adaptive instance normalization, which contains specific information about the microstructure; it is defined as:
[0119]
[0120] The converter encodes the input W and generates W+, which contains multiple style vectors, each of which represents a specific style of the image; then, the style vectors in W+ are input into the generator, which generates images of different styles based on the style vectors; finally, through iterative training, we randomly generate images close to the target porosity.
[0121] In this example, the Berea sandstone dataset was selected as the benchmark test set (TI). This example also selected two methods, the Deep Convolutional Generative Adversarial Network (DCGAN) and the Single Normal Equation Simulation (SNESIM), as comparison benchmarks: the DCGAN effectively improves the instability of GAN training by introducing convolutional networks into the GAN framework and shares the same multi-image joint training paradigm as 3DESGAN; the SNESIM, as a classic method for traditional random medium reconstruction, has been widely used in the field of random medium modeling.
[0122] After training, this embodiment obtains the corresponding random medium image reconstruction network model.
[0123] Reference Figure 3 , showing the outer surface and cross-sectional views (X=32, Y=32, Z=32) of this embodiment and other reconstruction methods. In the intuitive diagram, the skeleton is represented in black, and the pore space is represented in gray. By comparison, it can be observed that the results generated by the SNESIM method differ most from TI, with the pores being mostly dispersed and fragmented. The reconstructed images using DCGAN and 3DESGAN both exhibit irregular pore structures similar to TI.
[0124] The table below lists the average total porosity, connected porosity, and isolated porosity of TI and ten reconstructions. Comparing the porosities in the table, we find that the porosity of the DCGAN and 3DESGAN reconstructions is within 2% of that of TI, with 3DESGAN's data being even closer to TI.
[0125] type TI SNESIM DCGAN 3DESGAN Total porosity 18.3 15.36 19.86 17.48 Connected pores 18.0 11.21 19.55 17.04 Isolated pores 0.24 4.15 0.31 0.44
[0126] Furthermore, to compare the resource consumption of different reconstruction methods, we compared the average time and resource consumption of each method during training on the dataset. The following table lists the GPU / CPU utilization, memory usage, GPU memory consumption, and reconstruction time for ten reconstructions using each method.
[0127] SNESIM DCGAN 3DESGA MaximalCPUusage 61% 45% 45% MaximalGPUusage 0 99% 99% Maximalmemoryusage 60% 37% 37% MaximalGPUgraphicmemory(MB) 0 9362 9031 Time taken for the initial 1130 29526 26361 Timefortheother9 9622 2 2
[0128] Compared to the traditional SNESIM method, DCGAN and 3DESGAN take longer to reconstruct initially, but their subsequent nine reconstructions are significantly faster due to the reuse of the model and parameters established during the initial training phase. In contrast, traditional SNESIM cannot use pre-trained parameters in subsequent reconstructions, so resource consumption increases significantly as the number of reconstructions increases. In contrast, DCGAN and 3DESGAN consume significantly less time than SNESIM when generating large batches of data. On the Berea_64 dataset, the difference in resource consumption between DCGAN and 3DESGAN is small, with 3DESGAN outperforming DCGAN with significantly lower resource consumption.
[0129] The basic principles, main features, and advantages of the present invention are shown and described above. Those skilled in the art will appreciate that the present invention is not limited to the foregoing embodiments and that various modifications and improvements may be made to the present invention without departing from the spirit and scope of the present invention. Such modifications and improvements are intended to fall within the scope of the present invention. The scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A random medium reconstruction method based on generative adversarial network (3DESGAN), characterized by: The steps include: Step S1, obtaining three-dimensional random medium image data; Step S2, performing binarization or segmentation preprocessing on the three-dimensional random medium image data of step S1; Step S3: construct a deep learning network model, which is based on a generative adversarial network architecture and includes a generator, a discriminator, an interpreter, and a Transformer module, wherein: The Transformer module is built based on the attention mechanism; The generator is built based on StyleGAN and is used to generate random medium images; The discriminator is built based on a deep convolutional neural network to distinguish between real images and generated images; The interpreter is built based on XAI technology and is used to interpret the pixel importance of the generated image; Step S4: training the generative adversarial network model to obtain a random medium reconstruction network model; wherein, The training set of the generator is the input random medium image; The training set of the discriminator is real images and generated images; Step S5: input the random medium image to be reconstructed into the trained random medium reconstruction network model, and output the reconstructed image.
2. The random medium reconstruction method based on generative adversarial network (3DESGAN) according to claim 1, characterized in that: The data preprocessing in step S2 includes: Crop the dataset to 64×64×64 pixels; 64 images are used as input data and their porosity distribution is extracted.
3. The random medium reconstruction method based on generative adversarial network (3DESGAN) according to claim 1, characterized in that: The generative adversarial network architecture includes the following features: StyleGAN style transfer: decompose the input vector into multiple style parameters, which control different levels of image features respectively; WGAN-GP loss control: Wasserstein distance is used as the loss function, and a gradient penalty term is applied, where the gradient penalty coefficient λ = 10.
4. The random medium reconstruction method based on generative adversarial network (3DESGAN) according to claim 3, characterized in that: The StyleGAN style transfer method of the generative adversarial network architecture is: Step s1: The porosity distribution in the input image data is called conditional data, denoted by c, and represents the porosity distribution of the two-dimensional cross section in the Z direction in the three-dimensional digital rock; Step s2: Use 8 fully connected nonlinear mapping networks to generate an intermediate latent space W, which contains detailed information about the microstructure by controlling the generator through adaptive instance normalization; it is defined as: where x i is the input feature map of the i-th channel, y is the style parameter; μ(x i ) and σ(x i ) are feature maps x i The channel-by-channel mean and channel-by-channel standard deviation of ; Step s3: The converter encodes the input W to generate W+, which contains multiple style vectors, each of which represents a specific style of the image; Step s4: Input the style vector in W+ into the generator, and the generator will generate images of different styles based on the style vector; Step s5: Through iterative training, we randomly generate images with porosity close to the target.
5. The random medium reconstruction method based on generative adversarial network (3DESGAN) according to claim 3, characterized in that: The loss function of the generative adversarial network architecture is: Among them, D(x) is the direct score of the discriminator on the quality of a sample x; P r is the real data distribution, P g To generate data distribution; represents the mathematical expectation when the discriminator evaluates the generated samples as input; Represents the mathematical expectation when the discriminator evaluates the real sample as input; GP is the gradient penalty; When the generator generates a new result, the porosity sequence c' of the reconstructed result in the Z direction is obtained by calculating the porosity of each two-dimensional cross section in the Z direction. In order to ensure that the porosity distribution in the reconstructed image is similar, a classifier is added after the discriminator Q to control the reconstruction error by minimizing the error between the true porosity sequence c and the reconstructed porosity sequence c', which is defined as follows: Where f(·) is the function for calculating the porosity sequence; f(G(z,c)) is the reconstructed porosity sequence, i.e., c' = f(G(z,c)).
6. The random medium reconstruction method based on generative adversarial network (3DESGAN) according to claim 1, characterized in that: The interpreter module working process includes: The sample I=G(z) generated by the generator is input to the discriminator D; then the gradient of the classification score Sc(I) to the input image I is calculated by backpropagation: Where w is the gradient vector, and its dimension is the same as the input image I; S c is the classification score of the discriminator for the generated sample, where c is the target category; the gradient value w,i,j,k,c represents the importance of pixel (i,j,k) on channel c; For a three-dimensional image, each pixel contains the gradient values of three channels. The maximum absolute value of the gradient of each channel is taken as the total importance of the pixel. Then normalization is performed to normalize the value of M to the range of [0, 1]: After normalization, the closer the M value in the matrix is to 1, the greater the influence of the corresponding pixel on the discriminator classification; Finally, the matrix M is combined with the gradient of the generator Perform Hadamard product (element-wise multiplication): This operation enables the generator to focus on pixel areas that the discriminator considers important when updating parameters, thereby improving the generation quality.
7. The random medium reconstruction method based on generative adversarial network (3DESGAN) according to claim 1, characterized in that: The output of the discriminator is the image authenticity probability and the porosity distribution error.
Citation Information
Cited By
Cement structure microstructure generation method and system based on multi-point statistical modification meaning, terminal and storage medium
CN121616698A
Method, system and terminal for generating microstructure image of cement structure based on multi-point statistical modifier semantics and storage medium
CN121616698B