A soil resistivity prediction method and system for a direct current ground electrode project

CN122527675APending Publication Date: 2026-08-07STATE GRID HUNAN ELECTRIC POWER CO LTD MAINTENANCE CO +2
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
STATE GRID HUNAN ELECTRIC POWER CO LTD MAINTENANCE CO
Filing Date
2026-06-04
Publication Date
2026-08-07

AI Technical Summary

Technical Problem

目前,土壤电阻率主要通过现场四极法实测获取,该方法需在选址区域进行密集布点测试,受地形地貌、地质分层、现场施工条件等限制,普遍存在测试周期长、测试成本高、数据空间代表性不足等问题,尤其在复杂地质区域,难以快速、高效获取全域土壤电阻率分布数据,无法满足特高压工程快速设计与施工需求

Benefits of technology

[0053] This application uses Yeo-Johnson power transform to normalize soil parameters, which can be adapted to positive and negative soil parameters and effectively eliminates data skewness and heteroscedasticity. Combined with a feature embedding module with two-layer linear transform and ReLU activation function, the low-dimensional original features are mapped to a high-dimensional space, which significantly improves feature expression ability and modeling quality of small sample data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122527675A_ABST
    Figure CN122527675A_ABST
Patent Text Reader

Abstract

The application discloses a soil parameter prediction method and system for a direct current grounding electrode project. The method comprises the following steps: standardizing soil parameter data to obtain standardized soil parameter features by constructing a feature embedding layer; performing double-dimensional feature extraction through a feature attention module and a batch attention module in sequence to obtain feature attention output and batch attention output; inputting the two types of features into a pooling layer and a feature fusion layer to obtain fusion features; and outputting a soil parameter prediction result through a regression prediction layer. The application fully excavates the internal correlation of soil parameters and the correlation between samples through a parallel structure of feature attention and batch attention, thereby improving the prediction accuracy. The pooling and fusion structure can reduce feature redundancy and enhance the generalization ability of the model. The method is suitable for the direct current grounding electrode project scene and has the advantages of high prediction accuracy, good stability and strong generalization.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the technical field of ultra-high voltage direct current transmission engineering, specifically relating to a method and system for predicting soil resistivity for DC grounding electrode engineering. Background Technology

[0002] In ultra-high voltage direct current (UHVDC) transmission grounding electrode projects, soil resistivity is a core parameter for grounding electrode site selection, grounding grid design, and engineering construction. Its accurate acquisition directly determines the efficiency and reliability of the engineering design. Currently, soil resistivity is mainly obtained through on-site four-electrode measurement. This method requires densely distributed testing points in the site selection area. Due to limitations imposed by topography, geological stratification, and on-site construction conditions, it generally suffers from long testing cycles, high testing costs, and insufficient spatial representativeness of the data. Especially in complex geological areas, it is difficult to quickly and efficiently obtain comprehensive soil resistivity distribution data, failing to meet the rapid design and construction needs of UHVDC projects.

[0003] In terms of soil resistivity prediction, existing methods mainly include empirical formulas, MLP neural networks, tree-based algorithms such as XGBoost / CatBoost, and conventional Transformer models. However, all of them have significant drawbacks: empirical formulas can only be adapted to specific soil types and cannot capture the nonlinear coupling relationship between multiple soil parameters in UHV projects; MLP neural networks are typical "black box models" that lack interpretability, making it difficult for engineers to determine the influence mechanism of each soil parameter on resistivity and to optimize the design of grounding electrode projects based on the prediction results; tree-based algorithms such as XGBoost and CatBoost are not good at capturing the long-range dependence of soil parameters, and their prediction accuracy is difficult to meet the high-precision requirements of UHV projects; conventional Transformer models only implement single-dimensional feature attention calculations and do not consider the correlation between batches of measured engineering data, resulting in poor generalization ability on small sample soil datasets of UHV projects.

[0004] Meanwhile, existing soil resistivity prediction tools are mostly offline calculation software, lacking deep integration with the actual design process of UHVDC grounding electrode projects. They lack an integrated application system that combines interpretability and engineering applicability, resulting in a severe disconnect between prediction results and actual engineering applications. Engineers find it difficult to directly use resistivity prediction data for engineering decisions such as grounding electrode site selection and grounding grid structure optimization, leading to low design efficiency. In summary, current technologies suffer from three major technical pain points: low prediction accuracy, uninterpretable models, and unsuitable tools. These severely restrict the design efficiency and safety reliability of UHVDC transmission grounding electrode projects, necessitating a high-precision, interpretable, and engineering-adaptable soil resistivity prediction method. Summary of the Invention

[0005] This application provides a dual-attention method for predicting soil resistivity for UHVDC grounding electrodes, which can achieve rapid, accurate, and comprehensive prediction of soil resistivity in the UHV grounding electrode site selection area.

[0006] The technical solution adopted in this application is as follows:

[0007] In a first aspect, this application provides a method for predicting soil resistivity in DC grounding electrode engineering, comprising:

[0008] S1: Collect soil parameter sample data of the DC grounding electrode site, perform normalization preprocessing on the soil parameter sample data to obtain standardized soil parameters;

[0009] S2: Construct a dual-attention prediction model, which sequentially includes a feature embedding module, a dual-attention parallel computing module, a pooling layer, a feature fusion layer, and a regression prediction layer;

[0010] The feature embedding module is used to process the standardized soil parameters through a two-layer linear transformation and activation function to complete the feature embedding and obtain the feature embedding tensor.

[0011] The dual-attention parallel computation module is used to perform feature attention computation and batch attention computation in parallel based on the feature embedding tensor, resulting in a feature attention-enhanced tensor and a batch attention-enhanced tensor; feature attention captures the parameter correlation within the same sample, while batch attention captures the distribution correlation between samples in the same batch.

[0012] The pooling layer is used to perform mean pooling on the feature attention enhancement tensor and the batch attention enhancement tensor to obtain parameter dimension pooled features and sample dimension pooled features.

[0013] The feature fusion layer is used to fuse the parameter-dimensional pooling features with the sample-dimensional pooling features to obtain dual-attention fused features;

[0014] The regression prediction layer is used to output predicted soil resistivity values ​​based on dual-attention fusion features.

[0015] The dual-attention prediction model is trained based on standardized soil parameter training samples and their corresponding true soil resistivity values.

[0016] S3: Input the standardized soil parameters to be predicted into the trained dual-attention prediction model, perform model inference, and output the predicted soil resistivity value.

[0017] In some embodiments, in step S1, the soil parameters are preprocessed by normalization using the Yeo-Johnson power transform, wherein the Yeo-Johnson power transform formula is:

[0018] ;

[0019] in, This represents the original value of the j-th soil parameter for the i-th sample. The transformation adjustment parameter corresponding to the j-th soil parameter is predetermined and fixed during the training phase. for The corresponding standardized soil parameter values.

[0020] In some embodiments, this is determined by maximizing the log-likelihood function. The optimal value of the log-likelihood function; for:

[0021] ;

[0022] in, For the total sample size, Let j be the standardized soil parameter value of the j-th soil parameter in the i-th sample. ; Let be the sample mean of the standardized soil parameter values ​​for the j-th soil parameter. It is a symbolic function.

[0023] In some embodiments, the feature embedding in step S2 satisfies the single feature embedding formula:

[0024] ;

[0025] in, Represents the embedding vector of the j-th soil parameter; This represents the vector consisting of the j-th standardized soil parameter of all samples in the batch; Let represent the weight matrix of the first-level linear transformation of the j-th feature; This represents the bias term of the first-level linear transformation of the j-th feature; To modify the activation function of the linear unit; Let be the weight matrix of the second-level linear transformation of the j-th feature; This represents the bias term of the second-level linear transformation of the j-th feature;

[0026] Depend on Constituting the overall feature embedding tensor , For soil parameters, For batch size, For the embedded dimension.

[0027] In some embodiments, the feature attention in step S2 adopts The multi-head self-attention structure of the next iteration, initial input The iterative formula is:

[0028] ;

[0029] in, For the first The input feature tensor of the next iteration. For the first The output feature tensor of the next iteration; The number of iterations for feature attention is set to a preset value. ; For layer normalization; This is a multi-head self-attention function for the parameter dimension, used to extract the correlation between various soil parameters within the same sample.

[0030] In some embodiments, batch attention in step S2 adopts The multi-head self-attention structure of the next iteration, initial input The iterative formula is:

[0031] ;

[0032] in, For the first The input feature tensor for the next iteration; For the first The output feature tensor of the next iteration; The number of iterations for batch attention is a preset value. ; This is a multi-head self-attention function for the sample dimension, used to capture the distributional correlation between different samples in the same batch.

[0033] In some embodiments, during training, the particle swarm optimization algorithm is used to iteratively update the model hyperparameters, and the mean squared error is used as the loss function to complete the model training.

[0034] In some embodiments, the method further includes: performing interpretability analysis based on the predicted soil resistivity values ​​and quantifying the contribution of each soil parameter using the SHAP model.

[0035] Secondly, this application provides a dual-attention prediction system for soil resistivity of ultra-high voltage direct current grounding electrodes, comprising:

[0036] The preprocessing unit is used to collect soil parameter sample data of the DC grounding electrode site, and to perform normalization preprocessing on the soil parameter sample data to obtain standardized soil parameters.

[0037] A dual-attention prediction model construction and training unit is used to construct a dual-attention prediction model, which sequentially includes a feature embedding module, a dual-attention parallel computing module, a pooling layer, a feature fusion layer, and a regression prediction layer.

[0038] The feature embedding module is used to process the standardized soil parameters through a two-layer linear transformation and activation function to complete the feature embedding and obtain the feature embedding tensor.

[0039] The dual-attention parallel computation module is used to perform feature attention computation and batch attention computation in parallel based on the feature embedding tensor, resulting in a feature attention-enhanced tensor and a batch attention-enhanced tensor; feature attention captures the parameter correlation within the same sample, while batch attention captures the distribution correlation between samples in the same batch.

[0040] The pooling layer is used to perform mean pooling on the feature attention enhancement tensor and the batch attention enhancement tensor to obtain parameter dimension pooled features and sample dimension pooled features.

[0041] The feature fusion layer is used to fuse the parameter-dimensional pooling features with the sample-dimensional pooling features to obtain dual-attention fused features;

[0042] The regression prediction layer is used to output predicted soil resistivity values ​​based on dual-attention fusion features.

[0043] The dual-attention prediction model is trained based on standardized soil parameter training samples and their corresponding true soil resistivity values.

[0044] The prediction unit is used to input the standardized soil parameters to be predicted into the trained dual-attention prediction model, perform model inference, and output the predicted soil resistivity value.

[0045] The system is used to implement the above-described method.

[0046] Thirdly, this application provides an electronic device, including: a memory and a processor;

[0047] The memory is used to store computer programs;

[0048] The processor is used to invoke the computer program to execute the method described above.

[0049] Fourthly, this application provides a computer-readable storage medium storing a computer program that, when executed on an electronic device, causes the electronic device to perform the method described above.

[0050] Fifthly, this application provides a computer program product, including a computer program that, when run on an electronic device, causes the electronic device to perform the method described above.

[0051] The specific implementation methods of the second to fifth aspects of this application can refer to the implementation methods of the first aspect, and will not be elaborated here.

[0052] Beneficial effects:

[0053] This application uses Yeo-Johnson power transform to normalize soil parameters, which can be adapted to positive and negative soil parameters and effectively eliminates data skewness and heteroscedasticity. Combined with a feature embedding module with two-layer linear transform and ReLU activation function, the low-dimensional original features are mapped to a high-dimensional space, which significantly improves feature expression ability and modeling quality of small sample data.

[0054] This application proposes a dual attention mechanism that combines feature attention and batch attention, which can simultaneously capture the coupling correlation of multiple parameters within the same sample and the distribution pattern among samples in the same batch. This solves the problems of traditional models that only have single-dimensional attention, weak long-range dependency capture ability, and poor generalization for small samples, and significantly improves the accuracy of soil resistivity prediction and model stability.

[0055] This application employs a particle swarm optimization algorithm to automatically iteratively optimize model hyperparameters, using mean squared error as the loss function to complete training. This avoids the subjectivity and limitations of manual parameter tuning, achieving an optimal balance between model fitting ability, generalization performance, and computational efficiency, and is more suitable for rapid training and deployment in engineering.

[0056] This application introduces the SHAP interpretability analysis model, which can quantify the contribution and influence direction of each soil parameter on the prediction results, solve the "black box" problem of traditional deep learning models, and provide clear and traceable basis for engineering decisions such as grounding electrode site selection and grounding grid structure optimization, so as to realize closed-loop support for prediction and engineering design.

[0057] This application only requires the collection of a small number of easily measurable soil parameters to complete the accurate prediction of resistivity across the entire region, which can significantly reduce the workload of on-site testing, shorten the cycle, reduce engineering costs, and at the same time improve the spatial representativeness of the data, meeting the rapid design requirements of UHV projects.

[0058] This application presents an integrated engineering solution combining method and system, which is adaptable to multiple voltage levels of ±800kV and ±1000kV and complex geological scenarios in different regions. It has strong generalization ability and can be deeply integrated with the engineering design process of UHVDC grounding electrodes, thus possessing broad application value. Attached Figure Description

[0059] Figure 1 This is a diagram illustrating the overall architecture of a method in one embodiment of this application.

[0060] Figure 2 This is a distribution map of the average absolute SHAP values ​​of geotechnical engineering parameters in soil resistivity modeling in one embodiment of this application. Detailed Implementation

[0061] To enable those skilled in the art to better understand the present application, the technical solution of the present application will be further described in detail below with reference to the embodiments and accompanying drawings.

[0062] This application provides a method and system for predicting soil resistivity in DC grounding electrode engineering, and develops an integrated interpretable application system to achieve a complete solution from "high-precision prediction to interpretable analysis to engineering application". The core technical solution consists of two parts: prediction method and application system. It integrates multi-dimensional mathematical formulas and algorithm model formulas to achieve quantitative calculation, and is suitable for accurate soil resistivity assessment and engineering decision support in the UHV grounding electrode site selection, grounding grid design, and engineering construction stages. The following is a detailed description of this application using an UHV DC transmission grounding electrode engineering scenario as an example.

[0063] Example 1:

[0064] This embodiment provides a method for predicting soil resistivity in DC grounding electrode projects, including:

[0065] S1. Collect soil parameter sample data of the DC grounding electrode site, perform normalization preprocessing on the soil parameter sample data to obtain standardized soil parameters.

[0066] In some embodiments, the UHV grounding electrode project site is selected as an easily measurable location. Six core soil parameters (such as fine particle content F200, dry density ρd, moisture content w, liquid limit LL, plastic limit PL, and specific gravity Gs) are used as input features. The Yeo-Johnson power transform is employed to normalize the feature data, addressing the skewed distribution and heteroscedasticity issues of the soil parameters. The transformation formula is as follows:

[0067] ;

[0068] in, The original value of the j-th soil parameter for the i-th sample is given. The sample includes training samples and newly acquired samples to be predicted. The transformation adjustment parameters corresponding to each soil parameter are independent of each other. The transformation adjustment parameter corresponding to the j-th soil parameter is predetermined and fixed during the training phase. for The corresponding standardized soil parameter values.

[0069] Optimization of adjustment parameters based on statistical characteristics of soil samples from ultra-high voltage power transmission projects The optimal value is determined by maximizing the log-likelihood function. To improve the normalization effect for small sample data. Log-likelihood function. as follows:

[0070] ;

[0071] in, For the total sample size, Let j be the standardized soil parameter value of the j-th soil parameter in the i-th sample. ; Let be the sample mean of the standardized soil parameter values ​​for the j-th soil parameter. For symbolic functions, defined as .

[0072] S2. Construct a dual-attention prediction model, which includes, in sequence, a feature embedding module, a dual-attention parallel computing module, a pooling layer (which can use all pooling methods such as mean pooling, max pooling, adaptive pooling, and global pooling), a feature fusion layer, and a regression prediction layer (such as MLP regression prediction).

[0073] S2.1 Feature Embedding Module:

[0074] The input soil parameters (F200, ρd, w, LL, PL, Gs) for ultra-high voltage grounding electrode projects are tabular data with different dimensions and distribution characteristics. Directly inputting them into the model can lead to an imbalance in feature weights (e.g., the difference between Gs with a value of 2.665 and F200 with a value of 0-100 is huge), and it cannot fully explore the nonlinear correlation between parameters. This application constructs a feature embedding module through a two-layer linear transformation + ReLU activation function, mapping the original 6-dimensional low-dimensional features to a 36-dimensional high-dimensional space, enhancing the feature representation capability, and providing high-quality feature input for the subsequent dual attention mechanism.

[0075] The formula for calculating single feature embedding is:

[0076] ;

[0077] in, This represents the embedding vector (high-dimensional feature vector) of the j-th soil parameter. In some embodiments, j∈{1,2,...,6}, corresponding to 6 input features (F200 / ρd / w / LL / PL / Gs). This represents the vector formed by the j-th standardized soil parameter of all samples in a batch, i.e., the data in the j-th column of the standardized soil parameter matrix. The dimension is B×1, where B is the batch size. In the training / testing phase, B takes the number of training / testing samples in each batch. In the inference phase, B takes the number of samples to be predicted (which can be 1, corresponding to single-sample prediction). Let the weight matrix of the first-level linear transformation of the j-th feature be . ×1 ( =36 is the embedding dimension), which maps the 1-dimensional original feature to 36 dimensions; This represents the bias term of the first-level linear transformation of the j-th feature, with dimension . ×1 is used to adjust the feature distribution and improve the model's fitting ability; To correct the linear unit activation function, the expression ReLU(a) = max(0,a) is introduced to avoid linear overfitting of the model. Let be the weight matrix of the second-level linear transformation of the j-th feature, with dimension . × A second transformation is performed on the high-dimensional features output by ReLU to enhance feature correlation; This represents the bias term of the second-level linear transformation of the j-th feature, with dimension . ×1, optimizes the numerical range of embedded features to adapt to subsequent attention calculations.

[0078] The dimension of the overall feature embedding tensor is defined as:

[0079] ;

[0080] in, This represents the overall embedded feature tensor, which is the high-dimensional feature matrix of the final output and serves as the input basis for the dual attention mechanism. This indicates the number of soil parameters, which is fixed at 6 in some embodiments, corresponding to 6 soil physical parameters; For embedding dimensions, core hyperparameters are determined through PSO optimization in some embodiments. The value is fixed at 36 to balance expressive power and computational complexity.

[0081] A feature embedding module with two-layer linear transformation and ReLU activation is used to achieve high-dimensional mapping and feature enhancement of the original soil parameters.

[0082] S2.2, Dual Attention Parallel Computing Module:

[0083] This application employs an orthogonal dual-attention mechanism to learn the influence of soil resistivity from both parameter and sample dimensions. It includes two parallel branches: feature attention and batch attention, sharing a common overall embedded feature tensor. As the initial input.

[0084] S2.2.1 Feature Attention:

[0085] Feature attention uses the parameter dimension as the computational object to extract the nonlinear interaction relationships among six soil parameters within the same sample, enabling each soil parameter feature to model the influence weights of other parameter features within the same sample. In some embodiments, the feature attention module employs... The multi-head self-attention structure iterates through residual connections and layer normalization in each iteration, gradually enhancing the ability to model nonlinear correlations between parameters, making predictions more accurate and stable.

[0086] Specifically: using the overall embedding feature tensor Using the following formula as the initial input, iterative calculation is performed. Second-rate:

[0087] ;

[0088] ;

[0089] in, No. The input feature tensor of the next iteration. For the first The input feature tensor of the nth iteration, i.e., the... The output feature tensor of the next iteration; The number of iterations for feature attention is set to a preset value. In some embodiments, Correspondingly ; The representation layer normalization operation is used to stabilize the training process; This represents a multi-head self-attention function for the parameter dimension;

[0090] Multi-head self-attention is calculated as follows:

[0091] ;

[0092] in, Indicates the number of heads of attention; This is the output of the h-th attention head; This represents the splicing operation of multi-head attention results; This represents the final projected weight matrix of the multi-head attention output, used to map the concatenated features back to the original dimensions.

[0093] The calculation for each head is as follows:

[0094] ;

[0095] in, , , These are the query, key, and value projection weight matrices for the h-th attention head, respectively.

[0096] In this application, the multi-head self-attention module uses the features of the current layer. As input, through three sets of independent trainable projection matrices , , Generate the query matrix for the h-th attention head respectively. = Key matrix = AND-value matrix = . , , The dimension is Attention weights are calculated in the parameter dimension ( (Dimension), to achieve correlation modeling between soil parameters within the same sample.

[0097] The scaling dot product attention formula is:

[0098] ;

[0099] in, This indicates the attention computation operation, through , , Given three input matrices, calculate and output the weighted feature representation; It is a single-head dimension; This represents the normalization function used to calculate the importance weight of each feature.

[0100] S2.2.2 Batch Attention:

[0101] Batch attention uses the sample dimension as the computational object to extract distribution patterns and similarities among different samples in the same batch, enabling knowledge transfer between samples and improving generalization ability in small-sample scenarios. In some embodiments, the batch attention module adopts... =A multi-head self-attention structure with 2 iterations, each iteration strengthens the ability to model the distribution correlation between samples through residual connections and layer normalization.

[0102] Specifically:

[0103] global embedding feature tensor Using the following formula as the initial input, iterative calculation is performed. Second-rate:

[0104] ;

[0105] ;

[0106] in, For the first The input feature tensor for the next iteration; For the first The output feature tensor of the next iteration; in some embodiments, Correspondingly ; This is a multi-head self-attention function for the sample dimension.

[0107] Batch multi-head self-attention calculation is as follows:

[0108] ;

[0109] in, For the number of attention heads; For the first The output of each attention head; This is the final projection weight matrix output by batch attention, used to map the concatenated features back to the original dimensions.

[0110] The calculation for each head is as follows:

[0111] ;

[0112] in, , , The first The query, key, and value projection weight matrix of each attention head.

[0113] In this application, the batch multi-head self-attention module uses the features of the current layer. As input, through three sets of independent trainable projection matrices , , Generate the first one respectively A query matrix for each attention head Key matrix AND-value matrix . , , The dimension is Attention weights are calculated in the sample dimension ( (Dimension), to achieve distribution correlation modeling between different samples in the same batch.

[0114] The batch scaling dot product attention formula is:

[0115] .

[0116] S2.3 Pooling layer: Used to perform mean pooling on the feature attention enhancement tensor and batch attention enhancement tensor to obtain parameter-dimensional pooled features and sample-dimensional pooled features. The pooling layer can use all pooling methods, including mean pooling, max pooling, adaptive pooling, and global pooling.

[0117] S2.4 Feature Fusion Layer: This layer is used to fuse parameter-dimensional pooled features with sample-dimensional pooled features to obtain dual-attention fused features.

[0118] Specifically, the pooled feature attention output With batch attention output Feature fusion can be performed, for example by concatenation or weighted summation, to obtain dual-attention fusion features, while preserving the parameter coupling relationship and the correlation with the sample distribution, thus providing high-quality feature input for subsequent resistivity prediction.

[0119] This step employs an orthogonal dual-attention mechanism, which allows for the simultaneous learning of the influence of soil resistivity from two dimensions:

[0120] (1) Feature attention: to solve the problem of "complex parameter coupling" and learn the nonlinear interaction relationship between 6 soil parameters in a single sample;

[0121] (2) Batch attention: learn the distribution patterns between different samples, improve the generalization performance under small samples, capture the distribution correlation and similarity between different soil samples within a batch, and realize data augmentation and regularization.

[0122] The parallel computation and mutual complementarity of these two methods result in a model with higher accuracy and stability than traditional single-attention models. Under the conditions of small sample and tabular soil data in UHV projects, the model simultaneously achieves feature interaction relationship modeling and cross-sample knowledge transfer, significantly improving the model's fitting and generalization ability to nonlinear and non-stationary soil resistivity data.

[0123] S2.5, Regression Prediction Layer, is used to output predicted soil resistivity values ​​based on dual-attention fusion features. The regression prediction layer can employ a multilayer perceptron (MLP) for regression prediction.

[0124] S2.6 Hyperparameter Optimization and Loss Function:

[0125] The loss function is the optimization objective of model training, and hyperparameter optimization is the means of tuning model performance. The two work together to achieve high accuracy, strong generalization and high robustness prediction of the dual attention model on small sample soil data of UHV projects, meeting the stringent requirements of grounding electrode design.

[0126] The Particle Swarm Optimization (PSO) algorithm is used to optimize hyperparameters such as embedding dimension, number of attention heads, and learning rate. The formulas for velocity and position updates are as follows:

[0127] ;

[0128] ;

[0129] in, Indicates the first The velocity of a particle in the t-th iteration; As the inertial weight, w=0.5 in some embodiments; , In some embodiments, the learning factor is used as the learning factor. ; , Add random numbers between [0,1] to increase the randomness of the search; Indicates the first The best position in the history of each particle; This represents the globally optimal position of the entire particle swarm; Indicates the first The position of a particle in the t-th iteration.

[0130] Within the search space defined by the model's hyperparameters, the optimal hyperparameter combination is automatically found using a particle swarm optimization algorithm, achieving an optimal balance between model fitting ability, generalization ability, and computational efficiency. Fitting ability ensures the model accurately learns the nonlinear coupling relationship between soil parameters and resistivity; generalization ability ensures the model maintains high-precision predictions even under unfamiliar site and soil conditions, meeting the cross-regional application needs of UHV projects; computational efficiency ensures fast model training speed and low resource consumption, facilitating engineering deployment and real-time prediction. Through intelligent algorithm-based automatic optimization, the limitations of manual parameter tuning, such as strong subjectivity, low trial-and-error efficiency, and difficulty in achieving global optimum, are completely avoided, enabling the model to achieve stable, efficient, and high-precision prediction results on small-sample UHV project soil data.

[0131] The model training uses mean squared error (MSE) as the loss function to minimize the deviation between the predicted and actual values.

[0132] in, ;

[0133] The loss function represents the optimization objective of model training. It represents the overall error between the predicted value and the true value. The core of training is to minimize this value. The total number of samples is 252 groups of soil samples in some embodiments. This represents the true value of the i-th sample, that is, the true soil resistivity measured in the field / laboratory of the i-th group of soil samples; This is the model prediction value for the i-th sample, which is the soil resistivity prediction value calculated by the dual attention model for the i-th group of soil parameters (F200, ρd, w, LL, PL, Gs).

[0134] S3: Input the standardized soil parameters to be predicted into the trained dual-attention prediction model, perform model inference, and output the predicted soil resistivity value.

[0135] In some embodiments, the method of this embodiment further includes: performing interpretability analysis based on the predicted soil resistivity values ​​and quantifying the contribution of each soil parameter using the SHAP model.

[0136] The SHapley additive interpretation model is introduced to quantify the contribution and direction of influence of each parameter on resistivity. The core formula is:

[0137] ;

[0138] in, This represents the model's predicted output value for the i-th sample. This represents all the input feature vectors of the i-th sample. The average predicted value (baseline predicted value) for all samples. Let be the SHAP contribution value of the j-th feature to the prediction result of the i-th sample, which quantifies the degree of influence of the feature on the prediction result.

[0139] Experimental verification:

[0140] The effectiveness of the methods in the above embodiments is verified by specific experiments below.

[0141] Experimental scenario and samples:

[0142] The site of a ±800kV UHVDC transmission grounding electrode project in a certain region was selected as the test object. The soil types covered SP, SP-SM, and SP-SC. Seven types of soil samples were collected, and 252 sets of samples were constructed according to 6 moisture content × 6 dry density. The actual values ​​of six soil parameters and resistivity were measured and divided into training / validation / test sets according to 80 / 10 / 10.

[0143] Implementation of the prediction method:

[0144] 1. Perform Yeo-Johnson transformation on 252 sets of parameters to eliminate the effects of dimensions and skewness;

[0145] 2. A dual attention model was built based on PyTorch, with an embedding dimension of 36 and the number of attention heads of 4. Training was completed according to Equation S2. The hyperparameters were optimized using the PSO algorithm. After 1000 training epochs, the validation set loss stabilized at 0.01.

[0146] 3. Test set validation uses Mean Absolute Percentage Error (MAPE) and Coefficient of Determination (R²). 2 Evaluation accuracy:

[0147] ;

[0148] ;

[0149] This method has a MAPE of 0.63% and an R² of 0.9996, which is far superior to traditional models such as MLP, XGBoost, and TabPFN.

[0150] 4. Perform SHAP analysis, such as... Figure 2 As shown in the bar chart, the importance of parameters in soil resistivity prediction is quantified by the mean absolute SHAP value. The results show that F200 (SHAP value ≈ 0.6) and ρd (SHAP value ≈ 0.5) are the core parameters affecting the soil resistivity of this site.

[0151] Based on theoretical analysis and experimental results, this application has the following advantages compared with existing products:

[0152] 1. High prediction accuracy, suitable for UHV engineering requirements: The dual attention mechanism simultaneously captures the coupling relationship of soil parameters and the correlation of sample batches. Combined with PSO hyperparameter optimization, the MAPE is as low as 0.63% under small sample conditions, which is 23.2% higher than the accuracy of the traditional TabPFN model and far exceeds the accuracy requirements of UHV grounding electrode engineering.

[0153] 2. The model is interpretable and supports engineering optimization design: By quantifying the contribution of parameters through SHAP values, the problem of the lack of interpretability of traditional "black box models" is solved. Engineers can directly optimize the grounding electrode design parameters based on the characteristic influence mechanism, realizing a closed loop of "prediction-analysis-optimization".

[0154] 3. Reduce engineering costs and improve data representativeness: Only 6 easily obtainable parameters need to be measured to achieve full-domain resistivity prediction, replacing the traditional densely distributed measurement, reducing the testing workload by more than 70% and lowering costs; at the same time, full-domain interpolation is achieved through a small number of measurement points, improving the spatial representativeness of the data.

[0155] 4. Strong generalization ability and adaptability to multiple engineering scenarios: The model parameters are optimized for typical soil types in UHV projects and have been verified to be effective in projects in different regions such as ±800kV / ±1000kV, Southwest / North China / East China. It has strong generalization ability across voltage and regions and can be promoted nationwide.

[0156] Example 2:

[0157] This embodiment provides a dual-attention prediction system for soil resistivity of ultra-high voltage direct current grounding electrodes, including:

[0158] The preprocessing unit is used to collect soil parameter sample data of the DC grounding electrode site, and to perform normalization preprocessing on the soil parameter sample data to obtain standardized soil parameters.

[0159] A dual-attention prediction model construction and training unit is used to construct a dual-attention prediction model, which sequentially includes a feature embedding module, a dual-attention parallel computing module, a pooling layer, a feature fusion layer, and a regression prediction layer.

[0160] The feature embedding module is used to process the standardized soil parameters through a two-layer linear transformation and activation function to complete the feature embedding and obtain the feature embedding tensor.

[0161] The dual-attention parallel computation module is used to perform feature attention computation and batch attention computation in parallel based on the feature embedding tensor, resulting in a feature attention-enhanced tensor and a batch attention-enhanced tensor; feature attention captures the parameter correlation within the same sample, while batch attention captures the distribution correlation between samples in the same batch.

[0162] The pooling layer is used to perform mean pooling on the feature attention enhancement tensor and the batch attention enhancement tensor to obtain parameter dimension pooled features and sample dimension pooled features.

[0163] The feature fusion layer is used to fuse the parameter-dimensional pooling features with the sample-dimensional pooling features to obtain dual-attention fused features;

[0164] The regression prediction layer is used to output predicted soil resistivity values ​​based on dual-attention fusion features.

[0165] The dual-attention prediction model is trained based on standardized soil parameter training samples and their corresponding true soil resistivity values.

[0166] The prediction unit is used to input the standardized soil parameters to be predicted into the trained dual-attention prediction model, perform model inference, and output the predicted soil resistivity value.

[0167] The system is used to implement the above-described method.

[0168] Example 3:

[0169] This embodiment provides an electronic device, including: a memory and a processor;

[0170] The memory is used to store computer programs;

[0171] The processor is configured to invoke the computer program to execute the method as described in Embodiment 1.

[0172] Example 4:

[0173] This embodiment provides a computer-readable storage medium storing a computer program. When the computer program is run on an electronic device, it causes the electronic device to perform the method described in Embodiment 1.

[0174] Example 5:

[0175] This embodiment provides a computer program product, including a computer program that, when run on an electronic device, causes the electronic device to perform the method described in Embodiment 1.

[0176] The specific implementation of the system, electronic device, computer-readable storage medium, and computer program product provided in this application can be referred to the specific embodiments of the above methods, and will not be repeated here.

[0177] Obviously, those skilled in the art should understand that the various units or steps of this application described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Optionally, they can be implemented using computer-executable program code, thereby storing them in a storage device for execution by a computing device, or fabricating them separately as individual integrated circuit modules, or fabricating multiple modules or steps into a single integrated circuit module. Thus, this application is not limited to any particular combination of hardware and software.

[0178] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A method for predicting soil resistivity in DC grounding electrode engineering, characterized in that, include: S1: Collect soil parameter sample data of the DC grounding electrode site, perform normalization preprocessing on the soil parameter sample data to obtain standardized soil parameters; S2: Construct a dual-attention prediction model, which sequentially includes a feature embedding module, a dual-attention parallel computing module, a pooling layer, a feature fusion layer, and a regression prediction layer; The feature embedding module is used to process the standardized soil parameters through a two-layer linear transformation and activation function to complete the feature embedding and obtain the feature embedding tensor. The dual-attention parallel computation module is used to perform feature attention computation and batch attention computation in parallel based on the feature embedding tensor, resulting in a feature attention-enhanced tensor and a batch attention-enhanced tensor; feature attention captures the parameter correlation within the same sample, while batch attention captures the distribution correlation between samples in the same batch. The pooling layer is used to perform mean pooling on the feature attention enhancement tensor and the batch attention enhancement tensor to obtain parameter dimension pooled features and sample dimension pooled features. The feature fusion layer is used to fuse the parameter-dimensional pooling features with the sample-dimensional pooling features to obtain dual-attention fused features; The regression prediction layer is used to output predicted soil resistivity values ​​based on dual-attention fusion features. The dual-attention prediction model was trained using standardized soil parameter training samples and their corresponding actual soil resistivity values; soil parameter sample data. S3: Input the standardized soil parameters to be predicted into the trained dual-attention prediction model, perform model inference, and output the predicted soil resistivity value.

2. The method according to claim 1, characterized in that, In step S1, the soil parameters are preprocessed by normalizing using the Yeo-Johnson power transform, where the Yeo-Johnson power transform formula is: ; in, This represents the original value of the j-th soil parameter for the i-th sample. The transformation adjustment parameter corresponding to the j-th soil parameter is predetermined and fixed during the training phase. for The corresponding standardized soil parameter values.

3. The method according to claim 2, characterized in that, Determined by maximizing the log-likelihood function The optimal value of the log-likelihood function; for: ; in, For the total sample size, Let j be the standardized soil parameter value of the j-th soil parameter in the i-th sample. ; Let be the sample mean of the standardized soil parameter values ​​for the j-th soil parameter. It is a symbolic function.

4. The method according to claim 1, characterized in that, The feature embedding described in step S2 satisfies the single feature embedding formula: ; in, Represents the embedding vector of the j-th soil parameter; This represents the vector consisting of the j-th standardized soil parameter of all samples in the batch; Let represent the weight matrix of the first-level linear transformation of the j-th feature; This represents the bias term of the first-level linear transformation of the j-th feature; To modify the activation function of the linear unit; Let be the weight matrix of the second-level linear transformation of the j-th feature; This represents the bias term of the second-level linear transformation of the j-th feature; Depend on Constituting the overall feature embedding tensor , For soil parameters, For batch size, For the embedded dimension.

5. The method according to claim 4, characterized in that, In step S2, feature attention is adopted The multi-head self-attention structure of the next iteration, initial input The iterative formula is: ; in, For the first The input feature tensor of the next iteration. For the first The output feature tensor of the next iteration; The number of iterations for feature attention is set to a preset value. ; For layer normalization; This is a multi-head self-attention function for the parameter dimension, used to extract the correlation between various soil parameters within the same sample.

6. The method according to claim 5, characterized in that, In step S2, batch attention is used The multi-head self-attention structure of the next iteration, initial input The iterative formula is: ; in, For the first The input feature tensor for the next iteration; For the first The output feature tensor of the next iteration; The number of iterations for batch attention is a preset value. ; This is a multi-head self-attention function for the sample dimension, used to capture the distributional correlation between different samples in the same batch.

7. The method according to claim 1, characterized in that, During training, the particle swarm optimization algorithm is used to iteratively update the model hyperparameters, and the mean squared error is used as the loss function to complete the model training.

8. The method according to claim 1, characterized in that, Also includes: Interpretability analysis was performed based on the predicted soil resistivity values, and the contribution of each soil parameter was quantified using the SHAP model.

9. A dual-attention prediction system for soil resistivity of ultra-high voltage direct current grounding electrodes, characterized in that, include: The preprocessing unit is used to collect soil parameter sample data of the DC grounding electrode site, and to perform normalization preprocessing on the soil parameter sample data to obtain standardized soil parameters. A dual-attention prediction model construction and training unit is used to construct a dual-attention prediction model, which sequentially includes a feature embedding module, a dual-attention parallel computing module, a pooling layer, a feature fusion layer, and a regression prediction layer. The feature embedding module is used to process the standardized soil parameters through a two-layer linear transformation and activation function to complete the feature embedding and obtain the feature embedding tensor. The dual-attention parallel computation module is used to perform feature attention computation and batch attention computation in parallel based on the feature embedding tensor, resulting in a feature attention-enhanced tensor and a batch attention-enhanced tensor; feature attention captures the parameter correlation within the same sample, while batch attention captures the distribution correlation between samples in the same batch. The pooling layer is used to perform mean pooling on the feature attention enhancement tensor and the batch attention enhancement tensor to obtain parameter dimension pooled features and sample dimension pooled features. The feature fusion layer is used to fuse the parameter-dimensional pooling features with the sample-dimensional pooling features to obtain dual-attention fused features; The regression prediction layer is used to output predicted soil resistivity values ​​based on dual-attention fusion features. The dual-attention prediction model is trained based on standardized soil parameter training samples and their corresponding true soil resistivity values. The prediction unit is used to input the standardized soil parameters to be predicted into the trained dual-attention prediction model, perform model inference, and output the predicted soil resistivity value. The system is used to implement the method according to any one of claims 1 to 8.