A method to accelerate LBFGS inversion using physics-guided and data-driven multi-task forward simulation

By introducing physical guidance and data-driven multi-task forward modeling into the LBFGS inversion method and replacing the traditional forward response calculation with PDMNet neural network, the problem of excessively long calculation time of traditional methods is solved, realizing a fast and efficient inversion process and improving the efficiency of field analysis in geothermal exploration.

CN120180686BActive Publication Date: 2025-09-23CHINA WEST NORMAL UNIVERSITY +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510225511.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-27
Publication Date
2025-09-23
Estimated Expiration
2045-02-27

AI Technical Summary

Technical Problem

Traditional geophysical inversion methods take too long to process large amounts of measured data, making it impossible to quickly perform large-scale, detailed inversions and affecting the efficiency of on-site analysis in geothermal exploration.

Method used

A physical-guided and data-driven multi-task forward modeling method is adopted to accelerate the LBFGS inversion method. The PDMNet neural network written in Python is used for training to replace the forward response calculation module in the traditional LBFGS inversion. The method is integrated using C++ and Fortran languages ​​and combines multi-task network learning to calculate apparent resistivity and impedance phase.

Benefits of technology

It significantly improves the computational efficiency of LBFGS inversion, enables a rapid inversion process, and enhances the on-site analysis capabilities for geothermal exploration.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120180686B_ABST
    Figure CN120180686B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of geophysics technology and provides a method for accelerating LBFGS inversion using a physics-guided and data-driven multi-task forward simulation. The method comprises the following steps: 1. Using Python to write a physics-guided and data-driven multi-task neural network (PDMNet) to perform fitting training on the MT forward response calculation; 2. Converting the trained Python language model into a dynamic link library program written in C++; 3. Improving the forward response calculation module in a traditional LBFGS inversion method written in Fortran by integrating the dynamic link library program; and 4. Predicting the transverse magnetic (TM) forward response task using the improved traditional LBFGS inversion method. The present invention can effectively accelerate the traditional MT LBFGS inversion method.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of geophysics technology, and in particular to a method for accelerating LBFGS inversion using physics-guided and data-driven multi-task forward simulation. Background Art

[0002] Geothermal resources are playing an increasingly important role in modern industrial systems. Because geothermal energy is a clean energy source, a growing number of potential geothermal development areas are being rediscovered. Fault identification is one of the most important steps in geothermal investigations. Geophysical magnetotelluric (MT), as a powerful method for fault identification, is widely used in geothermal exploration areas.

[0003] To obtain effective tomographic results in geothermal areas, inversion algorithms are widely used in the MT method. However, all of these inversion algorithms require a large number of forward response simulations to determine the root mean square (RMS) error between the simulated and measured data. Traditional forward response calculations require the calculation of large sparse matrices, which causes the forward response calculation time to increase rapidly as the matrix expands. Therefore, if a large amount of measured data needs to be processed, large-scale and detailed inversion cannot be performed quickly in the field, which means that traditional inversion methods are not conducive to rapid on-site analysis by explorers. Summary of the Invention

[0004] The present invention provides a method for accelerating LBFGS inversion using physics-guided and data-driven multi-task forward simulation, which can effectively accelerate the traditional MT LBFGS inversion method.

[0005] A method for accelerating LBFGS inversion using physics-guided and data-driven multi-task forward simulation according to the present invention comprises the following steps:

[0006] First, a physics-guided and data-driven multi-task neural network (PDMNet) written in Python is used to fit and train the MT forward response calculation. Specifically, the training loss function consists of a data fitting term and a model fitting term. The data fitting term uses a multi-task approach to forward response calculation. An encoder encodes the geoelectric model, and two decoders calculate the apparent resistivity and impedance phase, respectively, which are then fitted to the labeled data. The model fitting term uses Bostick to invert the apparent resistivity and impedance phase obtained by the two decoders and then fit them to the designed geoelectric model. This physics-guided and data-driven multi-task training improves data calculation accuracy.

[0007] 2. Convert the trained Python language model into a dynamic link library program written in C++;

[0008] Third, the dynamic link library program is integrated to replace the forward response calculation module in the traditional LBFGS inversion method written in Fortran language to improve it;

[0009] 4. Predict the transverse magnetic TM forward response task through the improved traditional LBFGS inversion method.

[0010] Preferably, in step 1, the corresponding apparent resistivity data set and impedance phase data set are generated using the finite difference method, and are trained using the T-Unet hybrid neural network.

[0011] Preferably, the apparent resistivity and phase φ TM Solved by the following formula:

[0012]

[0013] Where ρ represents the underground resistivity, H x represents the magnetic field component in the x direction, ω represents the angular frequency, μ is the magnetic permeability, and E y is the electric field strength in the y direction.

[0014] As a preferred method, the target inversion function of the improved traditional LBFGS inversion method is for:

[0015]

[0016] in, is the forward response value predicted by the hybrid neural network, m,m0,C d ,C m are the inversion parameters, initial model, data and model data covariance matrix, d obs Represents the observation vector λ represents the factor used to balance the data term and model term in the objective function.

[0017] As a preference, the traditional LBFGS inversion method requires continuously calling the forward response function to determine whether the root mean square error has been reduced to a threshold. The use of PDMNet can quickly calculate the forward response value, thereby accelerating the traditional LBFGS inversion.

[0018] As a preference, a physical model loss function is added to the neural network loss function, that is, by performing Bostick fast imaging on the predicted forward response value and fitting it with the design model, the training network is continuously optimized and parameters are continuously adjusted.

[0019] Preferably, when performing forward response calculation, the apparent resistivity and impedance phase need to be calculated, and multi-task network learning is adopted to simultaneously calculate the apparent resistivity and impedance phase.

[0020] The beneficial effects of the present invention are as follows:

[0021] This invention integrates the forward response model, obtained through physics-guided and data-driven multi-task neural network training, as a computational module into the traditional LBFGS inversion framework, replacing the forward response computational module in the traditional LBFGS. This rapidly improves the computational efficiency of the forward response in LBFGS inversion, enabling a method that combines traditional electromagnetic inversion with neural networks, improving inversion efficiency and contributing to the development and utilization of clean geothermal energy. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 Flowchart of a method for accelerating L-BFGS inversion using physics-guided and data-driven multi-task neural networks;

[0023] Figure 2 A physics-guided and data-driven multi-task neural network forward modeling scheme;

[0024] Figure 3 Schematic diagram of PDMNet multi-task learning

[0025] Figure 4 A comparison diagram of the final inversion results;

[0026] Figure 5 Comparison of the intermediate iterative forward modeling responses of the two methods

[0027] Figure 6 Schematic diagram comparing the final forward modeling responses of the two methods. DETAILED DESCRIPTION

[0028] In order to further understand the content of the present invention, the present invention is described in detail with reference to the accompanying drawings and embodiments. It should be understood that the embodiments are merely for explaining the present invention and are not intended to limit the present invention.

[0029] like Figure 1 As shown, this embodiment provides a method for accelerating LBFGS inversion using a physics-guided and data-driven multi-task neural network, which includes the following steps:

[0030] First, a physics-guided and data-driven multi-task neural network was written in Python to perform fitting training on the MT forward response calculation. Specifically, the training loss function consists of a data fitting term and a model fitting term. The data fitting term uses a multi-task approach to perform forward response calculations. Specifically, an encoder encodes the geoelectric model, and two decoders calculate the apparent resistivity and impedance phase, respectively, which are then fitted to the labeled data. The model fitting term uses Bostick to perform inversion calculations on the apparent resistivity and impedance phase obtained by the two decoders, which are then fitted to the designed geoelectric model. This physics-guided and data-driven multi-task training improves data calculation accuracy.

[0031] 2. Convert the trained Python language model into a dynamic link library program written in C++;

[0032] Third, the dynamic link library program is integrated to replace the forward response calculation module in the traditional LBFGS inversion method written in Fortran language to improve it;

[0033] 4. Predict the transverse magnetic TM forward response task through the improved traditional LBFGS inversion method.

[0034] In step 1, the corresponding apparent resistivity dataset and impedance phase dataset are generated using the finite difference method according to the following formula, and the physics-guided and data-driven multi-task neural network is used to train and fit them. The physics-guided and data-driven loss functions are shown in Figure 2 As shown, the TUnet multi-task architecture is as follows Figure 3 shown.

[0035] Apparent resistivity and phase φ TM Solved by the following formula:

[0036]

[0037] Where ρ represents the underground resistivity, H x represents the magnetic field component in the x direction, ω represents the angular frequency, and μ is the magnetic permeability.

[0038] In MT 2D inversion, transverse magnetic TM has a strong lateral resolution and is therefore widely used for fault identification. Therefore, this example selects the governing equation of transverse magnetic TM polarization as the research object:

[0039]

[0040] H x | z=0 =1

[0041] y,z denote the y-direction and the z-direction. Using the finite difference method (FDM) and a class of boundary conditions, these equations can be transformed into a problem of solving a large, complex sparse matrix:

[0042] AH x =b

[0043] Where A is a large complex sparse matrix, H x is the horizontal magnetic field vector to be solved, and b is the constant on the right. By solving the above equation and its relationship with the electric field, we can obtain the apparent resistivity and phase. For details, see the formula for solving the apparent resistivity and phase.

[0044] The traditional LBFGS inversion method continuously calls the forward response function to determine whether the root mean square error has been reduced to a threshold. It uses the TM model equation of MT for inversion, and the objective function form is set as follows:

[0045]

[0046] Among them, m, m0, C d ,C m are the inversion parameters, initial model, data and model data covariance matrix, d obs Represents the observation vector λ represents the factor used to balance the data term and model term in the objective function. As can be seen from the objective function, due to the presence of the forward response operator in the objective function, as the number of iterations increases, a large number of forward response calculations will be frequently executed, which will consume a lot of time and thus affect the inversion execution efficiency.

[0047] from Figure 1 As can be seen from the LBFGS framework, forward response calculations are required to calculate the objective function. Therefore, forward response simulations account for a significant portion of the computational effort in the entire LBFGS inversion. However, traditional forward response calculations are time-consuming. To address this issue, this embodiment replaces the traditional forward response calculation module with a physics-guided and data-driven multi-task neural network forward response simulation in the inversion system, leveraging its advantage of rapidly calculating the inversion objective function.

[0048] Currently, most geophysical inversion methods are developed using the Fortran language. This embodiment is also developed using the Fortran language. Therefore, in order to embed the neural network training model written in Python into the Fortran language environment and then deploy the trained model, it is first necessary to perform secondary development in C++ and convert it into a dynamic link library. At this time, this dynamic link library can be used in the Fortran development environment to replace the forward response calculation in the traditional LBFGS inversion, thereby realizing the fusion of Python, C++ and Fortran languages. F(m) is replaced by the neural network forward prediction result.

[0049] Improved target inversion function of traditional LBFGS inversion method for:

[0050]

[0051] in, is the forward response value predicted by the hybrid neural network.

[0052] In this embodiment, a physical model loss function is added to the neural network loss function, that is, the predicted forward response value is subjected to Bostick fast imaging and fitted with the design model, so that the training network is continuously optimized and the parameters are continuously adjusted.

[0053] In this embodiment, when performing forward response calculation, it is necessary to calculate the apparent resistivity and the impedance phase, and multi-task network learning is adopted to simultaneously calculate the apparent resistivity and the impedance phase.

[0054] Experiments and results

[0055] A. Experimental Description

[0056] Before replacing the forward response module in traditional LBFGS inversion, a neural network forward response model must be generated. Creating a sample dataset is a key step in generating the neural network model. In many fields, networks are typically trained using rich, well-labeled open-source datasets. However, obtaining a realistic sample dataset of thousands or even tens of thousands of MT of forward response is quite challenging. It is worth noting that traditional inversion algorithms, such as LBFGS or NLCG, involve a large number of forward response calculations during the iterative inversion process. Since the neural network model was developed using PyTorch in the Python language environment, the ultimate LBFGS acceleration requires loading and calling the model in a Fortran environment. Therefore, the first step is to overcome the challenge of migrating PyTorch network models between different environments. PyTorch itself provides a method for converting models to a serialized form using TorchScript. This method is designed to ensure seamless model transfer between platforms and environments, thereby improving model flexibility and portability. The neural network model, compiled and converted using TorchScript, can then be saved in Python. At this point, the neural network model can be recognized and loaded by the C++ language environment. The next step is to use the trace function in Torch to generate module objects for apparent resistivity and impedance phase. The converted model is then loaded and called through the C++ API (LibTorch) to complete the neural network model deployment. Finally, a dynamic link library is generated in the C++ environment for loading and calling the LBFGS inversion program in the Fortran environment.

[0057] B. Generalization Ability Verification Experiment Results

[0058] In experiments, to verify the network's generalization performance, we generated a random composite resistivity model with gradually varying resistivity values ​​using cubic spline interpolation. This approach aimed to create a training dataset consistent with the actual subsurface model, ensuring effective application. The relevant inversion parameters were: the initial model was a homogeneous medium with a resistivity of 100 Ω·m. The error level was 0.05, λ was 0.1, the RMS threshold was 1.05, and the iteration threshold was 50. Clearly, the LBFGS inversion using the integrated neural network forward response exhibited very similar RMS inversion iteration curves to the traditional LBFGS inversion, and both methods achieved reduced fitting errors. Figure 4 It shows that the final inversion results obtained by different methods are in good consistency. Figure 4 In the figure, the first row is the designed geoelectric model (a, b, c); the second row is the conventional LBFGS inversion results (d, e, f); the third row is the LBFGS inversion results of integrated DL forward modeling (g, h, i); the fourth row is the relative error distribution between the second and third rows (j, k, l).

[0059] In order to fully reflect the comparative changes of the forward response during the inversion iteration process, this embodiment selects the forward response of the intermediate iteration process of each model for comparison, such as Figure 5 shown. Figure 6 Shows Figure 3 Comparison of the forward responses of the final inversion iteration of the model.

[0060] Figure 6 In (a), Figure 4 Comparison of the forward responses of the two inversion methods for the model (a). (b) Figure 4 A comparison of the forward responses of the two inversion methods for model (b) is shown. (c) Figure 4 Comparison of the forward responses of the two inversion methods for the model (c) in Figure 2. In each sub-figure (a), (b), and (c), the first row from left to right shows the apparent resistivity simulated by the finite-difference numerical simulation, the apparent resistivity predicted by the PDMNet model, and the relative error distribution of the apparent resistivity of the two methods. The second row from left to right shows the impedance phase simulated by the finite-difference numerical simulation, the impedance phase predicted by the PDMNet model, and the relative error distribution of the impedance phase of the two methods.

[0061] Figure 6 In each sub-figure (a), (b), and (c), the first row from left to right shows the apparent resistivity of the observed data, the apparent resistivity of the finite difference numerical simulation, the apparent resistivity predicted by the PDMNet hybrid model, and the relative error distribution of the apparent resistivity of the two methods. The second row from left to right shows the impedance phase of the observed data, the impedance phase simulated by the finite difference numerical simulation, the impedance phase predicted by the PDMNet hybrid model, and the relative error distribution of the impedance phase of the two methods.

[0062] To more accurately assess the differences in the inversion results between the two methods, this example uses mean relative error (MRE) and structural similarity (SSIM) to evaluate the accuracy and similarity of the two inversion methods. The smaller the MRE value, the higher the prediction accuracy. The higher the SSIM value, the more similar the inversion results of the two methods are. Table 1 shows the numerical comparison results of the inversion results.

[0063] Table 1 Figure 5 Evaluation parameters of the technical results of the two inversion methods

[0064]

[0065] Based on the above experimental results, compared with the traditional LBFGS method, the two-dimensional LBFGS inversion method integrated with neural network forward modeling improves the time efficiency by 38.21%.

[0066] The above is a schematic description of the present invention and its embodiments, which is not restrictive. The drawings show only one embodiment of the present invention, and the actual structure is not limited thereto. Therefore, if a person skilled in the art is inspired by this and, without departing from the purpose of the present invention, designs a structure and embodiment similar to this technical solution without inventiveness, they shall fall within the scope of protection of the present invention.

Claims

1. A method for accelerating LBFGS inversion using physics-guided and data-driven multi-task forward modeling, characterized by: The following steps are involved: First, a physics-guided and data-driven multi-task neural network (PDMNet) written in Python is used to train the MT forward response calculation.

2. Convert the trained Python language model into a dynamic link library program written in C++; Third, the dynamic link library program is integrated to replace the forward response calculation module in the traditional LBFGS inversion method written in Fortran language to improve it; Fourth, predict the transverse magnetic TM forward response task using the improved traditional LBFGS inversion method; Improved target inversion function of traditional LBFGS inversion method for: in, Forward response values ​​predicted by the physics-guided and data-driven multi-task neural network PDMNet, m, m0, C d ,C m are the inversion parameters, initial model, data and model data covariance matrix, d obs Represents the observation vector represents the apparent resistivity, φ TM Represents the phase; λ represents the factor used to balance the data term and model term in the objective function; A physical model loss function is added to the neural network loss function, that is, by performing Bostick fast imaging on the predicted forward response value and fitting it with the design model, the training network is continuously optimized and the parameters are continuously adjusted.

2. The method of accelerating LBFGS inversion using physics-guided and data-driven multi-task forward simulation according to claim 1, characterized in that: In step 1, a cubic spline interpolation curve is used to generate a geoelectric model, and the corresponding apparent resistivity dataset and impedance phase dataset are calculated using the finite difference method, which are then trained using the PDMNet multi-task neural network. Apparent resistivity and phase φ TM Solved by the following formula: Where ρ represents the underground resistivity, H x represents the magnetic field component in the x direction, ω represents the angular frequency, μ is the magnetic permeability, and E y is the electric field strength in the y direction.

3. The method of accelerating LBFGS inversion using physics-guided and data-driven multi-task forward simulation according to claim 2, characterized in that: The traditional LBFGS inversion method requires continuously calling the forward response function to determine whether the root mean square error has been reduced to a threshold. Using PDMNet can quickly calculate the forward response value, thereby accelerating the traditional LBFGS inversion.

4. The method of accelerating LBFGS inversion using physics-guided and data-driven multi-task forward simulation according to claim 3, characterized in that: When performing forward response calculations, it is necessary to calculate the apparent resistivity and impedance phase. Multi-task network learning is used to simultaneously calculate the apparent resistivity and impedance phase.

Citation Information

Patent Citations

  • Three-dimensional magnetotelluric inversion method, device and equipment

    CN119442875A