Soil heavy metal content spatial distribution prediction method based on genetic algorithm and BP neural network
By applying genetic algorithms and BP neural networks in soil heavy metal pollution detection, the problems of high cost and low efficiency in soil heavy metal pollution detection are solved, efficient and accurate soil heavy metal content distribution prediction is achieved, and field sampling demand is reduced and prediction is improved. reliability and accuracy.
Patent Information
- Application Number
- CN202410753967.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-12
- Publication Date
- 2024-11-15
AI Technical Summary
The prior art has high cost, high time-consuming and low efficiency problems in the detection and prediction of soil heavy metal pollution. In addition, traditional spatial interpolation methods are difficult to effectively deal with the complex relationship between the geographical location and environmental variables of sampling points, and data bias is prone to occur. Distribution and negative or outlier phenomena.
Using a method based on genetic algorithm and BP neural network, the BP evaluation and prediction neural network model is constructed by classifying, encoding and amplifying soil sampled data, combining geographical location and environmental variables to predict, reduce the demand for field sampling and improve prediction Accuracy and reliability.
The spatial distribution prediction of soil heavy metal content based on small sample data is realized, which reduces research costs, improves research efficiency and prediction accuracy, and can more accurately consider the complex relationship between the geographical location of the sampling points and the environmental variables.
Smart Images

Figure CN118966306A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of soil geography, in particular to a method for predicting the spatial distribution of soil heavy metal content based on genetic algorithm and BP neural network. Background Art
[0002] Heavy metal pollution in soil is a global environmental problem that not only affects the ecological function of soil, but may also threaten human health through the food chain. Currently, the detection and prediction of heavy metal content in soil mainly rely on field sampling and laboratory analysis, which is costly, time-consuming and inefficient. In addition, since the distribution of sampling points may be uneven, the representativeness and continuity of the data are limited.
[0003] Traditional studies on soil heavy metal pollution usually use spatial interpolation techniques such as Kriging and inverse distance weighting to predict the distribution of heavy metal content. Although these methods can provide a continuous pollution distribution surface to a certain extent, they have some obvious shortcomings. First, they are limited by the actual situation of the study area, time and cost factors, making large-scale sampling unrealistic. Secondly, the extreme outliers that may exist in the sampling data will cause the overall data to present a skewed distribution, affecting the accuracy of the interpolation results. In addition, it is difficult for traditional interpolation methods to comprehensively consider the complex relationship between the geographical location of the sampling points and environmental variables, and negative values or outliers may appear at the interpolation boundary.
[0004] In order to overcome these limitations, the present invention proposes a method for predicting the spatial distribution of soil heavy metal content based on genetic algorithm and BP neural network, so as to realize the prediction of the spatial distribution of soil heavy metal content based on small sample data, and improve the accuracy and reliability of prediction while reducing the workload of field sampling. Summary of the invention
[0005] The present invention provides a method for predicting the spatial distribution of soil heavy metal content based on genetic algorithm and BP neural network, which specifically comprises the following steps:
[0006] Step 1: Obtain environmental variable data such as heavy metal content, longitude and latitude coordinates, DEM, etc. of the sampling data through soil sampling and testing analysis;
[0007] Step 2: Calculate the distance between each sample point according to the latitude and longitude coordinates of the sampling data, and classify the data according to the distance to obtain several populations;
[0008] Step 3: Encode the heavy metal content, coordinates and other characteristics of all individuals in each population, and use genetic algorithms to generate new individuals;
[0009] Step 4: Construct a BP evaluation neural network model within the population to evaluate the fitness of new individuals and retain excellent individuals. When the number of new individuals reaches the requirement or the number of genetic algorithm iterations is completed, output all new individuals and sample data.
[0010] Step 5: Construct a BP prediction neural network, train the network using large sample data consisting of new individuals and sample data, and use it to predict the heavy metal content at the interpolation point.
[0011] Compared with the prior art, the present invention has the following advantages: first, the genetic algorithm is used to amplify data, effectively solving the spatial interpolation problem under small sample data conditions, and at the same time, the application of BP neural network improves the accuracy and reliability of prediction. In addition, the present method reduces the need for field sampling, reduces research costs, improves research efficiency, and can comprehensively consider the geographical location of the sampling point and the complex relationship between environmental variables, providing a more accurate prediction of the distribution of soil heavy metal content. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] Figure 1 It is a flow chart of a method for predicting the spatial distribution of heavy metal content in soil based on genetic algorithm and BP neural network of the present invention;
[0013] Figure 2 This is a schematic diagram of the structure of the BP evaluation neural network model in step 4 of this method;
[0014] Figure 3 This is a schematic diagram of the structure of the BP prediction neural network in step 5 of this method. DETAILED DESCRIPTION
[0015] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the examples of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, but not all of the embodiments.
[0016] refer to Figure 1 The figure shows a process of a method for predicting the spatial distribution of heavy metal content in soil based on a genetic algorithm and a BP neural network according to an embodiment of the present invention, which specifically includes the following steps:
[0017] Step 1: Field sampling and test analysis to obtain the latitude and longitude, heavy metal content, pH, DEM, slope, and aspect index data of the sample points;
[0018] Step 2: Calculate the distance between sample points based on their longitude and latitude coordinates, use the K-means clustering algorithm to classify the data, and determine the number of classes k. The k value needs to be selected based on the following three indicators: 1) the standard deviation of the geographic location of the sample points within each class is as small as possible; 2) the standard deviation of the geographic location of the sample points between different classes is as large as possible; 3) the number of sample points within each class is as large as possible; the calculation formulas for the three indicators are (1)-(3).
[0019]
[0020] In the above formula, n is the number of sampling points within a single population; Represents the mean of the horizontal coordinates of the sampling points; is the average value of the center coordinates of all populations, and the minimum k that satisfies the three index conditions is taken as the population size to obtain k populations.
[0021] Step 3: In each population, all individuals are binary coded. Using the biological evolution principle of genetic algorithm, new individual data is generated by selecting parents, gene crossover and gene mutation. The characteristic values of new individuals include terrain factors such as longitude and latitude, heavy metal content, pH and elevation;
[0022] Step 4: Construct a BP evaluation neural network model within the population, such as Figure 2 As shown in Figure 1, it is used to evaluate the fitness of new individuals. The sample data and new individual data in each population are used to train the BP evaluation network. The input and output of the BP evaluation network model are terrain factors such as longitude and latitude, heavy metal content, pH and elevation. The fitness is the RMSE between the predicted value and the measured value of the sample point. Only new individuals that do not increase the RMSE value of the model are retained. The hidden layer of the BP evaluation neural network uses the sigmoid function, see formula (4).
[0023]
[0024] The number of hidden layers is determined by the data quality. The output layer uses the poslin function to avoid generating abnormal values, as shown in formula (5):
[0025]
[0026] When the input value is greater than or equal to 0, the output value is guaranteed to be the same as the input value; when the input value is less than 0, the output value is 0 to avoid negative values. When the number of algorithm iterations or the number of new individuals reaches the set standard, the data augmentation part ends.
[0027] Step 5: Construct BP prediction network, such as Figure 3As shown in the figure, it is used to predict the heavy metal content value at the interpolation point. The sample data and the new individual data form a new large sample data set, the large sample data is used to train the BP prediction network, and the model is used to predict the predicted value of the sampling point. According to the prediction results, R and R are calculated. 2 , RMSE and MAE to quantitatively evaluate the performance of the model. Then this network is used to predict the heavy metal content at the interpolation point.
[0028] The input layer of the BP prediction network is terrain factors such as longitude and latitude coordinates and elevation. The number of hidden layers is determined by the data quality. The hidden layer and output layer are sigmoid functions, and the output layer is the heavy metal content used for prediction.
Claims
1. A method for predicting the spatial distribution of soil heavy metal content based on genetic algorithm and BP neural network, characterized in that: The method comprises the following steps: Step 1: Obtain environmental variable data such as heavy metal content, longitude and latitude coordinates, DEM, etc. of the sampling data through soil sampling and testing analysis; Step 2: Calculate the distance between each sample point according to the latitude and longitude coordinates of the sampling data, and classify the data according to the distance to obtain several populations; Step 3: Encode the heavy metal content, coordinates and other characteristics of all individuals in each population, and use genetic algorithms to generate new individuals; Step 4: Construct a BP evaluation neural network model within the population to evaluate the fitness of new individuals and retain excellent individuals. When the number of new individuals reaches the requirement or the number of genetic algorithm iterations is completed, output all new individuals and sample data; Step 5: Construct a BP prediction neural network, train the network using large sample data consisting of new individuals and sample data, and use it to predict the heavy metal content at the interpolation point.
2. The method for predicting the spatial distribution of soil heavy metal content based on genetic algorithm and BP neural network as claimed in claim 1, characterized in that: The classification described in step 2 uses the K-means clustering algorithm.
3. The method for predicting the spatial distribution of soil heavy metal content based on genetic algorithm and BP neural network as claimed in claim 1, characterized in that: The input and output of the BP evaluation neural network model described in step 4 are terrain factors such as longitude and latitude, heavy metal content, pH and elevation, and the number of hidden layers is determined according to the data quality.
4. The method for predicting the spatial distribution of soil heavy metal content based on genetic algorithm and BP neural network as claimed in claim 1, characterized in that: The hidden layer of the BP evaluation neural network model uses the sigmoid function, and the output layer uses the poslin function.
5. The method for predicting the spatial distribution of soil heavy metal content based on genetic algorithm and BP neural network as claimed in claim 1, characterized in that: The input layer of the BP prediction neural network described in step 5 is terrain factors such as latitude and longitude coordinates and elevation, and the number of hidden layers is determined according to the data quality.
6. The method for predicting the spatial distribution of soil heavy metal content based on genetic algorithm and BP neural network as claimed in claim 1, characterized in that: The hidden layer and output layer of the BP prediction network both use the sigmoid function.
Citation Information
Patent Citations
Farmland quality evaluation method and system based on the GA-BP neural network
CN108520345A
Soil heavy metal content spatial interpolation method based on genetic algorithm
CN111209679A
Soil pollutant content interpolation method coupling genetic algorithm and neural network
CN113159219A
Method for predicting small sample soil pollutant distribution by fusing data enhancement and neural network
CN116484698A
Method and system for predicting soil corrosion rate through BP neural network based on genetic algorithm
CN116955946A
Cited By
Intelligent paint degradation prediction method based on LSTM neural network
CN120340667A
An intelligent prediction method for coating degradation based on LSTM neural network
CN120340667B
