A knowledge-guided graph neural network-based three-dimensional geological model automatic modeling method and system
Patent Information
- Application Number
- CN202610823400.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-09
- Publication Date
- 2026-10-13
AI Technical Summary
然而,纯数据驱动的深度学习模型仅以点对点的钻孔数据为训练目标,缺乏必要的地质约束,易将局部异常作为整体趋势,导致输出结果违背地质规律,难以保证地层连续性和岩性分布的合理性
[0072]1.基于图神经网络信息传递机制,突破传统插值局限,显著提升稀疏数据下的建模精度;
Smart Images

Figure CN122906271A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of geological information technology, specifically to an automated modeling method and system for three-dimensional geological models based on knowledge-guided graph neural networks. Background Technology
[0002] Currently, there are numerous and widely used 3D geological modeling software programs on the market, such as GOCAD developed by the University of Nancy in France, Petrel developed by Schlumberger, Leapfrog Geo developed by Seequent, and domestically developed programs like Lizheng, Geo Station, and GEO5. However, these software programs generally employ a grid-based approach combined with various interpolation algorithms. Specifically, they typically define the study area as a rectangular computational domain on a regular hexahedral (voxel) or unstructured corner grid system, and then use algorithms such as Kriging, sequential Gaussian simulation, or discrete smoothing interpolation to extrapolate sparse borehole properties to the entire grid space along the grid direction. This type of method heavily relies on the variogram to describe spatial correlation. When borehole data is dense and uniformly distributed, relatively stable results can be obtained. However, when the borehole distribution is sparse or uneven, the estimation error of the variogram increases significantly, leading to a decrease in the reliability of the interpolation results and often resulting in over-smoothing, the disappearance of thin-layer structures, and other phenomena, making it difficult to accurately describe complex geological bodies.
[0003] Furthermore, traditional modeling processes typically require significant manual intervention, including extracting borehole coordinates, stratigraphic positions, and lithological information from paper reports or graphical data. This is not only labor-intensive but also prone to data entry errors. In recent years, machine learning methods have been introduced into the field of geological modeling, establishing direct mappings between coordinates and lithology through end-to-end networks, thereby reducing reliance on traditional statistical assumptions (such as variograms). However, purely data-driven deep learning models, trained only on point-to-point borehole data, lack necessary geological constraints and are prone to interpreting local anomalies as overall trends, leading to outputs that violate geological laws and failing to guarantee the continuity of stratigraphy and the rationality of lithological distribution. Therefore, existing technologies still have significant shortcomings in terms of modeling accuracy, data utilization, and geological rationality, particularly in effectively integrating geological knowledge to achieve high-precision automated modeling. Summary of the Invention
[0004] The purpose of this invention is to provide an automated modeling method for 3D geological models based on knowledge-guided graph neural networks, comprising the following steps:
[0005] Step 1) Obtain multi-source geological data of the target study area, and extract features from the multi-source geological data to obtain a standardized borehole dataset and geological profile interpretation data containing stratigraphic boundaries and attitude information;
[0006] Step 2) Based on geological profile interpretation data, construct a structured geological knowledge field that characterizes the spatial superposition relationship of strata and the direction of geological structures;
[0007] Step 3) Discretize the target study area into a three-dimensional mesh and construct a three-dimensional graph structure;
[0008] Standardized borehole datasets are mapped onto graph nodes of a 3D graph structure as observation features; structured fields of geological prior knowledge are sampled onto graph nodes of a 3D graph structure as prior knowledge features, forming a fused feature map.
[0009] Step 4) Construct a multi-task graph neural network model based on graph attention network, and train the multi-task graph neural network model using fused feature maps and structured geological knowledge fields;
[0010] Step 5) Using the trained multi-task graph neural network model, predict the lithology of all unsampled points in the target study area, and generate a three-dimensional geological model based on the prediction results.
[0011] Furthermore, in step 1), the multi-source geological data includes borehole columnar section data and two-dimensional geological profiles;
[0012] The borehole column data is subjected to structured parsing to obtain a standardized borehole dataset;
[0013] The borehole dataset contains centralized data information including borehole identification number, borehole plane coordinates, borehole elevation, stratigraphic lithology characteristics, and the starting and ending elevations of each stratum.
[0014] Interactive spatial calibration and feature acquisition are performed on the two-dimensional geological profile to obtain geological profile interpretation data. The steps include:
[0015] S1) Load the two-dimensional geological profile map, select at least three calibration points with known three-dimensional coordinates, and establish the affine transformation relationship from the image pixel coordinate system to the real geographic coordinate system.
[0016] The affine transformation relationship is shown below:
[0017] (1)
[0018] In the formula, A is the rotation and scaling matrix, and B is the translation matrix;
[0019] S2) Based on affine transformation, the stratigraphic boundary points are interactively picked on the image, and the true three-dimensional coordinates of the stratigraphic boundary points are automatically calculated as position constraint points.
[0020] Interactively pick line segments representing the strike or dip of stratigraphic boundaries on the image, and automatically calculate the unit normal vector corresponding to the line segment as the direction constraint vector;
[0021] The geological profile interpretation data is based on stratigraphic boundaries and the unit normal vector of the line segment representing the strike or dip of the stratigraphic boundaries.
[0022] Furthermore, in step 2), the structured geological knowledge field satisfies both location and gradient constraints;
[0023] The positional constraints are as follows:
[0024] (2)
[0025] In the formula, For each location constraint point, These are scalar values assigned based on the stratigraphic sequence.
[0026] The gradient constraints are shown below:
[0027] (3)
[0028] In the formula, For each direction constraint vector, The location of each directional constraint vector;
[0029] The function of the structured geological knowledge field is shown below:
[0030] (4)
[0031] In the formula, Let be the scalar weighting coefficient for the stratigraphic connectivity at the i-th location constraint point. This represents the total number of location constraint points; The vector weight coefficients for the i-th position constraint point; For target point Euclidean distance between the constraint point and the constraint point; Let x be the gradient of the radial basis function with respect to the target point x.
[0032] linear polynomial As shown below:
[0033] (5)
[0034] In the formula, These are the polynomial coefficients.
[0035] Furthermore, in step 3), the steps for forming the fused feature map include:
[0036] Step 3.1) Set the minimum and maximum values of the site range x, y, and z according to the actual situation;
[0037] Step 3.2) Based on the three-dimensional boundary constraints of the target study area, generate an unstructured tetrahedral mesh using the MeshPy library;
[0038] Step 3.3) Use the vertices of each tetrahedral mesh element as graph nodes to generate a node set V;
[0039] Step 3.4) Using the adjacency judgment rule, obtain the adjacent cell IDs of each cell through the tetrahedral mesh cell connection relationship, and construct the edge set E;
[0040] The adjacency determination rule states that mesh cells that share a face, edge, or vertex are adjacent nodes;
[0041] Step 3.5) Set the maximum number of adjacencies to n;
[0042] If the number of adjacent nodes is greater than the maximum number of adjacent nodes, then the n nearest nodes are selected as adjacent nodes based on distance, and a fused feature map is constructed. .
[0043] Furthermore, in step 4), the multi-task graph neural network model includes an input layer, a graph attention network feature extraction layer, and an output layer;
[0044] The input layer is used to receive the node feature matrix F= ;
[0045] Where x, y, and z are the three-dimensional spatial coordinates of the tetrahedral mesh element nodes. This represents the scalar value of the structured geological knowledge field obtained at this node through spatial interpolation sampling.
[0046] The graph attention network feature extraction layer consists of two stacked graph attention network layers;
[0047] Among them, for the first Layered graph attention network layers use node feature matrices Sum of edges As input, based on nodes With adjacent nodes Attention coefficient between The neighborhood features are weighted and aggregated to output the updated node feature matrix. ;
[0048] Graph attention network layers all enhance feature representation capabilities through multi-head attention mechanisms;
[0049] The output layer adopts a lithology classification task and a scalar field regression task structure, outputting the probability distribution of lithology categories, as well as the predicted field value and gradient vector of the structured geological knowledge field.
[0050] The multi-task graph neural network model is trained using the Adam optimizer, and the joint loss function used during training is shown below:
[0051] (6)
[0052] In the formula, The cross-entropy loss function for lithological classification tasks. For the regression loss of the stratigraphic scalar field, To calculate the mean squared error loss function for the reconstruction error of the scalar field at all nodes, These are the preset weighting coefficients.
[0053] Furthermore, the lithological classification task consists of a two-layer, multi-layer sensing mechanism;
[0054] The output of the graph attention network layer is used as the input of the first layer of the multilayer perceptron. The extracted features are activated by the ReLU activation function, and the first layer feature map is output.
[0055] The first layer feature map is used as the input of the second layer multilayer perceptron. After feature extraction, the Softmax function is used to output the probability distribution of each node belonging to silty clay, gravel, and granite.
[0056] The scalar field regression task consists of two fully connected layers;
[0057] The first fully connected layer uses the ReLU activation function, and the output feature map is used as the input to the second fully connected layer.
[0058] The second fully connected layer outputs the predicted field value of the structured geological knowledge field.
[0059] Furthermore, in step 5), the step of generating a three-dimensional geological model based on the prediction results includes:
[0060] Step 5.1) Obtain the lithology category probability predicted by the multi-task graph neural network model for each node in the 3D graph structure;
[0061] Step 5.2) For each volume element in the tetrahedral mesh, count the lithology category with the highest predicted probability for all vertices of each volume element, and determine the category with the highest frequency as the final lithology attribute of the tetrahedral mesh;
[0062] Step 5.3) Export the tetrahedral mesh with determined lithological properties as a visual, universal 3D geological model file format.
[0063] The system based on the aforementioned automated modeling method for 3D geological models using graph neural networks includes a data acquisition and preprocessing module, a knowledge field construction module, a graph structure construction and feature fusion module, a multi-task graph network model module, and a model generation module.
[0064] The data acquisition and preprocessing module is used to automatically parse borehole data and interactively extract geological profile features to generate a standardized dataset.
[0065] The knowledge field construction module is used to construct a structured geological knowledge field that represents the laws of geological structure based on the extracted geological profile features;
[0066] The graph structure construction and feature fusion module is used to establish a three-dimensional graph structure of the study area and fuse borehole data with geological knowledge fields into graph node features.
[0067] The multi-task graph network model module is used to perform attention weight calculation, node feature aggregation, lithology classification, and scalar field regression of the graph attention network.
[0068] The model generation module is used to predict the lithology of the entire region and generate a three-dimensional geological model using the trained model.
[0069] An electronic device includes a memory, a processor, and a data bus. The memory stores all machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory via the data bus, and the machine-readable instructions are executed by the processor to perform the automated modeling method for graph neural network three-dimensional geological models.
[0070] A computer-readable storage medium storing a computer program that, when executed by a processor, performs the described automated modeling method for three-dimensional geological models using a graph neural network.
[0071] The technical effects of this invention are undeniable. Addressing the problems of low accuracy, poor geological plausibility, and insufficient automation in existing 3D geological modeling methods when dealing with sparse boreholes and complex geological bodies, this invention provides a novel 3D geological modeling method. This method achieves a new modeling approach and system for generating 3D geological models with both high accuracy and high geological plausibility under sparse borehole conditions by structurally encoding qualitative and empirical geological expert knowledge and combining it with the powerful spatial reasoning capabilities of Graph Neural Networks (GNNs). This invention has the following significant beneficial effects:
[0072] 1. Based on the information transmission mechanism of graph neural networks, it breaks through the limitations of traditional interpolation and significantly improves the modeling accuracy under sparse data;
[0073] Existing commercial software (such as GOCAD and Petrel) largely relies on traditional statistical algorithms like Kriging, which are essentially simple distance-based interpolation and are prone to failure when borehole data is sparse. This invention innovatively transforms 3D geological modeling into a node classification problem on a graph structure. Utilizing the unique message-passing mechanism of Graph Neural Networks (GNNs), the model not only considers the spatial coordinates of nodes but also adaptively aggregates feature information from adjacent nodes through an attention mechanism. This mechanism allows the lithological characteristics of known boreholes to be effectively transmitted to unsampled blank areas along the graph's topology. Therefore, even in cases of sparse or uneven borehole distribution, this invention can infer the attributes of unknown areas by learning deep topological relationships between nodes, effectively compensating for data gaps and significantly improving the model's spatial prediction accuracy in locally complex areas.
[0074] 2. By integrating geological prior knowledge field constraints, geological artifacts in pure data-driven models are effectively avoided, ensuring the rationality of model topology;
[0075] To address the issue that pure deep learning models are prone to violating geological common sense (such as stratigraphic penetration and lenticular morphology distortion), this invention does not rely solely on data-driven approaches. Instead, it transforms geological expert knowledge into a structured, unified geological knowledge scalar field. By designing a multi-task joint loss function that incorporates lithology classification and scalar field regression, stratigraphic superposition patterns and occurrence information are integrated as strong constraints into the training process. This forces the model to consider the consistency of geological structure when making lithology predictions, thereby fundamentally ensuring that the generated 3D geological model conforms to geological sedimentary patterns and topological connectivity, resulting in stronger geological interpretability and reliability.
[0076] 3. Build a fully automated Python architecture to break free from dependence on commercial software and achieve reproducibility and lightweight geological modeling;
[0077] This invention is implemented entirely using the Python programming language and open-source ecosystem (such as dxfgrabber, PyTorchGeometric, and PyVista), constructing an end-to-end automated workflow from multi-source data automated parsing to 3D model generation. This solution is completely independent, requiring no reliance on expensive third-party commercial modeling software, significantly reducing application costs. Furthermore, by replacing the tedious manual interpolation, profile stitching, and data cleaning steps of traditional methods with a scripted processing flow, modeling can be completed with only minimal human interaction, greatly reducing workload and human error, and making the geological modeling process highly reproducible and scalable. Attached Figure Description
[0078] Figure 1 This is a flowchart of the method of the present invention;
[0079] Figure 2 This is a schematic diagram of the two-dimensional cross-sectional interactive spatial calibration of the present invention;
[0080] Figure 3 This is a schematic diagram of the unified geological knowledge scalar field of the present invention;
[0081] Figure 4 This is a schematic diagram of the multi-task graph neural network model architecture of the present invention;
[0082] Figure 5 This is a schematic diagram of a three-dimensional geological model constructed using the graph neural network of the present invention. Detailed Implementation
[0083] The present invention will be further described below with reference to embodiments, but it should not be construed that the scope of the present invention is limited to the following embodiments. Various substitutions and modifications made based on ordinary technical knowledge and common practices in the art without departing from the above-described technical concept of the present invention should be included within the scope of protection of the present invention.
[0084] Example 1:
[0085] See Figures 1 to 5 An automated modeling method for 3D geological models based on knowledge-guided graph neural networks includes the following steps:
[0086] Step 1) Obtain multi-source geological data of the target study area, and extract features from the multi-source geological data to obtain a standardized borehole dataset and geological profile interpretation data containing stratigraphic boundaries and attitude information;
[0087] Occurrence information refers to the occurrence state and orientation parameters of geological bodies (such as rock strata, faults, joints, etc.) in three-dimensional space, including three core elements: strike, dip, and dip angle.
[0088] The direction of extension of the line where the geological layer intersects with the horizontal plane;
[0089] Inclination, that is, the direction in which the layer tilts downward (perpendicular to the direction).
[0090] Inclination angle, which is the maximum angle between the plane and the horizontal plane;
[0091] Step 2) Based on geological profile interpretation data, construct a structured geological knowledge field that characterizes the spatial superposition relationship of strata and the direction of geological structures;
[0092] Step 3) Discretize the target study area into a three-dimensional mesh and construct a three-dimensional graph structure;
[0093] Standardized borehole datasets are mapped onto graph nodes of a 3D graph structure as observation features; structured fields of geological prior knowledge are sampled onto graph nodes of a 3D graph structure as prior knowledge features, forming a fused feature map.
[0094] Step 4) Construct a multi-task graph neural network model based on graph attention network, and train the multi-task graph neural network model using fused feature maps and structured geological knowledge fields; Step 5) Use the trained multi-task graph neural network model to predict the lithology of all unsampled points in the target study area, and generate a three-dimensional geological model based on the prediction results.
[0095] When constructing the training dataset, the lithology category is the rock type identified from the borehole data of previous exploration. Lithology refers to the physical and chemical properties of rocks, mainly used to describe the characteristics of rocks such as color, composition, and structure. In this embodiment, the lithology category is divided into 3 classes, with the correspondence between numerical labels and geological lithology names: 0 for silty clay, 1 for sand and gravel, and 2 for granite; this mapping relationship is determined when constructing the training data and remains consistent in the subsequent model prediction output.
[0096] Example 2:
[0097] The main structure of this embodiment is the same as that of embodiment 1. Further, in step 1), the multi-source geological data includes borehole columnar data and two-dimensional geological profiles.
[0098] The borehole column data is subjected to structured parsing to obtain a standardized borehole dataset;
[0099] The borehole dataset contains centralized data information including borehole identification number, borehole plane coordinates, borehole elevation, stratigraphic lithology characteristics, and the starting and ending elevations of each stratum.
[0100] Interactive spatial calibration and feature acquisition are performed on the two-dimensional geological profile to obtain geological profile interpretation data. The steps include:
[0101] S1) Load the two-dimensional geological profile map, select at least three calibration points with known three-dimensional coordinates, and establish the affine transformation relationship from the image pixel coordinate system to the real geographic coordinate system.
[0102] The affine transformation relationship is shown below:
[0103] (1)
[0104] In the formula, A is the rotation and scaling matrix, and B is the translation matrix;
[0105] S2) Based on affine transformation, the stratigraphic boundary points are interactively picked on the image, and the true three-dimensional coordinates of the stratigraphic boundary points are automatically calculated as position constraint points.
[0106] Interactively pick line segments representing the strike or dip of stratigraphic boundaries on the image, and automatically calculate the unit normal vector corresponding to the line segment as the direction constraint vector;
[0107] The geological profile interpretation data is based on stratigraphic boundaries and the unit normal vector of the line segment representing the strike or dip of the stratigraphic boundaries.
[0108] Example 3:
[0109] The main structure of this embodiment is the same as any one of embodiments 1-2. Further, in step 2), the structured geological knowledge field satisfies the position constraints and gradient constraints.
[0110] The positional constraints are as follows:
[0111] (2)
[0112] In the formula, For each location constraint point, These are scalar values assigned based on the stratigraphic sequence.
[0113] The gradient constraints are shown below:
[0114] (3)
[0115] In the formula, For each direction constraint vector, The location of each directional constraint vector;
[0116] The function of the structured geological knowledge field is shown below:
[0117] (4)
[0118] In the formula, Let be the scalar weighting coefficient for the stratigraphic connectivity at the i-th location constraint point. This represents the total number of location constraint points; The vector weight coefficients for the i-th position constraint point; For target point Euclidean distance between the constraint point and the constraint point; This is the gradient of the radial basis function with respect to the target point x, and its direction is consistent with the direction constraint vector.
[0119] linear polynomial As shown below:
[0120] (5)
[0121] In the formula, These are polynomial coefficients used to ensure the nonsingularity and stability of the solutions to a system of linear equations.
[0122] Example 4:
[0123] The main structure of this embodiment is the same as any one of embodiments 1-3. Further, in step 3), the step of forming the fused feature map includes:
[0124] Step 3.1) Set the minimum and maximum values of the site range x, y, and z according to the actual situation;
[0125] Step 3.2) Based on the three-dimensional boundary constraints of the target study area, generate an unstructured tetrahedral mesh using the MeshPy library;
[0126] Step 3.3) Use the vertices of each tetrahedral mesh element as graph nodes to generate a node set V;
[0127] Step 3.4) Using the adjacency judgment rule, obtain the adjacent cell IDs of each cell through the tetrahedral mesh cell connection relationship, and construct the edge set E; this can be implemented using MeshPy or an equivalent mesh processing library;
[0128] The adjacency determination rule states that mesh cells that share a face, edge, or vertex are adjacent nodes;
[0129] Step 3.5) Set the maximum number of adjacencies to n (n=10);
[0130] If the number of adjacent nodes is greater than the maximum number of adjacent nodes, then the n nearest nodes are selected as adjacent nodes based on distance, and a fused feature map is constructed. .
[0131] Example 5:
[0132] The main structure of this embodiment is the same as any one of embodiments 1-4. Further, in step 4), the multi-task graph neural network model includes an input layer, a graph attention network feature extraction layer, and an output layer.
[0133] The input layer is used to receive the node feature matrix F= ;
[0134] Where x, y, and z are the three-dimensional spatial coordinates of the tetrahedral mesh element nodes. This represents the scalar value of the structured geological knowledge field obtained at this node through spatial interpolation sampling.
[0135] The node feature matrix encodes the observation data (borehole lithology information) from step 1) and the geological prior knowledge (unified knowledge field) from step 2) in the same feature space, which is then used by the subsequent graph attention network for feature extraction.
[0136] The graph attention network feature extraction layer consists of two stacked graph attention network layers;
[0137] Among them, for the first Layered graph attention network layers use node feature matrices Sum of edges As input, based on nodes With adjacent nodes Attention coefficient between The neighborhood features are weighted and aggregated to output the updated node feature matrix. The attention coefficient is calculated from the concatenated features after linear transformation of node features using an attention function and a normalization function;
[0138] Graph attention network layers all enhance feature representation capabilities through multi-head attention mechanisms;
[0139] The output layer adopts a lithology classification task and a scalar field regression task structure, outputting the probability distribution of lithology categories, as well as the predicted field value and gradient vector of the structured geological knowledge field.
[0140] The multi-task graph neural network model is trained using the Adam optimizer, and the joint loss function used during training is shown below:
[0141] (6)
[0142] In the formula, is the cross-entropy loss function for lithology classification tasks, used to measure the difference between the model's predicted probability of lithology category at each node and the actual borehole lithology label. For the regression loss of the stratigraphic scalar field, To calculate the mean squared error loss function for the reconstruction error of the scalar field at all nodes, These are the preset weighting coefficients.
[0143] Example 6:
[0144] The main structure of this embodiment is the same as any one of embodiments 1-5. Furthermore, the lithological classification task is composed of two-layer multi-layer sensing mechanisms.
[0145] The output of the graph attention network layer is used as the input of the first layer of the multilayer perceptron. The extracted features are activated by the ReLU activation function, and the first layer feature map is output.
[0146] The first layer feature map is used as the input of the second layer multilayer perceptron. After feature extraction, the Softmax function is used to output the probability distribution of each node belonging to silty clay, gravel, and granite.
[0147] The scalar field regression task consists of two fully connected layers;
[0148] The first fully connected layer uses the ReLU activation function, and the output feature map is used as the input to the second fully connected layer.
[0149] The second fully connected layer outputs the predicted field value (1-dimensional scalar) and gradient vector (3-dimensional component) of the structured geological knowledge field, for a total of 4 output values. The gradient vector should be consistent with the gradient direction of the structured geological knowledge field constructed in step 2).
[0150] Example 7:
[0151] The main structure of this embodiment is the same as any one of embodiments 1-6. Further, in step 5), the step of generating a three-dimensional geological model based on the prediction results includes:
[0152] Step 5.1) Obtain the lithology category probability predicted by the multi-task graph neural network model for each node in the 3D graph structure;
[0153] Step 5.2) For each volume element in the tetrahedral mesh, count the lithology category with the highest predicted probability for all vertices of each volume element, and determine the category with the highest frequency as the final lithology attribute of the tetrahedral mesh;
[0154] Step 5.3) Export the tetrahedral mesh with determined lithological properties as a visual, universal 3D geological model file format.
[0155] Example 8:
[0156] The system based on the automated modeling method for three-dimensional geological models using graph neural networks as described in any one of Examples 1-7 includes a data acquisition and preprocessing module, a knowledge field construction module, a graph structure construction and feature fusion module, a multi-task graph network model module, and a model generation module.
[0157] The data acquisition and preprocessing module is used to automatically parse borehole data and interactively extract geological profile features to generate a standardized dataset.
[0158] The knowledge field construction module is used to construct a structured geological knowledge field that represents the laws of geological structure based on the extracted geological profile features;
[0159] The graph structure construction and feature fusion module is used to establish a three-dimensional graph structure of the study area and fuse borehole data with geological knowledge fields into graph node features.
[0160] The multi-task graph network model module is used to perform attention weight calculation, node feature aggregation, lithology classification, and scalar field regression of the graph attention network.
[0161] The model generation module is used to predict the lithology of the entire region and generate a three-dimensional geological model using the trained model.
[0162] Example 9:
[0163] An electronic device includes: a memory, a processor, and a data bus, wherein the memory stores all machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the memory via the data bus, and the machine-readable instructions are executed by the processor to perform the method described in any one of embodiments 1 to 7.
[0164] Example 10:
[0165] A computer-readable storage medium storing a computer program that, when executed by a processor, performs the method described in any one of embodiments 1 to 7.
[0166] Example 11:
[0167] The hardware configuration used in this embodiment is as follows: Intel Core i9-13900K processor (24 cores, 32 threads, 3.0GHz clock speed, 36MB cache), 64GB DDR5 5600MHz memory, NVIDIA RTX 5080 graphics card (16GB GDDR6X video memory, 16384 CUDA cores), and 2TB NVMe SSD hard drive; the software environment is as follows: Windows 11 Professional operating system, Python 3.9.16 programming language, and the core libraries required include dxfgrabber 0.8.12 (DXF file parsing), NumPy 1.24.3 (numerical computation), SciPy 1.10.1 (spatial interpolation and matrix operations), MeshPy 2023.1 (grid generation), PyTorch 2.0.1 (deep learning framework), PyTorch Geometric 2.3.1 (graph data processing and GNN model construction), and Matplotlib. 3.7.1 (Result Visualization), OpenCV-Python 4.7.0.72 (Image-Assisted Calibration), tkinter (Interactive Geological Feature Extraction). The flowchart of this embodiment is as follows: Figure 1 As shown in the figure, the complete process from acquiring multi-source geological data to generating a 3D geological model is illustrated. The arrows indicate the order in which data processing is performed.
[0168] S1. Automated acquisition and knowledge extraction of multi-source geological data.
[0169] Multiple AutoCAD DXF format engineering geological columnar sections of the target site were obtained. The open-source Python library dxfgrabber was used to parse the entity information in the DXF drawings. Text entities in the DXF drawings were scanned column by column to extract coordinates and lithological distribution characteristics for each layer. This data was then saved as a CSV file using the openpyxl library, containing fields for borehole ID, X, Y, Z, Lithology, from, and to. A standardized borehole data table was finally generated, with fields and examples shown in Table 1 below.
[0170]
[0171] The data was read using the `read_csv` function of the pandas library via a Python script. A cylinder was generated 0.5 meters to the left and right of the borehole centerline. A certain number of points were randomly generated within each cylinder. To ensure lithological uniformity, a rule was set that at least 50 points would be randomly generated per meter along the z-direction. The lithological layer containing each random point was assigned the corresponding lithological classification.
[0172] Obtain cross-sectional drawings of the target site, such as... Figure 2 As shown in the figure, the diagram includes selecting no fewer than three calibration points with known three-dimensional coordinates on the original two-dimensional profile image, establishing an affine transformation relationship from the pixel coordinate system to the real geographic coordinate system, and interactively picking stratigraphic boundary points (dot markers) and directional constraint vectors based on the transformation relationship.
[0173] This paper uses Python's OpenCV and tkinter libraries to perform 3D spatial calibration on drawings. At least three points are selected from the drawing. OpenCV reads the pixel coordinates of the drawing and constructs an affine matrix based on the real-world coordinates input interactively. The least squares method is then used to further reduce errors. After constructing the affine matrix between pixels and real-world coordinates, the paper collects the real coordinates of nodes connecting strata in the image, along with their corresponding strata connection scalars and strata normal vectors (Gx, Gy, Gz).
[0174] Here, the affine matrix represents the transformation relationship between the pixel coordinates of a point in a pixel and the coordinates of the real-world field. The mathematical expression for the affine transformation is:
[0175] True coordinates = A × pixel coordinates + B
[0176] Here, A is a 3*3 rotation and scaling matrix, and B is a 3*1 translation matrix, which together are called affine transformation matrices (3*4 matrices).
[0177] S2. Structured Field Construction of Geological Prior Knowledge
[0178] This step is the core innovation of this invention compared to traditional RBF implicit modeling. Its purpose is to construct a unified geological knowledge field that simultaneously satisfies position and orientation constraints through HRBF, such as... Figure 3 As shown in the figure, the distribution of the structured geological knowledge field in three-dimensional space is displayed using a color-coded method. Different colors represent different scalar field values (the color scale from blue to red corresponds to field values from small to large, reflecting the stratigraphic sequence from shallow to deep). The figure also overlays and labels the spatial locations of constraint points (sphere markers) and the slice network structure, intuitively demonstrating the positional constraints and graph structure satisfied by the knowledge field. A unified scalar field is constructed using the Hermite radial basis function (HRBF) implicit modeling method. HRBF utilizes not only the location of points but also their normal vectors, enabling the construction of a smoother implicit field with stronger geological regularity. In this embodiment, the Wendland C2 function is selected as the radial basis function. This ensures the validity of the calculations and the smoothness of the field.
[0179] Construction of a unified geological knowledge scalar field: All three-dimensional points of stratigraphic boundaries extracted from S1 and their corresponding unit normal vectors are used as interpolation constraints for HRBF. The scalar field function is as follows (Formula 1):
[0180]
[0181] Where α is the scalar weighting coefficient for formation connectivity, β is the vector weighting coefficient, each constraint point corresponds to a set, and r represents the target point. Euclidean distance between the constraint points Radial basis functions with respect to the target point The gradient of , · represents the inner product operation of vectors, P(x) is a linear polynomial in the form of C0 + C1x + C2y + C3z, used to eliminate singularities in interpolation and ensure the stability of the solution, and C0, C1, C2, C3 are polynomial coefficients.
[0182] To ensure that the scalar field can accurately encode the stratigraphic stacking patterns and spatial distribution characteristics, two types of constraints are set:
[0183] Position constraints: ,in An ordered field value is assigned to each stratigraphic boundary point. In this embodiment, based on the stratigraphic depth pattern, the field value is assigned according to a linearly increasing rule from the surface to the depth. The field value ranges from 1 (constraint point near the surface) to 4 (constraint point is the bottom line of the stratigraphic boundary; if there are three lithological layers, the field value is 2), ensuring that the change of the scalar field value is positively correlated with the stratigraphic depth, thus encoding the stratigraphic superposition relationship.
[0184] Gradient constraints: This means that the gradient direction of the scalar field at the constraint point must be completely consistent with the geological normal direction at that point, thereby forcing the spatial variation trend of the scalar field to conform to the stratigraphic occurrence law.
[0185] By calling the linear algebra solver module of the scipy library in Python, the above position constraints and gradient constraints are transformed into a system of linear equations. All weight coefficients and polynomial coefficients are solved, and finally a unified geological knowledge scalar field covering the entire study area is obtained.
[0186] S3. Construction of a 3D graph structure integrating knowledge fields
[0187] First, the minimum and maximum values of the x, y, and z axes of the site are set according to the actual situation. Using the MeshPy library, an unstructured tetrahedral mesh is generated based on the 3D boundary constraints of the study area. The centroid of each tetrahedral mesh cell is used as a graph node, ultimately generating a node set V. Adjacency rules are adopted: mesh cells sharing faces, edges, or vertices are considered adjacent nodes. The `get_adjacent_cells()` function of MeshPy is used to obtain the adjacent cell IDs of each cell, constructing an edge set E. To reduce computational load, the maximum number of adjacencies is set to 10 (a single node has no more than 10 adjacent nodes). For any nodes exceeding this limit, the 10 closest nodes are selected as adjacent nodes based on distance, constructing an undirected graph G=(V,E).
[0188] S4. Knowledge-guided multi-task graph neural network modeling and training
[0189] This step is the core modeling step of this invention. By constructing a multi-task graph attention network, geological knowledge is integrated into the model training in a strongly constrained manner to achieve synergistic optimization that aligns lithological classification with geological patterns. The specific implementation is as follows:
[0190] Model Architecture Design. Specifically, a Graph Attention Network (GAT) is used as the basic framework of the model. The attention mechanism adaptively learns the association weights between nodes, and the message passing mechanism of the graph neural network aggregates the feature information of neighboring nodes to improve spatial feature extraction capabilities. The overall model is built on the PyTorch framework (version 2.0.1), with the following structure: Input Layer: Receives the node feature matrix F = (x, y, z, s), with an input dimension of 4. Here, x, y, and z are the coordinates of the 3D graph node generated in step S3, and s is the sampled scalar value of the structured geological knowledge field constructed in step S2 at that node.
[0191] GAT Feature Extraction Layer: Contains two stacked GAT layers. The first GAT layer has 4 attention heads, a hidden layer dimension of 256, and uses the ELU activation function. The second GAT layer has 4 attention heads, an output dimension of 256, and uses the ELU activation function. Both GAT layers enhance feature representation capabilities through a multi-head attention mechanism.
[0192] Output layer: Employs a dual-task header structure, corresponding to the main task and auxiliary task respectively.
[0193] The lithology classification task consists of two fully connected layers (multilayer perceptron). The first layer has an output dimension of 64 and uses the ReLU activation function. The second layer has an output dimension of 4 (consistent with the number of lithology categories) followed by a Softmax function, which outputs the probability distribution of each node belonging to silty clay, gravel, and granite.
[0194] Scalar field regression task: It consists of two fully connected layers. The first layer has an output dimension of 32 and uses the ReLU activation function. The second layer has an output dimension of 4 and directly outputs the predicted field value and gradient vector of the unified knowledge scalar field.
[0195] Loss function design: To achieve dual optimization of "lithological classification accuracy" and "geological rationality," a joint loss function integrating the main and auxiliary tasks is designed, with the following expression:
[0196]
[0197] in, For lithological classification loss, For the scalar field regression loss of the stratigraphic connection field, These are the preset weighting coefficients. This mechanism forces the model to adhere to given geological laws while optimizing lithological classification accuracy.
[0198] Model Training and Optimization: Using the 3D graph structure G constructed in step S3 as input, the Adam optimizer is used to train the model. The initial learning rate is set to 0.001, and an overfitting is avoided by using a learning rate decay strategy (decreasing to 0.9 times the original learning rate every 100 iterations). During training, the loss changes of the main task and auxiliary task are monitored in real time. Training is stopped when the loss value does not decrease significantly for 50 consecutive iterations, resulting in a converged knowledge-guided multi-task GNN model. The schematic diagram of the multi-task graph neural network model architecture is shown below. Figure 4As shown in the figure, the complete network structure is illustrated from the input layer (node features F=[x,y,z,s]) → graph attention network feature extraction layer (two stacked GAT layers, each with 4 attention heads) → dual-task output layer (lithology classification branch: two MLP layers → Softmax → 3 lithology probabilities; scalar field regression branch: two FC layers → 4-dimensional output). The connecting arrows between the layers indicate the changes in data dimensions.
[0199] S5. Generation of 3D Geological Models
[0200] This step utilizes the trained GNN model to automatically generate a 3D geological model, such as... Figure 5 As shown in the figure, the final output 3D geological model is displayed in the form of an unstructured tetrahedral mesh. Different fill patterns (or different gray levels) represent different lithological categories (silty clay, gravel, granite). The model completely covers the 3D spatial range of the target study area, intuitively showing the spatial distribution and contact relationships of various stratigraphic units. The core functionality is achieved through a professional visualization library to complete model format conversion and attribute assignment. Specifically, the trained GNN model is applied to the 3D graph structure of the entire study area, and the lithological classification results of each mesh node are output through the main task branch of the model. The unstructured tetrahedral mesh and corresponding node classification results generated in step 103 are loaded into the PyVista visualization library. A node category mode voting strategy is used to assign a value to each tetrahedral unit—that is, to count the lithological classification categories of all nodes contained in a single tetrahedron, and take the category with the highest frequency (mode) as the final lithological attribute of the tetrahedron, thus achieving a precise mapping from node features to unit attributes. Through the mesh data export function of the PyVista library, the 3D mesh with lithological attribute information is directly converted into the ParaView-compatible VTU format.
Claims
1. A knowledge-guided graph neural network-based automated modeling method for 3D geological models, characterized in that, Includes the following steps: Step 1) Obtain multi-source geological data of the target study area, and extract features from the multi-source geological data to obtain a standardized borehole dataset and geological profile interpretation data containing stratigraphic boundaries and attitude information; Step 2) Based on geological profile interpretation data, construct a structured geological knowledge field that characterizes the spatial superposition relationship of strata and the direction of geological structures; Step 3) Discretize the target study area into a three-dimensional mesh and construct a three-dimensional graph structure; Standardized borehole datasets are mapped onto graph nodes of a 3D graph structure as observation features; The structured field of geological prior knowledge is sampled onto the graph nodes of the three-dimensional graph structure as a prior knowledge feature to form a fused feature graph. Step 4) Construct a multi-task graph neural network model based on graph attention network, and train the multi-task graph neural network model using fused feature maps and structured geological knowledge fields; Step 5) Using the trained multi-task graph neural network model, predict the lithology of all unsampled points in the target study area, and generate a three-dimensional geological model based on the prediction results.
2. The automated modeling method for 3D geological models based on knowledge-guided graph neural networks according to claim 1, characterized in that, In step 1), the multi-source geological data includes borehole columnar section data and two-dimensional geological profiles; The borehole column data is subjected to structured parsing to obtain a standardized borehole dataset; The centralized data information of the borehole dataset includes borehole identification number, borehole plane coordinate information, borehole elevation information, stratigraphic lithology characteristics, and the starting and ending elevation information of each rock layer; Interactive spatial calibration and feature acquisition are performed on the two-dimensional geological profile to obtain geological profile interpretation data. The steps include: S1) Load the two-dimensional geological profile map, select at least three calibration points with known three-dimensional coordinates, and establish the affine transformation relationship from the image pixel coordinate system to the real geographic coordinate system. The affine transformation relationship is shown below: (1) In the formula, A is the rotation and scaling matrix, and B is the translation matrix; S2) Based on affine transformation, the stratigraphic boundary points are interactively picked on the image, and the true three-dimensional coordinates of the stratigraphic boundary points are automatically calculated as position constraint points. Interactively pick line segments representing the strike or dip of stratigraphic boundaries on the image, and automatically calculate the unit normal vector corresponding to the line segment as the direction constraint vector; Stratigraphic boundary points and the unit normal vectors of line segments representing the strike or dip of stratigraphic boundary points are used as geological profile interpretation data.
3. The automated modeling method for 3D geological models based on knowledge-guided graph neural networks according to claim 1, characterized in that, In step 2), the structured geological knowledge field satisfies both location and gradient constraints; The positional constraints are as follows: (2) In the formula, For each location constraint point, These are scalar values assigned based on the stratigraphic sequence. The gradient constraints are shown below: (3) In the formula, For each direction constraint vector, The location of each directional constraint vector; The function of the structured geological knowledge field is shown below: (4) In the formula, Let be the scalar weighting coefficient for the stratigraphic connectivity at the i-th location constraint point. This represents the total number of location constraint points; The vector weight coefficients for the i-th position constraint point; For target point Euclidean distance between the constraint point and the constraint point; Let x be the gradient of the radial basis function with respect to the target point x. linear polynomial As shown below: (5) In the formula, These are the polynomial coefficients.
4. The automated modeling method for three-dimensional geological models based on knowledge-guided graph neural networks according to claim 1, characterized in that, Step 3), the steps for forming the fused feature map include: Step 3.1) Set the minimum and maximum values of the site range x, y, and z according to the actual situation; Step 3.2) Based on the three-dimensional boundary constraints of the target study area, generate an unstructured tetrahedral mesh using the MeshPy library; Step 3.3) Use the vertices of each tetrahedral mesh element as graph nodes to generate a node set V; Step 3.4) Using the adjacency judgment rule, obtain the adjacent cell IDs of each cell through the tetrahedral mesh cell connection relationship, and construct the edge set E; The adjacency determination rule states that mesh cells that share a face, edge, or vertex are adjacent nodes; Step 3.5) Set the maximum number of adjacencies to n; If the number of adjacent nodes is greater than the maximum number of adjacent nodes, then the n nearest nodes are selected as adjacent nodes based on distance, and a fused feature map is constructed. .
5. The automated modeling method for three-dimensional geological models based on knowledge-guided graph neural networks according to claim 4, characterized in that, In step 4), the multi-task graph neural network model includes an input layer, a graph attention network feature extraction layer, and an output layer; The input layer is used to receive the node feature matrix F= ; Where x, y, and z are the three-dimensional spatial coordinates of the tetrahedral mesh element nodes. This represents the scalar value of the structured geological knowledge field obtained at this node through spatial interpolation sampling. The graph attention network feature extraction layer consists of two stacked graph attention network layers; Among them, for the first Layered graph attention network layers use node feature matrices Sum of edges As input, based on nodes With adjacent nodes Attention coefficient between The neighborhood features are weighted and aggregated to output the updated node feature matrix. ; Graph attention network layers all enhance feature representation capabilities through multi-head attention mechanisms; The output layer adopts a lithology classification task and a scalar field regression task structure, outputting the probability distribution of lithology categories, as well as the predicted field value and gradient vector of the structured geological knowledge field. The multi-task graph neural network model is trained using the Adam optimizer, and the joint loss function used during training is shown below: (6) In the formula, The cross-entropy loss function for lithological classification tasks. For the regression loss of the stratigraphic scalar field, To calculate the mean squared error loss function for the reconstruction error of the scalar field at all nodes, These are the preset weighting coefficients.
6. The automated modeling method for three-dimensional geological models based on knowledge-guided graph neural networks according to claim 5, characterized in that, The lithological classification task consists of a two-layer, multi-layer sensing mechanism; The output of the graph attention network layer is used as the input of the first layer of the multilayer perceptron. The extracted features are activated by the ReLU activation function, and the first layer feature map is output. The first layer feature map is used as the input of the second layer multilayer perceptron. After feature extraction, the Softmax function is used to output the probability distribution of each node belonging to silty clay, gravel, and granite. The scalar field regression task consists of two fully connected layers; The first fully connected layer uses the ReLU activation function, and the output feature map is used as the input to the second fully connected layer. The second fully connected layer outputs the predicted field value and gradient vector of the structured geological knowledge field.
7. The automated modeling method for three-dimensional geological models based on knowledge-guided graph neural networks according to claim 6, characterized in that, Step 5), the step of generating a three-dimensional geological model based on the prediction results, includes: Step 5.1) Obtain the lithology category probability predicted by the multi-task graph neural network model for each node in the 3D graph structure; Step 5.2) For each volume element in the tetrahedral mesh, count the lithology category with the highest predicted probability for all vertices of each volume element, and determine the category with the highest frequency as the final lithology attribute of the tetrahedral mesh; Step 5.3) Export the tetrahedral mesh with determined lithological properties as a visual, universal 3D geological model file format.
8. A system based on the automated modeling method for three-dimensional geological models using graph neural networks according to any one of claims 1-7, characterized in that, It includes a data acquisition and preprocessing module, a knowledge field construction module, a graph structure construction and feature fusion module, a multi-task graph network model module, and a model generation module; The data acquisition and preprocessing module is used to automatically parse borehole data and interactively extract geological profile features to generate a standardized dataset. The knowledge field construction module is used to construct a structured geological knowledge field that represents the laws of geological structure based on the extracted geological profile features; The graph structure construction and feature fusion module is used to establish a three-dimensional graph structure of the study area and fuse borehole data with geological knowledge fields into graph node features. The multi-task graph network model module is used to perform attention weight calculation, node feature aggregation, lithology classification, and scalar field regression of the graph attention network. The model generation module is used to predict the lithology of the entire region and generate a three-dimensional geological model using the trained model.
9. An electronic device, characterized in that, include: The device includes a memory, a processor, and a data bus, wherein the memory stores all machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the memory via the data bus, and the machine-readable instructions are executed by the processor to perform the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the method described in any one of claims 1 to 7.