Multi-modal spectral soil property estimation method and system based on task-prior gated distillation

CN122369696APending Publication Date: 2026-07-10NANJING NORMAL UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
NANJING NORMAL UNIVERSITY
Filing Date
2026-05-21
Publication Date
2026-07-10

AI Technical Summary

Technical Problem

Under small sample conditions, existing technologies, such as single-modal models and simple splicing fusion models, are prone to accuracy fluctuations and insufficient generalization in soil property prediction, making it difficult to accurately estimate multiple soil properties.

Method used

A multimodal spectral soil property estimation method based on task prior gated distillation is adopted. Using three types of spectral data, namely VNIR, XRF and LIBS, and combined with chemometric models such as PLS, SF-PLS and GR, stable estimation of multiple soil properties is achieved through modality-specific convolutional branches in the student network, GeM/TopK aggregation, task prior Dirichlet gating and dual expert hybrid prediction.

Benefits of technology

It improves the stability and accuracy of multiple soil property estimation under small sample conditions, reduces the overfitting risk of end-to-end deep models, and meets the requirements of lightweight and practical deployment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122369696A_ABST
    Figure CN122369696A_ABST
Patent Text Reader

Abstract

The present application belongs to the technical field of soil spectrum detection and agricultural informatization, and discloses a multi-modal spectrum soil property estimation method based on task priori gated distillation. Visible-near infrared reflectance spectrum, X-ray fluorescence spectrum and laser-induced breakdown spectrum of the same sample are obtained, and after pretreatment, teacher soft labels and intermediate features are generated by PLS, SF-PLS and GR chemometric teacher models; the student network extracts modal features through three one-dimensional convolution branches, adopts GeM / TopK aggregation, Dirichlet task gating and double expert prediction modules for fusion and regression, and is jointly trained by output distillation, feature distillation, true value regression and gating regularization. In the inference stage, only the student network is deployed for clay, organic matter, cation exchange capacity, pH, base saturation and extractable phosphorus, potassium, calcium and magnesium estimation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of soil spectral detection, agricultural informatization and multimodal data processing, and in particular to a multimodal spectral soil property estimation method and system based on task prior gated distillation. It is used to uniformly estimate soil properties such as clay content (Clay), soil organic matter (OM), cation exchange capacity (CEC), pH, base saturation (V), and extractable phosphorus, potassium, calcium and magnesium (ex-P, ex-K, ex-Ca, ex-Mg) under small sample labeling conditions. Background Technology

[0002] Soil texture, organic matter, cation exchange capacity, pH, and extractable nutrients are important physicochemical properties for precision fertilization, farmland quality assessment, and farmland management. Traditional wet chemical detection methods have high accuracy, but they suffer from problems such as complex pretreatment, long detection cycles, high unit sample costs, and difficulty in supporting large-scale continuous detection.

[0003] VNIR, XRF, and LIBS have all been used for rapid soil detection. VNIR can reflect broad-spectrum absorption characteristics related to minerals, organic matter, and water content; XRF can provide fluorescence spectra of elements such as K, Ca, and Fe; and LIBS can provide plasma emission information of elements such as C, P, Mg, and Ca. These three technologies are complementary in terms of physical mechanisms and sensitivity properties, and multi-sensor soil prediction and the fusion of VNIR, XRF, and LIBS have already been applied in this field.

[0004] Specifically, VNIR is sensitive to particle size, moisture content, and sample surface condition; XRF is easily affected by matrix effects such as moisture, organic matter, and iron speciation; and LIBS may have a weaker response to low-content elements or indirect properties. These factors make single-modal models and simple splicing fusion models prone to accuracy fluctuations and insufficient generalization under small sample conditions.

[0005] Previous studies have compared the prediction of soil properties using methods such as PLS, data-level fusion PLS, and Granger-Ramanathan weighted fusion, combining VNIR, XRF, and LIBS. The results show that different soil properties have varying dependencies on spectral modes, and a single fixed fusion method is insufficient to account for multiple properties. Therefore, a unified modeling method that can adjust modal weights according to the attribute task and is suitable for small-sample training is still needed. Summary of the Invention

[0006] To address the aforementioned technical problems, this invention provides a multimodal spectral soil property estimation method and system based on task-prior gated distillation. This scheme uses three types of spectra—VNIR, XRF, and LIBS—as input, utilizes chemometric models such as PLS, SF-PLS, and GR to provide supervision information, and incorporates modality-specific convolutional branches, GeM / TopK aggregation, task-prior Dirichlet gating, dual-expert mixed prediction, and output and feature bilayer distillation in the student network to improve the stability of multimodal soil property estimation under small sample conditions.

[0007] The specific technical solution is as follows:

[0008] One aspect of the present invention provides a multimodal spectral soil property estimation method based on task-prior gated distillation, comprising the following steps:

[0009] Step 1: Obtain the VNIR spectrum, XRF spectrum and LIBS spectrum corresponding to the same sample, and record the corresponding measured soil property labels during the training phase;

[0010] Step 2: Perform modal correspondence preprocessing on the three types of spectral data to form training and validation sets, and the standardized statistics of the target value are calculated only from the training set; the independent test set is only used for the final performance evaluation.

[0011] Step 3: Establish a stoichiometric teacher model for each soil property to be predicted, and output the teacher soft label and teacher intermediate features;

[0012] Step 4: Construct the student network, which includes three modality-specific one-dimensional convolutional branches: VNIR, XRF, and LIBS; a GeM / TopK aggregation module; a task prior Dirichlet gated fusion module; and a dual-expert multi-task prediction module.

[0013] Step 5: Use task-specific weighting to perform task-specific weighted fusion of the embedding vectors of each modality, and output the student predicted values ​​of each soil attribute through a dual-expert hybrid layer and a task regression head;

[0014] Step 6: The student network is jointly trained using output distillation loss, feature distillation loss, truth regression loss and gated prior regularization loss to obtain the trained soil property estimation model;

[0015] Step 7: Input the VNIR, XRF, and LIBS spectra of the sample to be tested into the trained student network, and output the estimation results of one or more soil properties.

[0016] Furthermore, in step 2, the VNIR spectrum is corrected for standard normal variables, normalized to the maximum value, subjected to Savitzky-Golay first derivative and smoothing; the XRF spectrum is corrected for live time, normalized to L2 or normalized to the Compton peak; the LIBS spectrum in the teacher model can be truncated to 200-540 nm and filtered for iSPA variables, while in the student network, the full spectrum or target band spectrum after normalization to the maximum value is preferred.

[0017] Furthermore, in step 3, the teacher model includes PLS, SF-PLS, and GR. The teacher soft label is the predicted value of the teacher model in the standardized target space, and the teacher intermediate features are PLS latent variables, SF-PLS latent variables, GR input prediction vectors, or equivalent intermediate representations after linear mapping.

[0018] Furthermore, in step 4, the three modality-specific branches of the student network all adopt a one-dimensional Inception multi-scale convolution structure, with the kernel size preferably being 1, 3, 5, and 7; the adaptive aggregation module adopts a linear combination of GeM pooling and TopK pooling to take into account both the global spectral trend and the local strong response spectral lines.

[0019] Furthermore, in step 5, the task-specific fusion module constructs Dirichlet parameters based on task-modal prior importance. And the gating weights are generated or regularized by this parameter. ; Dual expert hybrid layer through and Adaptive weighting of tasks is performed between the two expert subnetworks.

[0020] Furthermore, in step 6, annealed Mixup enhancement can be used to linearly mix the input spectrum, measured true value, teacher soft label, and teacher intermediate features using the same mixing coefficient to improve training stability and generalization ability.

[0021] Another aspect of the present invention provides a multimodal spectral soil property estimation system based on task prior gated distillation, which includes a data acquisition module, a preprocessing and partitioning module, a teacher model construction module, a student network construction module, a gated fusion module, a distillation training module, and a prediction output module; each module respectively performs the corresponding steps of data acquisition, modal preprocessing, teacher-supervised generation, student network construction, task prior gated fusion, joint distillation training, and prediction output.

[0022] The present invention also provides an electronic device and a computer-readable storage medium. The electronic device includes a processor and a memory, the memory storing a computer program executable on the processor; the computer program, when executed by the processor, implements the above-described method. The computer-readable storage medium stores a computer program for performing the above-described method.

[0023] Compared with the prior art, the present invention has at least the following beneficial effects:

[0024] (1) Input VNIR, XRF and LIBS three-modal information into the task prior gated distillation student network to change the fusion method from fixed splicing or static weighting to task-differentiated weighting based on soil properties;

[0025] (2) By combining teacher soft labels and teacher intermediate features for distillation, the student network can obtain continuous supervision signals under small sample conditions, thereby reducing the risk of overfitting in the end-to-end deep model.

[0026] (3) By using a task gating mechanism based on Dirichlet priors, the domain knowledge that “different attributes depend on different spectral modes” is explicitly written into the fusion weights, thereby improving the robustness and interpretability of the fusion process;

[0027] (4) Through the dual-expert hybrid layer and multi-task prediction module, multiple soil properties are estimated collaboratively within a unified model, which alleviates negative transfer between tasks and improves inference efficiency.

[0028] (5) After training, only the student network needs to be deployed to complete the in-situ inference, taking into account the detection accuracy, model lightweighting and actual deployment requirements. Attached Figure Description

[0029] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings are described below. The drawings are merely illustrative embodiments of the present invention and do not constitute a limitation on the scope of protection.

[0030] Figure 1 This is a schematic diagram of the overall teacher-student distillation process and student model structure of the present invention, where Cl represents the clay content;

[0031] Figure 2 This is a schematic diagram of the teacher branch construction, teacher output and data augmentation process of the present invention. In the diagram, Stacking represents stacked regression or weighted regression. Detailed Implementation

[0032] The present invention will now be described in conjunction with the accompanying drawings and embodiments, following the order of "data acquisition—preprocessing—teacher model—student model—gated fusion—loss function—training process—inference process". The following embodiments are for illustrative purposes only and are not intended to limit the scope of protection of the present invention.

[0033] Unless otherwise specified, the sample index is represented by i, and the modality set is... Corresponding to VNIR, XRF, and LIBS respectively, the task set T includes Clay, OM, CEC, pH, V, ex-P, ex-K, ex-Ca, and ex-Mg; the batch size is B, and the input tensors of each modality in the student network are... .

[0034] Example 1: Three-modal data acquisition and sample alignment.

[0035] The data acquisition methods of this invention include direct acquisition and database reading, without requiring the applicant to collect soil samples and spectral data independently. In one embodiment, the three-modal spectrum can be obtained by detecting the same soil sample using VNIR, XRF, and LIBS detection equipment; in another embodiment, the three-modal spectrum can also be read from an established public or self-built three-modal soil spectral database. Regardless of whether direct acquisition or database reading is used, it must be ensured that the VNIR, XRF, and LIBS spectra correspond one-to-one with the same sample identifier and its soil property label. During the training phase, the three-modal spectrum of the sample and the corresponding measured soil property label are acquired; during the inference phase, only the three-modal spectrum of the sample to be tested needs to be acquired, and the trained student network outputs one or more soil property estimates.

[0036] In this embodiment, to ensure the correspondence between the three spectra and the same sample and the same task, the original spectrum is assumed to be... The preprocessing operator is The training set is Preprocessing and target standardization can be represented as follows:

[0037]

[0038]

[0039] Where V, X, and L represent VNIR, XRF, and LIBS, respectively. For the preprocessing operators of the corresponding modes, and Only from the training set Calculations are performed to avoid leakage of information from the validation set and independent test set.

[0040] Example 2: Preprocessing and Dataset Partitioning.

[0041] The preferred VNIR preprocessing is as follows: the original 343-2222 nm spectrum is truncated to an effective band of 437-2149 nm; dual-detector connection artifacts near 1040 nm are corrected; and SNV, maximum normalization, Savitzky-Golay first derivative, and Savitzky-Golay smoothing are performed sequentially. The Savitzky-Golay window length can be 7 to 21 points, preferably 11 points, and the polynomial order can be 2 or 3, preferably 2.

[0042] The preferred XRF preprocessing is as follows: live-time correction is performed on the 2048-channel energy spectrum, expressed as photon count rate, and normalized using L2 or Rh-K Compton peaks; in the teacher model, K-lines such as Al, Si, K, Ca, Ti, Mn, Fe, Ni, and Cu, as well as scattering peaks, can be selected as explanatory variables; in the student network, the full channel spectrum or selected spectral line vectors can be input.

[0043] The preferred LIBS preprocessing is as follows: SNV and maximum value normalization are performed on the full spectrum of 200-780 nm; the range of 200-540 nm can be truncated in the teacher model, and the range is divided into multiple intervals using iSPA before the task-related intervals are selected; the full spectrum or target band is preferably retained in the student network so that the convolutional branch can automatically learn the spectral line combination.

[0044] For data partitioning, the Kennard-Stone algorithm is preferred to first generate modeling samples and independent test samples. Within the modeling samples, training and validation sets are further formed. The validation set is used for teacher selection, learning rate scheduling, and early termination, while the independent test set is used only for the final report. Target attributes mean and standard deviation The calculation is performed only on the training set, and the same statistic transformation is used for the validation set, independent test set, and test samples.

[0045] Example 3: Teacher model construction.

[0046] like Figure 2 As shown, the teacher branch is used to provide supervision signals to the student network. For each soil attribute to be predicted, PLS, SF-PLS, and GR candidate teacher models are trained separately. The unimodal PLS is modeled based on VNIR, XRF, or LIBS, respectively; SF-PLS performs PLS by concatenating multiple preprocessed modal features; the GR model takes the unimodal predictions and SF-PLS predictions as inputs and forms a prediction through linear weighted regression. The selection of teacher models is based solely on cross-validation within the training set or validation set metrics; the independent test set is only used for the final performance report.

[0047] The teacher branch's supervision relationship with the soft labels and intermediate features output from task t can be represented as:

[0048]

[0049] in, The target teacher model selected for the validation set. This refers to soft labels for teachers. This indicates the intermediate characteristics of teachers. PLS latent variables, SF-PLS latent variables, GR input prediction vectors, or equivalent features after linear mapping can be used.

[0050] In a preferred embodiment, the number of latent variables in PLS ranges from 1 to 20, selected based on the RMSE of the validation set; SF-PLS first concatenates the preprocessing matrices of each mode according to the variable dimension, then performs variance scaling and PLS regression; the GR model uses single-mode PLS prediction, SF-PLS prediction, and intercept term as inputs, and determines the linear weights through least squares. Teacher soft labels are stored in a standardized target space to avoid the influence of differences in the dimensions of different soil properties on distillation.

[0051] To perform feature distillation, teacher intermediate features can be taken in three forms: the first is the latent variable score of a single-modal PLS; the second is the latent variable score of the SF-PLS fusion; and the third is the prediction vector input to the GR model. If the teacher intermediate feature dimensions... With student embedded dimension If they are different, then they are determined by linear mapping. or Align them.

[0052] In one implementation, the teacher predictions for each single modality are also retained as feature-level supervision signals for the VNIR, XRF, and LIBS modality-specific branches to constrain student branches to learn the underlying structures related to the corresponding modality, while avoiding imposing excessive constraints on the final fused features.

[0053] Example 4: Student model construction.

[0054] like Figure 1 As shown, the student network is configured with VNIR, XRF, and LIBS branches, each employing a one-dimensional Inception multi-scale convolutional structure. Each branch preferably includes a Stem layer and three Inception blocks, with kernel sizes of 1, 3, 5, and 7, and the number of channels ranging from 32 to 128, preferably increasing layer by layer to 64, 128, and 256. The convolutional output is compressed into a fixed-length embedding vector by an adaptive aggregation module, preferably obtaining a 256-dimensional embedding for each modality. .

[0055] The relationship between modal branching and adaptive aggregation in a student network can be represented as follows:

[0056]

[0057]

[0058] in, The multi-scale convolution output of the m-th modality. For modal-specific convolution with kernel size k, Let m be the embedding vector of the modality. represents the combination coefficients of GeM pooling and TopK pooling.

[0059] In terms of tensor dimensions, the inputs to the VNIR, XRF, and LIBS branches are respectively... , and After passing through three layers of Inception blocks, we obtain... Modal feature map, where It can be 64 to 256. This represents the length of the sequence after convolution. After GeM / TopK aggregation, each modality yields... The embedding vector, composed of three-modal embeddings .

[0060] In alternative implementations, the modality-specific branch can employ depthwise separable one-dimensional convolution, residual one-dimensional convolution, or a lightweight Transformer encoder; adaptive aggregation can replace the GeM / TopK combination with attention pooling, but the preferred approach still retains GeM's representation of the global spectral shape and TopK's representation of the strong spectral line response.

[0061] Furthermore, the Stem layer is used for basic spectral feature extraction, Inc1 to Inc3 progressively aggregate multi-scale structures, and the Out256 layer maps each modality to a unified dimension; the FUSE layer completes cross-modal fusion, A_H, B_H, A_OUT, and B_OUT correspond to dual expert hidden layers and output layers, and the POST layer aggregates expert outputs to form multi-attribute predictions. The above layer naming is only used to illustrate one implementation method and does not limit the network layer names.

[0062] Example 5: Gated fusion and dual expert prediction.

[0063] For each task to be predicted, Dirichlet parameters are constructed based on the task's prior importance, and task gating weights are generated or regularized accordingly. This allows the student network to differentiate the weighting of VNIR, XRF, and LIBS embedding vectors according to the task. (Task Prior) It can be determined by soil science knowledge, teacher model performance, or a weighted combination of both. For example, Clay and OM can increase the weight of VNIR, CEC, V, ex-Ca, and ex-Mg can increase the weight of XRF and LIBS, and ex-P can increase the weight of LIBS; for all tasks All values ​​are normalized into a three-dimensional probability vector. Subsequently, the task fusion features are input into the dual-expert hybrid layer, where the task expert gating distributes weights between the two expert sub-networks and outputs the task representation.

[0064] Cross-modal task gating and dual-expert hybrid prediction are performed sequentially according to the following formulas:

[0065]

[0066]

[0067]

[0068]

[0069] in, For the prior importance of the task, Let be the gating weights of task t with respect to mode m. Let t be the expert weights for the r-th expert. For the r-th expert subnetwork, For task return head. Preferred. , The number of experts is 2, each expert is a two-layer MLP, the hidden dimension is 128 to 512, and the optimal value is 256.

[0070] Task Priorities Can be written as The matrix consists of rows corresponding to a soil property task and columns corresponding to VNIR, XRF, or LIBS. This prior can be generated from teacher model validation performance, soil property mechanisms, or a normalized weighted average of both. For example, for OM, a higher VNIR prior can be set while preserving the contribution of LIBS to the C spectral line; for ex-K, the K spectral line prior in XRF can be increased; and for ex-P, the P spectral line prior in LIBS can be increased.

[0071] Specifically, a single-modal teacher model can be established on the training set first, and RMSE(t,m) can be obtained on the validation set. The data-driven prior can be formed by q(t,m)=[1 / (RMSE(t,m)+δ)] / Σm′[1 / (RMSE(t,m′)+δ)], and then fused with the soil spectral mechanism prior r(t,m) to form p(t,m)=ηq(t,m)+(1−η)r(t,m). α(t,m)=αmin+τp(t,m) can be constructed, where η∈[0,1], αmin>0, and τ>0. The above RMSE, q, p, and α must not be calculated using independent test set labels.

[0072] In the early stages of training, the gating weights can be fixed at the Dirichlet prior mean to reduce the risk of premature gating weight shift under small sample conditions; in the later stages of training, the gating parameters can be loosened and more flexible. Apply regularization constraints. This setting allows the gating weights to reflect task differences with training data while remaining within prior constraints.

[0073] Example 6: Loss Function.

[0074] During the training phase, output distillation loss, feature distillation loss, ground truth regression loss, and gating prior regularization loss are used simultaneously. Output distillation loss is used to constrain student predictions to approximate teacher soft labels; feature distillation loss is used to constrain student intermediate representations to align with teacher intermediate features; ground truth regression loss is used to ensure that the student model remains consistent with the measured labels; and gating prior regularization loss is used to constrain the task gating distribution to not deviate from the task prior. All outputs and teacher soft labels are computed in the standardized target space, and the results are inversely transformed back to the original dimensions when reporting the results.

[0075] In multilevel distillation training, output distillation, feature distillation, truth regression, and the overall objective function can be represented as follows:

[0076]

[0077]

[0078]

[0079]

[0080] Annealed Mixup enhancement uses the same mixing coefficient for the input spectrum, real labels, and teacher soft labels, and can be expressed as follows:

[0081]

[0082]

[0083] in, For feature alignment mapping, , , and The weights are non-negative, e is the current training epoch, and E is the total number of training epochs. Optimal , The value is taken as 0.001 to 0.05, preferably 0.01. In an alternative embodiment, and MSE, Huber, or MAE loss can be used. MSE or cosine distance can be used.

[0084] Example 7: Training process.

[0085] The training process preferably includes the following steps: first, fit a preprocessor and target normalizer on the training set; then train the teacher model for each task and save the teacher soft labels and intermediate features; subsequently, initialize the student network, task prior matrix, and dual expert module; finally, input the trimodal spectrum in mini-batch, calculate the student output, task gating, expert weights, and joint loss, and backpropagate to update the student network parameters.

[0086] The optimal training hyperparameters are: optimizer AdamW, initial learning rate... Optional range to Weight decay Optional range to Batch size 8 to 64, preferably 16; maximum training epochs 100 to 1000, preferably 500; reduce the learning rate when the validation set macro average R² or RMSE does not improve for several consecutive epochs, and the number of early stopping patience epochs is preferably 25; gradient norm pruning threshold is preferably 0.5.

[0087] Annealed Mixup uses the same mixing coefficient for sample pairs (i,j) within the same mini-batch. Simultaneously, it mixes VNIR, XRF, LIBS inputs, measured labels, teacher soft labels, and teacher intermediate features. Beta distribution parameters. The linear annealing value was reduced from 0.40 to 0.15, which provides stronger smoothing constraints in the early stages of training and gradually approximates the true sample distribution in the later stages of training.

[0088] To assess stability, each model architecture is preferably trained repeatedly using 10 different random seeds. The mean and 95% confidence intervals for each task and macro-average metric are reported. Confidence intervals can be calculated using a t-distribution, i.e., mean ± 0.5%. , where n is the number of repetitions and s is the sample standard deviation.

[0089] Example 8: Reasoning process and application.

[0090] After training, only the student network needs to be deployed during the inference phase. The test samples are preprocessed using the same steps as in the training phase to obtain VNIR, XRF, and LIBS input tensors. These are then fed into three modality-specific convolutional branches, followed by GeM / TopK aggregation, task-prior Dirichlet gated fusion, dual-expert hybrid prediction, and a task regression head, outputting standardized estimates of one or more soil properties. These properties may include Clay, OM, CEC, pH, V, ex-P, ex-K, ex-Ca, and ex-Mg. This invention can be applied to scenarios such as rapid soil nutrient testing, arable land quality assessment, precision fertilization decision support, and digital agricultural management.

[0091] During the inference phase, the standardized estimation results output by the task regression head are inversely transformed back to their original dimensions, and the final soil property estimates are obtained using the following formula:

[0092]

[0093] The above steps constitute a complete processing flow from data input to result output.

[0094] In an alternative implementation, when a certain mode is temporarily unavailable due to on-site conditions, it can be compensated by mode drop-out enhancement or missing mode masking during the training phase; however, in the complete scheme defined by the preferred embodiment and independent claims of the present invention, the input of the sample to be tested includes three spectra: VNIR, XRF and LIBS, to ensure that the task prior gated distillation student network makes full use of the three-modal complementary information.

[0095] Example 9: Performance verification and ablation analysis based on publicly available three-modal soil spectral dataset.

[0096] This embodiment uses a publicly available three-modal soil spectral dataset for experimental verification. This dataset is published by Mendeley Data, version 3, DOI 10.17632 / 88c5kvmgbf.3, and includes 102 soil samples from two Brazilian agricultural fields, along with their VNIR, XRF, LIBS spectral and fertility property measurements. This dataset is used only for verification purposes and is not intended to be protected by this invention.

[0097] This embodiment reads four data tables from the dataset: "soil fertility data," "VNIR data," "XRF data," and "LIBS data," and aligns the three-modal spectral data with soil attribute labels using the sample ID as the primary key. Soil attributes include Clay, OM, CEC, pH, V, ex-P, ex-K, ex-Ca, and ex-Mg. After sample alignment, the dataset is divided into training, validation, and independent test sets. All spectral preprocessing parameters, target attribute standardization parameters, variable selection, teacher model selection, task-modal prior estimation, early termination, and hyperparameter selection are performed solely based on the training or validation set; the independent test set is used only for the final performance report.

[0098] Where R² is the coefficient of determination, RMSE is the root mean square error, 95% CI is the 95% confidence interval, and Δ represents the change relative to the complete model. RMSE units are: Clay = g·kg−1, OM = g·dm−3, CEC, ex-K, ex-Ca, and ex-Mg = mmolc·dm−3, V = %, ex-P = mg·dm−3, pH is dimensionless, and R² is dimensionless.

[0099] The VNIR spectra recorded in this public dataset were acquired using a benchtop Veris MSP3 system, with a spectral range of approximately 343–2222 nm and a spectral resolution of approximately ±5 nm. Each sample was scanned three times and the average was taken. The XRF spectra were acquired using a BrukerTracer III-SD portable XRF system with an Rh target X-ray tube power of 4 W, a tube voltage of 35 kV, a tube current of 7 μA, 2048 channels, and a scanning time of 90 s in air atmosphere. The average was taken from three positions for each sample. The LIBS spectra were acquired using a 1064 nm Nd:YAG laser and an ESA3000 spectrometer, with a spectral range of approximately 200–780 nm. The laser energy was 65 mJ, the pulse width was 5 ns, the delay time was 2 μs, the integration gate width was 7 μs, 15 laser pulses were accumulated, and the argon flow rate was 5.0 L·min−1. The average was taken from 21 positions for each pellet sample.

[0100] The soil properties used in the experiment included Clay, OM, CEC, pH, V, ex-P, ex-K, ex-Ca, and ex-Mg. The preferred methods for property determination were: Clay using the Bouyoucos hydrometer method; OM using the potassium dichromate oxidation method; and pH using... Solution determination; extractable nutrients are extracted using ion exchange resin; CEC is calculated from the potential acidity of the buffer solution and the sum of basic ions; V is calculated from the ratio of the sum of basic ions to CEC.

[0101] The student model experiment of this invention adopts the Kennard-Stone partitioning strategy, preferably forming approximately 70% modeling samples and approximately 30% independent test samples. On the publicly available data of 102 samples, preferably 71 samples are used for teacher fitting and student training, and 31 samples are reserved as test samples. Within the modeling samples, validation samples are further partitioned according to training needs for early stopping and hyperparameter selection. Independent test samples are not used for teacher selection, learning rate scheduling, and early stopping.

[0102] The baselines for comparison included: unimodal VNIR, XRF, and LIBS; bimodal VNIR+XRF, VNIR+LIBS, and XRF+LIBS; PLS, SF-PLS, and GR teacher models; and ablation settings such as average pooling fusion, trainable uniform gating, fixed uniform gating, no-annealing augmentation, simplified branching, no feature-level distillation, no knowledge distillation, and no dual-expert modules. Except for the ablation modules, the training process and hyperparameters remained consistent.

[0103] In single-mode and dual-mode ablation, in addition to shutting down the corresponding network branches, the feature-level distillation loss corresponding to the removed mode is also shut down to ensure that the ablation results reflect the actual contributions of the effective input mode and the distillation signal.

[0104] Table 1. Comparison of Reference Results and Teacher Model Reproduction Results

[0105] property Best way to refer to results Reference result R² Reference RMSE The best way for teachers to reproduce Teacher reproduction of R² Teacher Reproduction RMSE Clay VNIR+XRF-SF-PLS 0.89 25.47 VNIR+XRF-SF-PLS 0.89 25.48 OM VNIR+XRF-SF-PLS 0.77 2.17 VNIR+XRF-SF-PLS 0.87 2.09 CEC XRF+LIBS-SF-PLS 0.77 13.44 LIBS-PLS (iSPA) 0.72 13.17 pH VNIR-PLS 0.16 0.29 VNIR-PLS 0.58 0.29 V VNIR+XRF-SF-PLS 0.86 5.50 VNIR+XRF-SF-PLS 0.93 5.17 ex-P XRF+LIBS-GR -0.15 6.20 VNIR+LIBS-GR 0.54 6.35 ex-K VNIR+XRF-SF-PLS 0.68 1.25 VNIR+XRF-GR 0.73 1.13 ex-Ca XRF+LIBS-SF-PLS 0.88 6.90 LIBS-PLS 0.86 6.90 ex-Mg XRF+LIBS-GR 0.94 3.12 XRF+LIBS-GR 0.83 4.98 Mean — 0.64 7.15 — 0.77 7.28

[0106] Note: The reference results in the table are taken from publicly available information. The teacher's reproduction results are obtained by remodeling according to the process of this embodiment. Due to differences in sample division, preprocessing, and variable selection, numerical differences are allowed.

[0107] Table 1 shows that teacher models such as PLS, SF-PLS, and GR can reflect the main performance trends of multi-sensor soil prediction. The optimal sensor combinations for different attributes are not consistent, indicating that adjusting modal weights according to the task has practical significance.

[0108] Table 2 Performance Comparison of Teacher Model and Student Model

[0109] property Teacher Model R² Teacher Model RMSE Student model R² (95% CI) Student model RMSE (95% CI) Clay 0.89 25.48 0.91 (0.90, 0.92) 22.71 (21.77, 23.65) OM 0.87 2.09 0.89 (0.88, 0.90) 1.96 (1.91, 2.01) CEC 0.72 13.17 0.79 (0.78, 0.80) 11.17 (10.92, 11.41) pH 0.58 0.29 0.58 (0.57, 0.59) 0.29 (0.28, 0.29) V 0.93 5.17 0.95 (0.95, 0.96) 4.38 (4.03, 4.73) ex-P 0.54 6.35 0.56 (0.53, 0.59) 6.03 (5.82, 6.24) ex-K 0.73 1.13 0.86 (0.85, 0.88) 0.81 (0.76, 0.85) ex-Ca 0.86 6.90 0.89 (0.89, 0.90) 6.01 (5.87, 6.14) ex-Mg 0.83 4.98 0.85 (0.84, 0.86) 4.75 (4.57, 4.93)

[0110] As shown in Table 2, under the joint constraints of output distillation, feature distillation, truth regression and gated prior, the student model's prediction results on multiple soil properties are generally better than or no worse than those of the teacher model.

[0111] Table 3 Ablation study of the overall framework (macro-average R² and average RMSE)

[0112] Model R² (95% CI) Average RMSE (95% CI) ΔR² Δ Average RMSE XRF only 0.62 ± 0.03 8.12 ± 0.77 -0.19 1.67 LIBS only 0.64 ± 0.02 8.81 ± 0.51 -0.17 2.36 VNIR only 0.70 ± 0.03 8.46 ± 0.72 -0.11 2.01 VNIR + XRF 0.75 ± 0.06 7.26 ± 1.47 -0.06 0.81 VNIR + LIBS 0.77 ± 0.00 7.11 ± 0.24 -0.04 0.66 XRF + LIBS 0.71 ± 0.03 7.28 ± 0.43 -0.10 0.83 Average pooling fusion 0.71 ± 0.05 8.10 ± 0.99 -0.10 1.65 Trainable uniform gating 0.75 ± 0.03 6.91 ± 0.76 -0.06 0.46 Fixed uniform gating 0.76 ± 0.05 6.89 ± 0.80 -0.05 0.44 Non-annealing enhancement 0.77 ± 0.04 6.76 ± 1.04 -0.04 0.31 Simplify branches 0.77 ± 0.05 6.93 ± 0.41 -0.04 0.48 No characteristic stage distillation 0.79 ± 0.04 6.60 ± 0.83 -0.02 0.15 Knowledge-free distillation (truth value supervision only) 0.79 ± 0.04 6.78 ± 1.04 -0.02 0.33 Unparalleled Expert Module 0.80 ± 0.03 6.66 ± 0.99 -0.01 0.21 Complete model 0.81 ± 0.03 6.45 ± 0.16 — —

[0113] Note: The average RMSE in Table 3 is the arithmetic mean of the RMSEs of the nine tasks and is only used for model comparison under the same experimental scope. The values ​​in the table are the results of this embodiment and do not limit the specific values ​​of this invention under other soil types, instrument conditions, or sample sources.

[0114] Table 3 shows that removing any modal branch, replacing the task prior gating, canceling annealed mixup, canceling feature-level distillation, completely canceling knowledge distillation, or removing the dual-expert module all lead to a decrease in the macro-average R² or an increase in RMSE. This result indicates that trimodal input, task gating, distillation training, and the dual-expert module all affect model performance.

[0115] Optionally, an insertion-deletion method can be used to verify the model's dependence on key spectral segments. After progressively inserting or deleting spectral segments according to feature importance, the R² values ​​of attributes such as Clay, OM, V, and ex-K show significant changes, while the plateau values ​​of attributes such as pH and ex-P are lower and more volatile, indicating that there are differences in the effective spectral segments and modeling difficulty for different attributes.

[0116] It also allows for visualization and analysis of intermediate representations at different stages of the student network. After processing through the Stem layer, Inception multi-scale module, Out256 projection, FUSE fusion, and dual-expert module, the sample representation can gradually form a representation structure related to the target attributes.

[0117] In one exemplary implementation, the complete student model has approximately 1.40M parameters, and the single inference latency is approximately 17.11ms. These values ​​are affected by the hardware platform and software implementation, and are merely illustrative examples, not intended to limit the scope of this invention.

[0118] The above description is only a preferred embodiment of the present invention. For those skilled in the art, several modifications and substitutions can be made without departing from the principles and concepts of the present invention, and all equivalent modifications and substitutions should fall within the protection scope of the present invention.

Claims

1. A multimodal spectral soil property estimation method based on task-prior gated distillation, characterized in that, Includes the following steps: S1, acquire the visible-near infrared reflectance spectrum (VNIR), X-ray fluorescence spectrum (XRF), and laser-induced breakdown spectrum (LIBS) corresponding to the same soil sample to form a three-modal input; S2, perform modality-specific preprocessing on the three modal inputs respectively, and divide the samples into training set and validation set. The standardized statistics of the target attribute are calculated only from the training set. S3. For each soil attribute to be predicted, construct a stoichiometric candidate teacher model including single-modal PLS, SF-PLS and GR on the training set, and determine the target teacher model based on cross-validation within the training set or validation set indicators, so that the target teacher model outputs teacher soft labels and teacher intermediate features. S4, Construct a student network, which includes three modality-specific one-dimensional convolutional branches corresponding to VNIR, XRF and LIBS respectively. Each modality-specific one-dimensional convolutional branch has a multi-scale convolutional unit and outputs a modality feature map. S5. For each modality feature map, a combination of GeM pooling and TopK pooling is used for aggregation to obtain a modality embedding vector of fixed dimensions. S6. Construct Dirichlet parameters based on task-modal prior importance, generate task-specific gating weights or apply regularization constraints to the neural gating output, and perform task-weighted fusion of the three modal embedding vectors to obtain task fusion features. S7, the task fusion features are input into the dual-expert hybrid prediction module, the task expert gating allocates weights between the two expert sub-networks, and the student prediction value corresponding to the soil attribute is output through the task regression head; S8. The student network is jointly trained using the output distillation loss corresponding to the teacher's soft label, the feature distillation loss corresponding to the teacher's intermediate features, the regression loss corresponding to the measured true value, and the gated prior regularization loss to obtain the trained soil property estimation model. S9. During the inference phase, only the trained student network is deployed. The VNIR, XRF, and LIBS of the soil sample to be tested are input into the student network, and one or more soil property estimates are output.

2. The multimodal spectral soil property estimation method based on task prior gated distillation according to claim 1, characterized in that, The preprocessing in step S2 includes: VNIR spectra are sequentially corrected using standard normal variables, normalized to maximum values, subjected to Savitzky-Golay first derivative, and smoothed using Savitzky-Golay; XRF spectra are corrected using live-time, normalized using L2, or normalized using Compton peak; LIBS spectra are corrected using standard normal variables, normalized to maximum values, and subjected to target band selection, which includes 200-540 nm cutoff, iSPA interval variable selection, or full spectrum input. The tensor form of the trimodal input in the student network is as follows: Where B is the batch size. These represent VNIR, XRF, and LIBS, respectively. The number of effective wavelength points for VNIR. This refers to the number of XRF channels or the number of elemental spectral lines. This refers to the number of LIBS wavelength points or the number of variables in the target band.

3. The multimodal spectral soil property estimation method based on task prior gated distillation according to claim 1, characterized in that, In step S3, the chemometric candidate teacher model includes a single-modal PLS, an SF-PLS, and a GR model; the SF-PLS model is a partial least squares regression performed after splicing the preprocessed multimodal spectra, and the GR model is a linear weighted regression with single-modal predicted values ​​and SF-PLS predicted values ​​as independent variables; the number of latent variables in PLS is determined by the validation set RMSE in the range of 1 to 20.

4. The multimodal spectral soil property estimation method based on task prior gated distillation according to claim 1, characterized in that, In step S4, the multi-scale convolutional unit adopts a one-dimensional Inception structure, with convolutional kernel sizes including 1, 3, 5 and 7. Each convolutional branch outputs 32 to 128 channels, which are then spliced ​​and linearly projected to obtain 128 to 512-dimensional features.

5. The multimodal spectral soil property estimation method based on task prior gated distillation according to claim 1, characterized in that, In step S5, GeM pooling and TopK pooling are... Combined to form modal embedding vectors ,in For the m-th modal feature map, K is 1% to 20% of the sequence length. .

6. The multimodal spectral soil property estimation method based on task prior gated distillation according to claim 1, characterized in that, In step S6, the task-modal prior importance is generated from the performance of the single-modal teacher model and / or the soil spectral mechanism prior on the training and validation sets, and independent test set labels must not be used; wherein, the prior importance of task t with mode m satisfy ≥0 and The Dirichlet parameter is ,in , Task-specific gating weights Generated by the Dirichlet parameters, or by neural gating output and passed through Regularization constraints, task fusion features are .

7. The multimodal spectral soil property estimation method based on task prior gated distillation according to claim 1, characterized in that, In step S7, the dual-expert hybrid prediction module includes a first expert sub-network. Second expert sub-network And task expert gating network, task expert gating network output and ,and Experts are represented as And returned to the head of the task Output the predicted student values ​​for task t.

8. The multimodal spectral soil property estimation method based on task prior gated distillation according to claim 1, characterized in that, In step S8, the overall loss function is ,in To output distillation losses, Characteristic distillation loss, For true regression loss, For gated prior regularization loss; , , and The weights are non-negative.

9. The multimodal spectral soil property estimation method based on task prior gated distillation according to claim 1, characterized in that, In step S8, annealed Mixup enhancement is employed, linearly mixing the VNIR, XRF, LIBS input spectra, measured ground truth values, teacher soft labels, and teacher intermediate features using the same mixing coefficient. The mixing coefficient is sampled from a Beta distribution, with the Beta distribution parameter linearly annealed from 0.40 to 0.15 with each training epoch. The preferred training optimizer is AdamW, with a learning rate ranging from [value missing]. to The weight decay range is to The batch size ranges from 8 to 64, the gradient pruning threshold is preferably 0.5, and the early stop patience rounds are preferably 25.

10. A multimodal spectral soil property estimation system based on task-prior gated distillation, characterized in that, include: The data acquisition module is used to acquire the VNIR, XRF and LIBS three-mode spectra of the same sample; The preprocessing and partitioning module is used to perform modality correspondence preprocessing and form training and validation sets; The teacher model building module is used to build chemometrics teacher models and output teacher soft labels and teacher intermediate features; The student network construction module is used to construct three modality-specific one-dimensional convolutional branches and the GeM / TopK aggregation module; The gating fusion module is used to generate task-specific gating weights based on task-modal priors and perform cross-modal fusion. The distillation training module is used to train student networks based on output distillation, feature distillation, truth regression, and gated prior regularization. The prediction output module is used to output soil property estimates during the inference phase. Each of the modules is configured to perform the method described in any one of claims 1 to 9.