Spectrum coordination correction method, device, equipment and medium
By acquiring benchmark and measured spectral data in the spectral correction method and calculating weighting coefficients for collaborative correction, the coupling interference problem between soil moisture absorption and particle size scattering is solved, thereby improving the quality of spectral data and the accuracy of the inversion model.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHANDONG UNIV OF TECH
- Filing Date
- 2026-05-18
- Publication Date
- 2026-07-14
AI Technical Summary
Existing spectral correction methods struggle to effectively eliminate the coupling interference between soil moisture absorption and particle size scattering when faced with complex, multi-parameter interactions in real-world physical scenarios, resulting in insufficient quantitative accuracy and generalization ability of the inversion model.
By acquiring the spectral data of the reference sample under standard conditions, extracting the reference spectral values at characteristic wavelengths, and combining them with the measured spectral data of the sample to be tested, weighting coefficients and collaborative correction coefficients are calculated to correct the spectral data and eliminate moisture and particle size interference.
This method achieves the simultaneous elimination of the coupling effect of moisture absorption and particle size scattering at the spectral level, thereby improving the quality of the target spectral data and the accuracy of the inversion model.
Smart Images

Figure CN122385509A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and in particular to a method, apparatus, device, and medium for spectral collaborative correction. Background Technology
[0002] With the increasing demands of modern agricultural production and environmental monitoring, the use of spectroscopic technology for rapid, non-destructive, and online monitoring of soil physicochemical properties has become a recognized key technological approach in the industry. In particular, soil reflectance spectroscopy in the near-infrared / shortwave infrared range not only provides information on the molecular vibrations and resonances of soil components but also offers advantages such as fast response, simple sample preparation, and real-time field measurement. However, in actual measurement and inversion processes, the inherent water absorption and particle size scattering effects of soil severely couple and interfere with the spectral signal, directly limiting the quantitative accuracy and generalization ability of the inversion model.
[0003] To address the aforementioned interference issues, various spectral correction methods have been developed in the existing technology. Among them, the industry commonly employs preprocessing techniques such as multivariate scattering correction and standard normal transformation to statistically weaken particle scattering noise caused by non-chemical absorption. In addition, some studies have constructed empirical models or interpolation curves of soil moisture content and characteristic wavelength reflectance in order to perform single-factor moisture compensation for spectra under different moisture content conditions. Other schemes rely on single-factor correction devices based on particle size distribution models to correct the reflectance of spectral data under different particle size gradients using sieved soil samples as a benchmark.
[0004] However, in real-world, complex measurement environments, the inherent moisture absorption and particle size scattering effects of soil cause severe coupling interference to spectral signals. The aforementioned preprocessing methods, which rely on mathematical statistical characteristics, are highly dependent on the distribution of the original sampled data and cannot effectively separate mixed and superimposed signals from different physical sources. Furthermore, existing single-factor compensation techniques, by their inherent mechanisms, can only fit the isolated effects of a single variable. When faced with complex, multi-parameter interactions in real-world physical scenarios, their one-dimensional correction models often ignore the competition and masking mechanisms between different variables. This makes it difficult for existing technologies to effectively eliminate mixed physical interference in complex scenarios with synergistic effects of multiple parameters. Summary of the Invention
[0005] This invention provides a method, apparatus, device, and medium for spectral collaborative correction, which addresses the technical problems existing in current spectral correction methods.
[0006] This invention provides a spectral co-correction method, comprising the following steps: Acquire the first spectral data of a reference sample under standard conditions, and extract the reference spectral values of the first spectral data at multiple preset characteristic wavelengths; the sample moisture content under the standard conditions is lower than a first preset threshold and the sample particle size is lower than a second preset threshold; Acquire the second spectral data of the sample to be tested, and extract the measured spectral values of the second spectral data at each of the preset characteristic wavelengths; Obtain the weighting coefficients corresponding to each of the preset feature wavelengths, and obtain the collaborative correction coefficients based on the ratio of the measured spectral values to the reference spectral values corresponding to all the preset feature wavelengths and the weighting coefficients; Based on the aforementioned collaborative correction coefficients, the second spectral data is corrected to obtain the target spectral data.
[0007] According to the spectral collaborative correction method provided by the present invention, obtaining the weighting coefficients corresponding to each of the preset characteristic wavelengths includes: For each preset characteristic wavelength, obtain the prior basic weight coefficient of the preset characteristic wavelength under the standard state; The real-time moisture state parameters and real-time particle size state parameters of the sample to be tested are obtained, and the environmental adjustment coefficient corresponding to the preset characteristic wavelength is determined based on the balance distribution rule. Extract the spectral prediction residual of the preset characteristic wavelength within a historical time window, and determine the residual feedback coefficient corresponding to the preset characteristic wavelength based on the spectral prediction residual; Based on the prior basic weight coefficient, the environmental adjustment coefficient, and the residual feedback coefficient, the weight coefficient corresponding to the preset characteristic wavelength is obtained.
[0008] According to the spectral co-correction method provided by the present invention, the step of acquiring the real-time moisture state parameter and real-time particle size state parameter of the sample to be tested, and determining the environmental adjustment coefficient corresponding to the preset characteristic wavelength based on the balance distribution rule, includes: A first target wavelength with a correlation coefficient greater than a first correlation threshold and a second target wavelength with a correlation coefficient greater than a second correlation threshold are determined. The moisture weight corresponding to the first target wavelength is determined based on the increase in the real-time moisture state parameter of the sample to be tested relative to the baseline moisture state. The particle size weight corresponding to the second target wavelength is determined based on the increase of the real-time particle size state parameter of the sample to be tested relative to the reference particle size state. A preset balance coefficient is obtained, and based on the balance coefficient, the moisture weight, and the particle size weight, an environmental adjustment coefficient corresponding to the preset characteristic wavelength is determined.
[0009] According to the spectral collaborative correction method provided by the present invention, the step of extracting the spectral prediction residual of the preset characteristic wavelength within a historical time window and determining the residual feedback coefficient corresponding to the preset characteristic wavelength based on the spectral prediction residual includes: Extract the spectral prediction residuals of the preset feature wavelength within multiple consecutive historical time windows, and construct the residual sequence corresponding to the preset feature wavelength; Determine the error statistics of the residual sequence corresponding to the preset characteristic wavelength; If the error statistic corresponding to the preset characteristic wavelength is greater than the preset error threshold, then the first value is determined to be its corresponding residual feedback coefficient. If the error statistic corresponding to the preset characteristic wavelength is less than or equal to the preset error threshold, then the second value is determined to be its corresponding residual feedback coefficient. Wherein, the first value is less than the second value.
[0010] According to the spectral collaborative correction method provided by the present invention, obtaining the collaborative correction coefficient based on the ratio of the measured spectral value to the reference spectral value corresponding to each of the preset characteristic wavelengths and the weighting coefficient includes: Based on the weighting coefficients corresponding to each preset characteristic wavelength, the ratios of the measured spectral values to the reference spectral values corresponding to all preset characteristic wavelengths are weighted and averaged to obtain the initial correction coefficients. The initial correction coefficients within a preset time window are subjected to smoothing filtering to obtain smoothed correction coefficients. If the smoothing correction coefficient exceeds the preset physical boundary condition range, the smoothing correction coefficient is truncated based on the boundary value of the physical boundary condition range to obtain the cooperative correction coefficient.
[0011] According to the spectral co-correction method provided by the present invention, before acquiring the first spectral data of the reference sample in a standard state, the method further includes: Obtain a spectral training set containing training samples with multiple different moisture gradients and different particle size gradients; A partial least squares regression prediction model is constructed based on the aforementioned spectral training set; Determine the variable projection importance index values for each candidate wavelength in the partial least squares regression prediction model; The wavelengths whose variable projection importance index values are greater than a preset importance threshold are determined as preset feature wavelengths.
[0012] According to the spectral co-correction method provided by the present invention, after obtaining the target spectral data, the method further includes: Obtain the true index parameters corresponding to the sample to be tested, and construct a target parameter prediction model based on the target spectral data and the true index parameters; Obtain the test spectral data of the validation set samples, and input the test spectral data into the target parameter prediction model to obtain the corresponding predicted value; Based on the predicted values and the true values of the validation set samples, a model accuracy evaluation index is determined; If the model accuracy evaluation index does not meet the preset accuracy condition, then return to the step of obtaining the weight coefficients corresponding to each preset feature wavelength to update the collaborative correction coefficients until the model accuracy evaluation index meets the preset accuracy condition.
[0013] The present invention also provides a spectral co-correction device, comprising: The first acquisition module is used to acquire the first spectral data of a reference sample under standard conditions, and extract the reference spectral values of the first spectral data at multiple preset characteristic wavelengths; the sample moisture content under the standard conditions is lower than a first preset threshold and the sample particle size is lower than a second preset threshold. The second acquisition module is used to acquire the second spectral data of the sample to be tested, and extract the measured spectral values of the second spectral data at each of the preset characteristic wavelengths; The third acquisition module is used to acquire the weighting coefficients corresponding to each of the preset feature wavelengths, and to obtain the collaborative correction coefficients based on the ratio of the measured spectral values to the reference spectral values corresponding to all the preset feature wavelengths and the weighting coefficients. The correction module is used to correct the second spectral data based on the cooperative correction coefficient to obtain the target spectral data.
[0014] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor executes the program to implement the spectral co-correction method as described above.
[0015] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the spectral collaborative correction method as described above.
[0016] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the spectral collaborative correction method as described above.
[0017] The spectral collaborative correction method, apparatus, device, and medium provided by this invention establish a baseline spectrum under a preset standardized state to eliminate moisture and particle size interference as the optimal reference. It then calculates and weights the ratios of the measured spectrum and the baseline spectrum at multiple characteristic wavelengths, constructing a collaborative correction mechanism based on a standard ratio. This not only quantifies and eliminates the dual-factor mixed interference of moisture absorption and particle size scattering at the physical level but also effectively resists single-point measurement errors through multi-wavelength information fusion, thus improving the quality of the target spectral data. Attached Figure Description
[0018] To more clearly illustrate the technical solutions of the present invention or the conventional ones, the drawings used in the embodiments or conventional descriptions will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0019] Figure 1 This is a schematic flowchart of the spectral collaborative correction method provided in an embodiment of the present invention.
[0020] Figure 2 This is a schematic diagram illustrating the performance of the evaluation index of the PLSR prediction model established using the original spectral data under 12 gradients provided in this embodiment of the invention.
[0021] Figure 3 This is a schematic diagram of the spectral reflectance of soil samples with different moisture levels at four different particle sizes, provided in an embodiment of the present invention.
[0022] Figure 4 This is a schematic diagram comparing the spectral reflectance of a single sample before and after correction at a characteristic wavelength, provided in an embodiment of the present invention.
[0023] Figure 5 This is a schematic diagram comparing the model results provided in the embodiments of the present invention.
[0024] Figure 6 This is a schematic diagram of the spectral collaborative correction device provided in an embodiment of the present invention.
[0025] Figure 7 This is a schematic diagram of the structure of the electronic device provided in an embodiment of the present invention. Detailed Implementation
[0026] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0027] It should be noted that in the description of this invention, the terms "comprising," "including," or any other variations thereof are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element. The terms "upper," "lower," etc., indicating orientation or positional relationships based on the orientation or positional relationships shown in the accompanying drawings, are only for the convenience of describing the invention and for simplifying the description, and do not indicate or imply that the system or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the invention. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.
[0028] The terms "first," "second," etc., used in this invention are used to distinguish similar objects, not to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class, without limiting the number of objects; for example, a first object can be one or more. Furthermore, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0029] Figure 1 This is a schematic flowchart of the spectral collaborative correction method provided in an embodiment of the present invention, as shown below. Figure 1 As shown, the method includes the following steps 110, 120, 130 and 140.
[0030] Step 110: Obtain the first spectral data of the reference sample under standard conditions, and extract the reference spectral values of the first spectral data at multiple preset characteristic wavelengths; the sample moisture content corresponding to the standard conditions is lower than a first preset threshold and the sample particle size is lower than a second preset threshold.
[0031] First, the first spectral data of the reference sample under standard conditions is acquired. Standard conditions refer to the physical state of the sample after minimizing the two main physical factors that interfere with the spectral signal—water content and particle size—through specific sample processing methods. In this state, the sample's water content is below a first preset threshold, and the sample's particle size is below a second preset threshold.
[0032] Under these standard conditions, soil moisture is completely removed and soil particle size is uniformly reduced to a minimum, thereby eliminating both water absorption interference and particle size scattering interference at the physical level.
[0033] In one embodiment, the soil sample is first thoroughly dried to completely remove free and bound water from the sample, reducing the moisture content of the sample to below a first preset threshold. Then, the dried sample is finely ground and sieved through a standard sieve to uniformly reduce the sample particle size to below a second preset threshold.
[0034] refer to Figure 3 As shown, under low humidity (2%) conditions, reflectivity decreases with increasing particle size (R0). 0.3mm >R 0.45mm >R 0.9mm >R 2mm This indicates that the scattering effect of particle size is dominant and is unaffected by low humidity levels. Figure 3 a). At a moderate moisture content (6.5%), reflectance no longer strictly follows the trend of decreasing with increasing particle size. This deviation indicates that moisture interferes with the particle size effect ( Figure 3 b). At high moisture content (11%), the spectral curves tend to converge, indicating that strong moisture absorption may mask the differences between different particle sizes, thus making the particle size effect negligible. Figure 3 c).
[0035] The reference sample refers to a soil sample that has undergone the above treatment and is in a standard state. A hyperspectral analyzer is used to perform a spectral scan on the reference sample to obtain first spectral data, which contains reflectance information of the reference sample at various wavelengths.
[0036] In one embodiment, the first spectral data can be acquired using a hyperspectral instrument with a wavelength range of 350 nm to 1100 nm (e.g., HS1-eSWIR-400-2500H).
[0037] The characteristic wavelength is defined as a specific wavelength position that is pre-selected from the full-band spectrum, which has a significant response to the target soil physicochemical parameters (such as soil total nitrogen content) and can effectively reflect moisture interference and particle size interference.
[0038] The number of preset feature wavelengths can be one or more. In one embodiment, the number of preset feature wavelengths is no more than 20, so as to ensure the correction effect while avoiding the model from becoming too complex.
[0039] After obtaining the first spectral data, the reflectance at each preset characteristic wavelength is extracted as the reference spectral value. The reference spectral value at the i-th preset characteristic wavelength is denoted as R. base,i , where i is an integer from 1 to N, and N is the total number of preset characteristic wavelengths.
[0040] Step 120: Obtain the second spectral data of the sample to be tested, and extract the measured spectral values of the second spectral data at each of the preset characteristic wavelengths.
[0041] Here, the spectral data of the sample to be tested, collected under conventional measurement conditions, is obtained, i.e., the second spectral data. The moisture content and particle size of the sample to be tested may be in various different conditions. For example, the moisture content may be in different gradients such as 2%, 6.5%, and 11%, and the particle size may be in different gradients such as 0.3 mm, 0.45 mm, 0.9 mm, and 2 mm.
[0042] It should be noted that, because the sample was being measured under normal conditions, its second spectral data was superimposed with interference from moisture absorption and particle size scattering. Compared to the first spectral data of the reference sample, the reflectance of the second spectral data will drift at certain wavelengths, and the degree of drift varies with the moisture content and particle size of the sample. Figure 4 As shown, before correction, the spectral reflectance of each sample at the characteristic wavelength was significantly dispersed under different combinations of moisture gradient and particle size gradient.
[0043] After acquiring the second spectral data, the reflectance at each preset characteristic wavelength is extracted as the measured spectral value. The measured spectral value at the i-th preset characteristic wavelength is denoted as R. ref,i .
[0044] It should be noted that both the first and second spectral data can undergo spectral preprocessing before extracting the spectral values at each preset characteristic wavelength. Preprocessing methods include, but are not limited to, Savitzky-Golay smoothing and standard normal transformation, to remove random noise and baseline drift from the spectral signal.
[0045] Step 130: Obtain the weighting coefficients corresponding to each of the preset characteristic wavelengths, and obtain the collaborative correction coefficients based on the ratio of the measured spectral values to the reference spectral values corresponding to all the preset characteristic wavelengths and the weighting coefficients.
[0046] Next, the weighting coefficients w corresponding to each preset feature wavelength are obtained. i Weighting coefficient wi This reflects the relative importance of the i-th preset characteristic wavelength in the collaborative correction process. Different preset characteristic wavelengths have different abilities to reflect the soil target physicochemical parameters and the interference of moisture and particle size. Therefore, the weight coefficients of each wavelength are usually not equal.
[0047] After obtaining the weighting coefficients w corresponding to each preset characteristic wavelength i Then, a weighted average is calculated on the ratios of the measured spectral values to the reference spectral values at all preset characteristic wavelengths to obtain the collaborative correction coefficient P. The collaborative correction coefficient P is calculated as follows: ; Among them, R base,i R is the reference spectral value at the i-th preset characteristic wavelength. ref,i w is the measured spectral value of the sample under test at the i-th preset characteristic wavelength. i is the weighting coefficient corresponding to the i-th preset feature wavelength, and N is the total number of preset feature wavelengths.
[0048] Step 140: Based on the cooperative correction coefficient, the second spectral data is corrected to obtain the target spectral data.
[0049] In this embodiment, a co-correction coefficient is used to correct the second spectral data of the sample to be tested, thereby obtaining the target spectral data. Specifically, the spectral data of the sample to be tested is scaled using the co-correction coefficient to make the corrected spectral data closer to the spectral data under standard conditions, thereby eliminating the coupling effect of moisture absorption interference and particle size scattering interference at the spectral level.
[0050] In one embodiment, the reflectance of the target spectral data at each wavelength is equal to the quotient of the reflectance of the second spectral data at the corresponding wavelength and the co-correction coefficient, that is, the full-band spectrum is normalized and corrected using the co-correction coefficient.
[0051] Continue to refer to Figure 4 It can be seen that after synergistic correction, the spectral curves of each sample at the preset characteristic wavelength under different combinations of moisture and particle size gradients tend to converge, and the spectral variance is significantly reduced, achieving the correction goal of normalizing with the standard state spectrum. Furthermore, as... Figure 5 As shown, the prediction accuracy of the partial least squares regression prediction model for total nitrogen in soil based on the target spectral data is significantly better than that of the model based on the uncorrected original spectral data, the model based on the single moisture-corrected spectral data, and the model based on the single particle size-corrected spectral data, demonstrating the superiority of the collaborative correction method over the single-factor correction method.
[0052] The spectral collaborative correction method provided in this invention establishes a baseline spectrum under a preset standardized state to eliminate moisture and particle size interference as the optimal reference. It then calculates and weights the ratios of the measured spectrum and the baseline spectrum at multiple characteristic wavelengths, constructing a collaborative correction mechanism based on a standard ratio. This not only quantifies and eliminates the dual-factor mixed interference of moisture absorption and particle size scattering at a physical level, but also effectively resists single-point measurement errors through multi-wavelength information fusion, thus improving the quality of the target spectral data.
[0053] In some embodiments, obtaining the weighting coefficients corresponding to each of the preset feature wavelengths includes: For each preset characteristic wavelength, obtain the prior basic weight coefficient of the preset characteristic wavelength under the standard state; The real-time moisture state parameters and real-time particle size state parameters of the sample to be tested are obtained, and the environmental adjustment coefficient corresponding to the preset characteristic wavelength is determined based on the balance distribution rule. Extract the spectral prediction residual of the preset characteristic wavelength within a historical time window, and determine the residual feedback coefficient corresponding to the preset characteristic wavelength based on the spectral prediction residual; Based on the prior basic weight coefficient, the environmental adjustment coefficient, and the residual feedback coefficient, the weight coefficient corresponding to the preset characteristic wavelength is obtained.
[0054] For each preset characteristic wavelength, a priori weighting coefficient is obtained to determine its contribution to the prediction of the target's physicochemical parameters under standard conditions. The priori weighting coefficient refers to a fixed weight value, predetermined through spectral modeling analysis under standard conditions, reflecting the degree of contribution of each preset characteristic wavelength to the target's physicochemical parameters. This coefficient solidifies the basic contribution of each band to the target under standard reference conditions, and does not change with changes in real-time measurement conditions; it serves as the starting point for subsequent dynamic weight adjustments.
[0055] In one implementation, the prior basic weight coefficients are determined based on the variable importance in projection (VIP) index calculated during partial least squares regression modeling. For the i-th preset feature wavelength, its prior basic weight coefficient is associated with the VIP value corresponding to that wavelength; that is, the larger the VIP value, the larger the corresponding prior basic weight coefficient.
[0056] It should be noted that the determination of the prior basic weight coefficients is completed before the formal collection of the spectra of the samples to be tested, and belongs to the output of the offline modeling stage.
[0057] Next, the current moisture state and particle size state information of the sample to be tested are acquired in real time, and the real-time moisture state parameter and the real-time particle size state parameter are obtained respectively. The real-time moisture state parameter is a quantitative parameter that reflects the current moisture content of the sample to be tested. It can be the actual moisture content value of the sample or the grade classification result corresponding to the moisture content.
[0058] In one embodiment, the samples are divided into three ranges based on moisture content: low moisture (0%-4%), medium moisture (5%-8%), and high moisture (above 9%). Real-time particle size distribution parameters refer to quantitative parameters reflecting the current particle size distribution characteristics of the sample. In one embodiment, the sample particle size is divided into four levels: fine (0.3 mm and below), medium (0.45 mm), coarse (0.9 mm), and very coarse (2 mm).
[0059] The balance allocation rule refers to the calculation rule that adaptively allocates the moisture adjustment component and the particle size adjustment component when calculating the environmental adjustment coefficients of each preset characteristic wavelength by introducing a balance coefficient λ.
[0060] Specifically, for the i-th preset characteristic wavelength, its environmental adjustment coefficient is jointly determined by the moisture weight and the particle size weight, and the balance coefficient λ is used to adjust the respective weight ratio of the two in the comprehensive environmental adjustment coefficient.
[0061] It should be understood that when the moisture content increases, the dominant interference of moisture on the spectrum is enhanced, and the weight corresponding to the moisture-sensitive wavelength is increased. When the particle size becomes coarser and the scattering effect is enhanced, the weight corresponding to the particle size-sensitive wavelength is increased, so that the weight coefficient can focus on the current dominant interference factor according to the location and time, and realize intelligent response to changes in the measurement environment.
[0062] Next, the spectral prediction residuals of each preset characteristic wavelength within the most recent historical time window are extracted, and the residual feedback coefficients corresponding to each wavelength are determined accordingly. The spectral prediction residual refers to the difference between the predicted value and the true value when using spectral data at each preset characteristic wavelength to predict the target physicochemical parameters.
[0063] The residual feedback coefficient is used to reflect the real-time stability of each preset characteristic wavelength. For wavelengths with large prediction residuals within the historical time window, the corresponding residual feedback coefficient is taken as a smaller value, so that the wavelength is appropriately deweighted in the weight calculation; for wavelengths with small prediction residuals, the residual feedback coefficient is taken as a larger value, so that the wavelength is appropriately weighted in the weight calculation.
[0064] Finally, based on the above three components, the final weighting coefficient of the i-th preset characteristic wavelength is obtained.
[0065] The spectral collaborative correction method provided in this invention improves the adaptability and generalization ability of the multi-wavelength fusion weighted algorithm in complex and variable field environments by introducing a weight adjustment mechanism that includes a three-layer structure of prior basic importance, dynamic environmental adjustment, and real-time error feedback.
[0066] In some embodiments, acquiring the real-time moisture state parameter and real-time particle size state parameter of the sample to be tested, and determining the environmental adjustment coefficient corresponding to the preset characteristic wavelength based on the balance distribution rule, includes: A first target wavelength with a correlation coefficient greater than a first correlation threshold and a second target wavelength with a correlation coefficient greater than a second correlation threshold are determined. The moisture weight corresponding to the first target wavelength is determined based on the increase in the real-time moisture state parameter of the sample to be tested relative to the baseline moisture state. The particle size weight corresponding to the second target wavelength is determined based on the increase of the real-time particle size state parameter of the sample to be tested relative to the reference particle size state. A preset balance coefficient is obtained, and based on the balance coefficient, the moisture weight, and the particle size weight, an environmental adjustment coefficient corresponding to the preset characteristic wavelength is determined.
[0067] In this embodiment, the correlation coefficients between the spectral reflectance at each preset characteristic wavelength and the sample moisture content and sample particle size are calculated in advance, and the functional types of each preset characteristic wavelength are classified accordingly.
[0068] The first target wavelength refers to a preset characteristic wavelength that is significantly correlated with the sample moisture content. This means that the spectral reflectance at this wavelength is highly sensitive to changes in sample moisture content, and the corresponding correlation coefficient is greater than the first correlation threshold. The second target wavelength refers to a preset characteristic wavelength that is significantly correlated with the sample particle size. This means that the spectral reflectance at this wavelength is highly sensitive to changes in sample particle size, and the corresponding correlation coefficient is greater than the second correlation threshold.
[0069] Next, the real-time moisture state parameters of the sample to be tested are obtained, and the increase in moisture state relative to the baseline is calculated. The moisture weight is used to quantify the degree of moisture interference amplification carried by the i-th first target wavelength under the current moisture state. That is, the higher the moisture content, the stronger the absorption interference of moisture on the spectrum, and the larger the moisture weight value corresponding to the first target wavelength, so that the wavelength is adjusted up more in the weight calculation.
[0070] Furthermore, the real-time particle size state parameters of the sample under test are obtained, and their increase relative to the baseline particle size state is calculated. The particle size weight is used to quantify the amplification of particle size scattering interference carried by the i-th second target wavelength under the current particle size state. That is, the coarser the particle size, the stronger the interference of particle size scattering on the baseline shift of the spectrum, and the larger the particle size weight value corresponding to the second target wavelength, so that the wavelength is adjusted up more significantly in the weight calculation.
[0071] Finally, the preset balance coefficient λ is obtained, and the balance coefficient λ, moisture weight and particle size weight are multiplied together to obtain the environmental adjustment coefficient corresponding to each preset characteristic wavelength.
[0072] The spectral collaborative correction method provided in this invention distinguishes between moisture-sensitive wavelengths and particle size-sensitive wavelengths, quantifies the real-time response intensity of the two types of interference, and achieves adaptive fusion of the two through a balance coefficient, so that the weighting coefficient can accurately reflect the actual importance of each preset characteristic wavelength in the current interference mode.
[0073] In some embodiments, extracting the spectral prediction residual of the preset characteristic wavelength within a historical time window and determining the residual feedback coefficient corresponding to the preset characteristic wavelength based on the spectral prediction residual includes: Extract the spectral prediction residuals of the preset feature wavelength within multiple consecutive historical time windows, and construct the residual sequence corresponding to the preset feature wavelength; Determine the error statistics of the residual sequence corresponding to the preset characteristic wavelength; If the error statistic corresponding to the preset characteristic wavelength is greater than the preset error threshold, then the first value is determined to be its corresponding residual feedback coefficient. If the error statistic corresponding to the preset characteristic wavelength is less than or equal to the preset error threshold, then the second value is determined to be its corresponding residual feedback coefficient. Wherein, the first value is less than the second value.
[0074] Specifically, the spectral prediction residuals of the i-th preset feature wavelength within multiple consecutive historical time windows are extracted and arranged in chronological order to construct the residual sequence corresponding to that wavelength.
[0075] The length of the historical time window can be flexibly set according to the sampling frequency and application scenario. For example, it can take the residual data of the most recent 10 consecutive sampling moments, or it can be adjusted appropriately according to actual needs. For the i-th preset characteristic wavelength, the spectral prediction residual in the k-th historical time window is defined as the absolute value of the difference between the predicted value obtained by using the measured spectral data at the i-th wavelength in the time window to predict the target physicochemical parameters and the corresponding true value.
[0076] Based on this, statistical analysis is performed on the residual sequence corresponding to the i-th preset characteristic wavelength to obtain the error statistics for that wavelength.
[0077] Error statistics can be root mean square error, mean absolute error, or standard deviation of the residual sequence, etc., which reflect the predictive stability of the wavelength spectrum. The larger the error statistic, the worse the predictive stability of the wavelength in historical measurements; the smaller the error statistic, the better the predictive stability of the wavelength.
[0078] Furthermore, the error statistic of the i-th preset characteristic wavelength is compared with a preset error threshold. Based on the comparison result, the residual feedback coefficient of the wavelength is determined. If the error statistic of the i-th preset characteristic wavelength is greater than the preset error threshold, it indicates that the wavelength is unstable in historical measurements and has a large prediction error. In this case, the residual feedback coefficient of the wavelength is set to a smaller first value, and the wavelength is appropriately deweighted to reduce the interference of its unstable contribution on the accuracy of the collaborative correction coefficient. If the error statistic of the i-th preset characteristic wavelength is less than or equal to the preset error threshold, it indicates that the wavelength has a low residual and good stability in historical measurements. In this case, the residual feedback coefficient of the wavelength is set to a larger second value, and the wavelength is appropriately weighted to ensure that its stable spectral information is fully utilized in the correction process.
[0079] The preset error threshold can be set according to the accuracy of the spectrometer used, the characteristics of the sample, and the accuracy requirements of the application, and can be dynamically adjusted according to the overall error level.
[0080] The spectral collaborative correction method provided in this invention improves reliability in complex and ever-changing actual measurement environments by using a dynamic error feedback mechanism to enable the weighting coefficients to respond in real time to the performance stability of each preset characteristic wavelength under the current measurement environment.
[0081] In some embodiments, obtaining the collaborative correction coefficient based on the ratio of the measured spectral value to the reference spectral value corresponding to each of the preset characteristic wavelengths and the weighting coefficient includes: Based on the weighting coefficients corresponding to each preset characteristic wavelength, the ratios of the measured spectral values to the reference spectral values corresponding to all preset characteristic wavelengths are weighted and averaged to obtain the initial correction coefficients. The initial correction coefficients within a preset time window are subjected to smoothing filtering to obtain smoothed correction coefficients. If the smoothing correction coefficient exceeds the preset physical boundary condition range, the smoothing correction coefficient is truncated based on the boundary value of the physical boundary condition range to obtain the cooperative correction coefficient.
[0082] In this embodiment, weighting coefficients are used to assign weights to R at each preset characteristic wavelength. ref,i / R base,i The initial correction coefficient is obtained by weighting the ratios of the two samples. The initial correction coefficient reflects the weighted estimate of the overall spectral shift of the sample under the current single sampling condition relative to the reference sample. However, the initial correction coefficient may have some instantaneous fluctuations due to factors such as random noise in a single sampling, optical path fluctuations, or sample surface inhomogeneity.
[0083] Based on this, a smoothing filter is applied to multiple consecutive initial correction coefficients obtained at the current time and several previous sampling times to obtain smooth correction coefficients.
[0084] The preset time window contains several consecutive sampling moments, and its length can be set according to the sampling frequency and the real-time requirements of the correction. Smoothing filtering can be performed using methods such as moving average filtering, exponentially weighted moving average, or Savitzky-Golay smoothing to filter out instantaneous fluctuations in the initial correction coefficients, so that the correction coefficients remain stable in the time dimension.
[0085] Finally, the smoothing correction coefficient is compared with the preset physical boundary condition range. The preset physical boundary condition range is a reasonable range of correction coefficient values determined in advance based on the physical laws of soil spectra. If the smoothing correction coefficient is within the preset physical boundary condition range, it is directly output as the final co-correction coefficient; if the smoothing correction coefficient exceeds the preset physical boundary condition range, it is truncated to the corresponding boundary value, and this boundary value is used as the co-correction coefficient to prevent abnormally large or small correction coefficients from causing overcorrection of the target spectral data.
[0086] The spectral collaborative correction method provided in this invention, through a three-level processing flow of weighted averaging, time smoothing, and physical boundary constraints, ensures the real-time performance of the correction coefficients while suppressing jumps caused by instantaneous fluctuations and ensuring the physical rationality of the correction coefficients.
[0087] In some embodiments, prior to acquiring the first spectral data of the reference sample in a standard state, the method further includes: Obtain a spectral training set containing training samples with multiple different moisture gradients and different particle size gradients; A partial least squares regression prediction model is constructed based on the aforementioned spectral training set; Determine the variable projection importance index values for each candidate wavelength in the partial least squares regression prediction model; The wavelengths whose variable projection importance index values are greater than a preset importance threshold are determined as preset feature wavelengths.
[0088] In this embodiment, a pre-collected and organized spectral training set is acquired. This spectral training set contains multiple training samples with different combinations of moisture gradients and particle size gradients to cover various moisture-particle size coupling conditions that may occur in actual measurement scenarios.
[0089] In one embodiment, the spectral training set is constructed as shown in Table 1, with the moisture content divided into three gradients (2%, 6.5%, 11%) and the particle size divided into four gradients (0.3 mm, 0.45 mm, 0.9 mm, 2 mm), forming a total of 12 moisture-particle size combination gradients. Each gradient contains several training samples, and the total number of training samples is, for example, 720.
[0090] Table 1 Soil moisture and particle size at various gradients Gradient category 1 2 3 4 5 6 7 8 9 10 11 12 Moisture content 2% 2% 2% 2% 6.5% 6.5% 6.5% 6.5% 11% 11% 11% 11% Particle size (mm) 0.3 0.45 0.9 2 0.3 0.45 0.9 2 0.3 0.45 0.9 2 The moisture content of soil samples at each gradient was determined by recording the mass difference before and after sampling using a precision electronic balance. Particle size was obtained by sieving using standard sieves of 10 mesh (2 mm), 20 mesh (0.9 mm), 40 mesh (0.45 mm), and 60 mesh (0.3 mm). The target physicochemical parameters of each training sample were determined by chemical analysis using a fully automated Kjeldahl nitrogen analyzer. Spectroscopic data were acquired using a hyperspectral analyzer, covering the wavelength range of 350 nm to 1100 nm.
[0091] Next, a partial least squares regression prediction model is constructed using the spectral data of each training sample in the spectral training set and the corresponding measured values of the target physicochemical parameters. Before constructing the partial least squares regression prediction model, the spectral data can be preprocessed, including Savitzky-Golay smoothing and standard normal transformation, to remove the effects of baseline drift and random noise. By dividing the preprocessed spectral training set into a training subset and a validation subset at a certain ratio (e.g., 4:1), the partial least squares regression prediction model is trained using the spectral data of the training subset and the measured values of the target physicochemical parameters as input, and the model performance is evaluated using the prediction results of the validation subset.
[0092] In one implementation, such as Figure 2 As shown, the coefficient of determination R is used. 2 The performance of the model in predicting total nitrogen in soil was evaluated. The prediction model R was tested on different datasets. 2 Comparison revealed that, at all three moisture levels, except for dataset 7 (moisture content: 6.5%, particle size: 0.9 mm), R... 2 Generally, the improvement decreases with increasing particle size. The greatest improvement occurs at the lowest moisture content (2%), and the smallest improvement occurs at the highest moisture content (11%), indicating that the effect of particle size is more significant under drier conditions. At all four particle size levels, except for the dataset (moisture content: 6.5%, particle size: 0.9 mm), R...2 It typically decreases with increasing moisture content. Notably, at the maximum particle size (2 mm), R... 2 The change with humidity is minimal, indicating that the effect of humidity can be ignored under these conditions.
[0093] Furthermore, the Variable Importance in Projection (VIP) index for each candidate wavelength in the spectral training set within the established partial least squares regression prediction model is calculated. The VIP value is a widely used wavelength importance assessment index in partial least squares regression models, quantifying the overall contribution of spectral variables at each wavelength to the prediction of target physicochemical parameters. A larger VIP value indicates a stronger correlation between the spectral information at that wavelength and the target physicochemical parameters, resulting in a greater contribution to the prediction model; a smaller VIP value indicates a weaker correlation between that wavelength and the target physicochemical parameters.
[0094] Finally, the VIP value of each candidate wavelength is compared with the preset importance threshold, and the wavelengths with VIP values greater than the preset importance threshold are determined as preset feature wavelengths.
[0095] The spectral collaborative correction method provided in this invention constructs a spectral training set combining multiple moisture gradients and multiple particle size gradients, and uses the variable projection importance index of the partial least squares regression prediction model to achieve quantitative screening of characteristic wavelengths, ensuring a high degree of fit between the selected characteristic wavelengths and the correction target and correction process.
[0096] In some embodiments, after obtaining the target spectral data, the method further includes: Obtain the true index parameters corresponding to the sample to be tested, and construct a target parameter prediction model based on the target spectral data and the true index parameters; Obtain the test spectral data of the validation set samples, and input the test spectral data into the target parameter prediction model to obtain the corresponding predicted value; Based on the predicted values and the true values of the validation set samples, a model accuracy evaluation index is determined; If the model accuracy evaluation index does not meet the preset accuracy condition, then return to the step of obtaining the weight coefficients corresponding to each preset feature wavelength to update the collaborative correction coefficients until the model accuracy evaluation index meets the preset accuracy condition.
[0097] In this embodiment, the actual measured values of the target physicochemical parameters corresponding to the sample to be tested are obtained, and the target spectral data obtained after collaborative correction is paired with the corresponding actual measured values to form a modeling dataset and construct a target parameter prediction model.
[0098] The target parameter prediction model is a quantitative analysis model that takes target spectral data as input and outputs predicted values of target physicochemical parameters. In one implementation, the target parameter prediction model is constructed using partial least squares regression. During modeling, the dataset can be divided into a training subset and a validation subset in a 4:1 ratio, with the training subset used to construct the prediction model.
[0099] The test spectral data of each verification sample in the verification subset are obtained and input into the established target parameter prediction model to obtain the predicted values of the target physicochemical parameters of each verification sample.
[0100] Based on the predicted and true values of each sample in the validation subset, a model accuracy evaluation metric is calculated. Model accuracy evaluation metrics may include, but are not limited to, the coefficient of determination (R²). 2 And root mean square error (RMSE), etc.
[0101] For example, embodiments of the present invention experimentally verify that the soil total nitrogen prediction model constructed based on the collaboratively corrected target spectral data, such as... Figure 5 As shown, the model results indicate that the prediction model based on the collaboratively corrected data has the highest accuracy compared to the spectral prediction models established with uncorrected data, single moisture correction data, and single particle size correction data.
[0102] Finally, the model accuracy evaluation index is compared with the preset accuracy conditions. If the model accuracy evaluation index meets the preset accuracy conditions, it is considered that the current collaborative correction coefficient has achieved the expected correction effect, the process ends, and the final target spectral data is output for subsequent online detection of soil physicochemical parameters. If the model accuracy evaluation index does not meet the preset accuracy conditions, the process returns to the step of obtaining the weight coefficients corresponding to each preset feature wavelength. The weight coefficients of each preset feature wavelength are adjusted according to the current model accuracy feedback, and then the collaborative correction coefficients are recalculated. Based on the updated collaborative correction coefficients, the second spectral data is corrected again to obtain new target spectral data. The target parameter prediction model is reconstructed and the model accuracy is evaluated. This process is iterated until the model accuracy evaluation index meets the preset accuracy conditions.
[0103] The spectral collaborative correction method provided in this invention, through a closed-loop iterative optimization process of constructing a target parameter prediction model, evaluating the accuracy of the validation set, and updating the weight coefficients, directly incorporates the final goal of collaborative correction into the evaluation system of the correction process, thus ensuring reliability and accuracy in the final application scenario.
[0104] The spectral collaborative correction device provided in the embodiments of the present invention is described below. The spectral collaborative correction device described below can be referred to in correspondence with the spectral collaborative correction method described above.
[0105] The spectral cooperative correction device of this invention, such as Figure 6 As shown, it includes the following modules: The first acquisition module 610 is used to acquire the first spectral data of a reference sample under standard conditions, and extract the reference spectral values of the first spectral data at multiple preset characteristic wavelengths; the sample moisture content corresponding to the standard conditions is lower than a first preset threshold and the sample particle size is lower than a second preset threshold. The second acquisition module 620 is used to acquire the second spectral data of the sample to be tested, and extract the measured spectral values of the second spectral data at each of the preset characteristic wavelengths; The third acquisition module 630 is used to acquire the weighting coefficients corresponding to each of the preset feature wavelengths, and to obtain the collaborative correction coefficients based on the ratio of the measured spectral values to the reference spectral values corresponding to all the preset feature wavelengths and the weighting coefficients. The correction module 640 is used to correct the second spectral data based on the cooperative correction coefficient to obtain the target spectral data.
[0106] The spectral collaborative correction device provided in this invention establishes a reference spectrum under a preset standardized state to eliminate moisture and particle size interference as the optimal reference, and calculates and weights the ratios of the measured spectrum and the reference spectrum at multiple characteristic wavelengths to construct a collaborative correction mechanism based on a standard ratio. This not only quantifies and eliminates the dual-factor mixed interference of moisture absorption and particle size scattering at the physical level, but also effectively resists single-point measurement errors through multi-wavelength information fusion, thus improving the quality of the target spectral data.
[0107] Figure 7 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 7 As shown, the electronic device may include: a processor 710, a communications interface 720, a memory 730, and a communication bus 740, wherein the processor 710, the communications interface 720, and the memory 730 communicate with each other via the communication bus 740. The processor 710 can call logical instructions in the memory 730 to execute a spectral collaborative correction method, which includes: Acquire the first spectral data of a reference sample under standard conditions, and extract the reference spectral values of the first spectral data at multiple preset characteristic wavelengths; the sample moisture content under the standard conditions is lower than a first preset threshold and the sample particle size is lower than a second preset threshold; Acquire the second spectral data of the sample to be tested, and extract the measured spectral values of the second spectral data at each of the preset characteristic wavelengths; Obtain the weighting coefficients corresponding to each of the preset feature wavelengths, and obtain the collaborative correction coefficients based on the ratio of the measured spectral values to the reference spectral values corresponding to all the preset feature wavelengths and the weighting coefficients; Based on the aforementioned collaborative correction coefficients, the second spectral data is corrected to obtain the target spectral data.
[0108] Furthermore, the logical instructions in the aforementioned memory 730 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the conventional, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc., each of which can store program code.
[0109] On the other hand, embodiments of the present invention also provide a computer program product, the computer program product including a computer program, the computer program being able to be stored on a non-transitory computer-readable storage medium, and when the computer program is executed by a processor, the computer is able to execute the spectral collaborative correction method provided in each of the above embodiments, the method including: Acquire the first spectral data of a reference sample under standard conditions, and extract the reference spectral values of the first spectral data at multiple preset characteristic wavelengths; the sample moisture content under the standard conditions is lower than a first preset threshold and the sample particle size is lower than a second preset threshold; Acquire the second spectral data of the sample to be tested, and extract the measured spectral values of the second spectral data at each of the preset characteristic wavelengths; Obtain the weighting coefficients corresponding to each of the preset feature wavelengths, and obtain the collaborative correction coefficients based on the ratio of the measured spectral values to the reference spectral values corresponding to all the preset feature wavelengths and the weighting coefficients; Based on the aforementioned collaborative correction coefficients, the second spectral data is corrected to obtain the target spectral data.
[0110] In another aspect, embodiments of the present invention also provide a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the spectral co-correction method provided in each of the above embodiments, the method comprising: Acquire the first spectral data of a reference sample under standard conditions, and extract the reference spectral values of the first spectral data at multiple preset characteristic wavelengths; the sample moisture content under the standard conditions is lower than a first preset threshold and the sample particle size is lower than a second preset threshold; Acquire the second spectral data of the sample to be tested, and extract the measured spectral values of the second spectral data at each of the preset characteristic wavelengths; Obtain the weighting coefficients corresponding to each of the preset feature wavelengths, and obtain the collaborative correction coefficients based on the ratio of the measured spectral values to the reference spectral values corresponding to all the preset feature wavelengths and the weighting coefficients; Based on the aforementioned collaborative correction coefficients, the second spectral data is corrected to obtain the target spectral data.
[0111] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0112] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the conventional, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0113] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in each of the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of each embodiment of the present invention.
Claims
1. A spectral collaborative correction method, characterized in that, include: Acquire the first spectral data of a reference sample under standard conditions, and extract the reference spectral values of the first spectral data at multiple preset characteristic wavelengths; The sample moisture content and sample particle size are lower than the first preset threshold and the sample moisture content is lower than the second preset threshold under the standard conditions. Acquire the second spectral data of the sample to be tested, and extract the measured spectral values of the second spectral data at each of the preset characteristic wavelengths; Obtain the weighting coefficients corresponding to each of the preset feature wavelengths, and obtain the collaborative correction coefficients based on the ratio of the measured spectral values to the reference spectral values corresponding to all the preset feature wavelengths and the weighting coefficients; Based on the aforementioned collaborative correction coefficients, the second spectral data is corrected to obtain the target spectral data.
2. The spectral collaborative correction method according to claim 1, characterized in that, The step of obtaining the weight coefficients corresponding to each of the preset feature wavelengths includes: For each preset characteristic wavelength, obtain the prior basic weight coefficient of the preset characteristic wavelength under the standard state; The real-time moisture state parameters and real-time particle size state parameters of the sample to be tested are obtained, and the environmental adjustment coefficient corresponding to the preset characteristic wavelength is determined based on the balance distribution rule. Extract the spectral prediction residual of the preset characteristic wavelength within a historical time window, and determine the residual feedback coefficient corresponding to the preset characteristic wavelength based on the spectral prediction residual; Based on the prior basic weight coefficient, the environmental adjustment coefficient, and the residual feedback coefficient, the weight coefficient corresponding to the preset characteristic wavelength is obtained.
3. The spectral collaborative correction method according to claim 2, characterized in that, The process of acquiring the real-time moisture state parameters and real-time particle size state parameters of the sample to be tested, and determining the environmental adjustment coefficient corresponding to the preset characteristic wavelength based on the balance distribution rule, includes: A first target wavelength with a correlation coefficient greater than a first correlation threshold and a second target wavelength with a correlation coefficient greater than a second correlation threshold are determined. The moisture weight corresponding to the first target wavelength is determined based on the increase in the real-time moisture state parameter of the sample to be tested relative to the baseline moisture state. The particle size weight corresponding to the second target wavelength is determined based on the increase of the real-time particle size state parameter of the sample to be tested relative to the reference particle size state. A preset balance coefficient is obtained, and based on the balance coefficient, the moisture weight, and the particle size weight, an environmental adjustment coefficient corresponding to the preset characteristic wavelength is determined.
4. The spectral collaborative correction method according to claim 2, characterized in that, The step of extracting the spectral prediction residual of the preset feature wavelength within a historical time window and determining the residual feedback coefficient corresponding to the preset feature wavelength based on the spectral prediction residual includes: Extract the spectral prediction residuals of the preset feature wavelength within multiple consecutive historical time windows, and construct the residual sequence corresponding to the preset feature wavelength; Determine the error statistics of the residual sequence corresponding to the preset characteristic wavelength; If the error statistic corresponding to the preset characteristic wavelength is greater than the preset error threshold, then the first value is determined to be its corresponding residual feedback coefficient. If the error statistic corresponding to the preset characteristic wavelength is less than or equal to the preset error threshold, then the second value is determined to be its corresponding residual feedback coefficient. Wherein, the first value is less than the second value.
5. The spectral collaborative correction method according to claim 1, characterized in that, The method of obtaining the collaborative correction coefficient based on the ratio of the measured spectral value to the reference spectral value corresponding to each of the preset characteristic wavelengths and the weighting coefficient includes: Based on the weighting coefficients corresponding to each preset characteristic wavelength, the ratios of the measured spectral values to the reference spectral values corresponding to all preset characteristic wavelengths are weighted and averaged to obtain the initial correction coefficients. The initial correction coefficients within a preset time window are subjected to smoothing filtering to obtain smoothed correction coefficients. If the smoothing correction coefficient exceeds the preset physical boundary condition range, the smoothing correction coefficient is truncated based on the boundary value of the physical boundary condition range to obtain the cooperative correction coefficient.
6. The spectral collaborative correction method according to claim 1, characterized in that, Before acquiring the first spectral data of the reference sample in a standard state, the method further includes: Obtain a spectral training set containing training samples with multiple different moisture gradients and different particle size gradients; A partial least squares regression prediction model is constructed based on the aforementioned spectral training set; Determine the variable projection importance index values for each candidate wavelength in the partial least squares regression prediction model; The wavelengths whose variable projection importance index values are greater than a preset importance threshold are determined as preset feature wavelengths.
7. The spectral collaborative correction method according to claim 1, characterized in that, After obtaining the target spectral data, the process further includes: Obtain the true index parameters corresponding to the sample to be tested, and construct a target parameter prediction model based on the target spectral data and the true index parameters; Obtain the test spectral data of the validation set samples, and input the test spectral data into the target parameter prediction model to obtain the corresponding predicted value; Based on the predicted values and the true values of the validation set samples, a model accuracy evaluation index is determined; If the model accuracy evaluation index does not meet the preset accuracy condition, then return to the step of obtaining the weight coefficients corresponding to each preset feature wavelength to update the collaborative correction coefficients until the model accuracy evaluation index meets the preset accuracy condition.
8. A spectral co-correction device, characterized in that, include: The first acquisition module is used to acquire the first spectral data of a reference sample under standard conditions and extract the reference spectral values of the first spectral data at multiple preset characteristic wavelengths. The sample moisture content and sample particle size are lower than the first preset threshold and the sample moisture content is lower than the second preset threshold under the standard conditions. The second acquisition module is used to acquire the second spectral data of the sample to be tested, and extract the measured spectral values of the second spectral data at each of the preset characteristic wavelengths; The third acquisition module is used to acquire the weighting coefficients corresponding to each of the preset feature wavelengths, and to obtain the collaborative correction coefficients based on the ratio of the measured spectral values to the reference spectral values corresponding to all the preset feature wavelengths and the weighting coefficients. The correction module is used to correct the second spectral data based on the cooperative correction coefficient to obtain the target spectral data.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the spectral collaborative correction method as described in any one of claims 1 to 7.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the spectral collaborative correction method as described in any one of claims 1 to 7.