Method for detecting soil surface hardness based on LIBS (Laser-induced Breakdown Spectroscopy)

By integrating the LIBS spectral detection method, which combines plasma temperature and the deviation ratio of Cu and Cr elemental spectral lines from the original plasma, with the XGBoost model, the complexity and accuracy issues of soil surface hardness detection have been resolved, achieving efficient soil surface hardness detection.

CN120847071APending Publication Date: 2025-10-28CHANGCHUN UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511190645.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-25
Publication Date
2025-10-28

AI Technical Summary

Technical Problem

Existing LIBS technology for soil surface hardness testing suffers from problems such as complex detection, low efficiency, and inability to achieve in-situ online detection. Furthermore, the complex composition of soil leads to mutual interference between elemental spectral lines, affecting the accuracy of detection.

Method used

The method of detecting soil surface hardness using LIBS spectroscopy is adopted. By using plasma temperature and the deviation ratio of Cu and Cr elemental spectral lines as inputs, the XGBoost model is used to predict the hardness of soil samples. Samples with different hardness are prepared by mixing standard soil with chromium nitrate and copper nitrate. Characteristic spectral lines are identified and feature-level fusion is performed. Finally, the trained XGBoost model is used for detection.

Benefits of technology

It achieves accurate detection of soil surface hardness with a root mean square error of 2.38 HA and an average relative error of 4.12%, meeting the detection requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120847071A_ABST
    Figure CN120847071A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of soil detection, and particularly relates to a method for detecting soil surface hardness based on LIBS (Laser-induced Breakdown Spectroscopy), which specifically comprises the following steps: mixing standard soil, crystalline chromic nitrate and copper nitrate according to different proportions, applying different pressures by using a tablet press to prepare soil samples with different surface hardness, and collecting LIBS of each soil sample; for each LIBS spectrum, identifying characteristic spectral lines of Cr and Cu elements so as to calculate corresponding plasma temperatures and spectral line off-original ratios of the Cr and Cu elements, and carrying out characteristic level fusion; inputting the fused feature data of each soil sample and the corresponding surface hardness value into an XGBoost model for training; and predicting the surface hardness of the soil to be detected by using the trained XGBoost model. According to the method, the LIBS technology serves as a new means for evaluating the soil surface hardness, the surface hardness of a soil sample can be well detected, the root mean square error is 2.38 HA, the average relative error is 4.12%, and the detection requirement can be met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of soil testing technology, and in particular relates to a method for detecting soil surface hardness based on LIBS spectroscopy. Background Technology

[0002] LIBS technology, with its advantages in real-time, non-contact detection, has been widely used in various testing scenarios. Especially in recent years, with continuous research and improvement by researchers, LIBS technology has become more mature, and it is now increasingly being applied in the field of soil testing as a rapid, sample-process-free spectroscopic analysis technique.

[0003] Traditional detection methods, such as atomic absorption spectrometry (AAS) and inductively coupled plasma atomic emission spectrometry (ICP-AES), mostly require a series of complex processes including sampling and sample pretreatment, resulting in long detection cycles, low efficiency, and the inability to achieve in-situ online detection. While LIBS (Liquid Spectroscopy) has significantly promoted the development of the soil testing industry due to its relatively low cost and superior performance, there is still a technological gap in its application to soil surface hardness detection. Because soil composition is complex, with numerous elements and mutual interference between elemental spectral lines, coupled with significant fluctuations in laser excitation energy, it is difficult to use LIBS elemental spectral line intensity as the sole basis for soil surface hardness detection. To more effectively detect soil surface hardness, further research is needed on other physicochemical information in the LIBS spectrum to reduce the impact of laser energy fluctuations and inter-spectral line interference on soil surface hardness detection. Summary of the Invention

[0004] In view of this, the purpose of this application is to provide a method for detecting soil surface hardness based on LIBS spectroscopy. The method uses LIBS technology as a new means to evaluate soil surface hardness, integrates plasma temperature and the deviation ratio of Cu and Cr elemental spectral lines as inputs to an XGBoost model, and predicts the hardness of unknown soil samples. It can detect the surface hardness of soil samples well, with a root mean square error of 2.38 HA and an average relative error of 4.12%, which can meet the detection requirements.

[0005] This application provides a method for detecting soil surface hardness based on LIBS spectroscopy, including:

[0006] Standard soil, crystalline chromium nitrate, and copper nitrate were mixed in different proportions, and soil samples with different surface hardness were prepared by applying different pressures using a tablet press. The LIBS spectra of each soil sample were then collected.

[0007] For each LIBS spectrum, the characteristic spectral lines of Cr and Cu are identified to calculate the corresponding plasma temperature and the spectral line deviation ratio of Cr and Cu, and then feature-level fusion is performed.

[0008] The fused feature data and corresponding surface hardness values ​​of each soil sample are input into the XGBoost model for training.

[0009] The surface hardness of the soil to be tested is predicted using a trained XGBoost model.

[0010] Furthermore, the method of preparing soil samples with different surface hardness by mixing standard soil, crystalline chromium nitrate, and copper nitrate in different proportions, and applying different pressures using a tablet press includes:

[0011] Standard soil, crystalline chromium nitrate, and copper nitrate were mixed in a mortar in different proportions, and deionized water was added and stirred thoroughly to ensure that the sample was mixed evenly. After drying, grinding, and sieving, sample powders of different concentrations with sufficiently small particle sizes were obtained.

[0012] Take 3g of sample powder into a mold, and use a tablet press to apply pressure of 10, 20 and 30 MPa to the sample powder of different concentrations for 30 minutes to press the sample powder into a disc-shaped sheet with a diameter of 30 mm and a thickness of 2 mm to obtain soil samples with different surface hardness. The surface hardness of each soil sample is then tested using a Shore hardness tester.

[0013] Furthermore, the characteristic spectral lines of the Cr and Cu elements include: CrI 425.44nm, CrI 427.48nm, CrI 428.97nm, CrI 520.84nm, CrII 405.41nm, CuI 324.75nm and CuII 368.65nm;

[0014] The spectral line ratios of Cr and Cu elements include: Cr II 405.41nm / Cr I 520.84nm, Cr II 405.41nm / Cr I 428.97nm, Cr II 405.41nm / Cr I 427.48nm, Cr II 405.41nm / CrI 425.44nm, and CuII 368.65nm / CuI 324.75nm.

[0015] Furthermore, the plasma temperature is calculated in the following manner:

[0016] Extract the spectral information of any characteristic spectral line from the LIBS spectrum and substitute it into the Boltzmann formula shown below:

[0017]

[0018] In the formula, I is the intensity of the characteristic spectral line, λ is the wavelength of the characteristic spectral line, and g k As the statistical weight of the upper energy level, A ki For the transition probability, E k Where is the energy of the upper level, k is the Boltzmann constant, T is the plasma temperature, Z is usually the partition function of the ground state statistical weight, h is Planck's constant, c is the speed of light, and N0 is the number of particles in the ground state.

[0019] via the y-axis and x-coordinate E k Obtain the fitted slope This leads to the determination of the plasma temperature.

[0020] Furthermore, the XGBoost model is trained in the following manner:

[0021] Step 1: Collect training data from soil samples with different surface hardness {(x1,y1),(x2,y2),...,(x...} n ,y n )} as input, with mean squared error As the loss function during the training process, the objective function of the XGBoost model can be expressed as:

[0022]

[0023] In the formula, y i This indicates the true hardness value of the soil. Let γ represent the predicted soil hardness value, γ represent the regularization term of the leaf nodes in the decision tree, T represent the number of leaf nodes in the decision tree, λ represent the number of leaf nodes, and w represent the weight of the leaf nodes. j Let be the weight of the leaf node of the j-th tree;

[0024] Step 2: By iterating continuously, the objective function is minimized. Based on the characteristics of decision trees and Boosting algorithms, the objective function is transformed into the following form for the first time:

[0025]

[0026] In the formula, f represents the output of the first t-1 trees. (t) (x i ) represents the prediction result of the t-th tree, with other parameters remaining unchanged;

[0027] Based on the above formula, the first decision tree is trained and the prediction result is output.

[0028] Step 3: Perform a second-order Taylor expansion on the loss function. To make the objective function simpler, ignore its constant term. The objective function is transformed a second time as follows:

[0029]

[0030] In the formula, g i h is the first derivative of the loss function. i This is the second derivative of the loss function;

[0031] Since the loss function is a known constant and has no impact on the construction result of the decision tree, the objective function is further simplified to:

[0032]

[0033] Step 4: Expand the regularization term and further simplify the objective function to:

[0034]

[0035] In the formula, I j This represents all samples located in the j-th leaf node;

[0036] Step 5: Split the decision tree. At each step, attempt to split all leaf nodes at the same level, determining whether the split node can continue to split downwards. The criteria for this determination are:

[0037]

[0038] In the formula, the subscript L represents the optimal value of the objective function when partitioning to the left subtree, and the subscript R represents the optimal value of the objective function when partitioning to the right subtree. In actual partitioning, F is adopted. split Divide according to the principle of maximizing;

[0039] Step 6, when F split When the value is less than 0, it means that the leaf node no longer splits, and the decision tree stops growing and training ends.

[0040] The method for detecting soil surface hardness based on LIBS spectroscopy provided in this application uses LIBS technology as a new means to assess soil surface hardness. It integrates plasma temperature and the deviation ratio of Cu and Cr elemental spectral lines as inputs to an XGBoost model to predict the hardness of unknown soil samples. The method can detect the surface hardness of soil samples well, with a root mean square error of 2.38 HA and an average relative error of 4.12%, which meets the detection requirements. Attached Figure Description

[0041] Figure 1 A diagram of the LIBS spectral acquisition device provided in an embodiment of this application is shown;

[0042] Figure 2 This illustration shows a LIBS spectrum from the acquired spectra provided in an embodiment of this application;

[0043] Figure 3 This application provides a graph showing the trend of plasma temperature versus soil surface hardness according to an embodiment of the present application.

[0044] Figure 4 The diagram shows ablation pits of soil samples with different surface hardness provided in the embodiments of this application;

[0045] Figure 5 This paper shows the trend of the Cr and Cu element ratios from their original values ​​as a function of soil surface hardness, as provided in an embodiment of this application.

[0046] Figure 6 A flowchart of the method for detecting soil surface hardness based on LIBS spectroscopy provided in this application embodiment is shown;

[0047] Figure 7 The diagram shows the calibration curve of the actual hardness versus the predicted value of the predicted sample provided in the embodiments of this application. Detailed Implementation

[0048] To make the objectives, technical solutions, and advantages of this technical solution clearer, the following detailed description, in conjunction with specific embodiments, further illustrates this technical solution. It should be understood that these descriptions are merely exemplary and not intended to limit the scope of this technical solution.

[0049] Example 1: Analysis of the variation of plasma with soil surface hardness:

[0050] First, let me introduce the experimental equipment used in this application:

[0051] Please see as follows Figure 1The LIBS spectral acquisition setup shown uses a Nd:YAG laser (Beamtech, Nimma-400) with an output wavelength of 1064 nm, an excitation energy of 50 mJ, a pulse width of 8 ns, and a pulse frequency of 1 Hz as the light source. The laser beam is focused 2 mm below the sample surface using a 120 mm focal length focusing lens, exciting the sample and generating plasma. A half-wave plate and a Glan prism form an energy attenuation system to adjust the pulse energy of the ablation target. The generated plasma spectral signal is coupled via an optical fiber probe to a spectrometer (Andor, Me5000) with an ICCD for spectroscopic processing. The spectrometer has a spectral range of 200–975 nm and a resolution of λ / Δλ = 5000. A three-dimensional moving platform controls the sample movement in the experiment. The laser and spectrometer are synchronously controlled by a digital delay generator (Berkeley Nucleonics Corp., BNC575). The ICCD trigger signal is the Q-switching signal from the laser, and the spectrometer's detection delay is 0.8 μs. All experiments in this application were conducted under the above conditions.

[0052] Secondly, soil samples with different surface hardness were prepared:

[0053] Standard soil (GBW07403), crystalline Cr(NO3)3·9H2O, and Cu(NO3)2·3H2O were mixed in a specific ratio. The original concentrations of Cr and Cu in the standard soil were very low, approximately 2.28 μg and 6.4 μg, respectively, and therefore negligible compared to the concentrations of the added Cr and Cu. Specifically, the standard soil was mixed with chromium nitrate and copper nitrate in a mortar. To ensure uniform mixing, deionized water was added and the mixture was thoroughly stirred. The mixture was then dried, ground, and sieved to obtain a sufficiently small sample powder. 3g of the sample powder was placed in a mold, and pressures of 10, 20, and 30 MPa were applied to the powder at different concentrations using a tablet press for 30 minutes, pressing the powder into round discs with a diameter of 30 mm and a thickness of 2 mm to obtain soil samples with different surface hardnesses. The surface hardness of each soil sample was measured using a Shore hardness tester. The specific parameters of the soil samples are shown in Table 1.

[0054] Table 1. Specific parameters of soil samples

[0055]

[0056] Next, the physicochemical information and parameters related to soil surface hardness were analyzed:

[0057] Use as Figure 1The LIBS spectral acquisition device shown measured the LIBS spectra of soil samples in the 300-600 nm range. Combining information from the NIST database with the acquired spectral data, characteristic spectral lines of Cr and Cu were identified using Spectraline software. CrI (425.44 nm, 427.48 nm, 428.97 nm, 520.84 nm), CrII (405.41 nm), CuI (324.75 nm), and CuII (368.65 nm) were selected as analytical lines to analyze the atomic and ionic lines of Cr and Cu, respectively. To reduce the impact of environmental fluctuations and systematic errors on the detection results, 20 sample points were collected for each soil sample, and the average of five spectra from each sample point was used as the final result. Please refer to [link to relevant documentation]. Figure 2 The image shows one of the LIBS spectra from the collected spectra.

[0058] (1) The effect of soil surface hardness on plasma temperature:

[0059] Under the assumption of local thermodynamic equilibrium, the plasma temperature calculated for each element is theoretically the same. Therefore, taking Cr as an example, the variation of plasma temperature under different surface hardnesses is calculated. The spectral parameters of the characteristic lines used are shown in Table 2.

[0060] Table 2. Spectral parameters of characteristic chromium lines

[0061]

[0062] Plasma temperature was calculated for soil samples S4, S9, and S14, which had the same Cr element concentration but different surface hardness. Specifically, the plasma temperature was obtained using the Boltzmann formula, with Cr as the analyte.

[0063]

[0064] In the formula, I is the intensity of the characteristic spectral line, λ is the wavelength of the characteristic spectral line, and g k As the statistical weight of the upper energy level, A ki For the transition probability, E k Where is the energy of the upper level, k is the Boltzmann constant, T is the plasma temperature, Z is usually the partition function of the ground state statistical weight, h is Planck's constant, c is the speed of light, and N0 is the number of particles in the ground state.

[0065] via the y-axis and x-coordinate E k The fitted slope can be obtained. The plasma temperature was then obtained. This was based on soil samples numbered S4, S9, and S14. Figure 3The graph shows the trend of plasma temperature versus soil surface hardness. Furthermore, while acquiring LIBS spectra, the general outline of the ablation pits in the soil sample was photographed, resulting in the following image. Figure 4 The image shows ablation pits of soil samples with different surface hardnesses. The surface hardnesses of the soil samples sealed in the ablation pits are 43 HA, 70 HA, and 98 HA, corresponding to... Figure 4 (a), (b), (c).

[0066] from Figure 3 It can be seen that the excitation temperature of the plasma increases with the increase of soil surface hardness. This is because as soil surface hardness increases, the ablation of the soil sample surface decreases, which increases the absorption of laser energy by the plasma, leading to more intense particle collisions within the plasma and increasing the plasma temperature. Figure 4 This point has been proven, from Figure 4 The outline of the ablation pit can be roughly determined. As the soil surface hardness increases, the volume of the ablation pit decreases, and the ablation amount of the sample decreases. The correlation coefficient R² between soil surface hardness and plasma temperature can reach 0.928, showing a good linear relationship. Therefore, plasma temperature can be used as an evaluation index for predicting soil surface hardness.

[0067] (2) The effect of soil surface hardness on the ionic and atomic lines of Cr and Cu:

[0068] To investigate the effects of changes in soil surface hardness on atoms and ions in plasma, samples S4, S9, and S14 were used as analytical targets to study the trends in the ion-to-origin ratios of Cr and Cu elements with soil surface hardness. For each sample, the maximum and minimum values ​​were removed from 20 spectra, and the average of the remaining 18 spectra was calculated. This application establishes the ratios of CrII 405.41nm / CrI 425.44nm and CuII 368.65nm / CuI 324.75nm as the ordinate and soil surface hardness as the abscissa, as shown below. Figure 5 The graph shows the trend of the Cr and Cu element ratios as a function of soil surface hardness.

[0069] from Figure 5 It can be seen that the ratio of ion lines to atomic lines for both Cr and Cu elements increases with increasing soil surface hardness. This indicates that increased soil surface hardness leads to an increase in the number of ions in the plasma. This may be because a harder soil surface has a stronger repulsive force, increasing the shock wave front velocity and thus increasing the probability of particle collisions, leading to an increase in the ionization rate of atoms. Furthermore, the linear relationship between soil surface hardness and the ratio of ion lines to atomic lines shows that the ratio of ion lines to atomic lines can also be used as an evaluation index for soil surface hardness detection.

[0070] Example 2: A method for detecting soil surface hardness based on LIBS spectroscopy:

[0071] Based on the above analysis, this application creatively proposes to use the XGBoost model to detect the surface hardness of soil samples. XGBoost can integrate multiple different base learners, each of which contributes differently to the analysis results. Through continuous iteration, different weights are assigned to different base learners, and base learner samples that predict incorrectly are given greater weights. The model uses weak learners (decision trees) as base learners.

[0072] Please see as follows Figure 2 The flowchart shown is for a method of detecting soil surface hardness based on LIBS spectroscopy. Figure 2 As shown, the method includes:

[0073] S101. Using standard soil, crystalline chromium nitrate and copper nitrate, mixed in different proportions, soil samples with different surface hardness were prepared by applying different pressures using a tablet press, and the LIBS spectra of each soil sample were collected.

[0074] In practical implementation, soil samples with different surface hardness can be prepared in the following ways:

[0075] S1011. Standard soil, crystalline chromium nitrate, and copper nitrate are mixed in a mortar in different proportions, and deionized water is added and stirred thoroughly to make the sample uniform. After drying, grinding, and sieving, sample powders of different concentrations with sufficiently small particle sizes are obtained.

[0076] S1012. Take 3g of sample powder into a mold, and use a tablet press to apply pressure of 10, 20 and 30 MPa to the sample powder of each concentration for 30 minutes to press the sample powder into a disc-shaped sheet with a diameter of 30 mm and a thickness of 2 mm to obtain soil samples with different surface hardness. The surface hardness of each soil sample is then tested with a Shore hardness tester.

[0077] Then, using, as Figure 1 The LIBS spectral acquisition device shown measured the LIBS spectra of various soil samples in the range of 300-600 nm.

[0078] S102. For each LIBS spectrum, identify the characteristic spectral lines of Cr and Cu elements to calculate the corresponding plasma temperature and the spectral line deviation ratio of Cr and Cu elements, and perform characteristic-level fusion.

[0079] In this step, the characteristic spectral lines of Cr and Cu elements include: CrI 425.44nm, CrI 427.48nm, CrI 428.97nm, CrI 520.84nm, CrII 405.41nm, CuI 324.75nm, and CuII 368.65nm. The spectral line ratios of Cr and Cu elements are: CrII 405.41nm / CrI 520.84nm, CrII 405.41nm / CrI 428.97nm, CrII 405.41nm / CrI 427.48nm, CrII 405.41nm / CrI 425.44nm, and Cu II 368.65nm / CuI 324.75nm.

[0080] Furthermore, the plasma temperature was calculated using the following method:

[0081] Extract the spectral information of any characteristic spectral line from the LIBS spectrum and substitute it into the Boltzmann formula shown below:

[0082]

[0083] In the formula, I is the intensity of the characteristic spectral line, λ is the wavelength of the characteristic spectral line, and g k As the statistical weight of the upper energy level, A ki For the transition probability, E k Where is the energy of the upper level, k is the Boltzmann constant, T is the plasma temperature, Z is usually the partition function of the ground state statistical weight, h is Planck's constant, c is the speed of light, and N0 is the number of particles in the ground state.

[0084] via the y-axis and x-coordinate E k Obtain the fitted slope This leads to the determination of the plasma temperature.

[0085] It should be noted that the plasma temperature and Cu and Cr elemental spectral line deviation ratios for soil samples with different surface hardness need to be normalized to eliminate the influence of dimensions and unify the data scale.

[0086] S103. Input the fused feature data and corresponding surface hardness values ​​of each soil sample into the XGBoost model for training.

[0087] In practice, the XGBoost model is trained in the following way:

[0088] S1031, The training data of soil samples with different surface hardness {(x1,y1),(x2,y2),...,(x n ,y n)} as input, with mean squared error As the loss function during the training process, the objective function of the XGBoost model can be expressed as:

[0089]

[0090] In the formula, y i This indicates the true hardness value of the soil. Let γ represent the predicted soil hardness value, γ represent the regularization term of the leaf nodes in the decision tree, T represent the number of leaf nodes in the decision tree, λ represent the number of leaf nodes, and w represent the weight of the leaf nodes. j Let be the weight of the leaf node of the j-th tree;

[0091] S1032. By iterating continuously to minimize the objective function, based on the characteristics of decision trees and Boosting algorithms, the objective function is transformed into the following form for the first time:

[0092]

[0093] In the formula, f represents the output of the first t-1 trees. (t) (x i ) represents the prediction result of the t-th tree, with other parameters remaining unchanged;

[0094] Based on the above formula, the first decision tree is trained and the prediction result is output.

[0095] S1033. Perform a second-order Taylor expansion on the loss function. To make the objective function simpler, ignore its constant term. The objective function is transformed in the second way as follows:

[0096]

[0097] In the formula, g i h is the first derivative of the loss function. i This is the second derivative of the loss function;

[0098] Since the loss function is a known constant and has no impact on the construction result of the decision tree, the objective function is further simplified to:

[0099]

[0100] S1034. Expand the regularization term and further simplify the objective function as follows:

[0101]

[0102] In the formula, I j This represents all samples located in the j-th leaf node;

[0103] S1035. Split the decision tree, attempting to split all leaf nodes at the same level each time, and determining whether a split node can continue to split downwards, based on the following criteria:

[0104]

[0105] In the formula, the subscript L represents the optimal value of the objective function when partitioning to the left subtree, and the subscript R represents the optimal value of the objective function when partitioning to the right subtree. In actual partitioning, F is adopted. split Divide according to the principle of maximizing;

[0106] S1036, when F split When the value is less than 0, it means that the leaf node no longer splits, and the decision tree stops growing and training ends.

[0107] S104. Predict the surface hardness of the soil to be tested using the trained XGBoost model.

[0108] In this step, the LIBS spectrum of the soil to be tested is collected, and the corresponding plasma temperature and the spectral line deviation ratio of Cr and Cu elements are calculated. Then, feature-level fusion is performed. The fused feature data of the soil to be tested is input into the trained XGBoost model to predict the surface hardness of the soil to be tested.

[0109] Example 3: Verification Experiment

[0110] After the XGBoost model was trained, the main parameters were adjusted to further improve its detection performance. Specifically, `Subsample`, related to the sampling ratio of the training set, was set to 0.5. `n_estimators` represents the number of weak learners; too many weak learners increase the risk of overfitting and reduce model speed. `max_depth` represents the model's complexity, and `learning_rate` represents the model's learning rate; a low learning rate makes the model more stable. Through grid search, `n_estimators`, `max_depth`, and `learning_rate` were set to 40, 5, and 0.1, respectively.

[0111] Based on the above model parameters, predictions were made for samples S3, S7, and S14, and the results are as follows: Figure 7 The figure shows the calibration curves of the predicted hardness versus the actual hardness of the sample. As can be seen from the figure, the predicted surface hardness is almost identical to the actual surface hardness, with a Lorentz fitting coefficient R² of 0.997, a root mean square error (RMSE) of 2.38 HA, and a mean relative error (MRE) of 4.12%. The data indicate that LIBS technology, by fusing plasma temperature and the deviation ratios of Cr and Cu elemental spectra from the original values, can be used to detect the surface hardness of soil samples.

[0112] The above content is only a preferred embodiment of the present invention. For those skilled in the art, many changes can be made in the specific implementation and application scope based on the ideas of the present invention. As long as these changes do not depart from the concept of the present invention, they all fall within the protection scope of the present invention.

Claims

1. A method for detecting soil surface hardness based on LIBS spectroscopy, characterized in that, The method includes: Standard soil, crystalline chromium nitrate, and copper nitrate were mixed in different proportions, and soil samples with different surface hardness were prepared by applying different pressures using a tablet press. The LIBS spectra of each soil sample were then collected. For each LIBS spectrum, the characteristic spectral lines of Cr and Cu are identified to calculate the corresponding plasma temperature and the spectral line deviation ratio of Cr and Cu, and then feature-level fusion is performed. The fused feature data and corresponding surface hardness values ​​of each soil sample are input into the XGBoost model for training. The surface hardness of the soil to be tested is predicted using a trained XGBoost model.

2. The method as described in claim 1, characterized in that, The process involves mixing standard soil, crystalline chromium nitrate, and copper nitrate in different proportions, and applying different pressures using a tablet press to prepare soil samples with varying surface hardness. Standard soil, crystalline chromium nitrate, and copper nitrate were mixed in a mortar in different proportions, and deionized water was added and stirred thoroughly to ensure that the sample was mixed evenly. After drying, grinding, and sieving, sample powders of different concentrations with sufficiently small particle sizes were obtained. Take 3g of sample powder into a mold, and use a tablet press to apply pressure of 10, 20 and 30 MPa to the sample powder of different concentrations for 30 minutes to press the sample powder into a disc-shaped sheet with a diameter of 30 mm and a thickness of 2 mm to obtain soil samples with different surface hardness. The surface hardness of each soil sample is then tested using a Shore hardness tester.

3. The method as described in claim 1, characterized in that, The characteristic spectral lines of the Cr and Cu elements include: Cr I 425.44 nm, Cr I 427.48 nm, Cr I 428.97 nm, Cr I 520.84 nm, Cr II 405.41 nm, Cu I 324.75 nm and Cu II 368.65 nm; The spectral line ratios of Cr and Cu elements are as follows: Cr II 405.41nm / Cr I 520.84nm, Cr II 405.41nm / CrI 428.97nm, Cr II 405.41nm / Cr I 427.48nm, Cr II 405.41nm / Cr I 425.44nm, and Cu II 368.65nm / Cu I 324.75nm.

4. The method as described in claim 1, characterized in that, The plasma temperature was calculated using the following method: Extract the spectral information of any characteristic spectral line from the LIBS spectrum and substitute it into the Boltzmann formula shown below: In the formula, I is the intensity of the characteristic spectral line, λ is the wavelength of the characteristic spectral line, and g k As the statistical weight of the upper energy level, A ki For the transition probability, E k Where is the energy of the upper level, k is the Boltzmann constant, T is the plasma temperature, Z is usually the partition function of the ground state statistical weight, h is Planck's constant, c is the speed of light, and N0 is the number of particles in the ground state. via the y-axis and x-coordinate E k Obtain the fitted slope This leads to the determination of the plasma temperature.

5. The method as described in claim 1, characterized in that, The XGBoost model is trained using the following method: Step 1: Collect training data from soil samples with different surface hardness {(x1,y1),(x2,y2),...,(x...} n ,y n )} as input, with mean squared error As the loss function during the training process, the objective function of the XGBoost model can be expressed as: In the formula, y i This indicates the true hardness value of the soil. Let γ represent the predicted soil hardness value, γ represent the regularization term of the leaf nodes in the decision tree, T represent the number of leaf nodes in the decision tree, λ represent the number of leaf nodes, and w represent the weight of the leaf nodes. j Let be the weight of the leaf node of the j-th tree; Step 2: By iterating continuously, the objective function is minimized. Based on the characteristics of decision trees and Boosting algorithms, the objective function is transformed into the following form for the first time: In the formula, f represents the output of the first t-1 trees. (t) (x i ) represents the prediction result of the t-th tree, with other parameters remaining unchanged; Based on the above formula, the first decision tree is trained and the prediction result is output. Step 3: Perform a second-order Taylor expansion on the loss function. To make the objective function simpler, ignore its constant term. The objective function is transformed a second time as follows: In the formula, g i h is the first derivative of the loss function. i This is the second derivative of the loss function; Since the loss function is a known constant and has no impact on the construction result of the decision tree, the objective function is further simplified to: Step 4: Expand the regularization term and further simplify the objective function to: In the formula, I j This represents all samples located in the j-th leaf node; Step 5: Split the decision tree. At each step, attempt to split all leaf nodes at the same level, determining whether the split node can continue to split downwards. The criteria for this determination are: In the formula, the subscript L represents the optimal value of the objective function when partitioning to the left subtree, and the subscript R represents the optimal value of the objective function when partitioning to the right subtree. In actual partitioning, F is adopted. split Divide according to the principle of maximizing; Step 6, when F split When the value is less than 0, it means that the leaf node no longer splits, and the decision tree stops growing and training ends.