Next Article in Journal
Fuzzy Model-Based Predictive Control Applied to Wastewater Treatment Plants Represented by the BSM1 Benchmark
Previous Article in Journal
Microscale Modeling of Boarding and Alighting Processes at Shared-Use Bus Stops Under High Traffic Disruption
Previous Article in Special Issue
Elastic Time-Lapse FWI for Anisotropic Media: A Pyrenees Case Study
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Res-FormerNet: A Residual–Transformer Fusion Network for 2-D Magnetotelluric Inversion

1
Key Laboratory of Exploration Technologies for Oil and Gas Resources of MOE, Yangtze University, Wuhan 430100, China
2
College of Geophysics and Petroleum Resources, Yangtze University, Wuhan 430100, China
*
Author to whom correspondence should be addressed.
Appl. Sci. 2026, 16(1), 270; https://doi.org/10.3390/app16010270
Submission received: 4 December 2025 / Revised: 19 December 2025 / Accepted: 25 December 2025 / Published: 26 December 2025
(This article belongs to the Special Issue Applied Geophysical Imaging and Data Processing)

Abstract

We propose Res-FormerNet, an improved inversion network that integrates a lightweight Transformer encoder into a ResNet50 backbone to enhance two-dimensional magnetotelluric (MT) inversion. The model is designed to jointly leverage residual convolutional structures for local feature extraction and global attention mechanisms for capturing long-range spatial dependencies in geoelectrical resistivity models. To evaluate the effectiveness of the proposed architecture, more than 100,000 synthetic models generated by a two-dimensional staggered-grid finite-difference forward solver are used to construct training and validation datasets for TE and TM apparent resistivity responses, with realistic noise levels applied to simulate field acquisition conditions. A smoothness-aware loss function is further introduced to improve inversion stability and structural continuity. Results from synthetic tests demonstrate that incorporating the Transformer encoder substantially enhances the recovery of large-scale anomalies, structural boundaries, and resistivity contrasts compared with the original ResNet50. The proposed method also exhibits strong generalization capability when applied to real MT field data from southern Africa, producing inversion results highly consistent with those obtained using the nonlinear conjugate gradient (NLCG) method. These findings confirm that the Res-FormerNet architecture provides an effective and robust framework for MT inversion and illustrate the potential of hybrid convolution–attention networks for advancing data-driven electromagnetic inversion.

1. Introduction

Magnetotelluric (MT) sounding is a geophysical method that uses observations of natural electromagnetic signals at the Earth’s surface to invert for a geoelectric model that approximates the true subsurface structure [1,2]. Traditional MT inversion methods are mainly divided into two categories. The Gauss-Newton and quasi-Newton methods represent a family of inversion approaches [3,4,5,6,7,8]. Another major family includes the conjugate gradient method and the nonlinear conjugate gradient method [9,10,11,12]. It is noteworthy that the OCCAM inversion typically employs a conjugate gradient solver within its framework [13,14]. All these methods are grounded in the theory of objective function optimization and iterative algorithms. The traditional method has some deficiencies, such as depending on the choice of the initial model, easily falling into local minima, being generally time-consuming, making it difficult to meet the requirements of real-time processing and rapid interpretation of the measured data, and sometimes depending on human experience.
In recent years, the rapid development of deep learning technology has brought new ideas for studying inverse problems. The powerful nonlinear modeling capabilities of deep neural networks ensure that deep learning performs exceptionally well when tackling complex inverse problems, capturing details that are difficult to obtain using traditional methods. Deep learning technology based on the inverse problem was first successfully used in digital image restoration in 1988 [15]. Since then, it has been widely applied in various fields of inverse problems, including digital image processing, medical imaging, etc. [16,17,18,19], which demonstrates its powerful solution capabilities and wide application prospects. The successful application of deep learning technology in the field of inverse problems has also provided new technical means for geophysical inversion research. Currently, geophysical methods based on deep learning technology mainly focus on automatic seismic interpretation and seismic neural network inversion [20,21,22,23,24,25,26,27].
In recent years, with the widespread application of deep learning technology in the geophysical field, researchers have begun to introduce it into the application of electromagnetic data, including electromagnetic data denoising and electromagnetic data inversion [28,29,30,31,32,33,34,35,36,37]. Puzyrev developed a deep, fully convolutional 2D controlled-source electromagnetic inversion network and applied it to the inversion of measured data [38]. Liu implemented a 2D MT inversion based on the DBN algorithm and compared it with the classical linear iterative inversion method, LSR, based on synthetic and measured data, which proved the reliability of their method [39]. Liu proposed a residual fully convolutional neural network for the audio-magnetotelluric inversion method and applied it to the field data, achieving reliable inversion results [40]. Taqi developed a physics-informed neural network program that combines the advantages of deterministic inversion and neural network inversion and is capable of recovering reliable resistance models without the need to prepare a training data set [35]. Liu proposed a new inversion data preprocessing method that smooths the apparent resistivity and phase data observed with the magnetotelluric method before predicting the network inversion, brings it close to the training input data in terms of smoothness, and then produces the smoothed apparent resistivity and the integration carries out the phase into the inversion model for the inversion and thus achieves good inversion results [41]. Wang proposed a novel prior model generation method for conventional inversion using a deep learning method, which involves training a neural network model to generate prior inversion models via the U-Net network, and the reliability of this method was confirmed by the inversion of Electromagnetic data detected by the US Array [42]. Liu developed a robust deep learning inversion method for magnetotelluric noise by introducing different noises into the training data, thereby mitigating the influence of noise on the deep learning inversion model [43]. Pan developed a neural network model, MT2DInv-U-net, based on deformable convolution for 2D magnetotelluric inversion, which effectively alleviates problems such as gradient disappearance and network degradation [36]. Zhou developed a magnetotelluric inversion method based on Variational Autoencoder (VAE) and verified the reliability of this method by inverting synthetic data and measuring electromagnetic data from southern Africa [37]. The above MT inversion methods based on deep learning technology can achieve real-time inversion and generally outperform traditional regularization inversion methods in terms of computational efficiency, demonstrating the broad application prospects of deep learning technology in the field of geoelectromagnetic inversion.
This study builds upon our previous work [44], which established the effectiveness of Residual Neural Networks (ResNet) in electromagnetic inversion. This article proposes Res-FormerNet, an improved ResNet50-based architecture that integrates a lightweight Transformer encoder to simultaneously enhance local feature extraction and global structural awareness for two-dimensional magnetotelluric (MT) inversion. To construct and train the model, a large synthetic dataset was generated using Gaussian random fields, and a two-dimensional staggered finite-difference parallel forward modeling algorithm was employed for efficient data generation. During training, a learning rate scheduling strategy was applied to accelerate convergence and optimize model performance. The proposed model demonstrates superior reconstruction of large-scale resistivity anomalies and structurally continuous features, outperforming the original ResNet50 across synthetic datasets with varying geological complexity. Furthermore, Res-FormerNet exhibits strong generalization capability when applied to real MT field data, producing inversion results consistent with those obtained by conventional nonlinear conjugate gradient (NLCG) inversion. These results indicate that Res-FormerNet achieves fast, accurate, and effective MT inversion, offering both high-resolution reconstruction and practical applicability in real-world scenarios.

2. Deep Learning Inversion Using ResNet

ResNet is a deep residual network structure that was first proposed by Microsoft Research [45]. By introducing cross-layer residual connections, ResNet overcomes the gradient disappearance and explosion problems encountered in traditional deep neural networks, enabling the training of deeper network models. Magnetotelluric (MT) data inversion uses ResNet to learn the complex nonlinear mapping relationship between geological models and observed data to achieve efficient and accurate resistivity inversion. The implementation principles of the ResNet-based MT inversion model mainly include the following key points: (1) Preparation of model training sample set and data preprocessing: In this study, Gaussian random fields were used to generate a large number of geological models with different degrees of smoothness, building a standard resistivity -Batch data model library for MT inversion. The apparent resistivity responses of the TE and TM modes were then determined through parallel forward calculations. The model and response data were preprocessed to correspond to the resistance models of the response data and form a sample data set for network model training. (2) Network structure design and training: To better train the ResNet model, a suitable loss function needs to be redesigned. The loss function typically includes a data fitting term and a regularization term, which are used to balance data matching and model complexity during the inversion process, effectively reflecting the differences between observed data and model predictions. (3) Inversion prediction: The preprocessed observed data is input into the trained network model for inversion prediction, ultimately yielding the predicted distribution of the subsurface resistivity structure.
The flowchart for the ResNet-based 2D MT inversion process is shown in Figure 1.

2.1. Generating Large Data Sets

As can be seen from Figure 1, in deep learning-based magnetotelluric (MT) inversion, the first step is to generate a large sample data set. These sample sets contain a large amount of electromagnetic observation data that corresponds to different geological models. There are various ways to generate large sample datasets. The most common methods include numerical simulation of synthetic data and field measurement data. Numerical simulation is one of the most commonly used methods for generating large sample sets. By using numerical simulation methods such as finite element or finite difference methods, the electromagnetic field responses under various geoelectric models can be forward calculated. These models can generate different electromagnetic response data based on different geological parameters (such as different resistivity, polarization contrast, etc.), forming labeled data sets for training. The second method involves the use of field measurement data, which can effectively increase the realism and diversity of the data set and improve the applicability and generalization of the model in practical applications. In this study, the first sample generation method was used for various network comparison tests. A 2D staggered grid finite difference batch parallel forward modeling program was then used to calculate and generate the corresponding batch model responses [46]. The specific form can be expressed as:
d =   U i = 1 40 d i =   U i = 1 40 F i m  
In the above equation, d represents the 2D magnetotelluric forward responses at all measurement points for different frequencies, m represents the model parameter vector, represents the magnetotelluric response data vector at the i-th frequency point, and F is the 2D magnetotelluric forward calculation operator. In the sample preparation phase, 40 frequency points with a frequency range of 0.055 Hz to 320 Hz were used in this study.

2.1.1. Smooth Boundary Model Design

In deep learning tasks, the rationality of the sample set is crucial to improving the generalization ability of the model. When a significant distribution gap exists between training and test data, deep learning inversion performance deteriorates. Increasing the training data volume under this mismatch is ineffective [43]. If the training dataset is limited to samples featuring anomalous bodies with smooth, regular boundaries (as opposed to complex, irregular geological structures), the model will only learn a narrow set of anomaly characteristics. To solve this problem, we introduced Gaussian random fields in the design of the forward initial model to construct arbitrarily complex anomaly body models with varying degrees of boundary smoothness. This strategy is the same as initial model construction in traditional regularized inversion, setting up a Gaussian random field in the central region of the model. The geoelectric model constructed using the Gaussian random field can be expressed as follows:
Z x = m x + Y x  
where Z(x) is the value of the geoelectric property at position x, m(x) is the value of the mean value function that represents the overall trend of the geoelectric property. Y(x) is the realization of the Gaussian random field, which represents the randomness or uncertainty of the geoelectric property. The covariance or correlation between different positions  x i  and x j   is determined by the covariance function C x i ,   x j , which determines the degree of correlation between the geoelectric property values at different positions. The larger this value, the stronger the correlation between the two points; the smaller it is, the weaker the correlation. Common covariance functions include exponential type, Gaussian type, etc., and their general form can be expressed as follows:
C x i ,   x j = σ 2 · exp x i x j 2 2 θ 2  
Among them, σ 2 is the variance, indicating the volatility of the random field; θ is the scale parameter of spatial correlation, controlling the spatial correlation of the random field; x i x j 2 represents the squared distance between positions x i and x j . To generate a Gaussian random field model, methods such as Monte Carlo simulation or Kriging interpolation can be used. Figure 2 illustrates the method for generating complex smooth models using Gaussian random fields. The central regions of the layered model and the homogeneous half-space model contain several anomalous bodies with different resistivity values. By setting the area of anomalous bodies and the scaling parameter θ of the Gaussian random field, the smoothness of the model can be controlled. Models built with smaller parameter values have clearer boundaries between anomalous bodies, while models with larger parameter values have smoother boundaries. This approach enables the generation of a range of complex 2D geoelectric models with different geological features and provides an important training set for magnetotelluric deep learning inversion. To compare the performance differences in deep learning inversion models trained on sample sets of different scales, 50,000 models per batch were generated in the same way, for a total of 100,000 models in two batches. Examples of model generation are shown in Figure 3.

2.1.2. Forward Calculation

Obtaining the forward response of a single model through forward computation is the basis for preparing the inversion model training set and is the most time-consuming part of the entire inversion process. Although the forward computation time for a single model is short, handling a large sample library is computationally expensive. In order to solve this problem, we developed a batch forward parallel computing program that can automatically calculate the forward responses of all models in the library. We also analyzed the efficiency differences between serial and parallel calculations. In the parallel calculation program, we used the idea of frequency point parallel calculation to design the parallel algorithm, thereby greatly improving the forward calculation speed for a single model. In order to measure the efficiency of parallel calculations, we introduced S P as an evaluation metric, the calculation formula of which is as follows:
S P = T s T p  
In the above formula, T s is the serial execution time of the program, and T p is the parallel execution time of the program.
During the generation phase of the example calculation, our hardware configuration included a dedicated computer with an 8-core 2.4 GHz CPU and 32 GB of memory. We used Formula (4) to calculate the speedup for single-task and multi-task calculations. The specific comparison results of sampling calculation efficiency are shown in Table 1.
Based on the data in Table 1, it can be seen that parallel computation significantly reduces the computing time for large sample sizes. In particular, the frequency point parallel calculation strategy has significantly higher computing efficiency than the multitask parallelism strategy.

2.1.3. Prepare Training Set

The apparent resistivity data, including TE and TM polarization modes, were determined by forward calculation. In order to fully utilize the electrical information contained in both polarization modes, the apparent resistivities of the TE + TM polarization modes were selected as the training sample data, and the initial model corresponding to each sample was set as the training label. In the initial stage of deep learning model training, effective data preprocessing can significantly reduce the difficulty of network training, thereby helping the network learn and extract the nonlinear mapping relationship between input and output data more accurately and efficiently. According to the data characteristics shown in Figure 2 and Figure 3, the background resistance and the resistance of anomalous bodies in the model span several orders of magnitude. Excessive differences in resistance values are not conducive to data training, so appropriate processing methods are required to reduce these differences. In order to better simulate real observational data, a certain amount of noise must also be introduced into the synthetic data.
Therefore, the following data preprocessing strategies are proposed in this article:
(1)
Gaussian noise with a standard normal distribution was added at 5% intensity to 80% of the sample data. The resulting noisy data can be expressed as:
ρ T E / T M + n o i s e = ρ T M + 0.05 × σ ρ T E / T M × ϵ    
In the above formula, σ ρ T E / T M is the standard deviation of ρ T E and ρ T M , and ϵ is a random number with a mean of 0 and a standard deviation of 1.
(2)
Due to the wide range of resistivity changes in the model (1–10,000 Ω m ), in this article, a base-10 logarithmic transformation is applied to the sample data and sample labels, mapping all data to the same order of magnitude as the network input. This logarithmic processing effectively reduces the weight difference between strong and weak signals during network training and reduces the influence of noise on model training as follows:
ρ = l o g 10 ρ T E / T M  
This approach helps improve the stability of the training process.

2.2. Building and Training the Res-FormerNet

2.2.1. Architecture of a Neural Network

In traditional neural networks, each layer is directly connected to the other, with the output of one layer serving as the input to the next. However, when training deep networks, some problems, such as disappearing or exploding gradients, may occur. Disappearing gradients make it difficult to update the weights of the lower layers, while exploding gradients lead to excessively large weight updates, leading to network instability. To address these issues, ResNet introduces the residual learning framework, where each residual block learns a residual function instead of directly learning the underlying functions. This allows deep networks to pass information more easily, avoiding the vanishing gradient problem and maintaining the stability and effectiveness of the network [45]. Res-FormerNet integrates a ResNet50 backbone with a lightweight Transformer encoder, combining the strengths of residual learning and global attention mechanisms.
The network architecture of Res-FormerNet is illustrated in Figure 4. The ResNet50 backbone, constructed with stacked residual blocks, enables stable gradient propagation during training and efficient extraction of local spatial features from input data. In contrast, the integrated Transformer encoder captures global contextual dependencies across the feature space, thereby enhancing the model’s capacity to characterize both fine-scale and large-scale resistivity structures in geoelectric inversion tasks.
The network input consists of 40 × 40 apparent resistivity samples in both TE and TM polarization modes. These input samples first pass through the ResNet50 backbone, which is configured to exclude the default classification head and pre-trained weights. This process generates a high-dimensional feature map with a spatial dimension of 2 × 2 and a channel dimension of 2048. The feature map is then reshaped into a sequence of four tokens, each with a dimension of 2048, to conform to the input format required by the Transformer encoder. The token sequence is processed by two consecutive Transformer encoder blocks in turn. Each encoder block integrates layer normalization, multi-head self-attention mechanisms, feed-forward neural networks, and residual connection structures, which jointly maintain the stability of model training while enhancing the modeling of inter-token correlations. Subsequently, the feature representations enhanced by the Transformer encoder are flattened into a one-dimensional vector, which is fed into a fully connected layer with 512 neurons and ReLU activation function. A dropout layer with a dropout rate of 0.3 is connected thereafter to mitigate the risk of overfitting. Finally, a dense layer outputs 1600 continuous values via linear activation, which are then reshaped into a 40 × 40 geoelectric resistivity model, serving as the network’s final output.
Figure 5 presents a comparative analysis of the Structural Similarity distribution for inversion results derived from the ResNet50 and Res-FormerNet models, where both models are trained with the mean squared error loss and evaluated on a test set comprising 2000 samples. The statistical results show that the proportion of samples with a Structural Similarity value exceeding 0.8 rises prominently from 36.3% for the ResNet50 model to 67.1% for the Res-FormerNet model, reflecting the latter’s superior performance in preserving the structural consistency of geoelectric resistivity models.

2.2.2. Loss Function

Traditional regularization inversion methods can be represented in the following form:
Φ = Φ d + λ Φ m  
In the above equation, Φ represents the total objective function; Φ d denotes the data misfit objective function; Φ m represents the model constraint objective function (typically used to denote model smoothness or other prior information); λ is the regularization factor balancing data fitting and model smoothness. These methods typically aim to minimize the objective function to achieve optimal inversion results. However, traditional methods often have a strong dependence on initial models and tend to become trapped in local minima.
Similar to the construction of objective functions in regularization inversion methods, deep learning-based electromagnetic inversion also requires the design of an appropriate loss function. This loss function is minimized during model training to obtain the optimal inversion model. Unlike traditional inversion methods, deep learning methods offer several advantages: They do not rely on initial model selection because the network can learn complex features and patterns through training. During the training process, it is usually not necessary to explicitly calculate gradients of the loss function, which makes the entire process more efficient, stable, and memory-saving. The loss function plays a crucial role in measuring the difference between model predictions and true values. In electromagnetic inversion, the objective is to find a geological model whose synthetic forward responses match the field observations (true values). The synthetic responses are numerically computed from a candidate model, whereas the observations are measured data that reflect the true, underlying geology. One of the most commonly used loss functions is the mean square error loss function, which can be expressed as:
M S E y ,   y = i = 1 n ( y ,   y ) 2 n  
Here, n represents the number of samples, y represents the true results, and y represents the model’s predicted results.
When training inversion models, the use of the mean squared error loss function often leads to overfitting problems, where the model performs well on the training set but poorly on the test set, thereby reducing the generalization ability of the model [47]. To solve this problem, we propose a novel application of a composite loss function for electromagnetic inversion. Its innovation lies in the strategic integration of an L2 norm regularization term with the Mean-Square Error (MSE) to simultaneously achieve high data fidelity and model stability—a critical balance that standard loss functions often fail to maintain in this domain. The proposed function is defined in function (9) as:
L o s s = M S E + λ W 2 2  
where Loss represents the newly defined loss function, MSE denotes the mean squared error loss function without regularization, W 2 2 signifies the L2 norm squared of model parameters W, and this serves as the weight parameter of the regularization term. The introduction of the L2 norm regularization constraint serves several purposes: First, it may penalize large model parameters by encouraging smaller values, potentially reducing model complexity. Second, it may help mitigate overfitting and contribute to improved generalization. Finally, by adjusting the regularization coefficient λ, the balance between parameter constraints and data fitting can be influenced, which may further affect feature selection and predictive performance. This loss function is used for training both the ResNet50 and Res-FormerNet models.

2.2.3. Learning Rate

In deep learning tasks, the learning rate is an important hyperparameter that controls the extent of model parameter updates in each iteration. The choice of learning rate directly affects the convergence speed and final performance of model training. Too large a learning rate can cause too large parameter updates, which can lead to fluctuations or convergence failures during training. On the other hand, too low a learning rate can lead to slow convergence and increase training time. To adjust the learning rate effectively and meaningfully, we implement a customized learning rate decay strategy to accommodate the specific convergence dynamics of our electromagnetic inversion problem. The strategy, defined in function (10), is designed to ensure robust convergence by reducing the learning rate periodically.
η = η 0 × 0.8 τ 1  
In the above formula, η represents the learning rate in the current epoch, η 0 is the initial learning rate specified in this paper, and τ denotes the decay time. The key innovation is the tuning of the decay period (10 epochs) to align with the observed training behavior, allowing for rapid initial progress followed by stable refinement. This approach proved more effective than standard decay schedules for our task. Figure 6 shows a schematic representation of the learning rate decay curve during model training. The learning rate starts at its initial value and decreases to 80% of the previous learning rate every 10 iterations. This decay strategy helps to optimize the model parameters more effectively during training, thereby improving the training efficiency and overall performance of the model.

2.2.4. Train Neural Network

The complete hyperparameter settings for training the neural network model in this article are listed in Table 2.
Specific settings include the following: (1) Activation function: ReLU, the most commonly used rectified linear unit in convolutional neural networks; (2) Optimizer: Adam optimizer, known for its robustness and fast convergence, suitable for processing large hyperparameters; (3) Initial learning rate: Set to 0.01. If the validation error does not decrease during training in three consecutive epochs, the learning rate is reduced to 80% of its current value to help the model optimize the parameters more accurately; (4) Early stopping: To prevent overfitting, an early stopping strategy is used. Training stops if the validation error does not decrease in 50 consecutive epochs. This setting avoids situations where the model performs well on the training set but lacks generalization on the validation set. (5) Gradient clipping: To solve gradient explosion problems, a gradient clipping threshold value of 1 is set. When the L2 norm of a gradient vector exceeds 1, the gradient vector is shrunk to ensure that its L2 norm is equal to 1, effectively solving gradient explosion problems.
This study constructs the electromagnetic inversion neural network models using the TensorFlow 2.4 framework in CPU mode. All computations are performed on an Intel (R) Core (TM) i5-12400 processor (2.50 GHz) with 16 GB RAM. During training, apparent resistivity data from both TE and TM polarization modes are used as dual-channel inputs, and the true resistivity distribution is used as the output. The dataset is randomly divided into training and validation subsets with an 8:2 ratio. Figure 7 presents the training and validation loss curves for ResNet50 and Res-FormerNet under two different loss functions. In Figure 7a (MSE loss), both models exhibit a gradual decrease in loss; however, the convergence characteristics vary with sample size and network architecture. In contrast, Figure 7b (Custom loss, i.e., MSE + L2 regularization) shows a more stable training process for both models, with smoother curves and lower final loss values. The incorporation of L2 regularization appears to yield improved convergence behavior and reduced fluctuations during optimization.
Overall, the close alignment between the training and validation curves across iterations indicates that the models do not exhibit pronounced overfitting under either loss function. The improved stability observed with the custom loss further supports the effectiveness of the adopted training strategy and regularization scheme.
We further compared the SSIM values of the two Res-FormerNet models (trained with different loss functions) on a test set of 2000 samples, as shown in Figure 8. The proportion of test samples with SSIM greater than 0.8 increased from 67.1% to 80.5% for the model trained with the MSE + L2 loss, compared to the model trained solely with MSE.

3. Comparative Evaluation of Res-FormerNet and Baseline Networks

To assess the generalization capability of Res-FormerNet, a variety of geoelectric models were randomly selected, including smooth models with multiple anomalies and complex models with smooth anomaly bodies embedded in layered media. During data preprocessing, 5% Gaussian white noise was added to the TE and TM response data to simulate the noise characteristics of real field measurements.

3.1. Testing Inversion Models Trained on 50,000 Samples

First, we compared and analyzed the performance of three deep neural networks trained on a dataset of 50,000 model samples. Figure 9, Figure 10 and Figure 11 present the inversion results on synthetic data for two selected types of geological models with varying smoothness and complexity, obtained using three different methods: traditional two-dimensional NLCG inversion implemented in the open-source software ModEM (Version 1.2.0), standard ResNet50, and the proposed Res-FormerNet. Models are labeled Model 1, Model 2, and Model 3. In Figure 9, Figure 10 and Figure 11, panel (a) illustrates the true synthetic model, and panels (b) through (d) display the corresponding inversion results obtained using the three different methods. Figure 9a shows a complex geoelectric model embedded in four high-to low-resistivity anomaly bodies in a two-layer stratified model background. The model includes four randomly generated anomaly bodies with smooth boundaries of different sizes and burial depths. Figure 10a shows a geoelectric model with two anomaly bodies embedded in it, a two-layer model. It contains two randomly generated anomaly bodies with smooth boundaries of different sizes and burial depths. Figure 11a shows a complex model with multiple anomaly bodies embedded in a homogeneous half-space background with a resistivity of 100 Ω·m. The model includes four randomly generated anomaly bodies with smooth boundaries of different sizes and burial depths.
The inversion time consumption for models 1 to 3 using the traditional NLCG method was approximately 26 min, 23 min, and 24 min, respectively. In contrast, the inversion time for all three models using both resnet50 and res-formernet was consistently around 1 s. The inversion results demonstrate that Res-FormerNet effectively reconstructs the positions, depths, and scales of layered boundaries and various anomaly bodies across diverse synthetic geological models (Figure 9, Figure 10 and Figure 11). Quantitative evaluation using the structural similarity index (SSIM), as detailed in Table 3, indicates that Res-FormerNet outperforms ResNet50, while the performance of ResNet50 is approximately comparable to traditional two-dimensional NLCG inversion implemented in ModeM. These results highlight the improved accuracy of Res-FormerNet in recovering high-resistivity bodies and complex structural features, demonstrating its superior capability for two-dimensional magnetotelluric inversion.
In addition, Figure 9, Figure 10 and Figure 11 demonstrate that Res-FormerNet effectively recovers the structures of diverse synthetic geological models, including both complex anomaly configurations and simpler feature distributions. Compared to standard ResNet50 and traditional two-dimensional NLCG inversion in ModEM, Res-FormerNet exhibits improved reconstruction accuracy, particularly for complex high-resistivity bodies. These results indicate that Res-FormerNet provides a favorable balance between inversion accuracy and computational efficiency, making it suitable for a wide range of magnetotelluric inversion tasks with varying dataset sizes and geological complexity.

3.2. Testing Inversion Models Trained on 100,000 Samples

To evaluate the sensitivity of Res-FormerNet to training dataset size, a dataset of 100,000 samples was used for model training and benchmark testing. Figure 12, Figure 13 and Figure 14 present the inversion results for Model 1, Model 2, and Model 3, corresponding to the models shown in Figure 9, Figure 10 and Figure 11. In each figure, panel (a) represents the true model, while panels (b–d) show the inversion results obtained using two-dimensional NLCG implemented in ModEM, standard ResNet50, and the proposed Res-FormerNet, respectively.
Quantitative evaluation using the Structural Similarity Index (SSIM), as detailed in Table 4, reveals that with the doubled training dataset size, ResNet50 has limitations in delineating the boundaries and scales of complex structural models. Moreover, its ability to characterize anomalies in simple models and layered geological boundaries is inferior to that of Res-FormerNet. In contrast, Res-FormerNet accurately reconstructs the boundaries and scales of complex structural models and effectively characterizes anomalies in both simple and layered geological structures.
The inversion time for all three models using both ResNet50 and Res-FormerNet was consistently around 1 s. Based on the comparative analysis of inversion results with different training dataset sizes, Res-FormerNet demonstrates strong robustness to variations in both sample complexity and dataset scale. The network effectively captures the structural characteristics of complex models and accurately reconstructs anomaly features across large datasets, while maintaining efficient computational performance. These results indicate that Res-FormerNet provides a reliable and high-resolution solution for two-dimensional electromagnetic inversion tasks, outperforming standard ResNet50 and maintaining comparable or better efficiency relative to conventional two-dimensional NLCG inversion.

4. Inversion of Field Measurements Data in Southern Africa

Through the comparative analysis of synthetic data inversion and considering both computational efficiency and inversion performance, the proposed Res-FormerNet was applied to actual field electromagnetic data to evaluate its feasibility in two-dimensional inversion. The data were obtained from the SAMTEX dataset, available on the MTNet website (http://www.mtnet.info/data/download_data.html, accessed on 24 December 2024), which contains measurements from hundreds of points in southern Africa. This dataset has been widely used for studies on tectonic evolution, geophysical inversion, and geochemical analysis. Selecting these data allows for a practical assessment of the deep learning-based inversion method on real measurements.
For this study, data from 26 measurement points along the ETO profile and 14 points along the kim04 profile were selected, yielding a total of 40 measurement points along a single profile, as shown in Figure 15. Prior to inversion, the original impedance tensor data were rotated to align with the regional structural strike direction. Figure 16 presents the original apparent resistivity curves for some of these points. Data quality is slightly reduced in the ultra-low frequency range below 0.001 Hz; to mitigate this, the data were sampled at one frequency point intervals over the range of 320 Hz to 0.001 Hz, resulting in 40 frequency points per site. Based on the apparent resistivity curves, the subsurface resistivity of the study area can be roughly divided into three zones: high-resistivity zones (1000–10,000 Ω·m), medium- to low-resistivity zones (100–1000 Ω·m), and low-resistivity zones (<10 Ω·m). Using this resistivity distribution, 10,000 complex anomaly models were generated randomly via the Gaussian random field method, with 4–10 anomalies per model to reflect the range of subsurface electrical properties along the profile.
To improve inversion performance on real data, a transfer learning approach was employed. A pre-trained Res-FormerNet model, trained on 100,000 synthetic samples, was used as the initial model. This pre-trained model captures general electrical anomaly characteristics from the synthetic dataset, providing a robust starting point. The model was then fine-tuned using the actual field measurements, allowing the network to adapt to real data characteristics, reduce sensitivity to measurement noise, and improve generalization and inversion accuracy on field data.
In this study, Figure 17a shows the inversion results obtained using the NLCG module of ModEM, while Figure 17b presents the inversion results obtained with the proposed Res-FormerNet. The comparison demonstrates that Res-FormerNet effectively reconstructs key geological features in a manner consistent with the NLCG inversion. Both methods accurately identify the High T/Low P metamorphism zone and consistently delineate the extent and depth of the high-resistivity region between stations ETO012 and ETO019 [48]. While minor differences exist in the fine details of resistivity gradients, the overall structural interpretation from both models is consistent. The electrical structure exhibits a left-low and right-high resistivity pattern, with an intermediate resistivity layer approximately 10–20 km thick in the shallow subsurface. Along the profile at approximately 400–500 km, the resistivity boundaries inferred from Res-FormerNet closely match those obtained by NLCG inversion. Quantitative evaluation using the Structural Similarity Index (SSIM) confirms a high degree of agreement between the two methods, with an SSIM value of 0.898 achieved between the NLCG and Res-FormeRNet inversion results. The high SSIM value across the profile indicates that the overall structural and resistivity patterns recovered by Res-FormeRNet are highly consistent with those of the NLCG results, thereby validating the proposed network’s ability to accurately reproduce the subsurface electrical structure.
Figure 18 shows the forward response curves of the inversion models obtained by NLCG and Res-FormerNet for two typical measurement sites. The two sets of curves exhibit consistent morphological characteristics. These results indicate that Res-FormerNet is effective and reliable for inverting real electromagnetic field data, providing comparable or improved structural resolution relative to traditional NLCG methods while maintaining computational efficiency. The combination of visual inspection and SSIM analysis demonstrates that Res-FormerNet can serve as a robust alternative for two-dimensional magnetotelluric inversion in practical field applications.

5. Conclusions

This study presents Res-FormerNet, a two-dimensional deep-learning framework for magnetotelluric inversion that integrates residual convolutional blocks with a lightweight Transformer encoder. By combining local feature extraction with global contextual modeling, the network achieves improved structural continuity and anomaly resolution relative to conventional convolutional architectures and optimization-based inversion. The effectiveness of the method is supported by a comprehensive synthetic dataset design that incorporates variations in structural scale, burial depth, resistivity contrast, boundary gradients, and anomaly configurations. This diversity enables the network to learn generalized geoelectric priors and enhances its robustness when applied to more complex subsurface environments. Training stability and convergence are further improved through a problem-oriented loss function, adaptive learning-rate scheduling, and a transfer-learning procedure using field measurements.
Application of Res-FormerNet to magnetotelluric data from Southern Africa demonstrates that the model reconstructs key resistivity structures with high fidelity. The inverted models exhibit strong consistency with the results of the traditional two-dimensional NLCG inversion in ModEM, as indicated by high structural similarity (SSIM). These findings confirm that the proposed framework can deliver reliable geological interpretations with substantially reduced computational cost.
Despite its demonstrated advantages, several limitations remain. The current implementation uses only apparent resistivity data from TE and TM polarizations and depends on synthetic training models, which may constrain generalization under markedly different geological conditions. Future research will focus on incorporating full-tensor electromagnetic responses—including phase and tipper components—and integrating geological prior information during dataset construction to further enhance model robustness, interpretability, and applicability across diverse geological settings.

Author Contributions

Conceptualization, J.Y. and Z.X.; methodology, J.Y.; software, J.Y.; validation, J.Y., Z.X. and X.T.; formal analysis, J.Y.; investigation, J.Y.; resources, J.Y.; data curation, J.Y.; writing—original draft preparation, J.Y.; writing—review and editing, J.Y.; visualization, Z.X.; supervision, X.T.; project administration, J.Y.; funding acquisition, X.T. All authors have read and agreed to the published version of the manuscript.

Funding

This work was supported by the National Natural Science Foundation of China (Projects No. 42274087 and 42174083) and the Open Fund of the Key Laboratory of Oil and Gas Resources and Exploration Technology (Yangtze University), Ministry of Education (Grant No. k2024-02).

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

This meets the journal’s requirements and no further updates are needed for now.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Tikhonov, A.N. On determination of electrical characteristics of the deep layers of the Earth’s crust. Dokl. Akad. Nauk SSSR 1950, 73, 295–297. [Google Scholar]
  2. Cagniard, L. Basic theory of the magneto-telluric method of geophysical prospecting. Geophysics 1953, 18, 605–635. [Google Scholar] [CrossRef]
  3. Grayver, A.V.; Streich, R.; Ritter, O. Three-dimensional parallel distributed inversion of CSEM data using a direct forward solver. Geophys. J. Int. 2013, 193, 1432–1446. [Google Scholar] [CrossRef]
  4. De La Kethulle De Ryhove, S.; Mittet, R. Full-Jacobian Gauss-Newton 3D marine magnetotelluric inversion. In SEG Technical Program Expanded Abstracts, Proceedings of the SEG International Exposition and 86th Annual Meeting, Dallas, TX, USA, 16–21 October 2016; Society of Exploration Geophysicists: Tulsa, OK, USA; pp. 992–997.
  5. Loke, M.H.; Dahlin, T. A comparison of the Gauss–Newton and quasi-Newton methods in resistivity imaging inversion. J. Appl. Geophys. 2002, 49, 149–162. [Google Scholar] [CrossRef]
  6. Avdeeva, A.; Avdeev, D. A limited-memory quasi-Newton inversion for 1D magnetotellurics. Geophysics 2006, 71, G191–G196. [Google Scholar] [CrossRef]
  7. Avdeev, D.; Avdeeva, A. 3D magnetotelluric inversion using a limited-memory quasi-Newton optimization. Geophysics 2009, 74, F45–F57. [Google Scholar] [CrossRef]
  8. Mojabi, P.; LoVetri, J. Comparison of TE and TM inversions in the framework of the Gauss-Newton method. IEEE Trans. Antennas Propag. 2010, 58, 1336–1348. [Google Scholar] [CrossRef]
  9. Mackie, R.L.; Madden, T.R. Three-dimensional magnetotelluric inversion using conjugate gradients. Geophys. J. Int. 1993, 115, 215–229. [Google Scholar] [CrossRef]
  10. Rodi, W.; Mackie, R.L. Nonlinear conjugate gradients algorithm for 2-D magnetotelluric inversion. Geophysics 2001, 66, 174–187. [Google Scholar] [CrossRef]
  11. Newman, G.A.; Alumbaugh, D.L. Three-dimensional magnetotelluric inversion using non-linear conjugate gradients. Geophys. J. Int. 2000, 140, 410–424. [Google Scholar] [CrossRef]
  12. Kelbert, A.; Meqbel, N.; Egbert, G.D.; Tandon, K. ModEM: A modular system for inversion of electromagnetic geophysical data. Comput. Geosci. 2014, 66, 40–53. [Google Scholar] [CrossRef]
  13. Siripunvaraporn, W.; Egbert, G. An efficient data-subspace inversion method for 2-D magnetotelluric data. Geophysics 2000, 65, 791–803. [Google Scholar] [CrossRef]
  14. Siripunvaraporn, W.; Egbert, G. Data space conjugate gradient inversion for 2-D magnetotelluric data. Geophys. J. Int. 2007, 170, 986–994. [Google Scholar] [CrossRef]
  15. Zhou, Y.T.; Chellappa, R.; Vaid, A.; Jenkins, B.K. Image restoration using a neural network. IEEE Trans. Acoust. Speech Signal Process. 1988, 36, 1141–1151. [Google Scholar] [CrossRef]
  16. Jin, K.H.; McCann, M.T.; Froustey, E.; Unser, M. Deep convolutional neural network for inverse problems in imaging. IEEE Trans. Image Process. 2017, 26, 4509–4522. [Google Scholar] [CrossRef]
  17. McCann, M.T.; Jin, K.H.; Unser, M. Convolutional neural networks for inverse problems in imaging: A review. IEEE Signal Process. Mag. 2017, 34, 85–95. [Google Scholar] [CrossRef]
  18. Lucas, A.; Iliadis, M.; Molina, R.; Katsaggelos, A.K. Using deep neural networks for inverse problems in imaging: Beyond analytical methods. IEEE Signal Process. Mag. 2018, 35, 20–36. [Google Scholar] [CrossRef]
  19. Ongie, G.; Jalal, A.; Metzler, C.A.; Baraniuk, R.G.; Dimakis, A.G.; Willett, R. Deep learning techniques for inverse problems in imaging. IEEE J. Sel. Areas Inf. Theory 2020, 1, 39–56. [Google Scholar] [CrossRef]
  20. Xiong, W.; Ji, X.; Ma, Y.; Wang, Y.; Yang, N.; Peng, J.; Zhu, Y.; Zhang, T. Seismic fault detection with convolutional neural network. Geophysics 2018, 83, O97–O103. [Google Scholar] [CrossRef]
  21. Waldeland, A.U.; Jensen, A.C.; Gelius, L.-J.; Solberg, A.H.S. Convolutional neural networks for automated seismic interpretation. Lead. Edge 2018, 37, 529–537. [Google Scholar] [CrossRef]
  22. Wu, X.M.; Geng, Z.C.; Shi, Y.; Pham, N.; Fomel, S.; Caumon, G. Building realistic structure models to train convolutional neural networks for seismic structural interpretation. Geophysics 2020, 85, WA27–WA39. [Google Scholar] [CrossRef]
  23. Di, H.B.; Li, Z.; Maniar, H.; Abubakar, A. Seismic stratigraphy interpretation by deep convolutional neural networks: A semisupervised workflow. Geophysics 2020, 85, WA77–WA86. [Google Scholar] [CrossRef]
  24. Wang, T.Q.; Wang, Y.F. High-resolution seismic faults interpretation based on adversarial neural networks with a regularization technique. Geophysics 2022, 87, IM207–IM219. [Google Scholar] [CrossRef]
  25. Di, H.B.; Li, Z.; Maniar, H. Using relative geologic time to constrain convolutional neural network-based seismic interpretation and property estimation. Geophysics 2022, 87, IM25–IM35. [Google Scholar] [CrossRef]
  26. Das, V.; Pollack, A.; Wollner, U.; Mukerji, T. Convolutional neural network for seismic impedance inversion. Geophysics 2019, 84, R869–R880. [Google Scholar] [CrossRef]
  27. Sun, Y.H.; Liu, H.; Wang, X.; Li, Z. Inversion of low-to-medium-frequency velocities and densities from AVO data using invertible neural networks. Geophysics 2022, 87, A37–A42. [Google Scholar] [CrossRef]
  28. Wu, X.; Xue, G.Q.; Chen, W.Y.; Zhong, H.S.; Li, H. Removal of multisource noise in airborne electromagnetic data based on deep learning. Geophysics 2020, 85, B207–B222. [Google Scholar] [CrossRef]
  29. Wu, S.H.; Huang, Q.H.; Zhao, L. Denoising of transient electromagnetic data based on the long short-term memory-autoencoder. Geophys. J. Int. 2021, 224, 669–681. [Google Scholar] [CrossRef]
  30. Han, Y.; An, Z.G.; Di, Q.Y.; Wang, Z.X.; Zhang, W.; Guo, Z.Q. Research on noise suppression of magnetotelluric signal based on recurrent neural network. Chin. J. Geophys. 2023, 66, 4317–4331. [Google Scholar]
  31. Li, G.; Wu, S.L.; Fang, H.; Xue, G.Q.; Xiao, J.; Zhong, H.S. IncepTCN: A new deep temporal convolutional network combined with dictionary learning for strong cultural noise elimination of controlled-source electromagnetic data. Geophysics 2023, 88, E107–E122. [Google Scholar] [CrossRef]
  32. Jiang, E.H.; Chen, R.J.; Tang, J.T.; Ren, Z.Y.; Huang, Q.H.; Wang, M.Y. Deep-learning-based sferics recognition for audio magnetotelluric data processing in the dead band. Geophysics 2023, 88, B233–B250. [Google Scholar] [CrossRef]
  33. Li, J.; Liu, Y.C.; Tang, J.T.; Ren, Z.Y.; Huang, Q.H.; Wang, M.Y. Magnetotelluric noise suppression via convolutional neural network. Geophysics 2023, 88, WA361–WA375. [Google Scholar] [CrossRef]
  34. Li, J.; Liu, Y.C.; Tang, J.T.; Ren, Z.Y.; Huang, Q.H.; Wang, M.Y. Magnetotelluric data denoising method combining two deep-learning-based models. Geophysics 2023, 88, E13–E28. [Google Scholar] [CrossRef]
  35. Alyousuf, T.; Li, Y. Inversion using adaptive physics-based neural network: Application to magnetotelluric inversion. Geophys. Prospect. 2022, 70, 1252–1272. [Google Scholar] [CrossRef]
  36. Pan, K.J.; Ling, W.W.; Ren, Z.Y.; Long, Q.; Zhang, Y.W.; Xi, Y. MT2DInv-Unet: A 2D magnetotelluric inversion method based on deep-learning technology. Geophysics 2024, 89, G13–G27. [Google Scholar] [CrossRef]
  37. Zhou, H.Y.; Guo, R.; Fang, H.; Hu, X.Y.; Li, J.H. Feature-based magnetotelluric inversion by variational autoencoder using a subdomain encoding scheme. Geophysics 2024, 89, WA67–WA83. [Google Scholar] [CrossRef]
  38. Puzyrev, V. Deep learning electromagnetic inversion with convolutional neural networks. Geophys. J. Int. 2019, 218, 817–832. [Google Scholar] [CrossRef]
  39. Liu, W.; Xi, Z.; Wang, H.; Zhang, R. Two-dimensional deep learning inversion of magnetotelluric sounding data. J. Geophys. Eng. 2021, 18, 627–641. [Google Scholar] [CrossRef]
  40. Liu, Z.; Chen, H.; Ren, Z.; Cai, J.; Xiong, B.; Kalscheuer, T. Deep learning audio magnetotellurics inversion using residual-based deep convolution neural network. J. Appl. Geophys. 2021, 188, 104309. [Google Scholar] [CrossRef]
  41. Liu, W.; Wang, H.; Xi, Z.; Zhang, R. Smooth deep learning magnetotelluric inversion based on physics-informed Swin transformer and multiwindow Savitzky–Golay filter. IEEE Trans. Geosci. Remote Sens. 2023, 61, 4505214. [Google Scholar] [CrossRef]
  42. Wang, H.; Liu, Y.; Yin, C.; Su, Y.; Zhang, B.; Ren, X. Flexible and accurate prior model construction based on deep learning for 2-D magnetotelluric data inversion. IEEE Trans. Geosci. Remote Sens. 2023, 61, 5902511. [Google Scholar] [CrossRef]
  43. Liu, W.; Wang, H.; Xi, Z.; Wang, L. Physics-informed deep learning inversion with application to noisy magnetotelluric measurements. Remote Sens. 2024, 16, 62. [Google Scholar] [CrossRef]
  44. Yu, J.H.; Tang, X.G.; Xiong, Z.T. Two-dimensional magnetotelluric inversion based on residual neural networks. Chin. J. Geophys. 2025, 68, 269–281. [Google Scholar]
  45. He, K.; Zhang, X.; Ren, S.; Sun, J. Deep residual learning for image recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), Las Vegas, NV, USA, 27–30 June 2016; pp. 770–778. [Google Scholar]
  46. Chave, A.D.; Jones, A.G. The Magnetotelluric Method: Theory and Practice; Cambridge University Press: Cambridge, UK, 2012. [Google Scholar]
  47. Hawkins, D.M. The problem of overfitting. J. Chem. Inf. Comput. Sci. 2004, 44, 1–12. [Google Scholar] [CrossRef]
  48. Khoza, T.D.; Jones, A.G.; Muller, M.R.; Evans, R.L.; Miensopust, M.P.; Webb, S.J. Lithospheric structure of an Archean craton and adjacent mobile belt revealed from 2-D and 3-D inversion of magnetotelluric data: Example from southern Congo craton in northern Namibia. J. Geophys. Res. Solid Earth 2013, 118, 4378–4397. [Google Scholar] [CrossRef]
Figure 1. The flow chart of two-dimensional electromagnetic inversion based on ResNet.
Figure 1. The flow chart of two-dimensional electromagnetic inversion based on ResNet.
Applsci 16 00270 g001
Figure 2. Gaussian random field generation diagrams for layered embedded anomaly models and smooth models: (a) layered embedded anomaly models, and (b) smooth model generation.
Figure 2. Gaussian random field generation diagrams for layered embedded anomaly models and smooth models: (a) layered embedded anomaly models, and (b) smooth model generation.
Applsci 16 00270 g002
Figure 3. Schematic representation of the generation of a smooth edge model.
Figure 3. Schematic representation of the generation of a smooth edge model.
Applsci 16 00270 g003
Figure 4. Res-formernet network architecture.
Figure 4. Res-formernet network architecture.
Applsci 16 00270 g004
Figure 5. SSIM comparison of inversion results for ResNet50 and Res-FormerNet trained with MSE loss on 2000 test samples.
Figure 5. SSIM comparison of inversion results for ResNet50 and Res-FormerNet trained with MSE loss on 2000 test samples.
Applsci 16 00270 g005
Figure 6. Variation curve of learning rate during model training.
Figure 6. Variation curve of learning rate during model training.
Applsci 16 00270 g006
Figure 7. Comparison of training and validation loss curves of ResNet50 and Res-FormerNet under different loss functions: (a) MSE loss; (b) MSE + L2 custom loss.
Figure 7. Comparison of training and validation loss curves of ResNet50 and Res-FormerNet under different loss functions: (a) MSE loss; (b) MSE + L2 custom loss.
Applsci 16 00270 g007
Figure 8. SSIM distribution comparison on 2000 test samples: the impact of MSE vs. MSE + l2 regularization loss functions.
Figure 8. SSIM distribution comparison on 2000 test samples: the impact of MSE vs. MSE + l2 regularization loss functions.
Applsci 16 00270 g008
Figure 9. Results of inversion for model 1 using NLCG and two deep neural network architectures: (a) represents the electrical model, while (bd) show the inversion results using NLCG, ResNet-50 and Res-FormerNet, respectively.
Figure 9. Results of inversion for model 1 using NLCG and two deep neural network architectures: (a) represents the electrical model, while (bd) show the inversion results using NLCG, ResNet-50 and Res-FormerNet, respectively.
Applsci 16 00270 g009
Figure 10. Results of inversion for model 2 using NLCG and two deep neural network architectures: (a) represents the electrical model, while (bd) show the inversion results using NLCG, ResNet-50 and Res-FormerNet, respectively.
Figure 10. Results of inversion for model 2 using NLCG and two deep neural network architectures: (a) represents the electrical model, while (bd) show the inversion results using NLCG, ResNet-50 and Res-FormerNet, respectively.
Applsci 16 00270 g010
Figure 11. Results of inversion for model 3 using NLCG and two deep neural network architectures: (a) represents the electrical model, while (bd) show the inversion results using NLCG, ResNet-50 and Res-FormerNet, respectively.
Figure 11. Results of inversion for model 3 using NLCG and two deep neural network architectures: (a) represents the electrical model, while (bd) show the inversion results using NLCG, ResNet-50 and Res-FormerNet, respectively.
Applsci 16 00270 g011
Figure 12. Results of inversion for model 1 using NLCG and two deep neural network architectures: (a) represents the electrical model, while (bd) show the inversion results using NLCG, ResNet-50 and Res-FormerNet, respectively.
Figure 12. Results of inversion for model 1 using NLCG and two deep neural network architectures: (a) represents the electrical model, while (bd) show the inversion results using NLCG, ResNet-50 and Res-FormerNet, respectively.
Applsci 16 00270 g012
Figure 13. Results of inversion for model 2 using NLCG and two deep neural network architectures: (a) represents the electrical model, while (bd) show the inversion results using NLCG, ResNet-50 and Res-FormerNet, respectively.
Figure 13. Results of inversion for model 2 using NLCG and two deep neural network architectures: (a) represents the electrical model, while (bd) show the inversion results using NLCG, ResNet-50 and Res-FormerNet, respectively.
Applsci 16 00270 g013
Figure 14. Results of inversion for model 3 using NLCG and two deep neural network architectures: (a) represents the electrical model, while (bd) show the inversion results using NLCG, ResNet-50 and Res-FormerNet, respectively.
Figure 14. Results of inversion for model 3 using NLCG and two deep neural network architectures: (a) represents the electrical model, while (bd) show the inversion results using NLCG, ResNet-50 and Res-FormerNet, respectively.
Applsci 16 00270 g014
Figure 15. Distribution of measuring line positions.
Figure 15. Distribution of measuring line positions.
Applsci 16 00270 g015
Figure 16. Apparent resistivity curves for selected measurement points.
Figure 16. Apparent resistivity curves for selected measurement points.
Applsci 16 00270 g016
Figure 17. NLCG inversion results compared to Res-FormerNet inversion results: (a) represents the NLCG inversion result, while (b) shows the inversion result using Res-FormerNet.
Figure 17. NLCG inversion results compared to Res-FormerNet inversion results: (a) represents the NLCG inversion result, while (b) shows the inversion result using Res-FormerNet.
Applsci 16 00270 g017
Figure 18. Forward-modeled response curves corresponding to the inversion results from NLCG and Res-FormerNet.
Figure 18. Forward-modeled response curves corresponding to the inversion results from NLCG and Res-FormerNet.
Applsci 16 00270 g018
Table 1. Sample computational time comparison.
Table 1. Sample computational time comparison.
Parallel Type(Number of Samples, Number of Frequencies)Serial/Single-Task Time Consumption (h)Parallel/Multi-Task (h)Speedup Ratio
Frequency point parallelism(50,000, 40)15646.23.37
(100,000, 40)395984.03
Multi-task concurrency(50,000, 40)15664.32.43
(100,000, 40)3951482.66
Table 2. Hyper parameter description.
Table 2. Hyper parameter description.
Hyper ParametersParameters
Training Iterations200
Batch Size40
Activation FunctionReLU
Learning RateThe initial learning rate is 0.001, reduced by 20% every 10 iterations
OptimizerAdam
Gradient Clipping Threshold1
Table 3. Quantitative SSIM comparison of inversion results using three different methods on the 50,000 model dataset.
Table 3. Quantitative SSIM comparison of inversion results using three different methods on the 50,000 model dataset.
Inversion MethodsNLCGResNet50Res-FormerNet
model 10.3238750.6176030.841333
model 20.6320710.6182290.792049
model 30.4466390.6645780.725878
Table 4. Quantitative SSIM comparison of inversion results using three different methods on the 100,000 model dataset.
Table 4. Quantitative SSIM comparison of inversion results using three different methods on the 100,000 model dataset.
Inversion MethodsNLCGResNet50Res-FormerNet
model 10.3238750.8413330.871267
model 20.6320710.7315200.822049
model 30.4466390.8447240.969973
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Yu, J.; Tang, X.; Xiong, Z. Res-FormerNet: A Residual–Transformer Fusion Network for 2-D Magnetotelluric Inversion. Appl. Sci. 2026, 16, 270. https://doi.org/10.3390/app16010270

AMA Style

Yu J, Tang X, Xiong Z. Res-FormerNet: A Residual–Transformer Fusion Network for 2-D Magnetotelluric Inversion. Applied Sciences. 2026; 16(1):270. https://doi.org/10.3390/app16010270

Chicago/Turabian Style

Yu, Junhu, Xingong Tang, and Zhitao Xiong. 2026. "Res-FormerNet: A Residual–Transformer Fusion Network for 2-D Magnetotelluric Inversion" Applied Sciences 16, no. 1: 270. https://doi.org/10.3390/app16010270

APA Style

Yu, J., Tang, X., & Xiong, Z. (2026). Res-FormerNet: A Residual–Transformer Fusion Network for 2-D Magnetotelluric Inversion. Applied Sciences, 16(1), 270. https://doi.org/10.3390/app16010270

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop