Soil heavy metal detection method based on multi-element intelligence optimized multi-kernel extreme learning machine

By optimizing the multi-core extreme learning machine method with multiple intelligence, the problems of redundant spectral variables and collinearity in soil heavy metal detection were solved, the detection precision and accuracy were improved, and fast and accurate heavy metal content detection was achieved.

CN115169222BActive Publication Date: 2025-10-10CHINA THREE GORGES UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210706800.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-21
Publication Date
2025-10-10
Estimated Expiration
2042-06-21

AI Technical Summary

Technical Problem

Redundant spectral variables and collinearity problems exist in soil heavy metal detection, which affect the accuracy of X-ray fluorescence spectrometry analysis.

Method used

The multi-core extreme learning machine method is optimized by multiple intelligence. The spectral feature variables are selected through a competitive adaptive reweighting algorithm. The regularization coefficient, kernel function parameters and weight coefficient are optimized using particle swarm and ant lion optimization algorithms to establish a multi-core extreme learning machine model.

Benefits of technology

The precision and accuracy of soil heavy metal detection are improved, fast and accurate heavy metal content detection is achieved, the spectral dimension is reduced and the reliability and prediction accuracy of the model are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115169222B_ABST
    Figure CN115169222B_ABST
Patent Text Reader

Abstract

The application discloses a soil heavy metal detection method based on multi-element intelligence optimized multi-kernel extreme learning machine, which comprises the following steps: step 1, collecting X-ray fluorescence spectrum data and heavy metal content values of soil samples, constructing a sample set, and dividing the sample set into a training sample set and a test sample set; step 2, pre-processing the sample set or to-be-detected spectrum information; step 3, selecting spectrum characteristic variables from the pre-processed spectrum data, and taking the spectrum data corresponding to the characteristic variables as new training sample sets and test sample sets; step 4, establishing a multi-kernel extreme learning machine, taking the data in the training set as the input of the multi-kernel extreme learning machine, and taking the soil heavy metal content in the training set as the output of the extreme learning machine; step 5, training the multi-kernel extreme learning machine by using the optimized regularization coefficient C, kernel function parameter S and weight coefficient W, obtaining a soil heavy metal detection model, and inputting the test set into the detection model to obtain the predicted value of the heavy metal.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of soil heavy metal detection, and specifically relates to a soil heavy metal detection method using a multi-core extreme learning machine optimized by multiple intelligence. Background Art

[0002] With the rapid development of X-ray instrumentation and chemometric methods, X-ray spectroscopy has gained widespread application in heavy metal detection. Compared with traditional methods, X-ray fluorescence spectroscopy offers advantages such as strong penetration, no need for complex pretreatment, no sample damage, and in-situ and online detection. Therefore, it is widely used for the rapid analysis of complex samples in fields such as metallurgy, medicine, and soil.

[0003] However, due to the complexity and diversity of the soil background, the actual soil sample spectra usually contain redundant spectral variables with a large amount of redundant information, and there is a relatively serious collinearity relationship between the spectral variables. Therefore, it is necessary to eliminate the redundant spectral variables in the spectrum and select the spectral variables representing the sample property characteristics instead of the full spectrum to establish a quantitative model to improve the accuracy of X-ray fluorescence spectral analysis.

[0004] The competitive adaptive reweighted sampling algorithm, based on the survival of the fittest principle in evolutionary theory, has been widely used in the field of characteristic spectral variable screening due to its advantages, such as fast computational speed and a small number of characteristic spectral variables to be screened. The kernel extreme learning machine (KELM) is an improved algorithm based on the extreme learning machine (ELM) and combined with a kernel function. It replaces the random initialization of the ELM's hidden layer parameters. However, in addition to the KELM's inherent regularization parameter selection issues, the existence of the kernel function also requires joint tuning of some KELM parameters. Therefore, the use of a multivariate intelligence optimization algorithm to optimize the parameters of multi-kernel extreme learning machines is considered to improve prediction accuracy. Summary of the Invention

[0005] The purpose of this invention is to propose a method for detecting heavy metals in soil using a multi-core extreme learning machine to improve the accuracy of X-ray fluorescence spectroscopy analysis and thus improve the precision of soil heavy metal detection.

[0006] A soil heavy metal detection method based on multi-core extreme learning machine optimization using multiple intelligence includes the following steps:

[0007] Step 1: Collect X-ray fluorescence spectrum data and heavy metal content values ​​of soil samples, construct a sample set, and divide the sample set into a training sample set and a test sample set;

[0008] Step 2: Preprocess the sample set or the spectral information to be detected;

[0009] Step 3: Select spectral feature variables for the preprocessed spectral data, and use the spectral data corresponding to the feature variables as new training sample sets and test sample sets;

[0010] Step 4: Establish a multi-core extreme learning machine, use the data in the training set as the input of the multi-core extreme learning machine, and use the soil heavy metal content in the training set as the output of the extreme learning machine;

[0011] Step 5: Use the optimized regularization coefficient C, kernel function parameter S and weight coefficient W to train the multi-core extreme learning machine to obtain the soil heavy metal detection model. Input the test set into the detection model to obtain the predicted value of heavy metals.

[0012] In step 1, the sample set is constructed, a number of soil samples with a predetermined concentration range are configured, the heavy metal content value y of each sample is measured, and the X-ray fluorescence spectrum information x = [x1, x2, ..., x m ], randomly divide the sample set into training set and test set.

[0013] In step 3, a competitive adaptive reweighting algorithm is used to select spectral feature variables from the preprocessed spectral data, which includes the following sub-steps:

[0014] Step 3.1: Initialize the Monte Carlo sampling times N, and let the initial X-ray fluorescence spectrum characteristic variable v sel _ old =[1,2,…,m], set the sampling counter count=1;

[0015] Step 3.2: If count is greater than N, go to step 3.7. Otherwise, use the Monte Carlo method to extract a certain proportion of samples from the training set as a sub-training set, and use the spectral feature variable v sel_old Build a PLS model;

[0016] y=xb+e

[0017] Among them, y is the heavy metal concentration value, x is the spectral data corresponding to the heavy metal spectral characteristic variable, b is the spectral coefficient, and e is the prediction error

[0018] Step 3.3: Calculate v sel_old The weight w of each spectral feature variable in;

[0019]

[0020] Among them, w i is the weight of the i-th spectral characteristic variable, b i is the coefficient of the i-th spectrum, and p is the number of spectral characteristic variables

[0021] Step 3.4: Calculate the exponentially decreasing function value rcount , retain the spectral feature variable weight w greater than r count characteristic variables;

[0022] r count =ae -kcount ,count=1,2,3,…,N

[0023] a=(p / 2) 1 / (N-1)

[0024]

[0025] Among them, r count is the exponentially decreasing function value of the count-th sampling, a and k are two constants, and N is the number of sampling times

[0026] Step 3.5: Use the competitive adaptive reweighting algorithm to realize the competitive selection of spectral characteristic variables. Retain a certain proportion of characteristic variables from the characteristic variable subset obtained in step 3.4, denoted as v sel _ new ;

[0027] Step 3.6: Using v sel_new Calculate RMSECV, let v sel_old =v sel_new , count=count+1, go to step 3.1;

[0028] Step 3.7: Obtain N spectral feature variable sets and N RMSECVs;

[0029] Step 3.8: Select the spectral feature variable corresponding to the minimum RMSECV value during the sampling process as the spectral feature variable selection result.

[0030] In step 4, when establishing a multi-core extreme learning machine, the following sub-steps are included:

[0031] Step 4.1: Use the particle swarm optimization algorithm to optimize the regularization coefficient C and kernel function parameter S of the extreme learning machine with different kernel functions, and determine the regularization parameter C and kernel function parameter S of the extreme learning machine under different kernel functions based on the global optimal particle;

[0032] Step 4.2: Use the ant lion optimization algorithm to optimize the weight coefficient W of the multi-core extreme learning machine, and determine the weight coefficient W of the multi-core extreme learning machine according to the global optimal ant lion solution.

[0033] Use the above steps to build a multi-core extreme learning machine;

[0034] Among them, the multi-core extreme learning machine F(x) is:

[0035]

[0036] wherein k is a kernel function type, K k () represents a kernel function of type k, W k is a weight coefficient of the k kernel extreme learning machine, x' is the training sample spectral data, x i ' is the i-th training sample spectral data, y is the real value of the training sample heavy metal content, n is the number of training samples, I is an identity matrix, and C is a regularization coefficient;

[0037] The kernel function types are as follows:

[0038]

[0039] wherein S is a vector representing the kernel function parameters to be optimized; S(i) is the i-th parameter of the kernel function.

[0040] In step 4.1, the following sub-steps are included:

[0041] Step 4.1.1: Select the kernel function type k of the kernel extreme learning machine, set the particle dimension D, the population size N, the maximum number of iterations G, the inertia weight w, the acceleration coefficients c1 and c2, and initialize the particle position initial value x i (0) and the particle velocity initial value v i (0) , i = 1, 2,..., N, set the historical optimal solution pBest of the particle to the initial position, and set the iteration number t = 1;

[0042]

[0043] Step 4.1.2: Establish a kernel extreme learning machine according to the current particle swarm, take the spectral data corresponding to the characteristic variables selected in step 3 as the input of the kernel extreme learning machine, take the soil heavy metal content in the training sample set as the output of the kernel extreme learning machine, calculate the mean square error fitness between the prediction result and the soil heavy metal content in the training sample set, and take it as the fitness value of the particle swarm, and record the particle position corresponding to the minimum fitness value as the initial global optimal solution gBest;

[0044]

[0045] wherein y is the predicted value of the heavy metal content with the kernel function type i, and y is the real value of the training sample heavy metal content

[0046] Step 4.1.3: Determine whether the current iteration number t reaches the maximum iteration number G, if yes, execute step 4.1.7, otherwise, execute step 4.1.4;

[0047] Step 4.1.4: Update particle velocity v i (t) and position x i (t) ;

[0048]

[0049]

[0050]

[0051] Among them, rand, rand1, rand2 are 0-1 random numbers, w is the inertia weight, c1 and c2 are acceleration coefficients, is the velocity of particle i at time t, is the velocity of particle i at time t-1, is the position of particle i at time t, is the position of particle i at time t-1, pBest i is the historical optimal solution of particle i, gBest is the current global optimal solution;

[0052] Step 4.1.5: Calculate the fitness value of the new particle swarm and update the current global optimal solution gBest;

[0053] Step 4.1.6: t = t + 1, return to step 4.1.3;

[0054] Step 4.1.7: Determine the regularization parameter C and kernel function parameter S based on the global optimal value;

[0055] Step 4.1.8: If there are kernel function types that need to be optimized, go to step 4.1.1, otherwise end.

[0056] In step 4.2, the following sub-steps are included:

[0057] Step 4.2.1: Set the number of ants and ant lions N, the variable dimension D (the variable dimension is equal to the number of weight coefficients of the kernel extreme learning machine), the maximum number of iterations G, and randomly initialize their positions x ant (0) and x antlion (0) , set the number of iterations t = 1;

[0058] Step 4.2.2: Establish a multi-core extreme learning machine based on the parameters optimized by the particle swarm optimization in step 4.1. Use the spectral data corresponding to the spectral feature variables as the input of the multi-core extreme learning machine and the soil heavy metal content in the training sample set as the output of the multi-core extreme learning machine. Calculate the mean square error (fitness) between the predicted results and the soil heavy metal content in the training sample set as the ant lion fitness value.

[0059]

[0060] Among them, W i is the weight of the ith kernel extreme learning machine, type is the number of kernel function types of the kernel extreme learning machine, is the predicted value of kernel function type i, and y is the true value of the training sample

[0061] Step 4.2.3: Sort the ant lions by fitness from small to large, and select the first one as the elite ant lion, which is the global optimal solution;

[0062] Step 4.2.4: Determine whether the current number of iterations t reaches the maximum number of iterations G. If so, proceed to step 4.2.8. Otherwise, set the number of iterations t = t + 1 and proceed to step 4.2.5.

[0063] Step 4.2.5: Use the roulette wheel strategy to randomly select an ant lion for each ant, and calculate the influence of the ant lion on the ant's random walk through the adaptive mechanism;

[0064]

[0065]

[0066]

[0067]

[0068] in, is the minimum value of the i-th dimension variable at the t-th iteration, c t is the minimum value of all variables at the tth iteration, is the maximum value of the i-th dimension variable at the t-th iteration, d t is the maximum value of all variables at the tth iteration, is the position of the selected j-th ant lion at the t-th iteration, I is the proportional coefficient, and v is the wandering coefficient

[0069] Step 4.2.6: Calculate the position of the i-th ant at the t+1th iteration

[0070]

[0071]

[0072]

[0073] in, is the value generated by an ant randomly walking around an antlion selected by roulette at iteration t; The value generated by the ant's random walk around the elite ant lion in generation t

[0074] Step 4.2.7: Recalculate the fitness values ​​of ants and ant lions, merge the ant lions and ants, take the top N populations as the new ant lions, and update the new elite ant lions as the global optimal solution, and return to step 4.2.4;

[0075] Step 4.2.8: Determine the multi-core extreme learning machine weight coefficient W based on the position of the elite ant lion.

[0076] In step 5, the predicted values ​​of heavy metals are as follows:

[0077]

[0078] Among them, type is the number of kernel function types of the kernel extreme learning machine, i is the kernel function type, W i is the weight coefficient of the ith kernel extreme learning machine, kelm() is the kernel extreme learning machine detection model, sinc train is the training set, sinc test is the test set, C i is the regularization coefficient of the i-th kernel extreme learning machine, S i is the kernel function parameter of the i-th kernel extreme learning machine.

[0079] A method for selecting spectral characteristic variables from spectral data comprises the following steps:

[0080] Step 1) Initialize the Monte Carlo sampling times N, and let the initial X-ray fluorescence spectrum characteristic variable v sel_old =[1,2,…,m], set the sampling counter count=1;

[0081] Step 2) If count is greater than N, go to step 7) Otherwise, use the Monte Carlo method to extract a certain proportion of samples from the training set as a sub-training set, and use the spectral feature variable v sel_old Build a PLS model;

[0082] y=xb+e

[0083] Among them, y is the heavy metal concentration value, x is the spectral data corresponding to the heavy metal spectral characteristic variable, b is the spectral coefficient, and e is the prediction error;

[0084] Step 3) Calculate v sel_old The weight w of each spectral feature variable in;

[0085]

[0086] Among them, w i is the weight of the i-th spectral characteristic variable, b iis the coefficient of the i-th spectrum, and p is the number of spectral characteristic variables;

[0087] Step 4) Calculate the exponential decreasing function value r count , retain the spectral feature variable weight w greater than r count characteristic variables;

[0088] r count =ae -kcount ,count=1,2,3,…,N

[0089] a=(p / 2) 1 / (N-1)

[0090]

[0091] Among them, r count is the exponentially decreasing function value of the count-th sampling, a and k are two constants, and N is the number of sampling times;

[0092] Step 5) A competitive adaptive reweighting algorithm is used to realize the competitive selection of spectral characteristic variables, and a certain proportion of characteristic variables is retained from the characteristic variable subset obtained in step 4), which is denoted as v sel _ new ;

[0093] Step 6) Use v sel_new Calculate RMSECV, let v sel_old =v sel_new , count=count+1, go to step 1);

[0094] Step 7) Obtain N spectral feature variable sets and N RMSECVs;

[0095] Step 8) Select the spectral feature variable corresponding to the minimum RMSECV value during the sampling process as the spectral feature variable selection result.

[0096] A method for establishing a multi-core extreme learning machine comprises the following steps:

[0097] Step 1) using a particle swarm optimization algorithm to optimize the regularization coefficient C and kernel function parameter S of extreme learning machines with different kernel functions, and determining the regularization parameter C and kernel function parameter S of the extreme learning machine under different kernel functions based on the global optimal particle;

[0098] Step 2) Optimizing the multi-core extreme learning machine weight coefficient W using the ant lion optimization algorithm, and determining the multi-core extreme learning machine weight coefficient W according to the global optimal ant lion solution;

[0099] Among them, the multi-core extreme learning machine F(x) is:

[0100]

[0101] Among them, k is the kernel function type, K k () represents the kernel function of type k, W k is the weight coefficient of the k-core extreme learning machine, x′ is the training sample spectral data, x i ′ is the spectral data of the i-th training sample, y is the true value of the heavy metal content of the training sample, n is the number of training samples, I is the unit matrix, and C is the regularization coefficient;

[0102] The kernel function types are as follows:

[0103]

[0104] Among them, S is a vector representing the kernel function parameters to be optimized; S(i) is the i-th parameter of the kernel function.

[0105] The established multi-core extreme learning machine is used for the detection of heavy metals in soil;

[0106] In step 1), the following sub-steps are included:

[0107] Step (1) Select the kernel function type k of the kernel extreme learning machine, set the particle dimension D, population size N, maximum number of iterations G, inertia weight w, acceleration coefficients c1 and c2, and initialize the initial value of the particle position x i (0) and the initial value of particle velocity v i (0) , i = 1, 2, ..., N, set the particle's historical optimal solution pBest as the initial position, and set the number of iterations t = 1;

[0108]

[0109] Step (2) establish a kernel extreme learning machine based on the current particle swarm, use the target spectral data as the input of the kernel extreme learning machine, use the soil heavy metal content in the training sample set as the output of the kernel extreme learning machine, calculate the mean square error fitness between the prediction result and the soil heavy metal content in the training sample set, and use it as the fitness value of the particle swarm. The particle position corresponding to the minimum fitness value is recorded as the initial global optimal solution gBest;

[0110]

[0111] in, is the predicted value of heavy metal content with kernel function type i, and y is the actual value of heavy metal content in training samples

[0112] Step (3) Determine whether the current number of iterations t reaches the maximum number of iterations G. If so, execute step (7); otherwise, execute step (4);

[0113] Step 4: Update particle velocity v i (t) and position x i (t) ;

[0114]

[0115]

[0116]

[0117] Among them, rand, rand1, rand2 are 0-1 random numbers, w is the inertia weight, c1 and c2 are acceleration coefficients, is the velocity of particle i at time t, is the velocity of particle i at time t-1, is the position of particle i at time t, is the position of particle i at time t-1, pBest i is the historical optimal solution of particle i, gBest is the current global optimal solution;

[0118] Step (5): Calculate the fitness value of the new particle swarm and update the current global optimal solution gBest;

[0119] Step (6): t=t+1, return to step (3);

[0120] Step (seven): Determine the regularization parameter C and kernel function parameter S according to the global optimal value;

[0121] Step (8): If there are kernel function types that need to be optimized, go to step (1), otherwise end.

[0122] In step 2), the following sub-steps are included:

[0123] Step 1: Set the number of ants and ant lions N, the variable dimension D, the maximum number of iterations G, and randomly initialize their positions x ant (0) and x antlion (0) , set the number of iterations t = 1;

[0124] Step (2): Establish a multi-core extreme learning machine based on the parameters after particle swarm optimization in step 1), use the spectral data corresponding to the spectral feature variables as the input of the multi-core extreme learning machine, use the soil heavy metal content in the training sample set as the output of the multi-core extreme learning machine, and calculate the mean square error (fitness) between the prediction result and the soil heavy metal content in the training sample set as the ant lion fitness value;

[0125]

[0126] Among them, W i is the weight of the ith kernel extreme learning machine, type is the number of kernel function types of the kernel extreme learning machine, is the predicted value of kernel function type i, and y is the true value of the training sample

[0127] Step (3): Sort the ant lions by fitness from small to large, and select the first one as the elite ant lion, which is the global optimal solution;

[0128] Step (4): Determine whether the current number of iterations t reaches the maximum number of iterations G. If so, proceed to step (8). Otherwise, set the number of iterations t = t + 1 and proceed to step (5).

[0129] Step (5): Use the roulette strategy to randomly select an ant lion for each ant, and calculate the influence of the ant lion on the ant's random walk through the adaptive mechanism;

[0130]

[0131]

[0132]

[0133]

[0134] in, is the minimum value of the i-th dimension variable at the t-th iteration, c t is the minimum value of all variables at the tth iteration, is the maximum value of the i-th dimension variable at the t-th iteration, d t is the maximum value of all variables at the tth iteration, is the position of the selected j-th ant lion at the t-th iteration, I is the proportional coefficient, and v is the wandering coefficient

[0135] Step (6): Calculate the position of the i-th ant at the t+1th iteration

[0136]

[0137]

[0138]

[0139] in, is the value generated by an ant randomly walking around an antlion selected by roulette at iteration t; The value generated by the ant's random walk around the elite ant lion in generation t

[0140] Step (7): Recalculate the fitness values ​​of ants and ant lions, merge ant lions and ants, take the top N populations as new ant lions, and update the new elite ant lions as the global optimal solution, and return to step (4);

[0141] Step (eight): Determine the multi-core extreme learning machine weight coefficient W based on the position of the elite ant lion.

[0142] Compared with the prior art, the present invention has the following technical effects:

[0143] The soil heavy metal detection method based on the multi-core extreme learning machine optimized by multiple intelligence proposed in the present invention can quickly and accurately detect the content of heavy metals in the soil, which has important practical significance for the rapid response, accurate prediction and decision-making management of the heavy metal pollution risk in farmland soil.

[0144] This invention proposes a method for detecting heavy metals in soil using a multi-core extreme learning machine optimized by multiple intelligences. This method uses a competitive adaptive reweighting algorithm to select characteristic variables, eliminates correlations between spectral data, reduces spectral dimensionality, and improves model prediction accuracy. This invention proposes a method for detecting heavy metals in soil using a multi-core extreme learning machine optimized by multiple intelligences. This method uses a multi-core extreme learning machine optimized by multiple intelligences to optimize the regularization coefficient, kernel function parameters, and weight coefficients. The results of different extreme learning machines are weighted and summed to predict heavy metal content, ensuring model reliability and prediction accuracy. This method uses X-ray fluorescence spectroscopy, which has the advantages of simple experimental methods, high analytical sensitivity, rapid detection speed, high stability, and low analytical cost. BRIEF DESCRIPTION OF THE DRAWINGS

[0145] The present invention will be further described below with reference to the accompanying drawings and embodiments:

[0146] Figure 1 This is a flow chart of a soil heavy metal detection method using a multi-core extreme learning machine optimized by multiple intelligences in the present invention;

[0147] Figure 2 Flowchart for feature variable selection for competitive adaptive reweighting algorithm;

[0148] Figure 3 Results graph of feature variable selection for competitive adaptive reweighting algorithm;

[0149] Figure 4 Flowchart for optimizing the regularization coefficient and kernel function parameters of the kernel extreme learning machine for the particle swarm algorithm;

[0150] Figure 5 Flowchart for optimizing the kernel extreme learning machine weight coefficients for the Ant Lion algorithm;

[0151] Figure 6 is the fitness function evolution graph;

[0152] Figure 7 This is a graph showing the test set prediction results for the traditional kernel extreme learning machine and the multi-core extreme learning machine optimized by multiple intelligence methods. DETAILED DESCRIPTION

[0153] A soil heavy metal detection method based on multi-core extreme learning machine optimization using multiple intelligence includes the following steps:

[0154] Step 1: Collect X-ray fluorescence spectrum data and heavy metal content values ​​of soil samples, construct a sample set, and divide the sample set into a training sample set and a test sample set;

[0155] Step 2: Preprocess the sample set or the spectral information to be detected;

[0156] Step 3: Select spectral feature variables for the preprocessed spectral data, and use the spectral data corresponding to the feature variables as new training sample sets and test sample sets;

[0157] Step 4: Establish a multi-core extreme learning machine, use the data in the training set as the input of the multi-core extreme learning machine, and use the soil heavy metal content in the training set as the output of the extreme learning machine;

[0158] Step 5: Use the optimized regularization coefficient C, kernel function parameter S and weight coefficient W to train the multi-core extreme learning machine to obtain the soil heavy metal detection model. Input the test set into the detection model to obtain the predicted value of heavy metals.

[0159] In step 1, the sample set is constructed, a number of soil samples with a predetermined concentration range are configured, the heavy metal content value y of each sample is measured, and the X-ray fluorescence spectrum information x = [x1, x2, ..., x m ], randomly divide the sample set into training set and test set.

[0160] In step 3, a competitive adaptive reweighting algorithm is used to select spectral feature variables from the preprocessed spectral data, which includes the following sub-steps:

[0161] Step 3.1: Initialize the Monte Carlo sampling times N, and let the initial X-ray fluorescence spectrum characteristic variable v sel_old =[1,2,…,m], set the sampling counter count=1;

[0162] Step 3.2: If count is greater than N, go to step 3.7. Otherwise, use the Monte Carlo method to extract 90% of the samples from the training set as a sub-training set, and use the spectral feature variable v sel_old Build a PLS model;

[0163] y=xb+e

[0164] Among them, y is the heavy metal concentration value, x is the spectral data corresponding to the heavy metal spectral characteristic variable, b is the spectral coefficient, and e is the prediction error

[0165] Step 3.3: Calculate v sel_old The weight w of each spectral feature variable in;

[0166]

[0167] Among them, w i is the weight of the i-th spectral characteristic variable, b i is the coefficient of the i-th spectrum, and p is the number of spectral characteristic variables

[0168] Step 3.4: Calculate the exponentially decreasing function value r count , retain the spectral feature variable weight w greater than r count characteristic variables;

[0169] r count =ae -kcount ,count=1,2,3,…,N

[0170] a=(p / 2) 1 / (N-1)

[0171]

[0172] Among them, r count is the exponentially decreasing function value of the count-th sampling, a and k are two constants, and N is the number of sampling times

[0173] Step 3.5: Use the competitive adaptive reweighting algorithm to implement competitive selection of spectral feature variables, and retain 80% of the feature variables from the feature variable subset obtained in step 3.4, denoted as v sel_new ;

[0174] Step 3.6: Using v sel_new Calculate RMSECV, let v sel_old =v sel_new , count=count+1, go to step 3.1;

[0175] Step 3.7: Obtain N spectral feature variable sets and N RMSECVs;

[0176] Step 3.8: Select the spectral feature variable corresponding to the minimum RMSECV value during the sampling process as the spectral feature variable selection result.

[0177] In step 4, when establishing a multi-core extreme learning machine, the following sub-steps are included:

[0178] Step 4.1: Use the particle swarm optimization algorithm to optimize the regularization coefficient C and kernel function parameter S of the extreme learning machine with different kernel functions, and determine the regularization parameter C and kernel function parameter S of the extreme learning machine under different kernel functions based on the global optimal particle;

[0179] Step 4.2: Use the ant lion optimization algorithm to optimize the weight coefficient W of the multi-core extreme learning machine, and determine the weight coefficient W of the multi-core extreme learning machine according to the global optimal ant lion solution.

[0180] Use the above steps to build a multi-core extreme learning machine;

[0181] Among them, the multi-core extreme learning machine F(x) is:

[0182]

[0183] Among them, k is the kernel function type, K k () represents the kernel function of type k, W k is the weight coefficient of the k-core extreme learning machine, x′ is the training sample spectral data, x i ′ is the spectral data of the i-th training sample, y is the true value of the heavy metal content of the training sample, n is the number of training samples, I is the unit matrix, and C is the regularization coefficient;

[0184] The kernel function types are as follows:

[0185]

[0186] Among them, S is a vector representing the kernel function parameters to be optimized; S(i) is the i-th parameter of the kernel function.

[0187] In step 4.1, the following sub-steps are included:

[0188] Step 4.1.1: Select the kernel function type k of the kernel extreme learning machine, set the particle dimension D (the particle dimension is equal to the number of regularization parameters plus the number of kernel function parameters), population size N, maximum number of iterations G, inertia weight w, acceleration coefficients c1 and c2, and initialize the initial value of the particle position x i (0) and the initial value of particle velocity v i (0) , i = 1, 2, ..., N, set the particle's historical optimal solution pBest as the initial position, and set the number of iterations t = 1;

[0189]

[0190] Step 4.1.2: Establish a kernel extreme learning machine based on the current particle swarm. Use the spectral data corresponding to the characteristic variables selected in step 3 as the input of the kernel extreme learning machine and the soil heavy metal content in the training sample set as the output of the kernel extreme learning machine. Calculate the mean square error (fitness) between the predicted result and the soil heavy metal content in the training sample set as the fitness value of the particle swarm. The particle position corresponding to the minimum fitness value is recorded as the initial global optimal solution gBest.

[0191]

[0192] in, is the predicted value of heavy metal content with kernel function type i, and y is the actual value of heavy metal content in training samples

[0193] Step 4.1.3: Determine whether the current number of iterations t reaches the maximum number of iterations G. If so, proceed to step 4.1.7; otherwise, proceed to step 4.1.4.

[0194] Step 4.1.4: Update particle velocity v i (t) and position x i (t) ;

[0195]

[0196]

[0197]

[0198] Among them, rand, rand1, rand2 are 0-1 random numbers, w is the inertia weight, c1 and c2 are acceleration coefficients, is the velocity of particle i at time t, is the velocity of particle i at time t-1, is the position of particle i at time t, is the position of particle i at time t-1, pBest i is the historical optimal solution of particle i, gBest is the current global optimal solution;

[0199] Step 4.1.5: Calculate the fitness value of the new particle swarm and update the current global optimal solution gBest;

[0200] Step 4.1.6: t = t + 1, return to step 4.1.3;

[0201] Step 4.1.7: Determine the regularization parameter C and kernel function parameter S based on the global optimal value;

[0202] Step 4.1.8: If there are kernel function types that need to be optimized, go to step 4.1.1, otherwise end.

[0203] In step 4.2, the following sub-steps are included:

[0204] Step 4.2.1: Set the number of ants and ant lions N, the variable dimension D (the variable dimension is equal to the number of weight coefficients of the kernel extreme learning machine), the maximum number of iterations G, and randomly initialize their positions x ant (0) and x antlion (0) , set the number of iterations t = 1;

[0205] Step 4.2.2: Establish a multi-core extreme learning machine based on the parameters optimized by the particle swarm optimization in step 4.1. Use the spectral data corresponding to the spectral feature variables as the input of the multi-core extreme learning machine and the soil heavy metal content in the training sample set as the output of the multi-core extreme learning machine. Calculate the mean square error (fitness) between the predicted results and the soil heavy metal content in the training sample set as the ant lion fitness value.

[0206]

[0207] Among them, W i is the weight of the ith kernel extreme learning machine, type is the number of kernel function types of the kernel extreme learning machine, is the predicted value of kernel function type i, and y is the true value of the training sample

[0208] Step 4.2.3: Sort the ant lions by fitness from small to large, and select the first one as the elite ant lion, which is the global optimal solution;

[0209] Step 4.2.4: Determine whether the current number of iterations t reaches the maximum number of iterations G. If so, proceed to step 4.2.8. Otherwise, set the number of iterations t = t + 1 and proceed to step 4.2.5.

[0210] Step 4.2.5: Use the roulette wheel strategy to randomly select an ant lion for each ant, and calculate the influence of the ant lion on the ant's random walk through the adaptive mechanism;

[0211]

[0212]

[0213]

[0214]

[0215] in, is the minimum value of the i-th dimension variable at the t-th iteration, ct is the minimum value of all variables at the tth iteration, is the maximum value of the i-th dimension variable at the t-th iteration, d t is the maximum value of all variables at the tth iteration, is the position of the selected j-th ant lion at the t-th iteration, I is the proportional coefficient, and v is the wandering coefficient

[0216] Step 4.2.6: Calculate the position of the i-th ant at the t+1th iteration

[0217]

[0218]

[0219]

[0220] in, is the value generated by an ant randomly walking around an antlion selected by roulette at iteration t; The value generated by the ant's random walk around the elite ant lion in generation t

[0221] Step 4.2.7: Recalculate the fitness values ​​of ants and ant lions, merge the ant lions and ants, take the top N populations as the new ant lions, and update the new elite ant lions as the global optimal solution, and return to step 4.2.4;

[0222] Step 4.2.8: Determine the multi-core extreme learning machine weight coefficient W based on the position of the elite ant lion.

[0223] In step 5, the predicted values ​​of heavy metals are as follows:

[0224]

[0225] Among them, type is the number of kernel function types of the kernel extreme learning machine, i is the kernel function type, W i is the weight coefficient of the ith kernel extreme learning machine, kelm() is the kernel extreme learning machine detection model, sinc train is the training set, sinc test is the test set, C i is the regularization coefficient of the i-th kernel extreme learning machine, S i is the kernel function parameter of the i-th kernel extreme learning machine.

[0226] A method for selecting spectral characteristic variables from spectral data comprises the following steps:

[0227] Step 1) Initialize the Monte Carlo sampling times N, and let the initial X-ray fluorescence spectrum characteristic variable v sel_old= [1, 2, …, m], set the sampling counter count = 1;

[0228] Step 2) If count is greater than N, go to step 7) otherwise, use Monte Carlo method to extract a certain proportion of samples from the training set as a sub-training set, use spectral feature variables v sel_old PLS model is established;

[0229] y = xb + e

[0230] Wherein, y is the heavy metal concentration value, x is the spectral data corresponding to the heavy metal spectral feature variable, b is the spectral coefficient, e is the prediction error;

[0231] Step 3) Calculate v sel_old The weight w of each spectral feature variable in the middle;

[0232]

[0233] Wherein, w i is the weight of the i-th spectral feature variable, b i is the coefficient of the i-th spectrum, and p is the number of spectral feature variables;

[0234] Step 4) Calculate the exponential decay function value r count , keep the feature variables whose spectral feature variable weights w are greater than r count ;

[0235] r count = ae -kcount , count = 1, 2, 3, …, N

[0236] a = (p / 2) 1 / (N-1)

[0237]

[0238] Wherein, r count is the exponential decay function value of the count-th sampling, a and k are two constants, and N is the sampling number;

[0239] Step 5) Use the competitive self-adaptive reweighting algorithm to realize the competitive selection of spectral feature variables, keep a certain proportion of feature variables from the feature variable subset obtained in step 4), denoted as v sel_new ;

[0240] Step 6) Calculate RMSECV using v sel_new , let v sel_old = v sel_new , count = count + 1, and go to step 1);

[0241] Step 7) Obtain N spectral feature variable sets and N RMSECVs;

[0242] Step 8) Select the spectral feature variable corresponding to the minimum RMSECV value during the sampling process as the spectral feature variable selection result.

[0243] A method for establishing a multi-core extreme learning machine comprises the following steps:

[0244] Step 1) using a particle swarm optimization algorithm to optimize the regularization coefficient C and kernel function parameter S of extreme learning machines with different kernel functions, and determining the regularization parameter C and kernel function parameter S of the extreme learning machine under different kernel functions based on the global optimal particle;

[0245] Step 2) Optimizing the multi-core extreme learning machine weight coefficient W using the ant lion optimization algorithm, and determining the multi-core extreme learning machine weight coefficient W according to the global optimal ant lion solution;

[0246] Among them, the multi-core extreme learning machine F(x) is:

[0247]

[0248] Among them, k is the kernel function type, K k () represents the kernel function of type k, W k is the weight coefficient of the k-core extreme learning machine, x′ is the training sample spectral data, x i ′ is the spectral data of the i-th training sample, y is the true value of the heavy metal content of the training sample, n is the number of training samples, I is the unit matrix, and C is the regularization coefficient;

[0249] The kernel function types are as follows:

[0250]

[0251] Among them, S is a vector representing the kernel function parameters to be optimized; S(i) is the i-th parameter of the kernel function.

[0252] The established multi-core extreme learning machine is used for the detection of heavy metals in soil;

[0253] In step 1), the following sub-steps are included:

[0254] Step (1) Select the kernel function type k of the kernel extreme learning machine, set the particle dimension D, population size N, maximum number of iterations G, inertia weight w, acceleration coefficients c1 and c2, and initialize the initial value of the particle position x i (0) and the initial value of particle velocity v i (0) , i = 1, 2, ..., N, set the particle's historical optimal solution pBest as the initial position, and set the number of iterations t = 1;

[0255]

[0256] Step (two) establishes a kernel extreme learning machine according to the current particle group, takes the target spectrum data as the input of the kernel extreme learning machine, takes the soil heavy metal content in the training sample set as the output of the kernel extreme learning machine, calculates the mean square error fitness of the prediction result and the soil heavy metal content in the training sample set, takes the minimum fitness value as the initial global optimal solution gBest corresponding to the particle position;

[0257]

[0258] wherein, is the predicted value of the heavy metal content of the kernel function type i, y is the true value of the heavy metal content of the training sample

[0259] Step (three) judges whether the current iteration number t reaches the maximum iteration number G, if yes, step (seven) is executed, otherwise, step (four) is executed.

[0260] Step (four) updates the particle velocity v i (t) and the position x i (t) ;

[0261]

[0262]

[0263]

[0264] wherein, rand, rand1 and rand2 are 0-1 random numbers, w is an inertia weight, c1 and c2 are acceleration coefficients, is the velocity of the particle i at t, is the velocity of the particle i at t-1, is the position of the particle i at t, is the position of the particle i at t-1, pBest i is the historical optimal solution of the particle i, and gBest is the current global optimal solution;

[0265] Step (five) calculates the fitness value of the new particle group and updates the current global optimal solution gBest.

[0266] Step (six) t=t+1, and returns to step (three).

[0267] Step (seven) determines the regularization parameter C and the kernel function parameter S according to the global optimal value.

[0268] Step (8): If there are kernel function types that need to be optimized, go to step (1), otherwise end.

[0269] In step 2), the following sub-steps are included:

[0270] Step 1: Set the number of ants and ant lions N, the variable dimension D, the maximum number of iterations G, and randomly initialize their positions x ant (0) and x antlion (0) , set the number of iterations t = 1;

[0271] Step (2): Establish a multi-core extreme learning machine based on the parameters optimized by particle swarm optimization in step 1), use the spectral data corresponding to the spectral feature variables as the input of the multi-core extreme learning machine, use the soil heavy metal content in the training sample set as the output of the multi-core extreme learning machine, and calculate the mean square error (fitness) between the prediction result and the soil heavy metal content in the training sample set as the ant lion fitness value;

[0272]

[0273] Among them, W i is the weight of the ith kernel extreme learning machine, type is the number of kernel function types of the kernel extreme learning machine, is the predicted value of kernel function type i, and y is the true value of the training sample

[0274] Step (3): Sort the ant lions by fitness from small to large, and select the first one as the elite ant lion, which is the global optimal solution;

[0275] Step (4): Determine whether the current number of iterations t reaches the maximum number of iterations G. If so, proceed to step (8). Otherwise, set the number of iterations t = t + 1 and proceed to step (5).

[0276] Step (5): Use the roulette strategy to randomly select an ant lion for each ant, and calculate the influence of the ant lion on the ant's random walk through the adaptive mechanism;

[0277]

[0278]

[0279]

[0280]

[0281] in, is the minimum value of the i-th dimension variable at the t-th iteration, c t is the minimum value of all variables at the tth iteration, is the maximum value of the i-th dimension variable at the t-th iteration, d t is the maximum value of all variables at the tth iteration, is the position of the selected j-th ant lion at the t-th iteration, I is the proportional coefficient, and v is the wandering coefficient

[0282] Step (6): Calculate the position of the i-th ant at the t+1th iteration

[0283]

[0284]

[0285]

[0286] in, is the value generated by an ant randomly walking around an antlion selected by roulette at iteration t; The value generated by the ant's random walk around the elite ant lion in generation t

[0287] Step (7): Recalculate the fitness values ​​of ants and ant lions, merge ant lions and ants, take the top N populations as new ant lions, and update the new elite ant lions as the global optimal solution, and return to step (4);

[0288] Step (eight): Determine the multi-core extreme learning machine weight coefficient W based on the position of the elite ant lion.

[0289] Example:

[0290] like Figure 1 As shown, a soil heavy metal detection method using a multi-core extreme learning machine optimized by multiple intelligence includes the following steps:

[0291] Step 1: Collect X-ray fluorescence spectrum data and heavy metal content values ​​of soil samples, construct a sample set, and divide the sample set into a training sample set and a test sample set;

[0292] Step 2: Use standard transformation method to preprocess the sample set or the spectral information to be detected;

[0293] Soil was collected from uncontaminated farmland within a 1km radius of Yichang. To prevent the influence of laboratory equipment on the results and improve test reliability, ceramic utensils were used for sample collection, sorting, crushing, grinding, and bagging. After drying and grinding the soil through a 0.45mm sieve, experimental samples were prepared based on the content requirements of Class I, II, and III soils and the actual conditions of farmland soil.

[0294] The spectral data collection equipment for this dataset uses an X-123SDD energy-dispersive X-ray fluorescence detector and a Mini-X micro X-ray tube with an Ag target, both manufactured by Amptek. The integration time was set to 200 ms, the tube operating current was set to 40 μA, the tube operating voltage was set to 30 kV, and the detector channel count was set to 4096. Each sample was placed on the portable X-ray soil heavy metal detector, and spectral data for 87 samples, totaling 4096 characteristic variables, were acquired in the 0–26 keV range.

[0295] Atomic flame absorption spectrometry (AAS) was used to determine the heavy metal concentrations in the dataset. The dataset was randomly partitioned, with 60 samples randomly selected for training and the remaining 27 for testing. Before entering the sample set or the spectral information to be tested into the detection model, the sample set or the spectral information to be tested was normalized and preprocessed using mapminmax().

[0296] Step 3: If Figure 2 As shown in the figure, a competitive adaptive reweighting algorithm is used to select spectral feature variables from the preprocessed spectral data, and the spectral data corresponding to the feature variables are used as new training sample sets and test sample sets;

[0297] In this embodiment, taking Cr metal as an example, spectral feature variables are selected in channels 0 to 4096, the number of MCS sampling runs N is set to 50, the number of principal components of PLS ​​is set to 10, the sampling rate is set to 0.7, the number of iterations is set to 1000, and a PLS model is established using five-fold cross validation to select feature variables. A total of 61 feature variables are selected using the competitive adaptive reweighting algorithm, which only accounts for 1.5% of the original full spectrum wavelength. The results are as follows: Figure 3 shown.

[0298] Step 4: Establish a multi-core extreme learning machine, use the data in the training sample set as the input of the multi-core extreme learning machine, and use the soil heavy metal content in the training sample set as the output of the extreme learning machine;

[0299] Step 4.1: If Figure 4 As shown in the figure, the particle swarm optimization algorithm is used to optimize the regularization coefficient C and kernel function parameter S of the extreme learning machine with different kernel functions, and the regularization parameter C and kernel function parameter S of the extreme learning machine with different kernel functions are determined according to the global optimal particle;

[0300] In this embodiment, taking Cr as an example, the competitive adaptive reweighting algorithm determines that the input heavy metal spectrum data dimension of the extreme learning machine is 61 dimensions, and the output heavy metal content data dimension is 1 dimension;

[0301] In this embodiment, the kernel function types are Gaussian kernel function, polynomial kernel function and wavelet kernel function, respectively. The population size N of the particle swarm optimization algorithm is set to 80, the maximum number of iterations G is set to 100, the initial value of the inertia weight is set to w=0.7, the initial value of the acceleration coefficient is set to c1=2.8, the initial value of the acceleration coefficient is set to c2=1.2, the particle velocity interval is set to v=[-2 2] and the position interval is set to x=[-10 10]. When the kernel function is the Gaussian kernel, the particle dimension D of the adaptive particle swarm optimization algorithm is set to 2; when the kernel function is the polynomial kernel, the particle dimension D of the particle swarm optimization algorithm is set to 3; when the kernel function is the wavelet kernel, the particle dimension D of the adaptive particle swarm optimization algorithm is set to 4.

[0302] In this embodiment, the optimized values ​​of the three kernel functions are shown in the following table:

[0303] Table 1 Kernel function parameter values

[0304]

[0305] Step 4.2: If Figure 5 As shown, the ant lion optimization algorithm is used to optimize the weight coefficient W of the multi-core extreme learning machine, and the weight coefficient W of the multi-core extreme learning machine is determined according to the global optimal ant lion solution. In this embodiment, the population size N of the ant lion optimization algorithm is set to 40, the population dimension D to 3, the maximum number of iterations G to 50, and the position interval x to [-1 1];

[0306] In this embodiment, the fitness function evolution diagram of the multi-core extreme learning machine weight coefficient optimized by Ant Lion is shown in the figure below: Figure 6 As shown;

[0307] Step 5: Use the optimized weights and hidden layer bias to train the extreme learning machine to obtain the soil heavy metal detection model. Input the test set into the detection model to obtain the predicted value of heavy metals.

[0308] In this embodiment, compared with the unoptimized extreme learning machine, the experimental results are shown in the following table:

[0309] Table 2 Predicted values ​​of heavy metal Cr

[0310]

[0311] In this embodiment, the multi-intelligence method is used to optimize the R 2 =0.9927, root mean square error MSE = 23.5006, while R without using the optimized Gaussian kernel extreme learning machine 2 =0.46262, root mean square error MSE=24.6138, indicating that the method of the present invention has better prediction ability.

[0312] In this embodiment, the test set results of using the multi-core extreme learning machine optimization method and not using the optimization method to optimize the Gaussian kernel extreme learning machine are as follows: Figure 7 shown.

Claims

1. A soil heavy metal detection method based on multi-core extreme learning machine optimization using multiple intelligence, characterized in that: It includes the following steps: Step 1: Collect X-ray fluorescence spectrum data and heavy metal content values ​​of soil samples, construct a sample set, and divide the sample set into a training sample set and a test sample set; Step 2: Preprocess the sample set or the spectral information to be detected; Step 3: Select spectral feature variables for the preprocessed spectral data, and use the spectral data corresponding to the feature variables as new training sample sets and test sample sets; Step 4: Establish a multi-core extreme learning machine, use the data in the training set as the input of the multi-core extreme learning machine, and use the soil heavy metal content in the training set as the output of the extreme learning machine; Step 5: Use the optimized regularization coefficient C , kernel function parameters S and weight coefficient W Train a multi-core extreme learning machine to obtain a soil heavy metal detection model. Input the test set into the detection model to obtain the predicted value of heavy metals. In step 3, a competitive adaptive reweighting algorithm is used to select spectral feature variables from the preprocessed spectral data, which includes the following sub-steps: Step 3.1: Initialize the number of Monte Carlo samples N , let the initial X-ray fluorescence spectrum characteristic variable , set the sampling counter count =1; Step 3.2: If count Greater than N , go to step 3.7, otherwise, use the Monte Carlo method to extract a certain proportion of samples from the training set as a sub-training set, and use the spectral feature variables v sel_old Build a PLS model; ; in, y is the heavy metal concentration value, x is the spectral data corresponding to the heavy metal spectral characteristic variables, b is the spectral coefficient, e is the prediction error; Step 3.3: Calculation v sel_old The weight of each spectral feature variable in w ; ; in, w i For the i The weight of each spectral feature variable, b i For the i The coefficients of the spectrum, p is the number of spectral characteristic variables; Step 3.4: Calculate the exponentially decreasing function value r count , retaining the spectral feature variable weights w Greater than r count characteristic variables; ; ; ; in, r count For the count The exponentially decreasing function value of the subsample, a and k are two constants, N is the number of sampling times; Step 3.5: Use the competitive adaptive reweighting algorithm to realize the competitive selection of spectral characteristic variables. A certain proportion of characteristic variables is retained from the characteristic variable subset obtained in step 3.4, which is recorded as ; Step 3.6: Use v sel_new calculate RMSECV ,make v sel_old = v sel_new , count=count+1 , go to step 3.1; Step 3.7: Get N spectral feature variable sets and N indivual RMSECV ; Step 3.8: Select the sampling process RMSECV The spectral characteristic variable corresponding to the minimum value is taken as the spectral characteristic variable selection result; In step 4, when building a multi-core extreme learning machine The following sub-steps are included: Step 4.1: Optimize the regularization coefficient of the multi-core extreme learning machine using the particle swarm optimization algorithm C and kernel function parameters S , according to the global optimal particle, the regularization parameters of the multi-core extreme learning machine under different kernel functions are determined C and kernel function parameters S ; Step 4.2: Optimize the weight coefficients of the multi-core extreme learning machine using the Ant Lion Optimization Algorithm W , determine the weight coefficient of the multi-core extreme learning machine based on the global optimal ant lion solution W ; Use the above steps to build a multi-core extreme learning machine; Among them, multi-core extreme learning machine for: ; in, k is the kernel function type, Indicates type k The kernel function, for k The weight coefficients of the kernel extreme learning machine, is the training sample spectral data, For the i training sample spectral data, is the true value of heavy metal content in training samples, n is the number of training samples, I is the identity matrix, C is the regularization coefficient; The kernel function types are as follows: ; in, S Is a vector representing the kernel function parameters to be optimized; is the kernel function i parameters.

2. The method according to claim 1, characterized in that In step 4.1, the following sub-steps are included: Step 4.1.1: Select the kernel function type for the kernel extreme learning machine k , set the particle dimensions D , population size N , maximum number of iterations G , inertia weight w , acceleration factor c 1 and c 2. Initialize the particle position x i (0) and the initial value of particle velocity v i (0) , i =1, 2, ..., N , let the particle's historical optimal solution be pBest Set as initial position and set the number of iterations t =1; ; Step 4.1.2: Establish a kernel extreme learning machine based on the current particle swarm. Use the spectral data corresponding to the characteristic variables selected in step 3 as the input of the kernel extreme learning machine. Use the soil heavy metal content in the training sample set as the output of the kernel extreme learning machine. Calculate the mean square error between the predicted result and the soil heavy metal content in the training sample set. fitness , as the fitness value of the particle swarm, the particle position corresponding to the minimum fitness value is recorded as the initial global optimal solution gBest ; ; in, The kernel function type is i The predicted value of heavy metal content, y is the true value of heavy metal content in training samples; Step 4.1.3: Determine the current number of iterations t Whether the maximum number of iterations has been reached G If yes, go to step 4.1.7, otherwise go to step 4.1.4; Step 4.1.4: Update particle velocity v i (t) and location x i (t) ; ; ; ; in, rand 、 rand 1. rand 2 is a random number between 0 and 1. w is the inertia weight, c 1 and c 2 acceleration factor, for t Moment Particles i speed, for t -1 moment particle i speed, for t Moment Particles i location, for t -1 moment particle i location, pBest i For particles i The best solution in history, gBest is the current global optimal solution; Step 4.1.5: Calculate the fitness value of the new particle swarm and update the current global optimal solution gBest ; Step 4.1.6: t = t +1, return to step 4.1.3; Step 4.1.7: Determine the regularization parameter based on the global optimal value C and kernel function parameters S ; Step 4.1.8: If there are kernel function types that need to be optimized, go to step 4.1.1, otherwise end.

3. The method according to claim 1 or 2, characterized in that In step 4.2, the following sub-steps are included: Step 4.2.1: Set the number of ants and ant lions N , variable dimension D , the variable dimension is equal to the number of weight coefficients of the kernel extreme learning machine, and the maximum number of iterations G , randomly initialize their positions x ant (0) and x antlion (0) , set the number of iterations t =1; Step 4.2.2: Establish a multi-core extreme learning machine based on the parameters optimized by particle swarm optimization in step 4.

1. Use the spectral data corresponding to the spectral feature variables as the input of the multi-core extreme learning machine and the soil heavy metal content in the training sample set as the output of the multi-core extreme learning machine. Calculate the mean square error between the prediction result and the soil heavy metal content in the training sample set. fitness , as the antlion fitness value; ; in, For the i The weights of the kernel extreme learning machine, type is the number of kernel function types of the kernel extreme learning machine, The kernel function type is i The predicted value of y is the true value of the training sample; Step 4.2.3: Sort the ant lions by fitness from small to large, and select the first one as the elite ant lion, which is the global optimal solution; Step 4.2.4: Determine the current number of iterations t Whether the maximum number of iterations has been reached G If yes, execute step 4.2.8, otherwise, let the number of iterations be t = t +1, proceed to step 4.2.5; Step 4.2.5: Use the roulette wheel strategy to randomly select an antlion for each ant, and calculate the influence of the antlion on the ant's random walk through the adaptive mechanism; ; ; ; ; in, For the i Dimensional variables in the t The minimum value of the iterations, For all variables in t The minimum value of the iterations, For the i Dimensional variables in the t The maximum value of the iterations, For all variables in t The maximum value of the iterations, For the selected j The ant lion t The position of the iteration, I is the proportionality coefficient, v is the wandering coefficient; Step 4.2.6: Calculate the i The ant in the t +1 iteration position : ; ; ; in, For ants on a roulette wheel t The value generated by the random walk around the ant lion selected in the iteration; For the ants in t The values ​​generated by random walks around the elite ant lion of the generation; Step 4.2.7: Recalculate the fitness values ​​of ants and ant lions, merge ant lions and ants, and take the first N The number of ants in the population is used as the new ant lion, and the new elite ant lion is updated as the global optimal solution, and then return to step 4.2.4; Step 4.2.8: Determine the weight coefficient of the multi-core extreme learning machine based on the position of the elite ant lion W .

4. The method according to claim 1, wherein In step 5, the predicted values ​​of heavy metals are as follows: ; in, type is the number of kernel function types of the kernel extreme learning machine, i is the kernel function type, For the i Seed kernel extreme learning machine weight coefficient, kelm () is the kernel extreme learning machine detection model, is the training set, is the test set, For the i Regularization coefficient of the kernel extreme learning machine, For the i The kernel function parameters of the kernel extreme learning machine.

Citation Information

Patent Citations

  • Soil lead pollution degree prediction method and device based on a terahertz spectrum

    CN110987853A

  • Rolling bearing fault diagnosis method for optimizing extreme learning machine based on ant lion algorithm

    CN112903295A