Soil total nitrogen (STN) plays an important role in plant growth, and rapid and nondestructive detection of STN content is essential for agricultural production. Near-infrared spectroscopy (NIRS) takes advantage of the fast detection speed, low cost, and nondestructiveness, and it can be used for STN content detection. Typically, NIRS-based approaches require a large number of samples for detection model training. However, it is difficult to collect sufficient samples due to various causes (e.g., time-varying state, high assay costs, etc.) in practical application. To tackle this problem, a feature metric approach is introduced to detect the STN content based on NIRS in this work, and a new approach (named Pair-Soil-Spectra) is proposed to mine fine-grained features by contrasting different soil sample pairs, which takes full advantage of soil particle heterogeneity and NIRS penetration. For the validation of this study, three different soil datasets with various collection sources are selected as research subjects, and the performance of Pair-Soil-Spectra is analyzed from different perspectives. According to the results, Pair-Soil-Spectra has significantly improved the performance of STN content detection models (e.g., partial least-squares (PLS), Cubist, extreme learning machine (ELM), and random forest (RF)) in small sample cases. Of these, the coefficient of determination of RF has improved by 0.13, 0.42, and 0.10, and the root-mean-square of prediction has decreased by 0.15, 0.52, and 0.01 g/kg with different datasets, which has gained the greatest improvement. Meanwhile, this approach can be easily expanded to cover other domains.
Read full abstract