Soil organic carbon content prediction method based on hyperspectrum

By combining the Harris Eagle and continuous projection algorithms to screen characteristic bands, and using the BPNN model, the problem of insufficient characteristic band selection in soil organic carbon content prediction is solved, the prediction accuracy and stability are improved, and important information on soil carbon cycle research is provided. support.

CN118794896APending Publication Date: 2024-10-18HUZHOU UNIVERSITY
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202410975427.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-19
Publication Date
2024-10-18

AI Technical Summary

Technical Problem

In the prediction of soil organic carbon content using existing technology, the selection of characteristic bands is easily affected by the external environment and cannot sensitively reflect soil spectral information, resulting in insufficient model accuracy and stability.

Method used

The Harris Hawk algorithm (HHO) and the continuous projection algorithm (SPA) are combined to filter the characteristic bands of the spectral reflectance data, and the back propagation neural network (BPNN) is used to establish a soil organic carbon content prediction model to improve the accuracy and accuracy of the model. stability.

Benefits of technology

Through the screening of characteristic bands and the construction of BPNN models, the accuracy of soil organic carbon content prediction and the generalization ability of the model are improved, providing more accurate and stable soil carbon cycle research and management support.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118794896A_ABST
    Figure CN118794896A_ABST
Patent Text Reader

Abstract

The invention provides a soil organic carbon content prediction method based on hyperspectrum, and relates to the technical field of hyperspectrum prediction. The method comprises the following steps: firstly, collecting and treating a soil sample, and carrying out soil spectral measurement and SOC content determination; then measuring soil spectral reflectance data, and preprocessing the soil spectral reflectance data; secondly, preliminarily screening characteristic wave bands by adopting a Harlisia eagle algorithm (HHO), and carrying out secondary screening on the wave bands by utilizing continuous projection algorithm (SPA) characteristics; and finally, establishing an SOC content hyperspectral prediction model to predict the organic carbon content of the soil, and carrying out model inspection. The method provides important reference and guidance for soil carbon cycle research and soil management.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of hyperspectral prediction, and in particular relates to a method for predicting soil organic carbon content based on hyperspectral. Background Art

[0002] Soil organic carbon (SOC) content is one of the important indicators for assessing soil quality and health. By establishing an accurate prediction model for soil organic carbon content, a scientific basis can be provided for environmental monitoring and soil management, which will help to rationally utilize land resources and reduce environmental problems such as soil erosion and land degradation. Therefore, the quantitative study of soil organic carbon is of great significance for applications such as soil management, soil mapping, and soil carbon sequestration.

[0003] Traditionally, SOC content is obtained through laboratory chemical analysis. Common methods include CO2 detection, chemical oxidation and incineration. Although these methods are accurate, they are time-consuming and cumbersome, and are not suitable for obtaining information such as SOC content over a large area. In recent years, the exploration and application of hyperspectral analysis technology in environmental science has opened up an effective way for large-scale monitoring of SOC content. Its excellent spectral resolution has greatly improved the quantitative analysis of chemical components in soil. By measuring the spectral reflectance of soil, hyperspectral analysis technology can accurately invert the SOC content. It is not only fast and repeatable, but also non-destructive, non-consumption, low-cost and saves manpower and material resources. It is favored by research fields such as SOC content prediction and large-scale monitoring. Therefore, in order to realize the quantitative estimation of SOC based on hyperspectral analysis technology, scholars have conducted a lot of research work in the preprocessing of spectral reflectance data, characteristic band selection, modeling methods, etc. Common spectral reflectance data preprocessing methods include differential transformation and standard normal variable transformation. For example, Fang Chen et al. constructed a soil heavy metal content estimation model based on the logarithm, first-order differential (FD), and second-order differential (SD) preprocessing of the original soil spectral reflectance. It was found that different preprocessing methods can affect the model accuracy. Selecting a suitable processing method can improve the model estimation effect to a certain extent. Common characteristic band selection methods include competitive adaptive reweighting algorithm (CARS), genetic algorithm (GA), and continuous projection method (SPA). For example, Tan et al. used the characteristic bands screened by CARS to construct a soil heavy metal content estimation model and found that the model had the best accuracy and stability among all models. Wang et al. analyzed the SOC inventory of semi-arid pastures in eastern Australia, used stepwise regression and GA to select the variables with the largest amount of information, and then used these selected predictor variables to train the model. The results showed that GA can improve the accuracy of the soil organic carbon prediction model. At present, the characteristic band selection in the SOC content prediction task usually adopts a single algorithm, which is easily affected by the external environment and cannot sensitively reflect the soil spectral information. Summary of the invention

[0004] The technical problem to be solved by the present invention is to provide a soil organic carbon content prediction method based on hyperspectral to achieve soil organic carbon content prediction.

[0005] In order to solve the above technical problems, the technical solution adopted by the present invention is: a method for predicting soil organic carbon content based on hyperspectral, comprising the following steps:

[0006] Step 1: Collect and process soil samples, conduct soil spectral measurements and SOC content determination;

[0007] Several soil samples were collected, naturally air-dried, ground, and sieved; the processed soil was divided into two parts, and the soil spectral reflectance data and SOC content were measured respectively; the SOC content was determined by potassium dichromate external heating method;

[0008] Step 2: Determine soil spectral reflectance data: Use a ground object spectrometer to collect spectral reflectance data of soil samples in a dark room. The wavelength range of the spectral reflectance data is 350-2500nm, and the sampling interval is 1nm;

[0009] Step 3: Soil spectral reflectance data preprocessing: In order to eliminate spectral noise and redundant information, the Savitzky-Golay smoothing method is first used to denoise the soil spectral reflectance data to obtain the original spectral reflectance data; in order to further enhance the correlation between the soil spectral reflectance data and the SOC content, the original spectral reflectance data is transformed into a standard normal variable and then into a first-order differential transformation;

[0010] Step 4: Use the band selection algorithm to screen the characteristic bands of the spectral reflectance data; first use the Harris Hawk algorithm HHO to preliminarily screen the characteristic bands, and then use the continuous projection algorithm SPA to perform secondary screening on the characteristic bands;

[0011] The process of preliminary screening of characteristic bands using the HHO algorithm is as follows:

[0012] (1) Randomly initialize the Harris Hawk population as shown in the following formula:

[0013] X=rand(N,D)*(ub-lb)+lb

[0014] Where X is the initialization population of Harris Hawks, N is the number of hawks, D is the dimension of the problem, rand(N,D) is a random number in the range, ub and lb represent the upper and lower limits of the search space respectively;

[0015] (2) The Harris Hawk population individuals are binary discretized as shown in the following formula:

[0016]

[0017] in, is the binary value, X ij is the original position value of individual i in the population in dimension j, Threshold is the binary discretization threshold, set Threshold = 0.5, i is the index of the individual in the population, and j is the dimension index of the individual;

[0018] (3) Update the escape energy E and jump strength J of the prey;

[0019] (4) When |E|≥1, the global search phase is entered to update the population position; when |E|<1, the local development phase is entered to update the population position; the fitness function shown in the following formula is designed to calculate the fitness value of the updated population individuals:

[0020]

[0021] Among them, F is the fitness function to be optimized, α and β are weight parameters, α∈[0,1], and β=1-α, n is the number of selected feature bands, N is the number of all bands, and C is the determination coefficient;

[0022] (5) The position of the individual in the population with the best fitness value is taken as the new prey position; determine whether the maximum number of iterations has been reached. If so, output the prey position, with 1 representing selection and 0 representing non-selection, to obtain the selected feature band; otherwise, re-execute step (3);

[0023] The process of secondary screening of characteristic bands using the continuous projection algorithm SPA is as follows: k(0) and Iterations are the initial iteration vector and the number of soil samples, respectively, and the spectral reflectance data matrix is ​​column A;

[0024] 1) Assign the ath column of the optional spectral reflectance data matrix to the vector x a , denoted as the initial iteration vector x k(0) ;

[0025] 2) After removing the previously selected spectral reflectance data matrix column vector, the sum of the remaining matrix column vectors is recorded as s, as shown in the following formula:

[0026]

[0027] Among them, k(0),…,k(n-1) represent the band column index selected in each iteration process;

[0028] 3) Calculate vector x in sequence a Projection onto the remaining column vectors As shown in the following formula:

[0029]

[0030] Among them, x k(n-1) The k(n-1) columns of the spectral reflectance matrix are assigned to the vector x a The value after

[0031] 4) Select vector x a The largest spectral band is projected as shown in the following formula:

[0032]

[0033] 5) Let x a = P x , a ∈ s;

[0034] 6) Let n + 1. If (n + 1) < Iterations, then go back to step 2) and calculate in a loop.

[0035] Step 5: Establish a hyperspectral prediction model for SOC content to predict soil organic carbon content and conduct model testing;

[0036] Set the characteristic bands selected by the characteristic band selection algorithm as independent variables and the SOC content as the dependent variable, and use the backpropagation neural network (BPNN) method to construct a hyperspectral prediction model for SOC content; BPNN consists of an input layer, one or more hidden layers, and an output layer; the mathematical relationship between these three layers can be expressed as follows:

[0037] From the input layer to the hidden layer:

[0038]

[0039] From the hidden layer to the output layer:

[0040]

[0041] Among them, y m and y b represent the inputs of the input layer and the hidden layer respectively; y t represents the predicted value of the SOC content of the soil sample; μ bm and λ ob represent the network weights of the output layer and the hidden layer; μ b and λ o are the thresholds of the hidden layer and the output layer; 0 ≤ μ b , μ bm ≤ 1, 0 ≤ λ o , λ ob ≤ 1; n and I are the number of nodes in the input layer and the hidden layer; f I and f o represent the activation functions of the hidden layer and the output layer respectively.

[0042] The beneficial effects of adopting the above technical solution are: the method for predicting soil organic carbon content based on hyperspectral provided by the present invention, in order to remove noise, eliminate factors such as baseline drift, etc., by pre-processing soil samples, using indoor spectral measurement means, taking the pre-processed soil spectral reflectance data as the research object, analyzing the spectral response band of SOC, and mining spectral characteristic parameters. In order to reduce data redundancy and noise, the HHO algorithm and SPA algorithm are combined with spectral reflectance data for characteristic band selection, and the back propagation neural network (BPNN) method is used to establish a soil organic carbon content prediction model, thereby improving the accuracy of the prediction model, and providing theoretical and technical support for soil carbon content monitoring. It provides important reference and guidance for soil carbon cycle research and soil management. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 A distribution map of the study area and sampling points provided by an embodiment of the present invention;

[0044] Figure 2 A flowchart of a method for predicting soil organic carbon content based on hyperspectral provided by an embodiment of the present invention;

[0045] Figure 3 A soil spectral reflectance curve diagram provided by an embodiment of the present invention;

[0046] Figure 4 The correlation coefficient curve diagram between SOC content and spectral reflectance provided in the embodiment of the present invention, wherein (a) is a correlation coefficient diagram between original spectral data and SOC content, (b) is a correlation coefficient diagram between spectral data after SNV preprocessing and SOC content, (c) is a correlation coefficient diagram between spectral data after FD preprocessing and SOC content, (d) is a correlation coefficient diagram between spectral data after SD preprocessing and SOC content, (e) is a correlation coefficient diagram between spectral data after SNV-FD preprocessing and SOC content, (f) is a correlation coefficient diagram between spectral data after SNV-SD preprocessing and SOC content;

[0047] Figure 5 A flowchart of using the HHO algorithm to perform the first screening of characteristic bands provided by an embodiment of the present invention;

[0048] Figure 6 The spectral characteristic band diagram selected by the HHO algorithm provided in the embodiment of the present invention, wherein (a) is the band selection probability determined by the HHO algorithm, and (b) is the characteristic band distribution after the HHO algorithm selection;

[0049] Figure 7The spectral characteristic band diagram screened by the HHO-SPA algorithm provided in the embodiment of the present invention, wherein (a) is the RMSE value corresponding to the number of characteristic bands selected by the HHO-SPA algorithm, and (b) is the distribution of characteristic bands after screening by the HHO-SPA algorithm;

[0050] Figure 8 A structural diagram of a BPNN model provided by an embodiment of the present invention;

[0051] Fig. 9 A graph showing soil organic carbon content predicted by the BPNN model provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0052] The specific implementation of the present invention is further described in detail below in conjunction with the accompanying drawings and examples. The following examples are used to illustrate the present invention, but are not intended to limit the scope of the present invention.

[0053] The soil sample collection area in this embodiment is Wuxing District, Huzhou City, Zhejiang Province, China, with geographical coordinates of 119°14'44.1"~120°29'52.9"E, 30°22'56.4"~31°10'56.1"N. The region has a subtropical monsoon marine climate, with an average annual temperature of about 16.9℃, an average annual precipitation of about 1023.3mm, and an altitude of 3 to 5m. The soil types in the region mainly include tidal soil and paddy soil. The sampling time is November 4, 2023. The sampling points are all bare soil without surface cover for excavation sampling. A total of 91 samples were collected in the study area. The sampling points in the study area are distributed as follows: Figure 1 shown.

[0054] In this embodiment, a soil organic carbon content prediction method based on hyperspectral is provided. Figure 2 As shown, the following steps are included:

[0055] Step 1: Collect and process soil samples, and conduct soil spectrum measurement and SOC content determination; collect several soil samples, air-dry and grind them, and sieve them through a 0.2 mm sieve; divide the processed soil into two parts, and measure the soil spectrum reflectance data and SOC content respectively; the SOC content is determined by potassium dichromate external heating method;

[0056] In this embodiment, a handheld GPS locator is used for precise positioning during soil sample collection, and the sampling depth is 0 to 20 cm. The five soil samples collected at each sampling point are mixed evenly and stored as a soil sample in the dark. The soil samples are air-dried and ground, and the soil samples processed by a 0.2 mm sieve are divided into two parts, which are used for soil spectral reflectance data measurement and SOC content determination, respectively. In this embodiment, the SOC content of the soil sample is determined by the potassium dichromate external heating method, and the SOC content determination statistics are shown in Table 1. It can be seen from Table 1 that the SOC content of the soil sample varies from 2.92 to 29.02 g / kg, and the coefficient of variation is 46.72%, showing moderate variability; the average values ​​of the training set and the validation set are 13.76 g / kg and 13.76 g / kg, respectively, and the standard deviations are 6.47 g / kg and 6.52 g / kg, respectively, indicating that the possibility of deviation between the training set and the validation set is small, ensuring the representativeness of the sample.

[0057] Table 1 Descriptive statistics of organic carbon content in soil samples

[0058]

[0059] Step 2: Determine soil spectral reflectance data: Use a ground spectrometer to collect spectral reflectance data of soil samples in a dark room;

[0060] In this embodiment, an ASD FieldSpec4 ground spectrometer is used to collect sample soil spectral reflectance data in a dark room, with a wavelength range of 350 to 2500 nm and a sampling interval of 1 nm. A probe with a field of view angle of 25° is placed vertically above 10 cm from the soil sample, and a 200W halogen lamp is used as the only light source, 45 cm from the soil sample, with a zenith angle of 15° to simulate sunlight. Take an appropriate amount of soil sample and pour it into a weighing dish, compact it slightly with glass and scrape it flat. Whiteboard calibration is performed before each measurement, and 10 spectral curves are obtained for each sample, and the spectral reflectance of the soil sample is obtained by taking the average value. All spectral curves are uniformly removed from the head and tail bands (350-400nm and 2400-2500nm) with greater noise influence. According to the SOC content, all soil samples were divided into five levels: ≤5, 5-10, 10-15, 15-20, and >20 g / kg. The average spectral reflectance of the soil at each level of SOC content was calculated to obtain the spectral reflectance curve of the soil at different SOC contents. In this embodiment, the spectral reflectance curve of the SOC content is shown in FIG. Figure 3As shown in the figure. It can be seen from the figure that within the 400-2400nm spectral band, the soil spectral reflectance decreases with the increase of SOC content, and the overall change trend of the spectral reflectance of different SOC contents is consistent. When the SOC content is ≤5g / kg, the average reflectance is 0.39; when the SOC content is 5-10g / kg, the average reflectance is 0.35; when the SOC content is 10-15g / kg, the average reflectance is 0.32; when the SOC content is 15-20g / kg, the average reflectance is 0.28; when the SOC content is greater than 20g / kg, the average reflectance is 0.26. The spectral reflectance increases greatly between 400 and 1000nm, the spectral reflectance changes slowly between 1000 and 1800nm, and the spectral reflectance fluctuates greatly between 1800 and 2400nm. There are obvious water absorption valleys in the soil spectral reflectance curve near 1400, 1900 and 2200nm. These absorption valleys are usually related to the vibration and expansion of water molecules, the vibration of chemical bonds such as hydroxyl (-OH), carbonyl (-CO), methyl (-CH) in organic matter, etc.

[0061] Step 3: Soil spectral reflectance data preprocessing;

[0062] Soil spectral reflectance data preprocessing is an essential data processing stage. It can reduce the influence of factors such as noise, stray signals and nonlinear spectral effects in soil spectral reflectance data, and plays a vital role in improving the accuracy and reliability of data.

[0063] In order to eliminate spectral noise and redundant information, the Savitzky-Golay (SG) smoothing method was first used to denoise the soil spectral reflectance data to obtain the original spectral reflectance data (R); in order to further enhance the correlation between the soil spectral reflectance data and SOC content, the original spectral reflectance data (R) was further transformed by standard normal variables (SNV) and then FD transformation;

[0064] The formula for soil spectral reflectance data processed by FD and SNV is:

[0065] R′(λ i )=[R(λ i+1 )-R(λ i-1 )] / (Δλ) (1)

[0066]

[0067] Among them, λ i is the wavelength value of band i, R(λ i ) is the spectral reflectance of band i, Δλ is the spectral reflectance of band λ i-1 to λi+1 The interval of R′(λ i ) is the first-order differential spectral reflectance value of band i; Y k,SNV is the spectral reflectance value of the kth soil sample after SNV transformation, Y k,i is the spectral reflectance value of the i-th band of the k-th soil sample, is the average spectral reflectance of the kth soil sample, and n is the number of bands in the soil sample;

[0068] In this embodiment, the original spectral reflectance data (R) are preprocessed by standard SNV, FD, SD and combined SNV-FD and SNV-SD, and the correlation coefficient curves between SOC content and spectral reflectance under different conditions are shown in Figure 4 As shown by Figure 4 The results of correlation analysis show that the original spectral reflectance data and the spectral reflectance data preprocessed in five ways have a high correlation with the SOC content.

[0069] Figure 4 a is the correlation coefficient diagram between the original spectral reflectance data and the SOC content. The SOC content is negatively correlated with the spectral reflectance, which is relatively smooth in the 400-1900nm band and fluctuates in the 1900-2400nm band. The maximum absolute value of the correlation coefficient (|r|) is 0.60 (P<0.01).

[0070] Figure 4 b is the correlation coefficient diagram between the spectral reflectance data after SNV preprocessing and the SOC content. The SOC content and spectral reflectance are positively correlated in the 400-550nm band, negatively correlated in the 550-1300nm band, and both positively and negatively correlated in the 1300-2400nm band, with large fluctuations and lack of regularity. The maximum absolute value of the correlation coefficient (|r|) is 0.50 (P<0.01).

[0071] Figure 4 c is the correlation coefficient diagram between the spectral reflectance data after FD preprocessing and the SOC content. Compared with Figure a, it is easier to find the inflection point of the curve, and the maximum absolute value of the correlation coefficient (|r|) is 0.51 (P<0.01).

[0072] Figure 4 d is the correlation coefficient diagram between the spectral reflectance data and SOC content after SD preprocessing. Compared with Figure c, more inflection points appear, but the correlation is not obvious. The maximum absolute value of the correlation coefficient (|r|) is 0.40 (P<0.01).

[0073] Figure 4e and Figure 4 f is the correlation coefficient diagram between the spectral reflectance data after SNV-FD and SNV-SD preprocessing and the SOC content. The correlation shows positive and negative fluctuations, with more prominent reflection peaks and absorption valleys, making it easier to find the inflection point of the curve. The maximum absolute value of the correlation coefficient (|r|) is 0.61 (P<0.01) and 0.53 (P<0.01), respectively. In summary, this embodiment selects the spectral reflectance data after SNV-FD preprocessing for subsequent feature band screening.

[0074] Step 4: Use a band selection algorithm to screen the characteristic bands of the spectral reflectance data; in order to extract the most relevant and important information from the huge spectral band array, thereby reducing data redundancy and noise. It is crucial to perform characteristic band selection in the processed soil spectral reflectance data, which helps to extract the most relevant and important information from the huge spectral band array, thereby reducing data redundancy and noise. This embodiment uses a band selection algorithm to screen the characteristic bands of the spectral reflectance data; constructs the HHO-SPA algorithm, first uses the Harris Hawk algorithm (HHO) to preliminarily screen the characteristic bands, and removes useless information bands and interference information bands; then uses the continuous projection algorithm (SPA) to perform secondary screening on the characteristic bands;

[0075] The HHO algorithm consists of three parts: global search phase, transition phase, and local development phase;

[0076] (1) Global search phase:

[0077] In the global search phase, the Harris hawk randomly perches in a certain place and searches for prey through two strategies. The position is updated with probability q during iteration. The formula is as follows:

[0078]

[0079] Among them, X(t) and X(t+1) are the positions of the Harris Hawk in the current and next iterations, t is the number of iterations, and X rank (t) is the randomly selected Harris Hawk position, X rabbit (t) is the position of the prey, that is, the position of the Harris hawk with the best fitness, ub and lb represent the upper and lower limits of the search space respectively, r1, r2, r3, r4, q are all random numbers between [0, 1];

[0080] X m (t) is the Harris Hawk average position, and the formula is as follows:

[0081]

[0082] Among them, X k(t) is the position of the kth Harris hawk in the population, and M is the population size;

[0083] (2) Transition stage

[0084] The HHO algorithm switches between the global search and local development stages according to the prey's escape energy and jump strength update. The Harris Hawk uses the corresponding predation strategy to update the position of the Harris Hawk according to the changes in the prey's escape energy and jump strength. The updates of the prey's escape energy and jump strength are shown in equations (5) and (6), respectively:

[0085]

[0086] J = random(0,2) (6)

[0087] Where E is the energy of the prey's escape, T is the maximum number of iterations, E0 is the initial state of the prey's energy, which is a random number between [-1, 1], and J is the jump strength, which is a random number between [0, 2]. When |E|≥1, it enters the global search phase, and when |E|<1, it enters the local development phase.

[0088] (3) Local development stage

[0089] Define r as a random number between [0,1], which is used to select different development strategies for Harris Hawk position update;

[0090] When 0.5≤|E|<1 and r≥0.5, a soft siege strategy is adopted to update the position:

[0091] X(t+1)=ΔX(t)-E|JX rabbit (t)-X(t)| (7)

[0092] Where ΔX(t)=X rabbit (t)-X(t) represents the difference between the prey's position and the Harris's hawk's current position;

[0093] When |E|<0.5 and r≥0.5, a hard siege strategy is adopted to update the position:

[0094] X(t+1)=X rabbit (t)-E|αX(t)| (8)

[0095] When 0.5≤|E|<1 and r<0.5, a soft encirclement strategy of asymptotic rapid dive is adopted to update the position:

[0096]

[0097] Y=X rabbit (t)-E|JX rabbit(t)-X(t)| (10)

[0098] Z=Y+S*Lf(D) (11)

[0099] Where f() is the fitness function, D is the dimension of the problem, S is a random vector of size 1*D, and LF() is the mathematical expression of Levy flight;

[0100] When |E|<0.5 and r<0.5, a hard encirclement strategy of asymptotic fast dive is adopted to update the position:

[0101]

[0102] Y′=X rabbit (t)-E|JX rabbit (t)-X m (t)| (13)

[0103] Z′=Y′+S*LF(D) (14)

[0104] In this embodiment, the process of using the HHO algorithm to perform preliminary screening of characteristic bands is as follows: Figure 5 As shown, specifically:

[0105] (1) Randomly initialize the Harris Hawk population as shown in the following formula:

[0106] X=rand(N,D)*(ub-lb)+lb (15)

[0107] Where X is the initialization population of Harris Hawks, N is the number of hawks, D is the dimension of the problem, rand(N,D) is a random number in the range, ub and lb represent the upper and lower limits of the search space respectively;

[0108] (2) The Harris Hawk population individuals are binary discretized as shown in the following formula:

[0109]

[0110] in, is the binary value, X ij is the original position value of individual i in the population in dimension j, Threshold is the binary discretization threshold, set Threshold = 0.5, i is the index of the individual in the population, and j is the dimension index of the individual;

[0111] (3) Update the escape energy E and jump strength J of the prey; the updates of the escape energy and jump strength of the prey are shown in equations (5) and (6) respectively;

[0112] (4) When |E|≥1, the global search phase is entered to update the population position; when |E|<1, the local development phase is entered to update the population position; the fitness values ​​of the updated population individuals are calculated, and the fitness function shown in formula (17) is designed:

[0113]

[0114] Among them, F is the fitness function to be optimized, α and β are weight parameters, α∈[0,1], and β=1-α, n is the number of selected feature bands, N is the number of all bands, and C is the determination coefficient;

[0115] (5) The position of the individual in the population with the best fitness value is taken as the new prey position; determine whether the maximum number of iterations has been reached. If so, output the prey position, with 1 representing selection and 0 representing non-selection, to obtain the selected feature band; otherwise, re-execute step (3);

[0116] In this embodiment, the process of secondary screening of the characteristic bands using the successive projection algorithm (SPA) is as follows: k(0) and Iterations are the initial iteration vector and the number of soil samples, respectively, and the spectral reflectance data matrix is ​​column A;

[0117] 1) Assign the ath column of the optional spectral reflectance data matrix to the vector x a , denoted as the initial iteration vector x k(0) ;

[0118] 2) Remove the previously selected spectral reflectance data matrix column vector, and the sum of the remaining matrix column vectors is denoted as s, as follows:

[0119] As shown in the formula:

[0120]

[0121] Among them, k(0),…,k(n-1) represent the band column index selected in each iteration process;

[0122] 3) Calculate vector x in sequence a Projection onto the remaining column vectors As shown in the following formula:

[0123]

[0124] Among them, x k(n-1) The k(n-1) columns of the spectral reflectance matrix are assigned to the vector x a The value after

[0125] 4) Select vector x a The largest spectral band is projected as shown in the following formula:

[0126]

[0127] 5) Let x a = P x , a ∈ s;

[0128] 6) Let n + 1. If (n + 1) < Iterations, then go back to step 2) to calculate in a loop.

[0129] This embodiment also compares two feature band selection algorithms, CARS and GA, with the HHO - SPA algorithm.

[0130] When using a heuristic algorithm for feature band selection, there is a certain degree of randomness, and the screening results vary slightly each time. Therefore, this embodiment runs 100 times and statistically analyzes the results. The average value of the selection probability is denoted as the threshold T, which is used as the basis for screening feature bands. The bands with a selection probability higher than the threshold are selected as feature bands. First, use the HHO algorithm to screen feature bands. The population size is set to 60, and the number of iterations is set to 100. The result is that the band selection diagram determined by the HHO algorithm is as Figure 6 shown. Select 123 variables with a probability exceeding the threshold (T = 0.03) as feature bands. The number of feature bands obtained by the HHO algorithm is significantly reduced, only accounting for 6.15% of the full band, mainly concentrated in 408 - 582, 730 - 930, 1047 - 1068, 1280 - 1287, 1433 - 1452, 1922 - 1942, 2147 - 2203, and 2259 - 2265 nm.

[0131] Secondly, use the SPA algorithm for secondary feature band screening. The spectral feature band diagram screened by the HHO - SPA algorithm is as Figure 7 shown. When the SPA algorithm screens feature bands, a root mean square error value RMSE is obtained through cross - validation of a multiple linear regression model, and the minimum value of RMSE is found. The corresponding band combination is used as the feature band. The iteration range of the number of feature variables in the algorithm is set to 2 - 35. When the number of feature variables is between 1 - 15, RMSE drops rapidly and gradually levels off after 15. Therefore, 15 is selected as the number of feature variables, and the corresponding bands are screened as: 413, 420, 447, 475, 516, 545, 1018, 1152, 1285, 1796, 1822, 2049, 2149, 2283, and 2363 nm.

[0132] Step 5: Establish a hyperspectral prediction model for SOC content to predict soil organic carbon content and conduct model testing;

[0133] The characteristic bands selected by the characteristic band selection algorithm are set as independent variables, and the SOC content is set as the dependent variable. The back propagation neural network (BPNN) method is used to construct the SOC content hyperspectral prediction model; BPNN consists of an input layer, one or more hidden layers, and an output layer. BPNN always consists of one or more hidden layers, allowing the network to model complex functions. It mainly consists of two processes: forward information propagation and error back propagation. Figure 8 As shown, the mathematical relationship between these three layers can be expressed as follows:

[0134] Input layer to hidden layer:

[0135]

[0136] Hidden layer to output layer:

[0137]

[0138] Among them, y m and b Represent the input layer and the hidden layer input respectively; y t represents the predicted value of SOC content of soil sample; μ bm and λ ob represents the network weights of the output layer and the hidden layer; μ b and λ o is the threshold of the hidden layer and the output layer; 0≤μ b ,μ bm ≤1,0≤λ o ,λ ob ≤1; n and I are the number of nodes in the input layer and hidden layer; f I and f o denote the activation functions of the hidden layer and the output layer respectively.

[0139] In this example, in order to evaluate the performance of the SOC content hyperspectral prediction model, the root mean square error (RMSE) and the coefficient of determination (R 2 ) and relative percentage deviation (RPD) were used as indicators to evaluate the accuracy and stability of the model. 2 It mainly quantifies the correlation between the predicted values ​​and the actual values ​​of the model. The closer the value is to 1, the stronger the correlation between the predicted values ​​and the actual values, indicating that the model performance is better. RMSE measures the root mean square of the difference between the predicted values ​​and the actual observed values. The smaller the RMSE value, the smaller the prediction error and the better the model performance. RPD provides a measure of model accuracy. When RPD≤1.4, the model is less accurate and it is almost impossible to accurately estimate the sample. When 1.4≤RPD<2, the accuracy of the model allows for a rough estimate of the sample. When RPD≥2, the model is more accurate and can better estimate the sample. The theoretical formula is as follows:

[0140]

[0141]

[0142]

[0143] Where n is the number of samples, y i is the measured value, Y i is the predicted value, is the mean of the measurements and SD is the standard deviation of the analyzed sample.

[0144] BPNN is a common artificial neural network model used to solve regression problems. The process of using the back propagation neural network (BPNN) method to construct a hyperspectral prediction model for SOC content is as follows: First, determine the number of nodes in the input layer, hidden layer, and output layer, and select appropriate activation functions and loss functions. Subsequently, the model is trained using the training set, and the connection weights between neurons are continuously adjusted using the back propagation algorithm until the preset training stop condition is reached. Finally, the performance of the model is evaluated through cross-validation, and the model parameters are adjusted to improve the prediction accuracy, and finally a reliable hyperspectral prediction model for SOC content is obtained.

[0145] The back propagation neural network BPNN model used in this embodiment has a three-layer neural network (an input layer, a hidden layer, and an output layer), each layer is composed of a number of neurons. The ReLU activation function is used, the target error is set to 0.0001, the number of iterations is set to 500, and the learning rate is set to 0.01.

[0146] In this embodiment, the results of establishing the BPNN model based on the full-band dataset, the CARS dataset, the GA dataset, and the HHO-SPA dataset are shown in Table 2.

[0147] Table 2 BPNN modeling results

[0148]

[0149] The training set R of the model after feature selection by HHO-SPA algorithm 2 is 0.93, which is higher than the other three datasets. 2is 0.91, which is also higher than the other three data sets. This shows that the generalization ability of the model on the validation set has been improved, that is, the model has better adapted to new data. The RMSE of the training set has been reduced to 1.76, and the RMSE of the validation set has also been reduced to 1.87. This shows that the prediction error of the model has been improved to a certain extent. The RPD value increased from 1.72 of the full-band model to 3.40, indicating that the prediction effect of the model has been significantly improved. The feature selection of the HHO-SPA algorithm helps to improve the prediction accuracy and generalization ability of the model, making the model more practical and stable. The prediction results of the BPNN model based on the HHO-SPA data set are shown in Figure 2. Fig. 9 shown.

[0150] In general, the model after feature selection by the HHO-SPA algorithm performs significantly better than the models of other datasets on the validation set, and has better prediction effect and generalization ability.

[0151] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some or all of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope defined by the claims of the present invention.

Claims

1. A method for predicting soil organic carbon content based on hyperspectral, characterized in that: The following steps are involved: Step 1: Collect and process soil samples, conduct soil spectral measurements and SOC content determination; Step 2: Determine soil spectral reflectance data: Step 3: Soil spectral reflectance data preprocessing: In order to eliminate spectral noise and redundant information, the SG smoothing method is first used to denoise the soil spectral reflectance data to obtain the original spectral reflectance data; in order to further enhance the correlation between the soil spectral reflectance data and the SOC content, the original spectral reflectance data is transformed into a standard normal variable and then into a first-order differential transformation; Step 4: Use the band selection algorithm to screen the characteristic bands of the spectral reflectance data; first use the Harris Hawk algorithm HHO to preliminarily screen the characteristic bands, and then use the continuous projection algorithm SPA to perform secondary screening on the characteristic bands; Step 5: Establish a hyperspectral prediction model for SOC content to predict soil organic carbon content and perform model verification; The characteristic bands selected by the characteristic band selection algorithm were set as independent variables, SOC content was set as the dependent variable, and the back propagation neural network BPNN method was used to construct the SOC content hyperspectral prediction model.

2. The method for predicting soil organic carbon content based on hyperspectral according to claim 1, characterized in that: The specific method of step 1 is: Collect several soil samples, air-dry them naturally, grind them, and sieve them; divide the processed soil into two parts, and measure the soil spectral reflectance data and SOC content respectively; The SOC content was determined by potassium dichromate external heating method.

3. The method for predicting soil organic carbon content based on hyperspectral according to claim 1, characterized in that: The step 2 uses a ground spectrometer to collect spectral reflectance data of soil samples in a dark room, the wavelength range of the spectral reflectance data is 350 to 2500 nm, and the sampling interval is 1 nm.

4. The method for predicting soil organic carbon content based on hyperspectral according to claim 1, characterized in that: The process of using the HHO algorithm to perform the first screening of the characteristic bands in step 4 is as follows: (1) Randomly initialize the Harris Hawk population as shown in the following formula: X=rand(N,D)*(ub-lb)+lb Where X is the initialization population of Harris Hawks, N is the number of hawks, D is the dimension of the problem, rand(N,D) is a random number in the range, ub and lb represent the upper and lower limits of the search space respectively; (2) The Harris Hawk population individuals are binary discretized as shown in the following formula: in, is the binary value, X ij is the original position value of individual i in the population in dimension j, Thresh old is the binary discretization threshold, set Thresh old = 0.5, i is the index of the individual in the population, and j is the dimension index of the individual; (3) Update the escape energy E and jump strength J of the prey; (4) When |E|≥1, the global search phase is entered to update the population position; when |E|<1, the local development phase is entered to update the population position; the fitness function shown in the following formula is designed to calculate the fitness value of the updated population individuals: Among them, F is the fitness function to be optimized, α and β are weight parameters, α∈[0,1], and β=1-α, n is the number of selected feature bands, N is the number of all bands, and C is the determination coefficient; (5) The position of the individual in the population with the best fitness value is taken as the new prey position; determine whether the maximum number of iterations has been reached. If so, output the prey position, with 1 representing selection and 0 representing non-selection, to obtain the selected feature band; otherwise, re-execute step (3).

5. The method for predicting soil organic carbon content based on hyperspectral according to claim 4, characterized in that: The process of performing secondary screening of the characteristic bands using the continuous projection algorithm SPA in step 4 is as follows: Note x k(0) and Iterations are the initial iteration vector and the number of soil samples, respectively, and the spectral reflectance data matrix is ​​column A; 1) Assign the ath column of the optional spectral reflectance data matrix to the vector x a , denoted as the initial iteration vector x k(0) ; 2) Remove the previously optional spectral reflectance data matrix column vectors, and denote the sum of the remaining matrix column vectors as s, as shown in the following formula: where k(0), …, k(n - 1) represent the band column indices selected in each iteration step; 3) Calculate vector x in sequence a Projection onto the remaining column vectors As shown in the following formula: Among them, x k(n-1) The k(n-1) columns of the spectral reflectance matrix are assigned to the vector x a The value after 4) Select vector x a The largest spectral band is projected as shown in the following formula: 5) Let x a =P x ,a∈s; 6) Let n = n + 1. If (n + 1) < Iterations, then go back to step 2) and calculate in a loop.

6. The method for predicting soil organic carbon content based on hyperspectral according to claim 1, characterized in that: The BPNN consists of an input layer, one or more hidden layers, and an output layer; the mathematical relationship between these three layers can be expressed as follows: From the input layer to the hidden layer: From the hidden layer to the output layer: Among them, y m and b Represent the input layer and the hidden layer input respectively; y t represents the predicted value of SOC content of soil sample; μ bm and λ ob represents the network weights of the output layer and the hidden layer; μ b and λ o is the threshold of the hidden layer and the output layer; 0≤μ b ,μ bm ≤1,0≤λ o ,λ ob ≤1; n and I are the number of nodes in the input layer and hidden layer; f I and f o denote the activation functions of the hidden layer and the output layer respectively.

Citation Information

Cited By

  • Soil nutrient detection method and system fusing prior guidance and global optimization

    CN122200384A

  • A soil nutrient detection method and system fusing priori guidance and global optimization

    CN122200384B