Method, device and computer equipment for magnetotelluric two-dimensional inversion
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-30
- Publication Date
- 2026-08-11
AI Technical Summary
[0002]尽管传统大地电磁正反演方法已能通过有限元或有限差分等数值技术有效处理复杂地形,但其反演过程计算开销大
[0013]上述大地电磁二维反演方法、装置、计算机设备、计算机可读存储介质和计算机程序产品,获取二维电阻率模型样本;二维电阻率模型样本包括电阻率模型和地形剖面数据;将二维电阻率模型样本输入正演模块,由正演模块对二维电阻率模型样本进行处理,输出正演响应;将正演响应和地形剖面数据输入待训练的反演网络,由反演网络对正演响应和地形剖面数据进行处理,输出反演结果;基于电阻率模型和反演结果,计算反演损失;基于反演损失对反演网络的网络参数进行调整,并继续训练直至达到训练截止条件,从而得到训练完成的反演网络;将训练完成的反演网络用于对实际工程中的测量数据进行反演,得到对应的电阻率分布图。常规反演需要多次迭代,每次迭代都需要多次计算正演,求解大型线形方程组,效率低下。深度学习神经网络具备端到端直接映射的能力,可以快速响应,提升效率。通过引入地形剖面数据,生成的训练样本能够真实再现实际工程中地形和地下介质的自然变化特征,提高了训练数据的真实性和多样性,使得反演网络在面对实际测量数据时具备更好的适应性。有效解决了传统方法在样本真实性、网络反演能力和地形条件信息利用方面存在的不足,从而显著提升了二维反演的精度和训练效率,具备广泛的工程应用价值。
Smart Images

Figure CN122549219A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of geophysical technology, and in particular to a magnetotelluric two-dimensional inversion method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Technology
[0002] While traditional magnetotelluric forward and inverse methods can effectively handle complex terrain using numerical techniques such as finite element or finite difference methods, their inversion process incurs high computational costs. In recent years, deep learning methods have gained widespread attention in geophysical inversion due to their fast inference speed; however, existing network architectures often rely on regular grid inputs, making it difficult to flexibly integrate real-world terrain information of arbitrary shapes. Furthermore, when dealing with large-scale, highly non-uniform underground structures, model training is difficult and generalization ability is limited, failing to meet the combined requirements of accuracy and efficiency in practical exploration. Therefore, there is an urgent need to develop a novel inversion modeling method that can strictly adhere to the physical laws of electromagnetic fields while efficiently embedding complex terrain information to improve inversion efficiency. Summary of the Invention
[0003] Therefore, it is necessary to provide a topographic magnetotelluric two-dimensional inversion method, apparatus, computer equipment, computer-readable storage medium, and computer program product that can improve inversion efficiency in response to the above-mentioned technical problems.
[0004] Firstly, this application provides a two-dimensional magnetotelluric inversion method, including: Obtain a two-dimensional resistivity model sample; the two-dimensional resistivity model sample includes resistivity models and topographic profile data; The two-dimensional resistivity model sample is input into the forward modeling module, which processes the sample and outputs the forward modeling response. The forward modeling response and the terrain profile data are input into the inversion network to be trained. The inversion network processes the forward modeling response and the terrain profile data and outputs the inversion result. Based on the resistivity model and the inversion results, the inversion loss is calculated; the network parameters of the inversion network are adjusted based on the inversion loss, and training continues until the training cutoff condition is reached, thereby obtaining the trained inversion network. The trained inversion network is used to invert measurement data in actual engineering projects to obtain the corresponding resistivity distribution map.
[0005] In one embodiment, the steps of the inversion network processing the forward response and the terrain profile data include: The forward response is rearranged into a low-dimensional label sequence; each low-dimensional label in the low-dimensional label sequence is converted into a high-dimensional feature vector through a first linear mapping layer; modulation parameters corresponding to each low-dimensional label are obtained based on the terrain profile data; for each high-dimensional feature vector corresponding to a low-dimensional label, conditional modulation is performed on the high-dimensional feature vector using the corresponding modulation parameters to obtain modulated local features; global integrated features are captured based on the modulated local features; the global integrated features are converted back to a low-dimensional representation through a second linear mapping layer; the low-dimensional representations corresponding to each low-dimensional label in the low-dimensional label sequence are rearranged to obtain the inversion result.
[0006] In one embodiment, obtaining the modulation parameters corresponding to each low-dimensional marker based on the terrain profile data includes: obtaining a terrain mask map based on the terrain profile data; dividing the terrain mask map into multiple image blocks, wherein each image block corresponds one-to-one with a multiple low-dimensional marker in the low-dimensional marker sequence; for each image block, converting the image block into a high-dimensional vector representation through a third linear mapping layer; and generating the modulation parameters of the low-dimensional marker corresponding to the image block based on the high-dimensional vector representation.
[0007] In one embodiment, capturing global integrated features based on the modulated local features includes: performing layer normalization on the modulated local features to obtain normalized features; dividing the normalized features into multiple attention heads; obtaining a spectrum for each attention head through fast Fourier transform; modulating the spectrum through learnable basis filters and biases; and obtaining global integrated features through inverse fast Fourier transform after nonlinear activation of the modulated spectrum.
[0008] In one embodiment, calculating the inversion loss based on the resistivity model and the inversion result includes: calculating the mean square error between the resistivity model and the inversion result as the inversion loss.
[0009] Secondly, this application also provides a magnetotelluric two-dimensional inversion device, comprising: The acquisition module is used to acquire two-dimensional resistivity model samples; the two-dimensional resistivity model samples include resistivity models and terrain profile data. The forward modeling module is used to input the two-dimensional resistivity model sample into the forward modeling module, and the forward modeling module processes the two-dimensional resistivity model sample to output a forward modeling response; The inversion module is used to input the forward response and the terrain profile data into the inversion network to be trained, and the inversion network processes the forward response and the terrain profile data to output the inversion result; The parameter adjustment module is used to calculate the inversion loss based on the resistivity model and the inversion result; adjust the network parameters of the inversion network based on the inversion loss, and continue training until the training cutoff condition is reached, thereby obtaining the trained inversion network. The application module is used to use the trained inversion network to invert measurement data in actual engineering to obtain the corresponding resistivity distribution map.
[0010] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps: Obtain a two-dimensional resistivity model sample; the two-dimensional resistivity model sample includes resistivity models and topographic profile data; The two-dimensional resistivity model sample is input into the forward modeling module, which processes the sample and outputs the forward modeling response. The forward modeling response and the terrain profile data are input into the inversion network to be trained. The inversion network processes the forward modeling response and the terrain profile data and outputs the inversion result. Based on the resistivity model and the inversion results, the inversion loss is calculated; the network parameters of the inversion network are adjusted based on the inversion loss, and training continues until the training cutoff condition is reached, thereby obtaining the trained inversion network. The trained inversion network is used to invert measurement data in actual engineering projects to obtain the corresponding resistivity distribution map.
[0011] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the following steps: Obtain a two-dimensional resistivity model sample; the two-dimensional resistivity model sample includes resistivity models and topographic profile data; The two-dimensional resistivity model sample is input into the forward modeling module, which processes the sample and outputs the forward modeling response. The forward modeling response and the terrain profile data are input into the inversion network to be trained. The inversion network processes the forward modeling response and the terrain profile data and outputs the inversion result. Based on the resistivity model and the inversion results, the inversion loss is calculated; the network parameters of the inversion network are adjusted based on the inversion loss, and training continues until the training cutoff condition is reached, thereby obtaining the trained inversion network. The trained inversion network is used to invert measurement data in actual engineering projects to obtain the corresponding resistivity distribution map.
[0012] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, performs the following steps: Obtain a two-dimensional resistivity model sample; the two-dimensional resistivity model sample includes resistivity models and topographic profile data; The two-dimensional resistivity model sample is input into the forward modeling module, which processes the sample and outputs the forward modeling response. The forward modeling response and the terrain profile data are input into the inversion network to be trained. The inversion network processes the forward modeling response and the terrain profile data and outputs the inversion result. Based on the resistivity model and the inversion results, the inversion loss is calculated; the network parameters of the inversion network are adjusted based on the inversion loss, and training continues until the training cutoff condition is reached, thereby obtaining the trained inversion network. The trained inversion network is used to invert measurement data in actual engineering projects to obtain the corresponding resistivity distribution map.
[0013] The aforementioned magnetotelluric two-dimensional inversion method, apparatus, computer equipment, computer-readable storage medium, and computer program product acquire two-dimensional resistivity model samples. These samples include resistivity models and topographic profile data. The two-dimensional resistivity model samples are input into a forward modeling module, which processes them and outputs a forward modeling response. The forward modeling response and topographic profile data are input into an inversion network to be trained. The inversion network processes these data and outputs inversion results. Based on the resistivity model and inversion results, an inversion loss is calculated. The network parameters of the inversion network are adjusted based on the inversion loss, and training continues until the training cutoff condition is met, resulting in a trained inversion network. The trained inversion network is then used to invert measurement data from actual engineering projects to obtain the corresponding resistivity distribution map. Conventional inversion requires multiple iterations, each requiring multiple forward model calculations and solving large linear equation systems, leading to low efficiency. Deep learning neural networks, with their end-to-end direct mapping capability, can respond quickly and improve efficiency. By incorporating topographic profile data, the generated training samples can realistically reproduce the natural variations in terrain and underground media in actual engineering projects, improving the authenticity and diversity of the training data and enabling the inversion network to better adapt to actual measurement data. This effectively addresses the shortcomings of traditional methods in terms of sample authenticity, network inversion capability, and utilization of terrain information, thereby significantly improving the accuracy and training efficiency of two-dimensional inversion and possessing broad engineering application value. Attached Figure Description
[0014] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0015] Figure 1 This is a flowchart illustrating a two-dimensional magnetotelluric inversion method in one embodiment; Figure 2 This is a schematic diagram of the resistivity model in one embodiment; Figure 3 This is a grayscale image of the forward response in one embodiment; Figure 4 This is a grayscale image of the inversion result in one embodiment; Figure 5 This is a schematic diagram of the inversion network processing flow in one embodiment; Figure 6 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0016] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0017] It should be noted that the terms "first," "second," etc., used in this application can be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "comprising" and "having," and any variations thereof, used in this application, are intended to cover non-exclusive inclusion. The term "multiple" used in this application refers to two or more. The term "and / or" used in this application refers to one of the embodiments, or any combination of multiple embodiments.
[0018] The magnetotelluric two-dimensional inversion method provided in this application can be executed by a terminal alone, by a server alone, or by a system consisting of a terminal and a server; this application does not limit the execution of these methods. The terminal can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart in-vehicle devices, projection devices, etc. Portable wearable devices can include smartwatches, smart bracelets, head-mounted devices, etc. Head-mounted devices can be virtual reality (VR) devices, augmented reality (AR) devices, smart glasses, etc. The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.
[0019] In one exemplary embodiment, such as Figure 1 As shown, a two-dimensional magnetotelluric inversion method is provided. Taking the application of this method to a terminal as an example, the method includes the following steps 101 to 104. Wherein: Step 101: Obtain a two-dimensional resistivity model sample; the two-dimensional resistivity model sample includes resistivity model and terrain profile data.
[0020] Optionally, this step can obtain a preset number of two-dimensional resistivity model samples. This preset number can be flexibly set according to actual needs; for example, it can be 100,000. Parallel computing techniques, such as multi-process methods, can be used to generate the preset number of two-dimensional resistivity model samples in batches to meet the data volume requirements of deep learning training.
[0021] The two-dimensional resistivity model sample includes a resistivity model and topographic profile data. The resistivity model includes the resistivity values of each grid within a pre-defined two-dimensional study area. The longitudinal (or vertical) depth and the length in a certain lateral direction perpendicular to the longitudinal direction are determined first, and the two-dimensional study area is constructed based on this depth and length. The aforementioned depth, lateral direction, and length can be flexibly set according to actual needs. The two-dimensional study area can be understood as a two-dimensional geological profile constructed based on the aforementioned depth and length. This two-dimensional study area can be gridded, and the resistivity value of each grid can be determined according to certain rules, thus obtaining the resistivity model.
[0022] The terrain profile data includes the heights corresponding to multiple lateral positions. A core region can be determined within the aforementioned two-dimensional study area. For example, the core region can be specified by the user within the two-dimensional study area, or it can be divided according to preset division rules. This embodiment of the application does not limit this approach. Multiple lateral positions can be determined along the lateral direction of the core region, and the heights corresponding to each of these lateral positions can be obtained according to preset rules. Based on the heights corresponding to each of these lateral positions, terrain profile data is generated.
[0023] For example, see Figure 2 As shown, Figure 2 This is an example of a resistivity model in a two-dimensional resistivity model sample. The resistivity model includes 256×128 grids. To facilitate a visual view of the distribution of resistivity values, the resistivity value of each grid is mapped to a corresponding grayscale value for display.
[0024] Step 102: Input the two-dimensional resistivity model sample into the forward modeling module, which processes the sample and outputs the forward modeling response.
[0025] Optionally, the forward modeling module here can be a finite difference forward modeling program, a forward neural network, or other forward modeling computation algorithms or tools, and this application embodiment does not limit this.
[0026] The process involves inputting a two-dimensional resistivity model sample into the forward modeling module, which then processes the sample and outputs a forward modeling response. This response contains apparent resistivity and phase data for both TE and TM modes. For an example, see [link to example]. Figure 3 As shown, Figure 3 The image shows a grayscale representation of the forward modeling response output by the forward modeling module. Figure 3 The apparent resistivity and phase data for TE and TM modes at 228 measurement points and 24 frequency points are shown. The horizontal axis represents the measurement point number, and the vertical axis represents the frequency value.
[0027] Step 103: Input the forward response and terrain profile data into the inversion network to be trained. The inversion network processes the forward response and terrain profile data and outputs the inversion results.
[0028] Specifically, the inversion network adopts a Transformer-type structure, with core modules including FFT-based multi-head spectral attention, DropPath mechanism, and FiLM conditional modulation. After obtaining the forward response, the forward response and terrain profile data are input into the inversion network to be trained. The inversion network performs rearrangement, high-dimensional feature extraction, modulation, global feature extraction, low-dimensional feature transformation, and rearrangement on the forward response and terrain profile data, and outputs the inversion result. Detailed processes are described below.
[0029] Step 104: Calculate the inversion loss based on the resistivity model and inversion results; adjust the network parameters of the inversion network based on the inversion loss and continue training until the training cutoff condition is met, thereby obtaining the trained inversion network; use the trained inversion network to invert measurement data in actual engineering to obtain the corresponding resistivity distribution map.
[0030] The inversion results have the same dimensions as the resistivity model described above. The mean square error (MSE) between the inversion results and the resistivity model can be calculated, and this MSE can be used as the inversion loss.
[0031] Optionally, regarding optimization algorithms and training strategies, the Adam optimizer can be used to update the network parameters of the inverted network with a small learning rate (e.g., 0.0001). During training, stochastic gradient descent is performed using batch data (e.g., 64 samples), and a large number of samples are efficiently generated and loaded using multi-process techniques. The training cycle is set to multiple epochs (e.g., 1000 epochs), with all training samples traversed in each epoch, and the performance of the inverted network evaluated on an independent validation set at the end of each epoch. In each epoch, the training error and test error of the inversion are recorded. The current network parameters and training information are saved every fixed period (e.g., 100 epochs) to ensure that the performance of the inverted network can be tracked during training, and the inverted network can be recovered or further tuned as needed.
[0032] To verify the performance of the trained inversion network on unseen samples and visualize the results, the trained inversion network can be loaded onto the running device (GPU or CPU). Ensure the input data format is consistent with the training data. Randomly select several samples from pre-generated test samples, including resistivity models and terrain profile data. The test samples are generated in the same way as the aforementioned two-dimensional resistivity model samples. Input the resistivity model and terrain profile data from the test samples into the forward modeling module to obtain the corresponding forward response. Then, input the forward response and terrain profile data into the trained inversion network to obtain the corresponding inversion results. Perform a reverse mapping on the inversion results to convert the standardized data into actual physical units (e.g., Ω·m). Visualize the converted inversion results using contour maps, color maps, etc. The inversion results can be compared with the resistivity model in the test samples to evaluate the inversion effect of the inversion grid. Figure 4 Here is an example of an inversion result.
[0033] In the above embodiments, a two-dimensional resistivity model sample is obtained; the two-dimensional resistivity model sample includes a resistivity model and topographic profile data; the two-dimensional resistivity model sample is input into a forward modeling module, which processes the sample and outputs a forward modeling response; the forward modeling response and topographic profile data are input into an inversion network to be trained, which processes them and outputs an inversion result; based on the resistivity model and inversion result, the inversion loss is calculated; the network parameters are adjusted based on the inversion loss, and training continues until the training cutoff condition is met, thus obtaining a trained inversion network; the trained inversion network is used to invert measurement data in actual engineering to obtain the corresponding resistivity distribution map. Conventional inversion requires multiple iterations, each requiring multiple forward model calculations and solving large linear equation systems, resulting in low efficiency. Deep learning neural networks have the ability to directly map end-to-end, enabling rapid response and improving efficiency. By incorporating topographic profile data, the generated training samples can realistically reproduce the natural variations in terrain and underground media in actual engineering projects, improving the authenticity and diversity of the training data and enabling the inversion network to better adapt to actual measurement data. This effectively addresses the shortcomings of traditional methods in terms of sample authenticity, network inversion capability, and utilization of terrain information, thereby significantly improving the accuracy and training efficiency of two-dimensional inversion and possessing broad engineering application value.
[0034] In some embodiments, the steps of the inversion network processing the forward response and topographic profile data include: The forward response is rearranged into a low-dimensional label sequence; each low-dimensional label in the low-dimensional label sequence is converted into a high-dimensional feature vector through a first linear mapping layer; the modulation parameters corresponding to each low-dimensional label are obtained based on the terrain profile data; for each high-dimensional feature vector corresponding to a low-dimensional label, the high-dimensional feature vector is conditionally modulated using the corresponding modulation parameters to obtain the modulated local features; the global integrated features are captured based on the modulated local features; the global integrated features are converted back to a low-dimensional representation through a second linear mapping layer; the low-dimensional representations corresponding to each low-dimensional label in the low-dimensional label sequence are rearranged to obtain the inversion result.
[0035] The forward response can be rearranged into a sequence of low-dimensional tokens suitable for decoding, facilitating subsequent processing. Then, a linear mapping layer (referred to as the first linear mapping layer for simplicity) converts each low-dimensional token in the sequence into a high-dimensional feature vector. Conditional information is extracted from the terrain profile data, and modulation parameters corresponding to each low-dimensional token are generated based on this information.
[0036] For each low-dimensional token corresponding to a high-dimensional feature vector, the FiLM mechanism can be used to conditionally modulate the high-dimensional feature vector based on the corresponding modulation parameters to obtain modulated local features. This step can enhance the inversion network's responsiveness to terrain conditions. After obtaining the modulated local features, the modulated local features are input into an FFT-based Transformer decoder, which integrates global information and gradually recovers local details, outputting global integrated features. Finally, another linear mapping layer (referred to as the second linear mapping layer for convenience) transforms the global integrated features back into a representation of local patches (i.e., the low-dimensional representation in this embodiment).
[0037] After obtaining the low-dimensional representations corresponding to each low-dimensional label in the low-dimensional label sequence, the low-dimensional representations corresponding to each low-dimensional label are rearranged and combined to obtain the inversion result consistent with the size of the resistivity model mentioned above, that is, the underground resistivity distribution map is reconstructed.
[0038] The above embodiments provide the process of the inversion network processing the input forward response and topographic profile data, realizing efficient and accurate reconstruction of the underground resistivity model.
[0039] In some embodiments, obtaining modulation parameters corresponding to each low-dimensional marker based on terrain profile data includes: A terrain mask map is obtained based on terrain profile data; the terrain mask map is divided into multiple image blocks, and multiple image blocks correspond one-to-one with multiple low-dimensional labels in the low-dimensional label sequence; for each image block, the image block is converted into a high-dimensional vector representation through a third linear mapping layer; the modulation parameters of the low-dimensional labels corresponding to the image block are generated based on the high-dimensional vector representation.
[0040] As described above, the terrain profile data includes the heights corresponding to multiple lateral locations. For each lateral location, the corresponding grid is located in the two-dimensional study area based on its height, and this grid is set to a pixel value of 1. The remaining grids in the two-dimensional study area are set to a pixel value of 0. This yields the terrain mask map.
[0041] After obtaining the terrain mask map, the terrain mask map is divided into multiple image patches. These multiple image patches correspond one-to-one with the multiple low-dimensional tokens in the low-dimensional token sequence obtained by rearranging the forward response above.
[0042] For each image patch, a linear mapping layer (referred to as the third linear mapping layer for simplicity) is used to convert the image patch into a high-dimensional vector representation. Based on this high-dimensional vector representation, modulation parameters for the corresponding low-dimensional markers of the image patch are generated. Specifically, terrain information (representing terrain features) can be extracted from this high-dimensional vector representation. Based on this terrain information, a set of modulation parameters (including scaling factors and biases) is calculated using a specially designed parameter generation module.
[0043] In the process of conditionally modulating the high-dimensional feature vector using modulation parameters, the FiLM conditional modulation mechanism can be used to adjust the high-dimensional feature vector element by element based on the modulation parameters, so that each feature vector can reflect the influence of terrain conditions, thereby enhancing the adaptability of the inversion network to terrain changes and obtaining the modulated local features.
[0044] In the above embodiments, a FiLM conditional modulation mechanism is introduced. Modulation parameters (i.e., scaling factors and biases) are generated by extracting terrain information from the input data. These parameters are then applied element-wise to the high-dimensional features, thereby achieving conditional modulation of the network features. This mechanism enables the network to dynamically fuse terrain condition information, enhancing the inversion network's sensitivity to terrain changes and achieving high-precision inversion in complex terrain environments.
[0045] In some embodiments, capturing global integrated features based on modulated local features includes: The modulated local features are layer-normalized to obtain normalized features; the normalized features are divided into multiple attention heads; the spectrum of each attention head is obtained by fast Fourier transform; the spectrum is modulated by learnable basis filters and biases; the modulated spectrum is then activated by nonlinearity and then subjected to inverse fast Fourier transform to obtain global integrated features.
[0046] Optionally, the process of capturing global integrated features based on modulated local features described above can be implemented using stacked FFTEncoders (based on Transformer encoder blocks).
[0047] Each head independently processes a portion of the channel information, allowing the inversion network to extract features from different perspectives.
[0048] For each attention head, the time-domain (or spatial-domain) signal is transformed to the frequency domain using a Fast Fourier Transform (FFT) to obtain the corresponding spectrum. This process decomposes the signal into different frequency components, allowing the model to simultaneously capture global trends (low-frequency components) and local details (high-frequency components).
[0049] In the frequency domain, the spectrum corresponding to each attention head is modulated using a set of learnable basis filters and biases. In adaptive mode, adaptive scaling and offset parameters are generated by incorporating global context information to dynamically weight different frequency components (i.e., the spectrum corresponding to each attention head). This process helps to highlight key frequency information and improve the sensitivity of the inversion network to local details and global structure.
[0050] The modulated spectrum is then activated nonlinearly and then restored to the original domain through inverse fast Fourier transform, thus obtaining the global integrated features.
[0051] In the above embodiments, an inversion network based on FFT attention and a Transformer architecture was employed. After frequency domain transformation using FFT, the multi-head spectral attention module can efficiently capture low-frequency global trends and high-frequency local details, and achieve dynamic adjustment through adaptive spectral modulation. This reduces the computational efficiency from the traditional O(N×N) to O(NlogN) when processing large models and large-scale data, while also exhibiting higher accuracy and robustness in feature extraction and information integration. Ultimately, the entire network shows significant improvements in both global feature extraction and local detail recovery, thereby greatly improving inversion accuracy and stability. This achieves efficient and accurate reconstruction of underground resistivity models.
[0052] In some embodiments, the forward modeling module and the inversion network are trained synchronously. The magnetotelluric two-dimensional inversion method provided in this application further includes: performing two-dimensional forward modeling calculations based on two-dimensional resistivity model samples to obtain forward modeling results; calculating forward modeling loss based on forward modeling results and forward modeling response; and adjusting the network parameters of the forward modeling module based on the forward modeling loss.
[0053] As described above, the forward modeling module can be a forward neural network. In this case, the forward modeling module can be pre-trained or trained synchronously with the inversion network.
[0054] When training the forward modeling module and the inversion network simultaneously, two-dimensional forward modeling calculations are performed based on two-dimensional resistivity model samples to obtain the forward modeling results. The two-dimensional resistivity model samples are input into the forward modeling module to be trained. The forward modeling module processes the samples, outputs a forward response, and calculates the forward modeling loss based on the forward modeling results and the forward response. The network parameters of the forward modeling module are then adjusted based on the forward modeling loss. Conversely, the forward modeling response and terrain profile data are input into the inversion network to be trained. The inversion network processes the forward modeling response and terrain profile data, outputs an inversion result, calculates the inversion loss based on the resistivity model and the inversion result, and adjusts the network parameters based on the inversion loss. This achieves simultaneous training of the forward modeling module and the inversion network. When both the forward modeling module and the inversion network reach the training cutoff condition, the simultaneous training process ends, resulting in a well-trained forward modeling module and inversion network.
[0055] Optionally, two-dimensional forward modeling can be performed using the finite difference method based on two-dimensional resistivity model samples to obtain the forward modeling results. Alternatively, other methods can be used for two-dimensional forward modeling calculations, which are not limited in the embodiments of this application.
[0056] Optionally, the mean square error (MSE) between the forward response and the forward result can be calculated, and the MSE can be used as the forward loss.
[0057] The method for synchronous training of the forward modeling module and the inversion network provided in the above embodiments improves training efficiency.
[0058] In some embodiments, an internal processing flow of the inversion network is provided, see [link to relevant documentation]. Figure 5 As shown, it includes: Step 501: Input the forward response and terrain profile data into the inversion network to be trained. The forward response includes apparent resistivity and phase data for TE and TM modes.
[0059] Step 502: Rearrange the forward response into a low-dimensional token sequence.
[0060] Step 503: Convert each low-dimensional token in the low-dimensional token sequence into a high-dimensional feature vector through the first linear mapping layer.
[0061] Step 504: Extract conditional information from the terrain profile data, and generate modulation parameters corresponding to each low-dimensional token based on the conditional information.
[0062] Step 505: For each low-dimensional token, the high-dimensional feature vector can be conditionally modulated using the FiLM mechanism based on the corresponding modulation parameters to obtain the modulated local features.
[0063] Step 506: Input the modulated local features into the FFT-based Transformer decoder and output the global integrated features.
[0064] Step 507: Transform the global integrated features back into a low-dimensional representation through the second linear mapping layer.
[0065] Step 508: Rearrange and combine the low-dimensional representations corresponding to each low-dimensional marker to obtain an inversion result consistent with the size of the resistivity model above, that is, reconstruct the underground resistivity distribution map.
[0066] Step 509: Output the inversion results.
[0067] The above method is based on FFT attention and a Transformer architecture for forward and inverse modeling networks. By efficiently capturing global and local features and combining FiLM conditional modulation, it effectively solves the shortcomings of traditional methods in terms of sample authenticity, network inversion capability, and utilization of terrain condition information. This significantly improves the accuracy and training efficiency of two-dimensional forward and inverse modeling and has broad engineering application value.
[0068] As mentioned above, the inversion network adopts a Transformer structure, and its core modules include FFT-based multi-head spectral attention, DropPath mechanism, and FiLM conditional modulation.
[0069] The following sections will introduce each model in turn: FFT-based multi-head spectral attention module: The multi-head spectral attention module not only inherits the advantages of traditional multi-head attention mechanisms but also achieves significant improvements in computational complexity and feature capture. The following details its principles, its role in magnetotelluric two-dimensional inversion, and its main differences from traditional multi-head attention mechanisms: Module principle Layer normalization and multi-head partitioning: The module first performs layer normalization on the input, and then partitions the features into multiple attention heads. Each head independently processes a portion of the channel information, allowing the network to extract features from different perspectives.
[0070] Frequency domain transform (FFT): For each attention head, the Fast Fourier Transform (FFT) is used to transform the time-domain (or spatial-domain) signal to the frequency domain, obtaining the corresponding spectrum. This process decomposes the signal into different frequency components, allowing the model to simultaneously capture global trends (low-frequency components) and local details (high-frequency components).
[0071] Spectral modulation: In the frequency domain, each spectrum is modulated using a set of learnable basis filters and biases. In adaptive mode, adaptive scaling and offset parameters are also generated by incorporating global context information, dynamically weighting different frequency components. This process helps to highlight key frequency information and improve the model's sensitivity to local details and global structure.
[0072] Nonlinear activation and inverse transform: The modulated spectrum is nonlinearly activated and then recovered to the original domain using an inverse FFT. The recovered result is residually concatenated with the original input to ensure stable transmission of information flow.
[0073] Role in magnetotelluric two-dimensional inversion Enhancing global feature capture capabilities: Subsurface media often exhibit complex structures and periodic variations. Traditional attention mechanisms primarily rely on direct dot product calculations, which struggle to effectively distinguish between different frequency components. In contrast, multi-head spectral attention transforms the input to the frequency domain, achieving spectral decomposition. This allows for more refined capture of periodic and oscillatory features in signals, enabling more accurate modeling of the impact of complex subsurface structures and terrain on resistivity distribution.
[0074] Enhanced inversion accuracy and stability: The frequency domain modulation process can dynamically adjust the weights of each frequency component, enabling the network to better extract key physical information and improve the stability and accuracy of the inversion network under complex underground media conditions.
[0075] Integrating terrain information: The module utilizes an adaptive spectral modulation mechanism to generate modulation parameters from terrain information and integrates them into the feature representation, effectively alleviating the problem of missing terrain information in traditional methods and enhancing the ability to model complex terrain areas.
[0076] Reduced computational complexity: Traditional multi-head attention mechanisms have a computational complexity of O(N×N) when processing sequences of length N, meaning they need to calculate the relationships between all tokens. In contrast, the introduction of FFT reduces the computational complexity of multi-head spectral attention to O(NlogN), which is a significant advantage for processing large-scale, high-resolution two-dimensional model data.
[0077] Long-range periodic relationships: Traditional attention mainly relies on direct dot product calculations, which make it difficult to distinguish different frequency components. Multi-head spectral attention utilizes frequency domain decomposition, which can capture periodic and oscillatory features more precisely, and helps to better model the influence of complex underground structures and terrain.
[0078] Adaptive modulation: In traditional mechanisms, modulation is usually relatively fixed; however, the multi-head spectrum attention module introduces an adaptive spectrum modulation mechanism, which dynamically adjusts the weights of frequency components according to the global context, thereby more effectively integrating terrain and subsurface media information.
[0079] In summary, the multi-head spectral attention module, through FFT transformation, spectral modulation, and adaptive modulation mechanisms, not only significantly reduces computational complexity but also performs better in capturing global and local features. In particular, it can significantly improve the accuracy and stability of two-dimensional magnetotelluric inversion under large-scale, complex underground media and terrain conditions.
[0080] DropPath mechanism: The DropPath mechanism is a regularization method used to enhance the robustness and generalization ability of a network. Its core idea is to randomly discard parts of the computational path during training. Specifically, in the Transformer encoder block, DropPath skips certain residual connections or sub-network layers with a certain probability, thus forcing the model to randomly use different combinations of sub-networks during forward propagation. This randomization process has several significant advantages: Reduce the risk of overfitting: By randomly discarding parts of the path, the network learns different combinations of features in each training session, reducing its dependence on a single path and thus effectively reducing the risk of overfitting.
[0081] Improving robustness: During training, the network constantly faces situations where some paths are missing, enabling the model to make correct predictions even with incomplete information, thereby improving the overall robustness of the model.
[0082] Facilitating gradient flow: DropPath acts as a "bypass" in residual connections, helping to alleviate the problems of gradient vanishing or exploding in deep networks and ensuring a more stable training process.
[0083] In summary, introducing the DropPath mechanism into the Transformer encoder block enables the model to extract features in a more robust and flexible manner when dealing with large-scale, complex underground media and terrain information, thereby improving the overall inversion performance.
[0084] FiLM conditional modulation: FiLM (Feature-wise Linear Modulation) is a technique that modulates network features element-wise based on external conditions (such as terrain information). Its basic principles and functions can be explained as follows: Basic principles The core operation of FiLM is to perform linear modulation on each feature channel, with the specific formula as follows: FiLM(x) = γ⊙x + β Here, x represents the high-dimensional feature to be modulated, γ and β are the scaling factor and bias term extracted from external conditions (such as terrain information), respectively, and ⊙ represents element-wise multiplication. Through this operation, the features of each channel can be dynamically adjusted according to the conditional information.
[0085] Modulation parameter generation In this system, terrain information is used as a conditional input, and a specially designed parameter generation module (e.g., using a fully connected layer or MLP) extracts the γ and β parameters for modulation from the image. These parameters reflect the potential influence of terrain on the subsurface resistivity model.
[0086] Functions and advantages Enhanced conditional sensitivity: FiLM conditional modulation enables the network to flexibly adjust the expression of features in each layer according to different terrain conditions, thereby improving the model's sensitivity and responsiveness to local terrain changes.
[0087] Effective fusion of multi-source information: By modulating high-dimensional features element by element, the FiLM mechanism can seamlessly combine topographic information with resistivity model features, improve feature representation, and thus help to more accurately recover underground structures.
[0088] Improve model generalization: FiLM modulation enables the network to adaptively adjust feature representations when faced with complex and variable geological conditions, thereby improving the overall inversion accuracy and robustness.
[0089] In summary, the FiLM conditional mechanism, by performing element-wise linear modulation of high-dimensional features based on terrain conditions, can not only effectively integrate external condition information but also enhance the model's ability to model resistivity distribution in complex terrain environments, thus playing a key role in magnetotelluric two-dimensional inversion.
[0090] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.
[0091] Based on the same inventive concept, this application also provides a magnetotelluric two-dimensional inversion device for implementing the aforementioned magnetotelluric two-dimensional inversion method. The solution provided by this device is similar to the implementation described in the above method; therefore, the specific limitations of the one or more magnetotelluric two-dimensional inversion device embodiments provided below can be found in the limitations of the magnetotelluric two-dimensional inversion method described above, and will not be repeated here.
[0092] In one exemplary embodiment, a magnetotelluric two-dimensional inversion device is provided, comprising: The acquisition module is used to acquire two-dimensional resistivity model samples; the two-dimensional resistivity model samples include resistivity models and terrain profile data. The forward modeling module is used to input the two-dimensional resistivity model sample into the forward modeling module, and the forward modeling module processes the two-dimensional resistivity model sample to output a forward modeling response; The inversion module is used to input the forward response and the terrain profile data into the inversion network to be trained, and the inversion network processes the forward response and the terrain profile data to output the inversion result; The parameter adjustment module is used to calculate the inversion loss based on the resistivity model and the inversion result; adjust the network parameters of the inversion network based on the inversion loss, and continue training until the training cutoff condition is reached, thereby obtaining the trained inversion network. The application module is used to use the trained inversion network to invert measurement data in actual engineering to obtain the corresponding resistivity distribution map.
[0093] In some embodiments, the inversion module is used to rearrange the forward response into a low-dimensional label sequence; The first linear mapping layer converts each low-dimensional label in the low-dimensional label sequence into a high-dimensional feature vector. Based on the terrain profile data, obtain the modulation parameters corresponding to each low-dimensional marker; For each low-dimensional label, a high-dimensional feature vector is conditionally modulated using the corresponding modulation parameters to obtain modulated local features; global integrated features are captured based on the modulated local features; and the global integrated features are converted back to a low-dimensional representation through a second linear mapping layer. The low-dimensional representations corresponding to each low-dimensional label in the low-dimensional label sequence are rearranged to obtain the inversion result.
[0094] In some embodiments, the inversion module is used to obtain a terrain mask map based on the terrain profile data; The terrain mask map is divided into multiple image blocks, and each of the multiple image blocks corresponds one-to-one with a multiple low-dimensional label in the low-dimensional label sequence; For each image patch, the image patch is converted into a high-dimensional vector representation through a third linear mapping layer; based on the high-dimensional vector representation, modulation parameters of the low-dimensional marker corresponding to the image patch are generated.
[0095] In some embodiments, the inversion module is used to perform layer normalization on the modulated local features to obtain normalized features; and to divide the normalized features into multiple attention heads; The spectrum of each attention head is obtained by fast Fourier transform; the spectrum is modulated by a learnable basis filter and a bias; the modulated spectrum is then activated by nonlinearity and then subjected to inverse fast Fourier transform to obtain the global integrated features.
[0096] In some embodiments, the parameter adjustment module is used to calculate the mean square error between the resistivity model and the inversion result as the inversion loss.
[0097] Each module in the aforementioned magnetotelluric two-dimensional inversion device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the computer device's memory as software, so that the processor can call and execute the corresponding operations of each module.
[0098] In one exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 6As shown, the computer device includes a processor, memory, input / output interface, communication interface, display unit, and input device. The processor, memory, and input / output interface are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interface. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interface is used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, Near Field Communication (NFC), or other technologies. When executed by the processor, the computer program implements a magnetotelluric two-dimensional inversion method. The display unit is used to form a visually visible image and can be a display screen, projection device, or virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.
[0099] Those skilled in the art will understand that Figure 6 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0100] In one embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.
[0101] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.
[0102] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0103] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0104] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0105] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method of 2D magnetotelluric inversion, characterized in that, The method includes: Obtain a two-dimensional resistivity model sample; the two-dimensional resistivity model sample includes resistivity models and topographic profile data; The two-dimensional resistivity model sample is input into the forward modeling module, which processes the sample and outputs the forward modeling response. The forward modeling response and the terrain profile data are input into the inversion network to be trained. The inversion network processes the forward modeling response and the terrain profile data and outputs the inversion result. Based on the resistivity model and the inversion results, the inversion loss is calculated; the network parameters of the inversion network are adjusted based on the inversion loss, and training continues until the training cutoff condition is reached, thereby obtaining the trained inversion network. The trained inversion network is used to invert measurement data in actual engineering projects to obtain the corresponding resistivity distribution map.
2. The method of claim 1, wherein, The steps of the inversion network processing the forward response and the terrain profile data include: The forward response is rearranged into a low-dimensional labeled sequence; The first linear mapping layer converts each low-dimensional label in the low-dimensional label sequence into a high-dimensional feature vector. Based on the terrain profile data, obtain the modulation parameters corresponding to each low-dimensional marker; For each low-dimensional label, a high-dimensional feature vector is conditionally modulated using the corresponding modulation parameters to obtain modulated local features; global integrated features are captured based on the modulated local features; and the global integrated features are converted back to a low-dimensional representation through a second linear mapping layer. The low-dimensional representations corresponding to each low-dimensional label in the low-dimensional label sequence are rearranged to obtain the inversion result.
3. The method of claim 2, wherein, The process of obtaining the modulation parameters corresponding to each low-dimensional marker based on the terrain profile data includes: A terrain mask map is obtained based on the terrain profile data; The terrain mask map is divided into multiple image blocks, and each of the multiple image blocks corresponds one-to-one with a multiple low-dimensional label in the low-dimensional label sequence; For each image patch, the image patch is converted into a high-dimensional vector representation through a third linear mapping layer; based on the high-dimensional vector representation, modulation parameters of the low-dimensional marker corresponding to the image patch are generated.
4. The method of claim 2, wherein, The capture of globally integrated features based on the modulated local features includes: The modulated local features are layer-normalized to obtain normalized features; the normalized features are then divided into multiple attention heads. The spectrum of each attention head is obtained by fast Fourier transform; the spectrum is modulated by a learnable basis filter and a bias; the modulated spectrum is then activated by nonlinearity and then subjected to inverse fast Fourier transform to obtain the global integrated features.
5. The method of claim 1, wherein, The calculation of the inversion loss based on the resistivity model and the inversion results includes: The mean square error between the resistivity model and the inversion result is calculated as the inversion loss.
6. A device for 2D magnetotelluric inversion, characterized in that, The device includes: The acquisition module is used to acquire two-dimensional resistivity model samples; the two-dimensional resistivity model samples include resistivity models and terrain profile data. The forward modeling module is used to input the two-dimensional resistivity model sample into the forward modeling module, and the forward modeling module processes the two-dimensional resistivity model sample to output a forward modeling response; The inversion module is used to input the forward response and the terrain profile data into the inversion network to be trained, and the inversion network processes the forward response and the terrain profile data to output the inversion result; The parameter adjustment module is used to calculate the inversion loss based on the resistivity model and the inversion result; adjust the network parameters of the inversion network based on the inversion loss, and continue training until the training cutoff condition is reached, thereby obtaining the trained inversion network. The application module is used to use the trained inversion network to invert measurement data in actual engineering to obtain the corresponding resistivity distribution map. 7.A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the computer device is configured to perform the method according to any one of claims 1-6 when the computer program is executed by the processor. When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 5.
8. A computer-readable storage medium having stored thereon a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.
9. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.