Soil resistivity layering prediction method and system based on artificial intelligence
Through the prediction model of the multi-electrode array system and the Transformer algorithm combined with the attention mechanism, the accuracy problem of soil resistivity stratification prediction under complex geological conditions is solved, and more efficient and accurate soil resistivity stratification prediction is achieved.
Patent Information
- Application Number
- CN202510335813.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-20
- Publication Date
- 2025-07-08
AI Technical Summary
The existing soil resistivity measurement and inversion methods are difficult to accurately predict the stratification of soil resistivity under complex geological conditions. The traditional methods are highly dependent on the initial value of the parameters, are complex in calculations and are prone to fall into local optimal solutions, resulting in limited accuracy.
Using the soil resistivity stratified prediction method based on artificial intelligence, the apparent resistivity data is obtained through a multi-electrode array system, and pre-processing and feature extraction are carried out in combination with soil-related information, and a prediction model that integrates the Transformer algorithm and attention mechanism is constructed for training and prediction.
It improves the accuracy and efficiency of soil resistivity stratification prediction, and can more accurately obtain resistivity information of soils at different depths, providing reliable data support for related fields.
Smart Images

Figure CN120277887A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a method and system for predicting soil resistivity stratification based on artificial intelligence, belonging to the technical field of soil resistivity prediction. Background Art
[0002] In many fields such as the design of power engineering grounding systems, geological exploration, and agricultural soil research, accurately obtaining the stratification information of soil resistivity is crucial. Traditional soil resistivity measurement and inversion methods, such as derivative-based methods (steepest descent method, Newton method, etc.) and direct search methods (genetic algorithm, etc.), have many limitations. Although derivative-based methods have a relatively fast convergence speed, they are extremely dependent on the selection of the initial parameter values. Solving complex partial derivatives increases the computational amount and complexity, and it is easy to fall into local optimal solutions. Although direct search methods are easy to operate and do not require the calculation of partial derivatives, the search speed is slow, and they are also prone to falling into local optima, resulting in limited accuracy of the inversion results. When facing the soil structure under complex geological conditions, the existing methods are difficult to accurately predict the soil resistivity stratification and cannot meet the needs of actual engineering and research.
[0003] The Chinese invention patent with the patent number "CN115755201A" discloses a method for calculating the apparent resistivity of a towed transient electromagnetic field based on a neural network model. The invention preprocesses the transient electromagnetic data collected historically through a data preprocessing module to generate the input data of the neural network; constructs training data through a training data construction module to determine the training sample set of the network, and calculates the theoretical apparent resistivity value; the network model construction and training module uses the training data constructed by the training data construction module, and the trained neural network is used as the network model for subsequent apparent resistivity calculation; in actual use, the original data of the induced electromotive force collected at each measuring point is preprocessed and then input into the trained neural network to obtain the apparent resistivity value, and the apparent resistivity and depth calculation module can quickly calculate the apparent resistivity values at different depths through the obtained apparent resistivity value.
[0004] The above solution does not consider that soil information will also affect the measurement of resistivity values, so the actual resistivity measurement values are not accurate. Summary of the Invention
[0005] In order to solve the problems existing in the above-mentioned prior art, the present invention proposes a method and system for predicting soil resistivity stratification based on artificial intelligence. Through innovative algorithm design and data processing methods, the accuracy and efficiency of soil resistivity stratification prediction are improved, the defects of traditional methods are overcome, and the resistivity information of soils at different depths can be obtained more accurately, providing reliable data support for related fields.
[0006] The technical solution of the present invention is as follows:
[0007] On the one hand, the present invention proposes an artificial intelligence-based method for predicting soil resistivity stratification, comprising the following steps:
[0008] Measure the soil resistivity of the target area with different measurement parameters to obtain apparent resistivity data under different measurement parameters, and simultaneously collect soil-related information, where the soil-related information includes soil depth data;
[0009] Preprocess the apparent resistivity data and soil-related information under different measurement parameters, and use correlation analysis to extract features from the soil-related information to obtain soil feature data;
[0010] Put the preprocessed apparent resistivity data and soil feature data into the training sample set as training samples;
[0011] Construct a prediction model that combines the Transformer algorithm and the attention mechanism. The prediction model includes an input layer, a Transformer encoder layer, an attention layer, and an output layer. The input layer is used to receive input data, the Transformer encoder layer is used to extract features from the input data through the multi-head self-attention mechanism, the attention layer is used to calculate the importance weights of each feature, and the output layer is used to output resistivity prediction data; Input the training sample set into the prediction model to train the prediction model to obtain a trained soil resistivity prediction model;
[0012] Obtain the soil-related information of the soil to be measured, preprocess it and input it into the trained soil resistivity prediction model to obtain the soil resistivity prediction results at different soil depths.
[0013] As a preferred embodiment, the step of measuring the soil resistivity of the target area with different measurement parameters to obtain apparent resistivity data under different measurement parameters is specifically:
[0014] Measure the soil resistivity of the target area through a multi-electrode array system to obtain apparent resistivity data under different pole distances.
[0015] As a preferred embodiment, the soil-related information includes soil depth data, soil water content data, soil temperature data, soil humidity data, soil pH value, soil mineral content data, soil organic matter content data, soil pore data, soil type data, and soil parent material data;
[0016] The step of preprocessing the apparent resistivity data and soil-related information under different measurement parameters includes:
[0017] For the apparent resistivity data, use the moving average filtering method to denoise, and the specific formula is:
[0018]
[0019] Among them, is the i-th apparent resistivity data after filtering, and ρ a,j is the corresponding original apparent resistivity data, and n is the size of the sliding window;
[0020] For the numerical data in the soil-related information, it is mapped to the interval of [0, 1] through normalization processing;
[0021] For the non-numerical data in the soil-related information, it is processed through one-hot encoding and transformed into a numerical vector.
[0022] As a preferred implementation manner, the step of using correlation analysis to extract features from the soil-related information to obtain soil feature data is specifically as follows:
[0023] Calculate the mean vector of the soil-related information:
[0024]
[0025] Among them, is the mean vector of the soil-related information, and P represents the total number of soil-related information; s p represents the p-th soil-related information;
[0026] Calculate the feature mean of each type of data in the soil-related information:
[0027]
[0028] Among them, represents the k-th type of data in the p-th soil-related information; represents the feature mean of the k-th type of data;
[0029] Calculate the correlation of each type of data according to the mean vector of the soil-related information and the feature mean of each type of data in the soil-related information:
[0030]
[0031] Among them, r k represents the correlation coefficient of the k-th type of data;
[0032] Screen the type of data whose correlation coefficient is within the preset interval range as the soil feature data.
[0033] As a preferred implementation manner, the steps of the Transformer encoder layer extracting features from the input data through the multi-head self-attention mechanism include:
[0034] For any input data, use the preprocessed soil depth data as the query vector, the preprocessed apparent resistivity data as the value vector, and the preprocessed soil feature data as the key vector for multi-head attention calculation. The specific formula is as follows:
[0035]
[0036] MultiHead(Q,K,V)=Concat(head1,…,head h )W O ;
[0037] where head i represents the output of the i-th attention head, Attention(·) represents the attention mechanism function, Q, K, and V are the input query vector, key vector, and value vector respectively, W i Q 、W i K 、W i V are the query vector weight parameter, key vector weight parameter, and value vector weight parameter of the i-th attention head respectively, softmax(·) is the normalization function, T represents the transpose, d k is the dimension of the key vector, MultiHead(·) represents the multi-head attention vector concatenation function, Concat(·) represents the vector concatenation operation, h represents the number of attention heads, and W O is the linear transformation matrix.
[0038] As a preferred implementation, the specific steps for the attention layer to calculate the importance weight of each feature are as follows:
[0039] For each feature in the soil feature data;
[0040] Compress each feature into a real number through global average pooling;
[0041] For each feature, calculate an importance weight through two fully connected layers and the corresponding real number and assign it to the corresponding feature.
[0042] As a preferred implementation, in the step of training the prediction model:
[0043] Construct the following loss function to calculate the loss:
[0044]
[0045] where s q represents the true value of the q-th resistivity data, represents the q-th resistivity prediction data, and Q represents the total number of resistivity data;
[0046] And the Adam optimization algorithm and the Dropout algorithm are used to optimize the prediction model during the training process.
[0047] On the other hand, the present invention also proposes an artificial intelligence-based soil resistivity stratified prediction system, including:
[0048] A data acquisition module, which is used to measure the soil resistivity of a target area with different measurement parameters, obtain apparent resistivity data under different measurement parameters, and simultaneously collect soil-related information, where the soil-related information includes soil depth data;
[0049] A preprocessing module, which is used to preprocess the apparent resistivity data and soil-related information under different measurement parameters, extract features from the soil-related information by using correlation analysis to obtain soil feature data; and put the preprocessed apparent resistivity data and soil feature data into a training sample set as training samples;
[0050] A model training module, which is used to construct a prediction model integrating the Transformer algorithm and the attention mechanism. The prediction model includes an input layer, a Transformer encoder layer, an attention layer, and an output layer. The input layer is used to receive input data, the Transformer encoder layer is used to extract features from the input data through the multi-head self-attention mechanism, the attention layer is used to calculate the importance weights of each feature, and the output layer is used to output resistivity prediction data; input the training sample set into the prediction model to train the prediction model to obtain a trained soil resistivity prediction model;
[0051] A soil resistivity stratified prediction module, which is used to obtain the soil-related information of the soil to be measured, preprocess it and then input it into the trained soil resistivity prediction model to obtain the soil resistivity prediction results at different soil depths.
[0052] In yet another aspect, the present invention also proposes an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, it implements the method according to any embodiment of the present invention.
[0053] In yet another aspect, the present invention also proposes a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, it implements the method according to any embodiment of the present invention.
[0054] The additional aspects and advantages of the present invention will be set forth in the following description, and some of them will be obvious from the description, or can be learned by practicing the present invention. In addition, the various aspects and advantages of the present invention can be realized and obtained by the method steps and combinations specifically pointed out in the appended claims. Description of the Drawings
[0055] Figure 1 This is a schematic flowchart of the method according to the first embodiment of the present invention. Specific implementation manner
[0056] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0057] It should be understood that the step numbers used in the text are only for convenient description and do not limit the order of execution of the steps.
[0058] It should be understood that the terms used in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include the plural forms.
[0059] The terms "comprising" and "including" indicate the presence of the described features, wholes, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or their combinations.
[0060] The term " / or" refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0061] Embodiment 1:
[0062] Refer to Figure 1 , this embodiment proposes a method for predicting soil resistivity stratification based on artificial intelligence, including the following steps:
[0063] S100. Measure the soil resistivity of the target area with different measurement parameters to obtain the apparent resistivity data under different measurement parameters, and simultaneously collect soil-related information, where the soil-related information includes soil depth data.
[0064] In this embodiment, specifically, we used a multi-electrode array system to measure the soil resistivity of the target area. In a specific power engineering construction area, the multi-electrode array system was used to measure the soil resistivity at different pole distances (such as 1 meter, 5 meters, 10 meters, 20 meters, 50 meters, 100 meters, etc.), and a total of 100 apparent resistivity data at different positions were obtained. In addition, in order to more comprehensively understand the physical and chemical properties of the soil, this embodiment also carried out the collection of other relevant information. These information include the depth of the soil (range 0 - 5 meters, accurate to 0.1 meter), water content (specific value measured by the drying method), soil temperature data, soil humidity data, soil pH value, soil mineral content data, soil organic matter content data, soil pore data, soil type data, and soil parent material data. By integrating these data, we can more accurately evaluate the soil condition and provide a scientific basis for subsequent agricultural cultivation, environmental monitoring, or engineering construction.
[0065] S200. Preprocess the apparent resistivity data and soil-related information under different measurement parameters, and use correlation analysis to extract features from the soil-related information to obtain soil feature data;
[0066] Put the preprocessed apparent resistivity data and soil feature data into the training sample set as training samples.
[0067] Specifically, in this embodiment, the step of preprocessing the apparent resistivity data and soil-related information under different measurement parameters includes:
[0068] For the apparent resistivity data, the sliding average filtering method is used for denoising, and the specific formula is:
[0069]
[0070] Where is the i-th apparent resistivity data after filtering, ρ a,j is the corresponding original apparent resistivity data, n is the size of the sliding window, and in this embodiment, the sliding window size n = 3 is selected.
[0071] For numerical data such as soil depth and soil water content, map them to the interval [0, 1] through normalization processing, and the formula is:
[0072]
[0073] Where x norm is the normalized numerical value, x is the original numerical value, x max and x min are the maximum and minimum values of this numerical value respectively.
[0074] For non - numerical data such as soil types, it is processed through one - hot encoding and transformed into a numerical vector. For example, clay is encoded as [1, 0, 0], sandy soil is encoded as [0, 1, 0], and loam soil is encoded as [0, 0, 1].
[0075] Specifically, in this embodiment, the step of using correlation analysis to extract features from the soil - related information to obtain soil feature data is specifically as follows:
[0076] Calculate the mean vector of the soil - related information:
[0077]
[0078] Among them, The mean vector of the soil - related information, \(P\) represents the total number of soil - related information; \(s_p\) p represents the \(p\) - th soil - related information;
[0079] Calculate the feature mean of each type of data in the soil - related information:
[0080]
[0081] Among them, \(x_{p,k}\) represents the \(k\) - th type of data in the \(p\) - th soil - related information; \(\overline{x}_k\) represents the feature mean of the \(k\) - th type of data;
[0082] Calculate the correlation of each type of data according to the mean vector of the soil - related information and the feature mean of each type of data in the soil - related information:
[0083]
[0084] Among them, \(r_{k}\) k represents the correlation coefficient of the \(k\) - th type of data;
[0085] Select the type of data whose correlation coefficient is within the preset interval range as the soil feature data.
[0086] S300. Build a prediction model that integrates the Transformer algorithm and the attention mechanism using the Python programming language and a deep learning framework (such as PyTorch). The prediction model includes an input layer, a Transformer encoder layer, an attention layer, and an output layer. The input layer is used to integrate the preprocessed data and input it into the model. The Transformer encoder layer is used to extract features from the input data through the multi-head self-attention mechanism, capturing the long-range dependencies between different-depth soil resistivity data and the associations with other soil properties. Based on the output of the Transformer encoder layer, further calculate the importance weights of each feature to highlight the data features that play a key role in the stratified prediction of soil resistivity, enabling the model to focus more on important information. The output layer is used to make predictions through a fully connected layer based on the features extracted by the Transformer encoder layer and the attention layer, and output the predicted values of soil resistivity at different soil depths. Input the training sample set into the prediction model to train the prediction model and obtain a trained soil resistivity prediction model. The trained soil resistivity prediction model can automatically predict the resistivity of the soil at different depths based on the input soil parameters, such as depth, water content, type, etc. During the training process, the model continuously adjusts the parameters to minimize the error between the prediction result and the real resistivity data. To evaluate the performance of the model, the test sample set can be input into the trained model, and the prediction result can be compared with the real resistivity data to calculate metrics such as the error rate.
[0087] S400. Obtain the soil-related information of the soil to be measured, preprocess it, and input it into the trained soil resistivity prediction model to obtain the predicted results of soil resistivity at different soil depths. The soil-related information of the soil to be measured may include, but is not limited to, the geographical location of the soil, soil type, soil depth, soil water content, soil temperature, etc. This information can be obtained through on-site measurement, laboratory analysis, database query, or other means. The trained soil resistivity prediction model can quickly and accurately predict the resistivity of the soil at different depths based on the input soil parameters. By obtaining the predicted results of soil resistivity at different soil depths, the electrical properties of the soil can be further analyzed, providing a basis for fields such as soil improvement, engineering construction, and environmental monitoring.
[0088] As a preferred implementation manner of this embodiment, the step of the Transformer encoder layer extracting features from the input data through the multi-head self-attention mechanism includes:
[0089] For any input data, perform multi-head attention calculation using the preprocessed soil depth data as the query vector, the preprocessed apparent resistivity data as the value vector, and the preprocessed other soil feature data as the key vector. The specific formula is:
[0090]
[0091] MultiHead(Q, K, V) = Concat(head1, …, head h )W O ;
[0092] where headi i represents the output of the i-th attention head, Attention(·) represents the attention mechanism function, Q, K, and V are the input query vector, key vector, and value vector respectively, and W i Q , W i K , W i V are the query vector weight parameter, key vector weight parameter, and value vector weight parameter of the i-th attention head respectively, softmax(·) is the normalization function, T represents the transpose, d k is the dimension of the key vector, MultiHead(·) represents the multi-head attention vector concatenation function, Concat(·) represents the vector concatenation operation, h represents the number of attention heads, and W O is the linear transformation matrix. In this embodiment, the number of heads h of the Transformer encoder layer is set to 8, the dimension d k of the key vector is set to 64, and a dropout layer is added between the attention layer and the fully connected layer, and the dropout probability is set to 0.2. The preprocessed data is divided into a training set at 70% and a test set at 30%.
[0093] As a preferred implementation manner of this embodiment, the specific steps for the attention layer to calculate the importance weight of each feature are as follows:
[0094] For each feature in the soil feature data;
[0095] Each feature is compressed into a real number through global average pooling;
[0096] For each feature, an importance weight is calculated through two fully connected layers and the corresponding real number and assigned to the corresponding feature.
[0097] As a preferred implementation manner of this embodiment, in the step of training the prediction model:
[0098] Construct the following loss function to calculate the loss:
[0099]
[0100] where s q represents the true value of the q-th resistivity data, denotes the q-th resistivity prediction data, and Q represents the total number of resistivity data;
[0101] And use the Adam optimization algorithm with an adaptive learning rate to train the model. During the training process, continuously adjust the model's parameters to gradually reduce the loss function, thereby improving the prediction accuracy of the model. The initial learning rate for training is set to 0.001, train for 100 epochs, and verify the performance of the model on the test set every 5 epochs of training. Observe the change in the loss function value. Stop training when the loss function no longer decreases, and save the trained model.
[0102] At the same time, to prevent the model from overfitting, adopt the Dropout technique. During the training process, randomly discard a part of the neurons to reduce the mutual dependence between neurons and enhance the generalization ability of the model.
[0103] After the model training is completed, multiple evaluation metrics can be used to evaluate the prediction results. In addition to the mean square error, the mean absolute error (MAE) and the coefficient of determination R 2 and other metrics can also be used. Through these evaluation metrics, the prediction performance of the model can be comprehensively and accurately evaluated. If the prediction performance does not meet the requirements, adjust the model parameters or re-perform data preprocessing and then train the model again until a satisfactory prediction effect is achieved.
[0104] Based on the above technical solutions, in this embodiment, by integrating the Transformer and the attention mechanism, it is possible to effectively capture the complex features and long-distance dependence relationships in the soil resistivity data. At the same time, the attention mechanism enables the model to focus more on key information, significantly improving the accuracy of soil resistivity stratification prediction compared with traditional methods and the algorithms in the papers.
[0105] Embodiment Two:
[0106] This embodiment proposes an artificial intelligence-based soil resistivity stratification prediction system, including:
[0107] A data acquisition module for measuring the soil resistivity of the target area with different measurement parameters to obtain the apparent resistivity data under different measurement parameters, and at the same time collecting soil-related information, where the soil-related information includes soil depth data; this module is used to implement the function of step S100 in Embodiment One, which will not be elaborated here;
[0108] A preprocessing module for preprocessing the apparent resistivity data and soil-related information under different measurement parameters, extracting features from the soil-related information using correlation analysis to obtain soil feature data; putting the preprocessed apparent resistivity data and soil feature data into the training sample set as training samples; this module is used to implement the function of step S200 in Embodiment One, which will not be elaborated here;
[0109] A model training module is used to build a prediction model that integrates the Transformer algorithm and the attention mechanism. The prediction model includes an input layer, a Transformer encoder layer, an attention layer, and an output layer. The input layer is used to receive input data. The Transformer encoder layer is used to extract features from the input data through the multi-head self-attention mechanism. The attention layer is used to calculate the importance weights of each feature. The output layer is used to output the resistivity prediction data. The training sample set is input into the prediction model to train the prediction model, and a trained soil resistivity prediction model is obtained. This module is used to implement the function of step S300 in the first embodiment and will not be elaborated here.
[0110] A soil resistivity stratified prediction module is used to obtain the soil-related information of the soil to be measured, preprocess it, and then input it into the trained soil resistivity prediction model to obtain the soil resistivity prediction results at different soil depths. This module is used to implement the function of step S400 in the first embodiment and will not be elaborated here.
[0111] Embodiment 3:
[0112] This embodiment provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, it implements the artificial intelligence-based soil resistivity stratified prediction method described in any embodiment of the present invention.
[0113] Embodiment 4:
[0114] This embodiment provides a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, it implements the artificial intelligence-based soil resistivity stratified prediction method described in any embodiment of the present invention.
[0115] In the embodiments of the present application, "at least one" means one or more, and "a plurality" means two or more. "And / or" describes the association relationship of associated objects and indicates that three relationships can exist. For example, A and / or B can represent the situation of A existing alone, A and B existing simultaneously, and B existing alone. Where A and B can be singular or plural. The character " / " generally represents an "or" relationship between the associated objects before and after. "At least one of the following" and its similar expressions refer to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, and c can represent: a, b, c, a and b, a and c, b and c, or a and b and c, where a, b, and c can be single or multiple.
[0116] Those of ordinary skill in the art can realize that the units and algorithm steps described in the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of electronic hardware. Whether these functions are executed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.
[0117] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the systems, devices, and units described above can refer to the corresponding processes in the foregoing method embodiments and will not be elaborated herein.
[0118] In several embodiments provided by this application, if any function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of this application. The foregoing storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROM), random access memories (RAM), magnetic disks, or optical discs.
[0119] The above are only the embodiments of the present invention, and thus do not limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made by using the content of the specification and drawings of the present invention, or directly or indirectly applied in other related technical fields, shall be equally included in the patent protection scope of the present invention.
Claims
1. An artificial intelligence-based method for predicting soil resistivity stratification, characterized in that, It includes the following steps: Measure the soil resistivity of the target area with different measurement parameters to obtain apparent resistivity data under different measurement parameters, and simultaneously collect soil-related information, where the soil-related information includes soil depth data; Preprocess the apparent resistivity data and soil-related information under different measurement parameters, and use correlation analysis to extract features from the soil-related information to obtain soil feature data; Put the preprocessed apparent resistivity data and soil feature data into the training sample set as training samples; Construct a prediction model that fuses the Transformer algorithm and the attention mechanism. The prediction model includes an input layer, a Transformer encoder layer, an attention layer, and an output layer. The input layer is used to receive input data, the Transformer encoder layer is used to extract features from the input data through the multi-head self-attention mechanism, the attention layer is used to calculate the importance weights of each feature, and the output layer is used to output resistivity prediction data; input the training sample set into the prediction model to train the prediction model to obtain a trained soil resistivity prediction model; Obtain the soil-related information of the soil to be measured, preprocess it and then input it into the trained soil resistivity prediction model to obtain the soil resistivity prediction results at different soil depths.
2. The method for predicting the stratification of soil resistivity based on artificial intelligence according to claim 1, wherein The step of measuring the soil resistivity of the target area with different measurement parameters to obtain apparent resistivity data under different measurement parameters is specifically: Measure the soil resistivity of the target area through a multi-electrode array system to obtain apparent resistivity data under different pole spacings.
3. The method for predicting the layered soil resistivity based on artificial intelligence according to claim 1, characterized in that The soil-related information includes soil depth data, soil water content data, soil temperature data, soil humidity data, soil pH value, soil mineral content data, soil organic matter content data, soil pore data, soil type data, and soil parent material data; The step of preprocessing the apparent resistivity data and soil-related information under different measurement parameters includes: For the apparent resistivity data, use the moving average filtering method to denoise, and the specific formula is: Among them, is the i-th apparent resistivity data after filtering, and ρ a,j is the corresponding original apparent resistivity data, and n is the size of the sliding window; For the numerical data in the soil-related information, map it to the interval of [0,1] through normalization processing; For the non-numerical data in the soil-related information, process it through one-hot encoding and convert it into a numerical vector.
4. A method for predicting the layering of soil resistivity based on artificial intelligence according to claim 1, characterized in that The step of using correlation analysis to extract features from the soil-related information to obtain soil feature data is specifically: Calculate the mean vector of the soil-related information: Among them, the mean vector of soil-related information, and P represents the total number of soil-related information; s p represents the p-th soil-related information; Calculate the feature mean of each type of data in the soil-related information: Among them, represents the k-th type of data in the p-th soil-related information; represents the characteristic mean of the k-th type of data; Calculate the correlation of each type of data according to the mean vector of the soil-related information and the feature mean of each type of data in the soil-related information: where r k represents the correlation coefficient of the k-th type of data; Select the type of data whose correlation coefficient is within the preset interval range as the soil feature data.
5. The method for predicting the layered soil resistivity based on artificial intelligence according to claim 4, characterized in that, The step of the Transformer encoder layer extracting features from the input data through the multi-head self-attention mechanism includes: For any input data, use the preprocessed soil depth data as the query vector, the preprocessed apparent resistivity data as the value vector, and other soil feature data as the key vector for multi-head attention calculation. The specific formula is: MultiHead(Q,K,V)=Concat(head1,…,head h )W O ; Among them, head i represents the output of the i-th attention head, Attention(·) represents the attention mechanism function, Q, K, and V are the input query vector, key vector, and value vector respectively, and W i Q , W i K , W i V are the query vector weight parameter, key vector weight parameter, and value vector weight parameter of the i-th attention head respectively, softmax(·) is the normalization function, T represents the transpose, d k is the dimension of the key vector, MultiHead(·) represents the multi-head attention vector concatenation function, Concat(·) represents the vector concatenation operation, h represents the number of attention heads, and W O is the linear transformation matrix.
6. The method for predicting the layered soil resistivity based on artificial intelligence according to claim 4, wherein, The specific steps for the attention layer to calculate the importance weight of each feature are as follows: For each feature in the soil feature data; Through global average pooling, each feature is compressed into a real number; For each feature, an importance weight is calculated through two fully connected layers and the corresponding real number and assigned to the corresponding feature.
7. A method for predicting soil resistivity stratification based on artificial intelligence according to claim 1, characterized in that In the step of training the prediction model: Construct the following loss function to calculate the loss: where s q represents the true value of the q-th resistivity data, represents the q-th resistivity prediction data, and Q represents the total number of resistivity data; And use the Adam optimization algorithm and the Dropout algorithm to optimize the prediction model during training.
8. An artificial intelligence-based soil resistivity stratified prediction system, characterized in that, Including: A data acquisition module, which is used to measure the soil resistivity of the target area with different measurement parameters to obtain the apparent resistivity data under different measurement parameters, and at the same time collect soil-related information, where the soil-related information includes soil depth data; A preprocessing module, which is used to preprocess the apparent resistivity data and soil-related information under different measurement parameters, and perform feature extraction on the soil-related information by using correlation analysis to obtain soil feature data; Put the preprocessed apparent resistivity data and soil feature data into the training sample set as training samples; A model training module, which is used to construct a prediction model integrating the Transformer algorithm and the attention mechanism. The prediction model includes an input layer, a Transformer encoder layer, an attention layer, and an output layer. The input layer is used to receive input data, the Transformer encoder layer is used to perform feature extraction on the input data through the multi-head self-attention mechanism, the attention layer is used to calculate the importance weight of each feature, and the output layer is used to output the resistivity prediction data; input the training sample set into the prediction model to train the prediction model to obtain a trained soil resistivity prediction model; A soil resistivity stratified prediction module, which is used to obtain the soil-related information of the soil to be measured, preprocess it and then input it into the trained soil resistivity prediction model to obtain the soil resistivity prediction results at different soil depths.
9. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the artificial intelligence-based soil resistivity stratified prediction method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the artificial intelligence-based soil resistivity stratified prediction method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Pull-type transient electromagnetic apparent resistivity calculation method based on neural network model
CN115755201A
