## 2 Materials and Methods
### Spectral Data PreProcessing Methods for Soils  
Soil spectral data preprocessing is a necessary data processing method that reduces the influence of factors such as noise, spurious signals, and non-linear spectral effects that are present in soil spectral data. It plays a crucial role in improving the accuracy and reliability of the data. This pretreatment approach can analyze soil samples without causing any damage. It provides more accurate, comprehensive, and efficient data information for soil analysis, which is crucial for supporting and ensuring the success of soil science research. In the field of soil science research, soil spectral data preprocessing has become a significant technological strategy that is widely employed in various areas including soil quality evaluation, analysis of soil organic matter content, and soil contamination detection. It plays a crucial role in improving the accuracy and reliability of soil analysis. In this study, the raw soil spectral data were first subjected to SG smoothing. The SG smoothing [16] algorithm is a polynomial smoothing algorithm based on the principle of least squares proposed by [PERSON] and [PERSON]. It is an approach to signal processing that is frequently used to eliminate noise and spikes while keeping the data trend. The primary benefit of SG smoothing is its capacity to carry out smoothing and differentiation operations at the same time. SG smoothing has three parameters, namely window size, polynomial order, and derivative order. It can adapt to different data characteristics by adjusting the smoothing window size and polynomial order. When processing soil spectral data, SG smoothing efficiently eliminates random and systematic noise brought on by instrument measurement errors and environmental factors, enhancing the accuracy and quality of the resulting data. Additionally, it aids in lowering signal distortion and peak misalignment, improving the data's capacity to be compared and understood. The theoretical formula for SG smoothing is as follows:  
Figure 2: Spectral equipment acquisition device. \[\widetilde{\mathrm{x}}_{\mathrm{i}}=\sum_{\mathrm{j=-m}}^{\mathrm{m}}c_{\mathrm{j}} \mathrm{x}_{\mathrm{i+j}}, \tag{1}\]  
where \(\widetilde{\mathrm{x}}_{\mathrm{i}}\) represents the value of the sample point after undergoing SG smoothing, \(\mathrm{x}_{\mathrm{i+j}}\) represents the value of the \(\mathrm{i+j}\) data point in the original data, m represents the order of the polynomial fit, and \(c_{\mathrm{j}}\) represents the coefficients of the fitted curve, which can be determined through the least squares method. By adjusting the polynomial order and coefficients, the smoothing degree and fitting accuracy of SG smoothing can be controlled. In this study, we set the derivative order to 0, the window size to 5, and the polynomial order to 3, which correspond to the five-point third-order smoothing method. To further enhance the association between reflectance data and soil indicators, soil spectral data were further preprocessed utilizing a variety of differential transform techniques on the basis of SG smoothing. For this reason, this paper collects and organizes ten common methods of differential transformations in related papers in recent years, including first-order differentiation (FD), second-order differentiation (SD), logarithmic first-order differentiation (LFD), logarithmic second-order differentiation (LSD), inverse logarithmic first-order differentiation (RFD), inverse logarithmic second-order differentiation (RSD), log-logarithmic first-order differentiation (LRFD), log-logarithmic second-order differentiation (LRSD), inverse logarithmic first-order differentiation (RLFD), and inverse logarithmic second-order differentiation (RLSD). The spectra after LFD and LSD transformations can be theoretically shown to be equivalent to those after RLFD and RLSD transformations, and only the experimental results for RLFD and RLSD will be shown later in this section.