Spectral determination method and system for iNDF content of silage whole-plant corn
By performing data processing and feature screening on the whole corn samples in silage, a more generalized model is constructed, which solves the problem of inaccurate selection of principal components in the existing technology, and improves the accuracy of spectral determination of corn iNDF content.
Patent Information
- Application Number
- CN202411446619.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-16
- Publication Date
- 2024-12-10
- Estimated Expiration
- 2044-10-16
AI Technical Summary
The existing NIRS-combined PLS algorithm has inaccuracy when measuring the iNDF content of corn in the whole plant of silage. It is mainly due to the inaccurate selection of principal components and the failure to best reflect the characteristics of iNDF, resulting in a decrease in prediction accuracy.
By processing the corn sample set, building a neighborhood set of each sample, extracting common infrared spectral features, matching and screening, and obtaining more generalized model features to improve prediction accuracy.
Improve the consistency of data analysis, identify the most valuable spectral characteristics for iNDF content prediction, optimize the model training process, reduce the risk of overfitting, and improve the prediction efficiency and accuracy of iNDF content spectroscopy of the whole corn in silage plant .
Smart Images

Figure CN119104503A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of spectral data analysis, and in particular to a spectral determination method and system for iNDF content of whole-plant corn silage. Background Art
[0002] In animal husbandry, whole corn silage is an important feed resource. The evaluation of its nutritional value and animal digestibility is crucial for feed formulation and animal feeding management. Whole corn silage refers to the harvesting of the aboveground part of the corn plant, including the cobs, at the appropriate harvesting period, which is then chopped, processed and fermented to make feed suitable for herbivorous livestock such as cattle and sheep. This feed has the characteristics of high biological yield, excellent fiber quality, good green retention, and appropriate dry matter and moisture content, making it very suitable for closed silage for anaerobic fermentation.
[0003] The content of indigestible neutral detergent fiber (iNDF) is a key indicator when evaluating the nutritional value of whole-plant corn silage. The determination of iNDF content helps to estimate the digestibility and range of organic matter, and plays an important role in regulating the digestibility of feed and the feed intake of ruminants. Therefore, accurate determination of iNDF content in whole-plant corn silage is of great significance for improving feed utilization and animal production performance.
[0004] Near infrared spectroscopy (NIRS) is widely used for rapid determination of feed ingredients, including iNDF content, due to its advantages of rapidity, non-destructiveness and good reproducibility. NIRS can quickly complete the spectral measurement of samples by analyzing the spectral absorption characteristics of samples. In the NIRS method, the partial least squares regression (PLS) algorithm is a common means of constructing prediction models.
[0005] However, the existing technology has some limitations when using NIRS combined with PLS algorithm to measure the iNDF value of corn. In the traditional PLS algorithm model construction process, the principal component with the greatest similarity to the explanatory variable and the explained variable is usually selected as the target component. However, this method is inaccurate because it does not take into account the differences in iNDF content between different corn samples, resulting in the selected principal component may not best reflect the characteristics of iNDF. In addition, sometimes the selected principal component may only be a general characteristic of corn, rather than a key indicator of iNDF content. This inaccurate principal component selection will affect the subsequent model construction, resulting in a decrease in the accuracy of the NIRS algorithm in predicting the iNDF content of corn. Summary of the invention
[0006] In order to solve the technical problem of inaccurate measurement of iNDF content of whole-plant corn silage, the object of the present invention is to provide a spectral measurement method and system for iNDF content of whole-plant corn silage. The technical solution adopted is as follows:
[0007] In a first aspect, an embodiment of the present invention provides a spectral determination method for iNDF content of whole-plant corn silage, which is applied to a spectral determination system for iNDF content of whole-plant corn silage, and the method comprises:
[0008] Performing data processing on the corn sample set to be tested to obtain iNDF content data and corresponding infrared spectrum data of each corn sample in the corn sample set;
[0009] Performing neighborhood processing on the iNDF content data of each corn sample of the training sample set in the corn sample set to obtain a neighborhood set of each corn sample, wherein the neighborhood set of each corn sample includes a plurality of corn samples having the same iNDF content data as that of each corn sample;
[0010] Performing data analysis according to the neighborhood set of each corn sample to obtain a first feature corresponding to the neighborhood set of each corn sample, wherein the first feature represents infrared spectrum data common to the neighborhood set of each corn sample;
[0011] According to the first feature corresponding to the neighborhood set of each corn sample, data matching is performed on each corn sample in the corn sample set to obtain a plurality of feature sequences, wherein the plurality of feature sequences include each first feature and a feature sequence corresponding to each first feature;
[0012] According to the multiple feature sequences, determining whether a first feature corresponding to the neighborhood set of each corn sample is a target feature, wherein the target feature is used to determine the iNDF content data of each corn sample;
[0013] Feature screening is performed according to the target feature to obtain training features, and the training features are used to train a target model, and the target model is used for spectral determination of iNDF content of whole-plant corn silage.
[0014] In a second aspect, an embodiment of the present invention provides a spectral measurement system for the iNDF content of whole-plant corn ensilage, comprising a memory and a processor, wherein the memory is connected to the processor, and the processor is used to execute one or more computer programs stored in the memory, and when the processor executes the one or more computer programs, the spectral measurement system for the iNDF content of whole-plant corn ensilage implements the spectral measurement method for the iNDF content of whole-plant corn ensilage as described in the first aspect.
[0015] In a third aspect, an embodiment of the present invention provides a spectral measurement device for iNDF content of whole-plant corn silage, which is applied to a spectral measurement system for iNDF content of whole-plant corn silage, and the device comprises:
[0016] A processing unit, used for performing data processing on the corn sample set to be detected, to obtain iNDF content data and corresponding infrared spectrum data of each corn sample in the corn sample set;
[0017] The processing unit is further used to perform neighborhood processing on the iNDF content data of each corn sample of the training sample set in the corn sample set to obtain a neighborhood set of each corn sample, wherein the neighborhood set of each corn sample includes a plurality of corn samples having the same iNDF content data as that of each corn sample;
[0018] An analysis unit, configured to perform data analysis according to the neighborhood set of each corn sample to obtain a first feature corresponding to the neighborhood set of each corn sample, wherein the first feature represents infrared spectrum data common to the neighborhood set of each corn sample;
[0019] A matching unit, configured to perform data matching on each corn sample in the corn sample set according to the first feature corresponding to the neighborhood set of each corn sample, to obtain a plurality of feature sequences, wherein the plurality of feature sequences include each first feature and a feature sequence corresponding to each first feature;
[0020] The processing unit is further used to determine whether the first feature corresponding to the neighborhood set of each corn sample is a target feature according to the multiple feature sequences, and the target feature is used to determine the iNDF content data of each corn sample;
[0021] A screening unit is used to perform feature screening according to the target feature to obtain training features, wherein the training features are used to train a target model, and the target model is used for spectral determination of iNDF content of whole-plant corn silage.
[0022] In a fourth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the processor executes the spectral determination method for the iNDF content of whole-plant corn silage as described in the first aspect.
[0023] The present invention has the following beneficial effects: by performing neighborhood processing on a corn sample set, the present invention ensures that the samples in the neighborhood set of each corn sample have similar iNDF contents, thereby improving the consistency of data during data analysis; the first feature of each corn sample neighborhood set obtained represents the common infrared spectrum data, which helps to identify and extract the most valuable spectral features for iNDF content prediction; by performing data analysis on the neighborhood set, the feature sequences obtained help to build a model with more generalization ability, because they are based on the spectral features of multiple samples rather than a single sample; by performing data matching on each corn sample, a plurality of feature sequences are obtained, which helps to find the similarity of spectral features between different samples, thereby optimizing subsequent data analysis and model training processes; by obtaining training features through feature screening, the risk of overfitting in the model training process can be reduced, because the screened features are more likely to reflect the real iNDF content changes, that is, using the screened training features to train the target model can improve the model's prediction efficiency and accuracy for spectral determination of iNDF content of whole-plant corn silage. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0025] Figure 1 A schematic diagram of a process for a spectral determination method of iNDF content of whole-plant corn silage provided by an embodiment of the present invention;
[0026] Figure 2 A schematic diagram of the structure of a spectral measurement device for iNDF content of whole-plant corn silage provided by one embodiment of the present invention;
[0027] Figure 3 A schematic diagram of the structure of a spectral measurement system for iNDF content of whole-plant corn silage provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0028] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following is a detailed description of the spectroscopic determination method and system for the iNDF content of whole-plant corn silage proposed by the present invention, its specific implementation, structure, characteristics and effects as follows in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.
[0029] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
[0030] The specific scheme of the spectral determination method and system for the iNDF content of whole-plant corn silage provided by the present invention is described in detail below in conjunction with the accompanying drawings.
[0031] See also Figure 1 , which shows a schematic flow chart of a method for spectroscopic determination of iNDF content of whole-plant corn silage provided by an embodiment of the present invention, the method comprising the following steps:
[0032] S10. Process the corn sample set to be tested to obtain iNDF content data and corresponding infrared spectrum data of each corn sample in the corn sample set.
[0033] Among them, the corn sample set includes corn samples of different varieties, growth conditions, maturity, etc., and each corn sample is assigned a unique identifier.
[0034] Among them, the iNDF content data can be determined by wet chemical methods (such as nylon bag method) to determine the iNDF content of each sample.
[0035] Among them, the infrared spectrum data is obtained by using a near-infrared spectrometer to perform spectral scanning on each sample and collect the spectral absorption data of each sample within a specific wavelength range.
[0036] Specifically, before determining the iNDF content and collecting spectral data, the corn samples may need to be properly processed, such as drying and crushing; ensure the data quality during the determination and collection process, and eliminate outliers and errors; record the iNDF content and spectral data of each sample in a database or data table for subsequent analysis; convert the spectral data into digital vectors, each vector containing absorbance values at a series of wavelengths; preprocess the spectral data, such as standardization or normalization, to eliminate the impact of differences in measurement conditions; use the iNDF content data as a label for the spectral data for subsequent machine learning model training.
[0037] It can be seen that what is obtained in this implementation is a data set containing the iNDF content of each corn sample and its corresponding infrared spectrum data. This data set is the basis for the subsequent establishment of a prediction model and analysis of corn samples, and can be used for a variety of purposes, such as variety identification, quality assessment, and optimization of growth conditions.
[0038] S20, performing neighborhood processing on the iNDF content data of each corn sample in the training sample set in the corn sample set to obtain a neighborhood set of each corn sample, wherein the neighborhood set of each corn sample includes a plurality of corn samples having the same iNDF content data as that of each corn sample.
[0039] The process of neighborhood processing is to construct a neighborhood set for each corn sample in the training sample set according to its iNDF content data using the KNN method (k=5), that is, each sample will be grouped together with the other 4 samples with the closest iNDF content (plus itself, a total of 5 samples) to form a neighborhood set M i The purpose of this process is to cluster samples with similar iNDF contents together, since these samples are likely to also have similarities in their spectral signatures.
[0040] Specifically, since different corn samples have different iNDF contents, it is difficult to extract the spectral features of iNDF. Therefore, a neighborhood is constructed for each sample point to obtain corn samples with consistent iNDF content in the sample, and the reference value of the corn sample in the PLS algorithm is obtained. The iNDF neighborhood of the corn sample is constructed using the KNN method (k=5). Select a corn sample i and obtain the neighborhood set M containing the sample. i , with the set M i The sample corn in is taken as the object of analysis, and the PCA algorithm is used to obtain the corresponding principal components. The obtained principal components reflect the common infrared spectral characteristics of corn in the neighborhood set.
[0041] It can be seen that in this embodiment, through the above process, the neighborhood set of each corn sample is constructed, and these sets can then be used for further data analysis and model training.
[0042] S30. Perform data analysis according to the neighborhood set of each corn sample to obtain a first feature corresponding to the neighborhood set of each corn sample, wherein the first feature represents infrared spectrum data common in the neighborhood set of each corn sample.
[0043] After constructing the neighborhood set, data analysis is performed on each set to extract common infrared spectrum data features. These features can be represented as the main change trend in the infrared spectrum data of each sample, that is, the first feature.
[0044] The extraction of the first feature is achieved through statistical methods such as principal component analysis (PCA), which can help identify the most important sources of variation in the data. In this process, the first features of each neighborhood set are extracted, which can represent the common spectral characteristics of all samples in the set.
[0045] Among them, the infrared spectral data of all samples in the neighborhood set of each corn sample are summarized before data analysis. These data usually exist in the form of spectral curves, each curve represents the infrared spectrum of a sample, and before analysis, the spectral data may need to be preprocessed, such as baseline correction, normalization, smoothing, etc., to eliminate interference factors in the instrument or sample processing process.
[0046] It can be seen that the first feature of the neighborhood set of each corn sample in this embodiment is extracted, and this feature can be used for further analysis, such as establishing a prediction model to associate infrared spectral data with iNDF content.
[0047] S40. Perform data matching on each corn sample in the corn sample set according to the first feature corresponding to the neighborhood set of each corn sample to obtain a plurality of feature sequences, wherein the plurality of feature sequences include each first feature and a feature sequence corresponding to each first feature.
[0048] The purpose of data matching is to find the sequence that best represents the spectral features of each corn sample. Through matching, the spectral data of each sample can be compared with the extracted first features to identify and construct feature sequences corresponding to these features.
[0049] Specifically, for each corn sample, its infrared spectrum data is compared with the first feature of the neighborhood set; by calculating the similarity or correlation between the spectrum data and the first feature, the sample feature matching the first feature can be identified.
[0050] Among them, the feature sequence corresponding to each first feature is composed of sample features that match the first feature. The feature sequence includes each first feature and its corresponding sample feature. These sequences will be used for subsequent analysis and model construction.
[0051] Since each corn sample may be associated with multiple neighborhood sets, multiple feature sequences matching different first features may be obtained. These feature sequences may contain different spectral bands and absorption intensity information, reflecting the diverse characteristics of corn samples.
[0052] After constructing the feature sequence, further optimization and screening can be performed to ensure that the selected features are the most representative and informative for predicting iNDF content. Various feature selection and feature extraction techniques can be used to optimize the feature sequence, such as recursive feature elimination (RFE), model-based feature selection, etc.
[0053] It can be seen that, through this process in this embodiment, it is possible to ensure that the most representative and informative features are extracted from the spectral data of the corn sample, providing a basis for building an accurate prediction model.
[0054] S50. According to the multiple feature sequences, determine whether the first feature corresponding to the neighborhood set of each corn sample is a target feature, wherein the target feature is used to determine the iNDF content data of each corn sample.
[0055] Among them, target features refer to those that can effectively distinguish corn samples with different iNDF content levels. These features have high predictive value in the model and can help accurately determine the iNDF content of corn samples.
[0056] The feature sequence contains the first feature of each corn sample neighborhood set and its corresponding relationship in the overall sample set. By analyzing these sequences, we can identify which features appear repeatedly in multiple samples, which may be the target features.
[0057] Among them, after the target features are determined, these feature sequences will be used to train prediction models, such as partial least squares regression (PLS) models, for spectral determination of iNDF content in whole-plant corn silage.
[0058] Among them, the steps of judging the target feature are: feature sequence evaluation, that is, evaluating the feature sequence of each corn sample to check the frequency and consistency of the first feature in multiple samples; correlation analysis, that is, analyzing the correlation between the first feature and the iNDF content data. The target feature should have a high correlation with the iNDF content; statistical testing, that is, statistical testing (such as t-test, ANOVA, etc.) may be required to determine the statistical significance of the first feature at different iNDF content levels.
[0059] It can be seen that in this embodiment, the most representative and informative features are extracted from the spectral data of the corn sample, providing a basis for building an accurate prediction model. This method not only improves the accuracy and reliability of the model prediction of iNDF content, but also enhances the interpretability of the model, making the prediction results of the model easier to understand and trust.
[0060] S60. Perform feature screening according to the target feature to obtain training features, wherein the training features are used to train a target model, and the target model is used for spectral determination of iNDF content of whole-plant silage corn.
[0061] Among them, the screening of target features is to select the most effective and relevant features for predicting the iNDF content of whole-plant corn silage from all potential spectral features. These features can maximize the reflection of the change of iNDF content. These feature sequences include the first feature extracted from the neighborhood set and its corresponding feature sequence.
[0062] Among them, the features retained after screening are called training features. These features will be used as input variables to train the model.
[0063] Among them, the steps of training the target model are: splitting the data set containing training features and iNDF content into a training set and a test set; selecting a suitable algorithm to build the model, such as partial least squares (PLS) regression, support vector machine (SVM), neural network, etc.; using the training set data to train the model, and optimizing the model performance by adjusting the model parameters; using the test set data to verify the predictive ability of the model to ensure that the model has good generalization ability.
[0064] The trained target model can be used to determine the iNDF content of unknown whole-plant corn silage samples. This usually involves the following steps: Collect spectral data of unknown samples. Use the trained model to process the spectral data. Output the iNDF content predicted by the model.
[0065] It can be seen that, in this embodiment, through the above process, the model finally obtained can quickly and accurately predict the iNDF content of whole-plant corn silage, which has important application value in the fields of agricultural production, feed quality control and scientific research.
[0066] The present invention ensures that the samples in the neighborhood set of each corn sample have similar iNDF contents by performing neighborhood processing on the corn sample set, thereby improving the consistency of data during data analysis; the first feature of each corn sample neighborhood set obtained represents the common infrared spectrum data, which is helpful to identify and extract the most valuable spectral features for iNDF content prediction; the feature sequences obtained by performing data analysis on the neighborhood set are helpful to build a model with more generalization ability, because they are based on the spectral features of multiple samples rather than a single sample; data matching is performed on each corn sample to obtain multiple feature sequences, which is helpful to find the similarity of spectral features between different samples, thereby optimizing subsequent data analysis and model training processes; and the training features are obtained by feature screening, which can reduce the risk of overfitting in the model training process, because the screened features are more likely to reflect the real iNDF content changes, that is, the screened training features are used to train the target model, which can improve the prediction efficiency and accuracy of the model for the spectral determination of the iNDF content of the whole silage corn.
[0067] In one embodiment, data matching is performed on each corn sample in the corn sample set according to the first feature corresponding to the neighborhood set of each corn sample to obtain multiple feature sequences, including: obtaining a target corn sample to be matched in the corn sample set and infrared spectrum data to be matched in the target corn sample; calculating the infrared spectrum data to be matched in the target corn sample and the first feature corresponding to the neighborhood set of the target corn sample according to a first preset calculation formula to obtain the similarity between the infrared spectrum data to be matched in the target corn sample and the first feature corresponding to the neighborhood set of the target corn sample; traversing each corn sample in the corn sample set to obtain multiple similarities; and obtaining multiple feature sequences according to the multiple similarities.
[0068] The purpose of data matching is to find sequences that can represent the spectral features of each corn sample. These feature sequences will be used to build a prediction model.
[0069] Among them, the first preset calculation formula is:
[0070]
[0071] Among them, s i (k) represents the similarity between the infrared spectrum data v to be matched in the selected corn sample and the kth first feature of the i-th corn sample. The k first features are traversed and the first feature with the largest similarity is selected as the first feature matching the infrared spectrum data v to be matched. That is: argmax k s i (k).
[0072] in:
[0073]
[0074] Among them, {λ j} represents the spectral band set corresponding to the infrared spectrum data v to be matched in the selected sample set, represents the kth feature vector v in the i-th corn sample i (k) corresponds to the spectral band set; J(*,*) represents the Jaccard similarity between the two sets, which is the similarity of the first feature through the overlap of the spectral wavelength features in the first feature. The higher the similarity, the more the principal component exhibits the same spectral feature, and the larger the value, the greater the similarity between the spectral features; D(*,*) represents the dtw distance between the two sequences, which reflects the distance similarity of the sequences; Jaccard requires the wavelength of the spectrum to be consistent when calculating the similarity, but in fact there will be certain deviations in the detection spectra of different corns, resulting in fewer overlapping spectral bands in the two sets in practice, which makes the similarity smaller; therefore, it is necessary to use the dtw distance calculated for the two sequences to correct the similarity. The smaller the dtw distance, the higher the similarity between the spectral band sequences, and thus the greater the similarity between the corresponding first features.
[0075] Therefore, E1 i (k) represents two sets {λ j}, Jaccard similarity between; E2 i (k) represents two sets {λ j}, The DTW distance between them, j represents the index of the spectral band. In spectral analysis, each band corresponds to a specific wavelength, and the index "j" is used to identify these bands. Specifically, select a first feature of a corn sample, select the first features of other corn samples, and complete the first feature matching of the two corn samples; repeat this process to complete the first feature matching of all corn samples, and obtain the corresponding multiple matching feature sequences.
[0076] Among them, by calculating the similarity between multiple first features of each sample and the infrared spectrum data to be matched, the first feature with the largest similarity is selected as the matching feature. This process involves traversing each corn sample and comparing the k first features of each sample to select the best matching feature, that is, comparing the infrared spectrum data of each target corn sample with each first feature v in its neighborhood set. i (k) Calculate s i (k). Traverse all first features and find the first feature with the greatest similarity.
[0077] Specifically, a first feature is selected from a corn sample as a reference; the reference feature is compared with the first features of other corn samples; the above matching process is repeated until the first features of all corn samples are matched; through the matching process, multiple feature sequences are obtained, each sequence represents the similarity ranking between the first feature of a sample in the corn sample set and the first features of other samples.
[0078] It can be seen that multiple feature sequences can be generated in this embodiment, and each sequence provides an important data basis for subsequent model training and iNDF content prediction.
[0079] In one embodiment, judging whether the first feature corresponding to the neighborhood set of each corn sample is a target feature according to the multiple feature sequences includes: obtaining a target corn sample to be matched in the corn sample set and infrared spectrum data to be judged in the target corn sample; obtaining a target feature sequence according to the infrared spectrum data to be judged in the target corn sample and the multiple feature sequences, wherein the target feature sequence is consistent with the infrared spectrum data to be judged in the target corn sample; obtaining a target neighborhood corn sample corresponding to the target corn sample according to the target corn sample, wherein the target neighborhood corn sample is in the neighborhood set of the target corn sample; and The target feature sequence and the target neighborhood corn sample are compared to obtain a target difference value and a target association value, wherein the target difference value is a difference value between a target neighborhood corn sample corresponding to the target corn sample and the target corn sample under the infrared spectrum data to be judged, and the target association value is an association value between a target neighborhood corn sample corresponding to the target corn sample and the target corn sample under the infrared spectrum data to be judged; according to the target difference value and the target association value, a target accurate value corresponding to the infrared spectrum data to be judged in the target corn sample is obtained, and the target accurate value is used to judge whether the first feature corresponding to the neighborhood set of each corn sample is a target feature.
[0080] Among them, the target corn sample is any corn sample selected from the corn sample set, and this sample will be the object of subsequent analysis and judgment.
[0081] The target feature sequence is a target feature sequence that is consistent with the infrared spectrum data of the target corn sample to be judged, and is determined from multiple feature sequences. This sequence will be used as a standard for judging the target feature.
[0082] For the target corn sample, find the corn samples in its neighborhood set. These samples will be used to calculate the target difference value and target association value.
[0083] Among them, an infrared spectrum data to be judged in a corn sample is selected, and the target feature sequence corresponding to the infrared spectrum data to be judged is obtained, and the corresponding features under different corn samples are determined; if there is similarity between the features corresponding to corn samples with similar iNDF contents; the features corresponding to different iNDF contents are different, and the change in iNDF content is strongly correlated with the change in the feature; then it means that the feature is more likely to be the feature required in the PLS model. The obtained neighborhood corn samples are used as the feature change similarity judgment; a feature sequence is selected to obtain the features corresponding to the remaining corn samples in the neighborhood;
[0084]
[0085] v represents the infrared spectrum data to be matched, I represents the neighboring corn samples within the corn; v I Indicates the features in the neighborhood that match the features of the corn; ||vv I || represents the similarity between the eigenvectors in the neighborhood, reflecting the difference in absorption between different bands in the spectrum, ∑ I It represents the summation operation of relevant parameters for all neighboring corn samples within the corn, which is a well-known technology.
[0086] However, there may be normal deviations in the actual spectral wavelength correspondence, so s I As a weight, the similarity is corrected; s I It represents the infrared spectrum data v to be matched and the feature v in the neighborhood that matches the feature of the corn. I The spectral matching similarity between them; S represents the difference value of the characteristics of the corn and the corn in the neighborhood; the larger the S is, the greater the similarity of the characteristics in the neighborhood is, and thus the greater the possibility that the matching principal component sequence will show the iNDF content characteristics.
[0087] Among them, a corn sample is selected, the feature sequence to be judged is determined, and the feature difference δv corresponding to the remaining corn samples and the corn sample is calculated. J =||vv J ||, the corresponding iNDF content difference is δf J =||ff J ||; get the corresponding difference sequence {δv J}、{δf J}, the Pearson correlation coefficient R of the corn sample characteristics was obtained according to the difference sequence; r = |R| was used as the correlation value between the change of the principal component characteristics and the change of iNDF content.
[0088] Through the above process, the correlation value r and characteristic difference value S corresponding to each corn sample feature are obtained; the stronger the correlation and the greater the similarity, the greater the target accuracy value P of the principal component as the iNDF content feature; P = r × S.
[0089] It can be seen that in this embodiment, it can be determined whether the first feature in the neighborhood set of each corn sample has a strong correlation with the iNDF content, thereby providing accurate feature selection for the establishment of the spectral measurement model.
[0090] In one embodiment, after obtaining the target accurate value corresponding to the infrared spectrum data to be judged in the target corn sample according to the target difference value and the target association value, the method further includes: judging whether the target accurate value is greater than a preset threshold; if the target accurate value is greater than or equal to the preset threshold, determining that the first feature corresponding to the neighborhood set of each corn sample is the target feature; or, if the target accurate value is less than the preset threshold, determining that the first feature corresponding to the neighborhood set of each corn sample is not the target feature.
[0091] Among them, the preset threshold is determined in advance based on experimental data, experience or statistical methods, and is used to evaluate whether the target accuracy value is large enough to determine whether the feature has a significant correlation with the iNDF content.
[0092] Optionally, the preset threshold can be 0.7-0.9, that is, if the target accuracy value is a similarity measure (such as cosine similarity or correlation coefficient), it is generally believed that values between 0.7 and 0.9 indicate a higher correlation; or 0.5-0.7, values between 0.5 and 0.7 can indicate a moderate correlation; or 0.3-0.5, which indicates a lower correlation.
[0093] Among them, if the target accuracy value is greater than or equal to the preset threshold, this indicates that the correlation between the feature and the iNDF content is strong, so the feature can be determined to be a target feature, that is, it is useful for predicting the iNDF content. If the target accuracy value is less than the preset threshold, this indicates that the correlation between the feature and the iNDF content is weak, so the feature is determined not to be a target feature, that is, it may not be so useful for predicting the iNDF content.
[0094] It can be seen that in this embodiment, only features highly correlated with iNDF content are included in the final prediction model, thereby improving the prediction performance and reliability of the model. In this way, the most useful information can be effectively screened out from a large amount of spectral data for spectral determination of iNDF content of whole-plant corn silage.
[0095] In one embodiment, before performing neighborhood processing on the iNDF content data of each corn sample in the training sample set in the corn sample set to obtain the neighborhood set of each corn sample, the method further includes: performing random selection in the corn sample set to obtain a training sample set and a test sample set; performing neighborhood processing on the iNDF content data of each corn sample in the training sample set to obtain the neighborhood set of each corn sample.
[0096] Among them, 75% of the samples are randomly selected as training samples, and the remaining 25% of the samples are used as testing samples.
[0097] The random selection of samples from the corn sample set is to ensure the representativeness and randomness of the training sample set and the test sample set to avoid any potential bias. Random selection can be achieved through a random number generator or a random sampling method.
[0098] The training sample set is used for model training, that is, for establishing model parameters and feature selection. In most cases, the training sample set accounts for a larger proportion of the total samples, because more data helps the generalization ability of the model. The test sample set is used for model testing, that is, for evaluating the prediction performance of the model. The test sample set does not participate in model training to ensure the objectivity of the evaluation results.
[0099] It can be seen that in this embodiment, by reserving a part of the samples as the test set, the performance of the model on unseen data can be evaluated, thereby avoiding overfitting of the model on the training data, and further ensuring that the model fully utilizes the available data during the training process, while maintaining a certain degree of independence and fairness in model evaluation.
[0100] In one embodiment, the feature screening according to the target feature to obtain the training feature includes: constructing multiple second features of a preset model according to the iNDF content data of each corn sample in the training sample set, the second feature is used to represent the iNDF content data of each corn sample; performing difference calculation on the multiple second features according to the multiple feature sequences to obtain the error value between each second feature and the multiple feature sequences; traversing the multiple second features to obtain multiple error values; confirming that the third feature corresponding to the minimum error value among the multiple error values is the training feature to be determined, and the third feature is in the target feature; and correcting the training feature to be determined to obtain the training feature. Among them, the second feature is constructed according to the iNDF content data of each corn sample in the training sample set. These features are usually obtained by the partial least squares (PLS) algorithm, which represents the relationship between the iNDF content data and the spectral data. In a specific implementation, the PLS algorithm is used to train all corn samples to construct a PLS model and obtain all second features, which can be recorded as Vpls ={v1 pls ,v2 pls ……}, V pls represents the set of all second features obtained by the partial least squares (PLS) algorithm, v1 pls ,v2 pls etc. are specific elements in the set V_pls, each element represents a second feature obtained by the PLS algorithm, v1 pls Represents the first second feature, v2 pls Represents the second secondary feature.
[0101] Among them, the difference between multiple feature sequences (first features based on the neighborhood set) and multiple second features is calculated to obtain the error value between each second feature and the feature sequence. This step is to quantify the difference between the second feature extracted in the PLS model and the feature sequence obtained by the neighborhood method.
[0102] Among them, for the set V pls For each second feature in , calculate the error between it and each feature sequence. By traversing, the error value between each second feature and the feature sequence can be obtained. During the traversal process, the second feature with the smallest error value is found. This feature is considered to be the training feature to be determined, that is, the third feature. The third feature is located in the target feature, and it represents the spectral information most relevant to the iNDF content.
[0103] The training features to be determined are modified to obtain the final training features. The modification may include noise removal, standardization, or adjustment of feature weights.
[0104] In the specific implementation, the PLS model is constructed for all the trained corn samples through the PLS algorithm to obtain the second feature of the PLS model, which is recorded as V pls ={v1 pls ,v2 pls ……}; Calculate the difference between the second feature constructed by all corn samples and the second feature sequence. The second feature sequence is a feature sequence constructed by neighborhood samples, that is, it is constructed based on the feature sequences of multiple samples with similar iNDF content to the target sample. Fix a second feature sequence and traverse V pls The error between the kth PLS second feature and the second feature sequence is obtained; the error is usually calculated using the following methods: Euclidean distance, Manhattan distance or mean square error; the PLS with the smallest error is selected as the third feature to complete the matching of the global second feature and the local second feature. pls The matching error of all PLS third features in is err(vk pls ); if the error err(vkpls ), indicating that the overall PLS second feature is more similar to the second feature of the local corn sample. However, the smaller the error, the PLS component is not necessarily the second feature that needs to be selected in the PLS model, because there is a normal fluctuation between the global PLS second feature and the local second feature. Selecting the smallest matching error may lead to overfitting, causing the second feature of the PLS model to over-learn the features of the trained corn sample, resulting in a large model error when facing the iNDF content determination of untrained corn.
[0105] Among them, there is a positive correlation between the global PLS second feature and the local second feature, which means that they should reflect the same spectral information to a certain extent, but they may also have differences, which is due to the difference in feature extraction between the global model and the local neighborhood model.
[0106] It can be seen that in this embodiment, the PLS model is ensured to be trained using the most relevant and representative features, thereby improving the accuracy and reliability of the model in predicting the iNDF content of corn samples.
[0107] In one embodiment, the correcting the training feature to be determined to obtain the training feature includes: obtaining a second feature to be analyzed and a corresponding feature sequence; determining the mean iNDF content in the feature sequence corresponding to the second feature to be analyzed according to the second feature to be analyzed and the corresponding feature sequence; calculating the mean iNDF content and the corresponding error value in the feature sequence corresponding to the second feature to be analyzed according to a second preset calculation formula to obtain a determined value to be determined; screening the determined values to be determined, selecting the largest determined value as the target determined value, and the feature corresponding to the target determined value is the training feature.
[0108] Among them, it is necessary to combine the possibility of local principal components for iNDF content, so as to modify the selection conditions of principal components in the PLS algorithm.
[0109] Among them, the second feature vk to be analyzed is extracted from the PLS model pls , which is the spectral feature related to iNDF content obtained by PLS algorithm. Determine the feature sequence corresponding to each second feature to be analyzed ({v j}), this sequence is constructed based on the neighborhood set and contains the features of multiple samples with similar iNDF content to the target sample.
[0110] For each feature sequence corresponding to the second feature to be analyzed, the average value (EP) of the iNDF content of all samples in the sequence is calculated. This average value represents the central trend of the feature sequence in terms of iNDF content.
[0111] Among them, all calculated determination values are screened and the largest determination value is selected as the target determination value. The feature corresponding to the target determination value will be selected as the training feature because it has the highest possibility in predicting iNDF content.
[0112] Among them, when selecting the principal components in the PLS model, it is necessary to consider the possibility of the local principal components for the iNDF content. If the local second feature sequence corresponding to a global second feature has a stronger performance in iNDF content (i.e., the greater the possibility of iNDF content), and the smaller the difference between the global and local features, then the possibility of this global second feature as an iNDF content feature is greater.
[0113] Specifically, select a global second feature vk to be analyzed pls , the matching local second feature sequence is {v j}, the greater the possibility that the second feature sequence as a whole is iNDF content, the smaller the difference between the global second feature and the local second feature, the greater the possibility that the global second feature is the iNDF content feature, and thus the greater the possibility that it is the second feature to be selected for the PLS model;
[0114] Q(vk pls )=EP×err(vk pls )
[0115] err(vk pls ) represents the error value, EP represents the mean value of iNDF content in the second characteristic sequence; Q(vk pls ) represents the determined value of the second feature of the model, vk pls The kth second feature obtained by the partial least squares (PLS) algorithm is represented in pls a specific location in .
[0116] From this we get V pls The determined value Q of all the second features in ; the second feature with the largest determined value is selected as the second feature of the PLS model.
[0117] It can be seen that in this embodiment, the most useful features for predicting iNDF content are accurately selected from the PLS model, thereby improving the prediction performance of the model, that is, the predictive ability of the features and their performance in the local data set are taken into account, which helps to build a more robust and effective prediction model.
[0118] In one embodiment, after screening the determination values to be determined and selecting the largest determination value as the target determination value, the method further includes: judging whether the target determination value meets the stop condition of feature screening; if the target determination value meets the stop condition of feature screening, stopping the feature screening of the target feature.
[0119] After selecting the maximum determination value as the target determination value, it is necessary to evaluate whether this value has reached the preset stop condition. The stop condition is to determine when to stop adding new features to avoid overfitting and improve the generalization ability of the model.
[0120] Among them, when using the PLS algorithm for feature selection, the determination value Q corresponding to each selected feature is recorded; the determination value Q reflects the contribution of the feature to the model's prediction ability.
[0121] Among them, the PLS algorithm is used to complete the subsequent feature selection, and the determined value Q of each global feature selection is recorded. When the decrease degree of Q between the current feature and the first feature exceeds 20%, the iteration is stopped, thereby completing the feature selection. That is:
[0122]
[0123] Among them, Q1 represents the determined value of the first global feature selection, Q k Represents the determined value of the k-th global feature selection.
[0124] When the decrease degree end(k) of the feature selected for the kth time is greater than 20%, the feature selection of the PLS algorithm is stopped.
[0125] Specifically, the stopping condition is that the ratio between the target determination value and the initial target determination value decreases to reach a preset ratio threshold.
[0126] Among them, when the decrease degree end(k) of the feature selected for the kth time is greater than 20%, that is, the decrease degree of the determined value exceeds 20%, the feature selection of the PLS algorithm is stopped. That is, if the newly added features no longer significantly improve the prediction ability of the model (that is, the decrease in the determined value exceeds 20%), there is no need to continue to add more features.
[0127] The stopping condition is that the ratio between the target determination value and the initial target determination value decreases to a preset ratio threshold, such as 20%. If the target determination value decreases by more than 20% relative to the initial determination value, it is considered that continuing to add features is no longer valuable for improving the model, so feature screening is stopped.
[0128] It can be seen that the feature screening process in this embodiment is effectively controlled, ensuring that the final model only contains the features that contribute most to the prediction of iNDF content, while reducing the risk of overfitting, which helps to build a prediction model that is both concise and efficient.
[0129] It should be noted that the sequence of the above embodiments of the present invention is for description only and does not represent the advantages and disadvantages of the embodiments. The processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0130] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.
[0131] As another aspect of the embodiment of the present application, the embodiment of the present application provides a spectral measurement device for iNDF content of whole-plant corn silage. Among them, the spectral measurement device for iNDF content of whole-plant corn silage can be a software module, and the software module includes several instructions, which are stored in a memory, and the processor can access the memory and call the instructions for execution to complete the spectral measurement method for iNDF content of whole-plant corn silage described in the above-mentioned various embodiments.
[0132] See also Figure 2 , Figure 2 Schematic diagram of a spectroscopic device for measuring iNDF content of whole-plant corn silage provided in an embodiment of the present application. Figure 2 As shown, the spectrometer 200 for measuring the iNDF content of whole-plant corn silage includes:
[0133] The processing unit 201 is used to perform data processing on the corn sample set to be detected, and obtain iNDF content data and corresponding infrared spectrum data of each corn sample in the corn sample set;
[0134] The processing unit 201 is further used to perform neighborhood processing on the iNDF content data of each corn sample of the training sample set in the corn sample set to obtain a neighborhood set of each corn sample, wherein the neighborhood set of each corn sample includes a plurality of corn samples having the same iNDF content data as that of each corn sample;
[0135] An analysis unit 202 is used to perform data analysis according to the neighborhood set of each corn sample to obtain a first feature corresponding to the neighborhood set of each corn sample, wherein the first feature represents infrared spectrum data common in the neighborhood set of each corn sample;
[0136] A matching unit 203 is used to perform data matching on each corn sample in the corn sample set according to the first feature corresponding to the neighborhood set of each corn sample to obtain a plurality of feature sequences, wherein the plurality of feature sequences include each first feature and a feature sequence corresponding to each first feature;
[0137] The processing unit 201 is further used to determine whether the first feature corresponding to the neighborhood set of each corn sample is a target feature according to the multiple feature sequences, and the target feature is used to determine the iNDF content data of each corn sample;
[0138] The screening unit 204 is used to perform feature screening according to the target feature to obtain training features, and the training features are used to train a target model, and the target model is used for spectral determination of iNDF content of whole-plant corn silage.
[0139] The present invention has the following beneficial effects: by performing neighborhood processing on a corn sample set, the present invention ensures that the samples in the neighborhood set of each corn sample have similar iNDF contents, thereby improving the consistency of data during data analysis; the first feature of each corn sample neighborhood set obtained represents the common infrared spectrum data, which helps to identify and extract the most valuable spectral features for iNDF content prediction; by performing data analysis on the neighborhood set, the feature sequences obtained help to build a model with more generalization ability, because they are based on the spectral features of multiple samples rather than a single sample; by performing data matching on each corn sample, a plurality of feature sequences are obtained, which helps to find the similarity of spectral features between different samples, thereby optimizing subsequent data analysis and model training processes; by obtaining training features through feature screening, the risk of overfitting in the model training process can be reduced, because the screened features are more likely to reflect the real iNDF content changes, that is, using the screened training features to train the target model can improve the model's prediction efficiency and accuracy for spectral determination of iNDF content of whole-plant corn silage.
[0140] In one embodiment, in the step of performing data matching on each corn sample in the corn sample set according to the first feature corresponding to the neighborhood set of each corn sample to obtain multiple feature sequences, the matching unit 203 is further used to: obtain a target corn sample to be matched in the corn sample set and infrared spectrum data to be matched in the target corn sample; calculate the infrared spectrum data to be matched in the target corn sample and the first feature corresponding to the neighborhood set of the target corn sample according to a first preset calculation formula to obtain the similarity between the infrared spectrum data to be matched in the target corn sample and the first feature corresponding to the neighborhood set of the target corn sample; traverse each corn sample in the corn sample set to obtain multiple similarities; and obtain multiple feature sequences according to the multiple similarities.
[0141] In one embodiment, in the process of determining whether the first feature corresponding to the neighborhood set of each corn sample is a target feature according to the multiple feature sequences, the processing unit 201 is further used to: obtain a target corn sample to be matched in the corn sample set and infrared spectrum data to be determined in the target corn sample; obtain a target feature sequence according to the infrared spectrum data to be determined in the target corn sample and the multiple feature sequences, wherein the target feature sequence is consistent with the infrared spectrum data to be determined in the target corn sample; obtain a target neighborhood corn sample corresponding to the target corn sample according to the target corn sample, wherein the target neighborhood corn sample is in the neighborhood of the target corn sample. set; according to the target feature sequence and the target neighborhood corn sample, a target difference value and a target association value are obtained, the target difference value is the difference value between the target neighborhood corn sample corresponding to the target corn sample and the target corn sample under the infrared spectrum data to be judged, and the target association value is the association value between the target neighborhood corn sample corresponding to the target corn sample and the target corn sample under the infrared spectrum data to be judged; according to the target difference value and the target association value, a target accurate value corresponding to the infrared spectrum data to be judged in the target corn sample is obtained, and the target accurate value is used to judge whether the first feature corresponding to the neighborhood set of each corn sample is the target feature.
[0142] In one embodiment, after obtaining the target accurate value corresponding to the infrared spectrum data to be judged in the target corn sample according to the target difference value and the target association value, the processing unit 201 is further used to: determine whether the target accurate value is greater than a preset threshold; if the target accurate value is greater than or equal to the preset threshold, determine that the first feature corresponding to the neighborhood set of each corn sample is the target feature; or, if the target accurate value is less than the preset threshold, determine that the first feature corresponding to the neighborhood set of each corn sample is not the target feature.
[0143] In one embodiment, before performing neighborhood processing on the iNDF content data of each corn sample in the training sample set in the corn sample set to obtain the neighborhood set of each corn sample, the processing unit 201 is further used to: perform random selection in the corn sample set to obtain a training sample set and a test sample set; perform neighborhood processing on the iNDF content data of each corn sample in the training sample set to obtain the neighborhood set of each corn sample.
[0144] In one embodiment, in the process of performing feature screening according to the target feature to obtain the training feature, the screening unit 204 is used to: construct a plurality of second features of a preset model according to the iNDF content data of each corn sample in the training sample set, wherein the second feature is used to represent the iNDF content data of each corn sample; perform difference calculation on the plurality of second features according to the plurality of feature sequences to obtain an error value between each second feature and the plurality of feature sequences; traverse the plurality of second features to obtain a plurality of error values; confirm that a third feature corresponding to a minimum error value among the plurality of error values is a training feature to be determined, and the third feature is in the target feature; and correct the training feature to be determined to obtain the training feature.
[0145] In one embodiment, in the process of correcting the training feature to be determined to obtain the training feature, the screening unit 204 is used to: obtain the second feature to be analyzed and the corresponding feature sequence; determine the mean iNDF content in the feature sequence corresponding to the second feature to be analyzed according to the second feature to be analyzed and the corresponding feature sequence; calculate the mean iNDF content and the corresponding error value in the feature sequence corresponding to the second feature to be analyzed according to a second preset calculation formula to obtain a determined value to be determined; screen the determined values to be determined, select the largest determined value as the target determined value, and the feature corresponding to the target determined value is the training feature.
[0146] In one embodiment, after screening the determination values to be determined and selecting the largest determination value as the target determination value, the screening unit 204 is used to: determine whether the target determination value meets the stop condition of feature screening; if the target determination value meets the stop condition of feature screening, stop the feature screening of the target feature.
[0147] In one embodiment, the stop condition is that the ratio between the target determination value and the initial target determination value decreases to a preset ratio threshold.
[0148] It should be noted that the above-mentioned spectral measurement device for the iNDF content of whole-plant corn silage can execute the spectral measurement method for the iNDF content of whole-plant corn silage provided in the embodiment of the present application, and has the corresponding functional modules and beneficial effects of the execution method. For technical details not fully described in the embodiment of the spectral measurement device for the iNDF content of whole-plant corn silage, please refer to the spectral measurement method for the iNDF content of whole-plant corn silage provided in the embodiment of the present application.
[0149] See also Figure 3 , Figure 3 Schematic diagram of a spectral measurement system for iNDF content of whole-plant corn silage provided in an embodiment of the present application. Figure 3 As shown, the system 300 includes a processor 301 and a memory 302. The processor 301 is in communication connection with the memory 302.
[0150] The processor 301 is configured to support the system to execute the corresponding functions in the spectral determination method for the iNDF content of the whole-plant corn for silage in the above-mentioned method embodiment. The processor 301 can be a central processing unit (CPU), a network processor (NP), a hardware chip or any combination thereof. The above-mentioned hardware chip can be an application specific integrated circuit (ASIC), a programmable logic device (PLD) or a combination thereof. The above-mentioned PLD can be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof.
[0151] Specifically, the processor 301 may include a sending card, a receiving card and a driving chip.
[0152] The memory 302 is used to store program codes, etc. The memory 302 may include a volatile memory (VM), such as a random access memory (RAM); the memory 302 may also include a non-volatile memory (NVM), such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD); the memory 302 may also include a combination of the above-mentioned types of memories.
[0153] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a computer, the computer executes the spectral determination method for the iNDF content of whole-plant corn silage as described in the above embodiment.
[0154] A person skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
[0155] The above disclosure is only the preferred embodiment of the present application, and certainly cannot be used to limit the scope of rights of the present application.
Claims
1. A spectral determination method for the iNDF content of whole-plant corn silage, characterized in that: The method is applied to a spectral determination system for iNDF content of whole-plant corn for silage, and comprises: Performing data processing on the corn sample set to be tested to obtain iNDF content data and corresponding infrared spectrum data of each corn sample in the corn sample set; Performing neighborhood processing on the iNDF content data of each corn sample of the training sample set in the corn sample set to obtain a neighborhood set of each corn sample, wherein the neighborhood set of each corn sample includes a plurality of corn samples having the same iNDF content data as that of each corn sample; Performing data analysis according to the neighborhood set of each corn sample to obtain a first feature corresponding to the neighborhood set of each corn sample, wherein the first feature represents infrared spectrum data common to the neighborhood set of each corn sample; According to the first feature corresponding to the neighborhood set of each corn sample, data matching is performed on each corn sample in the corn sample set to obtain a plurality of feature sequences, wherein the plurality of feature sequences include each first feature and a feature sequence corresponding to each first feature; According to the multiple feature sequences, determining whether a first feature corresponding to the neighborhood set of each corn sample is a target feature, wherein the target feature is used to determine the iNDF content data of each corn sample; Feature screening is performed according to the target feature to obtain training features, and the training features are used to train a target model, and the target model is used for spectral determination of iNDF content of whole-plant corn silage.
2. A spectral determination method for iNDF content of whole-plant corn silage according to claim 1, characterized in that: According to the first feature corresponding to the neighborhood set of each corn sample, data matching is performed on each corn sample in the corn sample set to obtain multiple feature sequences, including: Acquire a target corn sample to be matched in the corn sample set and infrared spectrum data to be matched in the target corn sample; According to a first preset calculation formula, the infrared spectrum data to be matched in the target corn sample and the first feature corresponding to the neighborhood set of the target corn sample are calculated to obtain the similarity between the infrared spectrum data to be matched in the target corn sample and the first feature corresponding to the neighborhood set of the target corn sample; Traversing each corn sample in the corn sample set to obtain multiple similarities; According to the multiple similarities, multiple feature sequences are obtained.
3. The spectral determination method for iNDF content of whole-plant corn silage according to claim 1, characterized in that: The step of judging, according to the plurality of feature sequences, whether the first feature corresponding to the neighborhood set of each corn sample is a target feature comprises: Acquire a target corn sample to be matched in the corn sample set and infrared spectrum data to be judged in the target corn sample; According to the infrared spectrum data to be determined in the target corn sample and the multiple feature sequences, a target feature sequence is obtained, wherein the target feature sequence is consistent with the infrared spectrum data to be determined in the target corn sample; According to the target corn sample, a target neighborhood corn sample corresponding to the target corn sample is obtained, where the target neighborhood corn sample is in a neighborhood set of the target corn sample; According to the target feature sequence and the target neighborhood corn sample, a target difference value and a target association value are obtained, wherein the target difference value is a difference value between a target neighborhood corn sample corresponding to the target corn sample and the target corn sample under the infrared spectrum data to be judged, and the target association value is an association value between a target neighborhood corn sample corresponding to the target corn sample and the target corn sample under the infrared spectrum data to be judged; According to the target difference value and the target association value, the target accurate value corresponding to the infrared spectrum data to be judged in the target corn sample is obtained, and the target accurate value is used to determine whether the first feature corresponding to the neighborhood set of each corn sample is the target feature.
4. A spectral determination method for iNDF content of whole-plant corn silage according to claim 3, characterized in that: After obtaining the target accurate value corresponding to the infrared spectrum data to be judged in the target corn sample according to the target difference value and the target correlation value, the method further includes: Determining whether the target accuracy value is greater than a preset threshold; If the target accuracy value is greater than or equal to a preset threshold, the first feature corresponding to the neighborhood set of each corn sample is determined to be the target feature; or, If the target accuracy value is less than a preset threshold, it is determined that the first feature corresponding to the neighborhood set of each corn sample is not a target feature.
5. The spectral determination method for iNDF content of whole-plant corn silage according to claim 1, characterized in that: Before performing neighborhood processing on the iNDF content data of each corn sample in the training sample set in the corn sample set to obtain a neighborhood set of each corn sample, the method further includes: Randomly select from the corn sample set to obtain a training sample set and a test sample set; The iNDF content data of each corn sample in the training sample set is processed in a neighborhood to obtain a neighborhood set of each corn sample.
6. The spectral determination method for iNDF content of whole-plant corn silage according to claim 1, characterized in that: The step of performing feature screening according to the target feature to obtain training features includes: According to the iNDF content data of each corn sample in the training sample set, construct a plurality of second features of a preset model, wherein the second features are used to represent the iNDF content data of each corn sample; Performing difference calculation on the plurality of second features according to the plurality of feature sequences to obtain an error value between each second feature and the plurality of feature sequences; Traversing the plurality of second features to obtain a plurality of error values; Confirming that a third feature corresponding to a minimum error value among the multiple error values is a training feature to be determined, and the third feature is in the target feature; The training feature to be determined is modified to obtain the training feature.
7. A spectral determination method for iNDF content of whole-plant corn silage according to claim 6, characterized in that: The step of correcting the training feature to be determined to obtain the training feature includes: Obtaining a second feature to be analyzed and a corresponding feature sequence; According to the second feature to be analyzed and the corresponding feature sequence, determining the mean value of the iNDF content in the feature sequence corresponding to the second feature to be analyzed; According to the second preset calculation formula, the iNDF content mean and the corresponding error value in the feature sequence corresponding to the second feature to be analyzed are calculated to obtain a determined value to be determined; The determined values to be determined are screened, and the largest determined value is selected as the target determined value, and the feature corresponding to the target determined value is the training feature.
8. A spectral determination method for iNDF content of whole-plant corn silage according to claim 7, characterized in that: After screening the determined values to be determined and selecting the largest determined value as the target determined value, the method further includes: Determining whether the target determination value meets the stop condition of feature screening; If the target determination value meets the stop condition of feature screening, the feature screening of the target feature is stopped.
9. The spectral determination method for iNDF content of whole-plant corn silage according to claim 7, characterized in that: The stopping condition is that the ratio between the target determination value and the initial target determination value decreases to a preset ratio threshold.
10. A spectral measurement system for iNDF content of whole-plant corn silage, characterized in that: The system comprises a memory and a processor, wherein the memory is connected to the processor, and the processor is used to execute one or more computer programs stored in the memory. When the processor executes the one or more computer programs, the spectral measurement system for the iNDF content of whole-plant corn silage implements the spectral measurement method for the iNDF content of whole-plant corn silage as described in any one of claims 1 to 9.
Citation Information
Patent Citations
Spectral data analysis method and spectral data analysis apparatus
CN109115692A
Whole plant silage corn nutrient content prediction model construction method and application
CN110220865A
Establishment method of near-infrared reflection spectrum model for measuring nutritional quality of corn stalks
CN111781161A
Methods for analyzing plant material, determining composition of plant material and detecting plant disease in plant material
CN117157516A
Straw comprehensive utilization classification method and system based on machine learning and medium
CN117435986A
Cited By
Whole-plant corn silage digestibility standardized determination method for near-infrared modeling
CN119555632A
