CN116297249A - Silage quality grading method, silage quality grading device and storage medium - Google Patents

Silage quality grading method, silage quality grading device and storage medium Download PDF

Info

Publication number
CN116297249A
CN116297249A CN202310510399.7A CN202310510399A CN116297249A CN 116297249 A CN116297249 A CN 116297249A CN 202310510399 A CN202310510399 A CN 202310510399A CN 116297249 A CN116297249 A CN 116297249A
Authority
CN
China
Prior art keywords
silage
spectrum data
data
samples
sample
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310510399.7A
Other languages
Chinese (zh)
Inventor
郝敏
田海清
孙建英
张梦宇
张红旗
康飞龙
赵凯
杨逸宸
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Inner Mongolia Agricultural University
Original Assignee
Inner Mongolia Agricultural University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Inner Mongolia Agricultural University filed Critical Inner Mongolia Agricultural University
Priority to CN202310510399.7A priority Critical patent/CN116297249A/en
Publication of CN116297249A publication Critical patent/CN116297249A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/17Systems in which incident light is modified in accordance with the properties of the material investigated
    • G01N21/25Colour; Spectral properties, i.e. comparison of effect of material on the light at two or more different wavelengths or wavelength bands
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P60/00Technologies relating to agriculture, livestock or agroalimentary industries
    • Y02P60/80Food processing, e.g. use of renewable energies or variable speed drives in handling, conveying or stacking
    • Y02P60/87Re-use of by-products of food processing for fodder production

Abstract

The invention provides a silage corn feed quality grading method, a silage corn feed quality grading device and a silage corn feed quality grading storage medium, and belongs to the technical field of agriculture and animal husbandry, wherein the silage corn feed quality grading method comprises the following steps: acquiring original spectrum data of a silage grading sample; preprocessing original spectrum data by adopting a standard normal transformation method SNV; extracting characteristic wavelengths of the preprocessed spectrum data by using a Linear Discriminant Analysis (LDA) method to obtain characteristic wavelength spectrum data with the largest contribution; and inputting the obtained characteristic wavelength spectrum data with the largest contribution into a Support Vector Machine (SVM), classifying the characteristic wavelength spectrum data with the largest contribution, and obtaining the quality grading result of the silage corn feed according to the classification result. According to the invention, the quality of silage corn feed can be accurately identified through an SNV-LDA-SVM combination algorithm, the accuracy of a training set is 100%, and the accuracy of a prediction set is 100%.

Description

Silage quality grading method, silage quality grading device and storage medium
Technical Field
The invention belongs to the technical field of agriculture and animal husbandry, and particularly relates to a silage quality grading method, device and storage medium.
Background
The whole plant silage is prepared by chopping whole plant corn with ears in a waxy period, and preparing the silage with good palatability, high digestibility and rich nutrition by means of microbial anaerobic fermentation and chemical action in a closed anaerobic environment. With the development of society, the demand for meat products and dairy products is increasing, and the production of ruminants such as cows, beef cattle and mutton sheep is rapidly developing, and the demand for silage is also increasing. As silage is very wide in source, along with rapid development of modern livestock industry, the fed livestock can suffer from diseases such as diarrhea, abortion and the like, and huge economic loss is caused. Therefore, the quality classification of silage is very important.
The most widely used method for evaluating the quality of silage is a sensory evaluation method, which is simple but has strong subjectivity, requires that a tester have high and abundant experience, and cannot accurately identify the quality of silage.
Disclosure of Invention
In order to solve the defect that the quality of silage can not be accurately identified at present, the invention provides a silage quality grading method, device and storage medium.
The silage quality grading method provided by the invention comprises the following steps:
acquiring original spectrum data of a silage grading sample;
preprocessing the original spectrum data by adopting a standard normal transformation method SNV;
extracting characteristic wavelengths of the preprocessed spectrum data by using a Linear Discriminant Analysis (LDA) method to obtain characteristic wavelength spectrum data with the largest contribution;
and inputting the obtained characteristic wavelength spectrum data with the largest contribution into a Support Vector Machine (SVM), classifying the characteristic wavelength spectrum data with the largest contribution, and obtaining the quality grade classification result of the silage according to the classification result.
Preferably, before the raw spectral data of the silage classified samples are obtained, silage classified samples with different grades are required to be prepared, and the preparation method of the silage classified samples is as follows:
placing the prepared silage in a polyethylene vacuum bag by using a 9-point sampling method, collecting 200 parts of samples, respectively marking, intermittently unsealing the samples for 60 minutes at 12 noon every day and continuously unsealing the samples, and discharging and sealing air in the plastic bag after unsealing; the continuous unsealing treatment is to uniformly arrange small holes on the surface of the polyethylene vacuum bag so as to ensure that the fodder can uniformly react with the outside air, thereby carrying out secondary fermentation to obtain silage classified samples with different grades.
Preferably, the objective function of the linear discriminant analysis LDA is:
Figure BDA0004217213990000021
Figure BDA0004217213990000022
Figure BDA0004217213990000023
wherein T is r The trace operation of the trace is that M is a projection matrix, M T Is the transposed matrix of the projection matrix, D b Inter-class divergence matrix for heterogeneous data, D w As an intra-class divergence matrix, x i In the case of a sample set,
Figure BDA0004217213990000024
for the j-th sample of the i-th class, < >>
Figure BDA0004217213990000025
The average value of the i-th sample is L, the number of categories is L i Representing the observed value contained in the i-th sample, i.e., the dimension of the sample, B (i) is the prior probability of the i-th sample.
Preferably, the method for extracting characteristic wavelengths from the preprocessed spectrum data by using the linear discriminant analysis method LDA to obtain the spectrum data with the characteristic wavelengths with the largest contribution comprises the following steps:
the LDA projects the preprocessed spectrum data on a low dimension, and projects the projection points of the same type of data and the projection points of different types of data at different positions, so that the data are classified in a dimension-reducing way directly through the distance of the projection points, and the characteristic wavelength with the largest contribution is extracted.
Preferably, the support vector machine SVM classification model is:
K(x i ,x j )=exp(-||x i -x j || 2 )/2σ 2
wherein: x is x i And x j Respectively representing two samples; σ is the bandwidth, controlling the radial extent of action.
The invention also provides a silage maize feed quality grading device, which comprises:
the data acquisition module is used for acquiring the original spectrum data of the silage classified sample;
the preprocessing module is used for preprocessing the original spectrum data by adopting a standard normal transformation method SNV;
the characteristic extraction module is used for extracting characteristic wavelengths of the preprocessed spectrum data by using a Linear Discriminant Analysis (LDA) method to obtain the spectrum data with the characteristic wavelengths with the largest contribution;
the data classification processing module is used for inputting the obtained characteristic wavelength spectrum data with the largest contribution into a Support Vector Machine (SVM) and classifying the characteristic wavelength spectrum data with the largest contribution;
and the grade classification module is used for classifying the quality grade of the silage corn feed according to the classification result.
The invention also provides a computer readable storage medium storing a computer program adapted to be loaded by a processor for performing the silage quality grading method described above.
The silage quality grading method, the silage quality grading device and the storage medium provided by the invention have the following beneficial effects:
according to the method, standard normal transformation (SNV) is adopted as a silage pretreatment method, linear Discriminant Analysis (LDA) is used for extracting characteristic wavelengths, a Support Vector Machine (SVM) classification model is established to obtain an optimal result, wherein the accuracy of a training set is 100%, the accuracy of a prediction set is 100%, and the quality of silage can be accurately identified by the combined algorithm.
Drawings
In order to more clearly illustrate the embodiments of the present invention and the design thereof, the drawings required for the embodiments will be briefly described below. The drawings in the following description are only some of the embodiments of the present invention and other drawings may be made by those skilled in the art without the exercise of inventive faculty.
FIG. 1 is a flow chart of an embodiment of the present invention;
FIG. 2 is a graph of spectra of raw spectral data pre-processed using a Multiple Scatter Correction (MSC), standard normal transformation (SNV), and S-G convolution smoothing;
FIG. 3 is a graph showing the results of spectral extraction of characteristic wavelengths after SNV pretreatment with CARS;
FIG. 4 is a graph of error for the SNV-CARS-RF model combination;
FIG. 5 is a diagram of classification results of SNV-CARS-CNN model combinations;
FIG. 6 is a graph of classification results for SNV-LDA-SVM model combinations.
Detailed Description
The present invention will be described in detail below with reference to the drawings and the embodiments, so that those skilled in the art can better understand the technical scheme of the present invention and can implement the same. The following examples are only for more clearly illustrating the technical aspects of the present invention, and are not intended to limit the scope of the present invention.
In the description of the present invention, it should be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", "axial", "radial", "circumferential", etc. indicate orientations or positional relationships based on the orientations or positional relationships shown in the drawings are merely for convenience in describing the technical solutions of the present invention and to simplify the description, and do not indicate or imply that the devices or elements referred to must have a specific orientation, be configured and operated in a specific orientation, and therefore should not be construed as limiting the present invention.
Furthermore, the terms "first," "second," and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. In the description of the present invention, it should be noted that, unless explicitly specified or limited otherwise, the terms "connected," "connected," and "connected" are to be construed broadly, and may be, for example, fixedly connected, detachably connected, or integrally connected; can be mechanically or electrically connected; may be directly connected or indirectly connected through an intermediate medium. The specific meaning of the above terms in the present invention can be understood by those of ordinary skill in the art according to the specific circumstances. In the description of the present invention, unless otherwise indicated, the meaning of "a plurality" is two or more, and will not be described in detail herein.
Examples
The invention provides a silage quality grading method, a silage quality grading device and a storage medium, wherein the silage quality grading method comprises the following steps of as shown in fig. 1.
Step 1: raw spectral data of silage graded samples were obtained.
In the test, silage corn feed is taken as a research object, silage corn raw materials are harvested in the Mongolian autonomous region of the year 2021 and Haote city and in Lingel county (longitude: 111.82, latitude: 40.38), the growing period is the end stage of milk ripening, whole corn is cut into 4cm by a silage harvester, silage is carried out, the silage corn is divided into silage bags and silage barrels, the silage corn feed samples are obtained by fermenting the raw materials in a closed anaerobic environment for 45 days, and the samples are divided into four grades according to the silage sensory evaluation standard (DLG) of Germany agricultural society, and are respectively good, moderate and spoilage, and the quality grading results of the silage corn feed samples are compared with the quality grading results of the invention.
After silage is finished, the prepared silage corn feed is placed in a polyethylene vacuum bag by using a 9-point sampling method, 200 samples are collected and marked respectively, and two treatment modes of intermittent unsealing and continuous unsealing are adopted for part of samples, so that samples with different grades are obtained. The intermittent unsealing treatment is to unseal for 60 minutes at 12 noon every day, and the air in the plastic bag is discharged and sealed after the unsealing is finished; the continuous unsealing treatment is to uniformly arrange small holes on the surface of the polyethylene vacuum bag so as to ensure that the feed can uniformly react with the outside air, and thus, the secondary fermentation is carried out to obtain feed samples with different grades. During this process, samples were taken for observation on days 0-14 after the two treatment regimes and sensory evaluation was performed according to the German agricultural Association sensory evaluation Standard (DLG).
Then, raw spectrum data of different grades of feed samples are collected, an acquisition instrument is a hyperspectral imaging system of Taiwan five-bell optical Co., ltd, and the system mainly comprises: hyperspectral imager, CCD camera, halogen lamp, mobile control platform and computer, etc.
Step 2: and preprocessing the original spectrum data by adopting a standard normal transformation method SNV.
In order to eliminate the influence caused by the surrounding environment, uneven illumination and dark current of an instrument when an image is acquired, the invention adopts a multi-element scattering correction Method (MSC), a standard normal transformation method (SNV) and an S-G convolution smoothing method to preprocess an original spectrum, a spectrum curve after the preprocessing is shown as a graph in fig. 2, the original spectrum is greatly influenced by noise as can be seen from the graph in fig. 2 (a), the contrast graph in fig. 2 (a) and the graph in fig. 2 (b), the difference between hyperspectral data curves is reduced by MSC preprocessing, the MSC preprocessing can eliminate scattering phenomenon in the spectrum, the necessary error is eliminated, the SNV preprocessing effect is similar to the MSC as can be seen from the graph in fig. 2 (c), and the spectrum curve after the S-G convolution smoothing preprocessing is smoother than the original curve as can be found from the graph in fig. 2 (a) and the graph in fig. 2 (d). The optimal pretreatment method is optimized by constructing a Partial Least Squares Regression (PLSR) model, and the prediction results are shown in table 1. As can be seen from table 1, the SNV preprocessing is best, wherein the root mean square error rmsec= 0.0416, the correlation coefficient rc= 0.9992, the root mean square error rmsep= 0.1273, the correlation coefficient rp= 0.9935, and the SNV preprocessing method are adopted for the subsequent processing.
Table 1 full wave band PLSR prediction model using different pretreatment methods
Figure BDA0004217213990000061
Step 3: and carrying out characteristic wavelength extraction on the SNV preprocessed spectrum data by using a variable combination cluster analysis method VCPA, a competitive self-adaptive re-weighting sampling method CARS and a linear discriminant analysis method LDA respectively to obtain the characteristic wavelength spectrum data with the largest contribution.
The VCPA is a new variable selection method taking interaction among variables into consideration by using the thought of model cluster analysis, the method adopts an exponential decay function EDF to determine the residual quantity of the variables, reduces the variable space, randomly combines the variables by a binary matrix sampling BMS in each EDF operation, generates clusters of different variable combination subsets, and builds a submodel according to the clusters. And (3) extracting a 10% optimal submodel with a smaller RMSECV value from the feature variable submodel cluster, and calculating the frequency of times of all the feature variables in the optimal 10% submodel, wherein the higher the frequency is, the more important the feature variables are, so as to obtain the optimal feature variable combination. The VCPA feature variable extraction method finally adopts EDF to remove the feature variable with smaller contribution.
When the variable combination cluster analysis method VCPA is used for extracting characteristic wavelengths from the spectrum after SNV pretreatment, a 5-fold cross validation method is used, the number of Binary Matrix Sampling (BMS) operations is set to 1000 times, the number of Exponential Decreasing Function (EDF) operations is set to 50 times, and finally 11 characteristic wavelengths are screened out, namely 411, 415, 432, 433, 466, 488, 594, 598, 682, 738 and 996nm respectively.
The competitive adaptive re-weighting sampling method is to find out the wavelength points with large absolute values of regression coefficients in the partial least square model (partial least squares, PLS) by adopting an adaptive re-weighting sampling (adaptive reweighted sampling, ARS) method, reject the wavelength points which do not meet the target requirement, and preferably select the subset with the lowest interactive verification root mean square error value, so as to select the optimal parameter combination and aim at screening the wave number combination with the highest competitiveness. The CARS algorithm calculates absolute value weights in regression coefficients through self-adaptive weighted sampling, removes points with smaller weights, takes points with larger weights as new subsets, establishes PLSR models based on the new subsets, and selects wavelengths corresponding to the PLSR models with minimum interactive verification Root Mean Square Error (RMSECV) as characteristic wavelengths. When the characteristic wavelength is extracted from the spectrum after SNV pretreatment by using the CARS method, the Monte Carlo sampling frequency is set to be 50 times, and a 5-fold cross validation method is used, and the obtained result diagram is shown in figure 3. As can be seen from fig. 3, as the number of samples increases, the number of variables gradually decreases, the RMSECV decreases and increases again, and the value of the RMSECV is the lowest at 19 th, which indicates that the wavelength with small correlation with the quality of the silage in the silage spectral data is rejected in the screening process, while in the screening process above 19 times, because of too high selectivity, some important parameters are rejected, so that the error increases gradually, 43 characteristic wavelengths are screened out, namely 408, 492, 551, 587, 593, 594, 660, 679, 682, 711, 726, 732, 733, 759, 761, 763, 802, 821, 834, 836, 837, 839, 843, 848, 858, 864, 876, 879, 882, 897, 899, 900, 905, 906, 909, 923, 939, 943, 948, 951, 955, 970 and 996nm, respectively.
The objective function of the linear discriminant analysis LDA is:
Figure BDA0004217213990000071
Figure BDA0004217213990000072
Figure BDA0004217213990000073
wherein T is r The trace operation of the trace is that M is a projection matrix, M T Is the transposed matrix of the projection matrix, D b Inter-class divergence matrix for heterogeneous data, D w As an intra-class divergence matrix, x i In the case of a sample set,
Figure BDA0004217213990000074
for the j-th sample of the i-th class, < >>
Figure BDA0004217213990000081
The average value of the i-th sample is L, the number of categories is L i Representing the observed value contained in the i-th sample, i.e., the dimension of the sample, B (i) is the prior probability of the i-th sample.
Step 4: and respectively inputting the obtained characteristic wavelength spectrum data with the largest contribution into a random forest classification model RF, a convolutional neural network classification model CNN and a support vector machine SVM, classifying the characteristic wavelength spectrum data with the largest contribution, and obtaining a silage quality grade classification result according to the classification result.
Random Forest (Random Forest) is an integrated algorithm, and the final result is obtained through voting or averaging by combining a plurality of weak classifiers, so that the result of the overall model has higher accuracy and generalization performance.
In this embodiment, the random forest classification model RF is:
h=(x,θ k ),k=1,2,…,J
wherein: x is the input vector; θ k The parameter vector of the kth tree is a random vector which is independently and uniformly distributed.
The classification accuracy formula of the random forest classification model RF is as follows:
Figure BDA0004217213990000082
wherein P is the number of samples of the positive example; n is the number of samples of the negative example; TP is the number of correctly predicted positive examples; TN is the number of correctly predicted negative examples.
In this embodiment, the number of decision trees in the model is set to 50, the minimum leaf number of each decision tree is set to 1, and 200 samples are randomly arranged according to 4:1 into training and testing sets, and into the RF model, the error curve is shown in fig. 4, it can be seen that as the number of decision trees increases, the error decreases with it, and when the number of decision trees is 39, the error is minimized and substantially unchanged. The classification results are shown in Table 2, and it can be seen that SNV-CARS-RF is the optimal algorithm combination, wherein the classification accuracy of the training set is 99.375%, and the classification accuracy of the prediction set is 100%.
TABLE 2 accuracy of RF-based silage classification model
Figure BDA0004217213990000083
Figure BDA0004217213990000091
Establishment of CNN classification model
The convolutional neural network is one of typical models of deep learning, and is a feedforward neural network with convolutional calculation and a deep structure, and the basic structure consists of an input layer, a convolutional layer, an activation layer, a pooling layer and a full-connection layer.
The convolutional neural network classification model CNN is:
Figure BDA0004217213990000092
wherein: j is a loss function; n is the number of samples; k is the number of categories; e, e Zi Outputting an index for the network of class i; y is i Is the true label of category i.
The classification accuracy formula of the convolutional neural network classification model CNN is as follows:
Figure BDA0004217213990000093
wherein: acc is the accuracy/%, n is the total data of the test set, and a is the number of correctly classified test sets.
In this embodiment, the convolutional neural network classification model CNN includes two convolutional pooling layers, the sizes of the convolutional kernels are all set to 2×1, the step sizes are 2, the number of the convolutional kernels is 16 and 32, the maximum pooling layers are respectively set to 2×1 and 2×2, the step sizes are all 2, a linear rectification (rectified linear unit, RELU) activation function is set in each convolutional layer, a gradient descent algorithm (Adam) is used as an optimization algorithm, the maximum iteration number is set to 500, the initial learning rate is set to 0.001, and the regularization parameter is set to 0.0001.
200 samples were taken at 4: the scale of 1 is divided into training and test sets. 160 samples are used as training sets, 40 samples are used as correction sets, the original silage corn feed spectral data, the spectral data after different preprocessing and the data after characteristic wavelength extraction are imported into a CNN model, classification results are shown in table 3, the SNV-CNN and the SNV-CARS-CNN are the same in classification results, the accuracy of the training sets is 100%, the accuracy of the prediction sets is 97.5%, but compared with the SNV-CARS-CNN model, the SNV-CARS-CNN has shorter running time, the characteristic wavelength extraction is illustrated, the model is simplified, and the operation speed is improved. The classification result of the SNV-CARS-CNN model is shown in FIG. 5. As can be seen from fig. 5 (a), the accuracy of the SNV-CARS-CNN model training set reaches 100%, and as can be seen from fig. 5 (b), in the SNV-CARS-CNN model test set, one of the two-stage feeds is misjudged as three-stage, i.e., the grade is misjudged as medium.
TABLE 3 precision of silage classification model based on CNN
Figure BDA0004217213990000101
Establishment of SVM classification model
The support vector machine classification model is applied to the silage quality discrimination problem, and the specific model is as follows:
K(x i ,x j )=exp(-||x i -x j || 2 )/2σ 2
wherein: x is x i And x j Respectively representing two samples; σ is the bandwidth, controlling the radial extent of action.
200 samples are input into an SVM model for classification, a silage classification result based on the SVM model is shown in a table 4, and an SNV-LDA-SVM classification result diagram is shown in a table 6.
TABLE 4 classification results (speed) based on SVM models
Figure BDA0004217213990000102
Comparing the different combination algorithms to divide the quality grades of the silage, the method adopts standard normal transformation (SNV) as a silage pretreatment method, uses Linear Discriminant Analysis (LDA) to extract characteristic wavelengths, establishes a Support Vector Machine (SVM) classification model to obtain the optimal result, wherein the accuracy of a training set is 100%, the accuracy of a prediction set is 100%, namely the SNV-LDA-SVM is the optimal combination, and the method is an effective silage quality classification method.
The invention also provides a silage maize feed quality grading device which comprises a data acquisition module, a preprocessing module, a characteristic extraction module, a data classification processing module and a grading module. The data acquisition module is used for acquiring original spectrum data of the silage classified sample; the preprocessing module is used for preprocessing the original spectrum data by adopting a standard normal transformation method SNV; the characteristic extraction module is used for extracting characteristic wavelengths of the preprocessed spectrum data by using a Linear Discriminant Analysis (LDA) method to obtain the spectrum data with the characteristic wavelengths with the largest contribution; the data classification processing module is used for inputting the obtained characteristic wavelength spectrum data with the largest contribution into the support vector machine SVM and classifying the characteristic wavelength spectrum data with the largest contribution; the grade classification module is used for classifying the quality grade of the silage corn feed according to the classification result.
The invention also provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the computer program is suitable for being loaded by a processor to execute the silage quality grading method.
The above embodiments are merely preferred embodiments of the present invention, the protection scope of the present invention is not limited thereto, and any simple changes or equivalent substitutions of technical solutions that can be obviously obtained by those skilled in the art within the technical scope of the present invention disclosed in the present invention belong to the protection scope of the present invention.

Claims (7)

1. The silage quality grading method is characterized by comprising the following steps of:
acquiring original spectrum data of a silage grading sample;
preprocessing the original spectrum data by adopting a standard normal transformation method SNV;
extracting characteristic wavelengths of the preprocessed spectrum data by using a Linear Discriminant Analysis (LDA) method to obtain characteristic wavelength spectrum data with the largest contribution;
inputting the obtained characteristic wavelength spectrum data with the largest contribution into a Support Vector Machine (SVM), and classifying the characteristic wavelength spectrum data with the largest contribution;
and classifying the quality grades of the silage corn feed according to the classification result.
2. The method for classifying silage according to claim 1, wherein before the raw spectral data of the silage classified samples are obtained, different grades of silage classified samples are required to be prepared, and the method for preparing the silage classified samples is as follows:
placing the prepared silage in a polyethylene vacuum bag by using a 9-point sampling method, collecting 200 parts of samples, respectively marking, intermittently unsealing the samples for 60 minutes at 12 noon every day and continuously unsealing the samples, and discharging and sealing air in the plastic bag after unsealing; the continuous unsealing treatment is to uniformly arrange small holes on the surface of the polyethylene vacuum bag so as to ensure that the fodder can uniformly react with the outside air, thereby carrying out secondary fermentation to obtain silage classified samples with different grades.
3. The silage quality grading method according to claim 1, characterized in that the objective function of the linear discriminant analysis LDA is:
Figure FDA0004217213980000011
Figure FDA0004217213980000012
Figure FDA0004217213980000013
wherein T is r The trace operation of the trace is that M is a projection matrix, M T Is the transposed matrix of the projection matrix, D b Inter-class divergence matrix for heterogeneous data, D w As an intra-class divergence matrix, x i In the case of a sample set,
Figure FDA0004217213980000021
for the j-th sample of the i-th class, < >>
Figure FDA0004217213980000022
The average value of the i-th sample is L, the number of categories is L i Representing the observed value contained in the i-th sample, i.e., the dimension of the sample, B (i) is the prior probability of the i-th sample.
4. The silage quality grading method according to claim 3, wherein the characteristic wavelength extraction is performed on the pretreated spectral data by using a linear discriminant analysis method LDA to obtain the characteristic wavelength spectral data with the greatest contribution, and the method comprises the following steps:
the LDA projects the preprocessed spectrum data on a low dimension, and projects the projection points of the same type of data and the projection points of different types of data at different positions, so that the data are classified in a dimension-reducing way directly through the distance of the projection points, and the characteristic wavelength with the largest contribution is extracted.
5. The silage quality classification method according to claim 1, wherein the support vector machine SVM classification model is:
K(x i ,x j )=exp(-||x i -x j || 2 )/2σ 2
wherein: x is x i And x j Respectively representing two samples; σ is the bandwidth, controlling the radial extent of action.
6. A silage quality grading plant, characterized by comprising:
the data acquisition module is used for acquiring the original spectrum data of the silage classified sample;
the preprocessing module is used for preprocessing the original spectrum data by adopting a standard normal transformation method SNV;
the characteristic extraction module is used for extracting characteristic wavelengths of the preprocessed spectrum data by using a Linear Discriminant Analysis (LDA) method to obtain the spectrum data with the characteristic wavelengths with the largest contribution;
the data classification processing module is used for inputting the obtained characteristic wavelength spectrum data with the largest contribution into a Support Vector Machine (SVM) and classifying the characteristic wavelength spectrum data with the largest contribution;
and the grade classification module is used for classifying the quality grade of the silage corn feed according to the classification result.
7. A computer readable storage medium, characterized in that the computer readable storage medium stores a computer program, which is adapted to be loaded by a processor for performing the method of any of claims 1 to 5.
CN202310510399.7A 2023-05-08 2023-05-08 Silage quality grading method, silage quality grading device and storage medium Pending CN116297249A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310510399.7A CN116297249A (en) 2023-05-08 2023-05-08 Silage quality grading method, silage quality grading device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310510399.7A CN116297249A (en) 2023-05-08 2023-05-08 Silage quality grading method, silage quality grading device and storage medium

Publications (1)

Publication Number Publication Date
CN116297249A true CN116297249A (en) 2023-06-23

Family

ID=86799859

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310510399.7A Pending CN116297249A (en) 2023-05-08 2023-05-08 Silage quality grading method, silage quality grading device and storage medium

Country Status (1)

Country Link
CN (1) CN116297249A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117007552A (en) * 2023-10-07 2023-11-07 北京市农林科学院智能装备技术研究中心 Watermelon maturity detection method, device, system, electronic equipment and storage medium
CN117808900B (en) * 2024-02-29 2024-05-14 云南省农业科学院质量标准与检测技术研究所 Method and device for classifying color development intensity of maize anthocyanin

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117007552A (en) * 2023-10-07 2023-11-07 北京市农林科学院智能装备技术研究中心 Watermelon maturity detection method, device, system, electronic equipment and storage medium
CN117007552B (en) * 2023-10-07 2024-02-06 北京市农林科学院智能装备技术研究中心 Watermelon maturity detection method, device, system, electronic equipment and storage medium
CN117808900B (en) * 2024-02-29 2024-05-14 云南省农业科学院质量标准与检测技术研究所 Method and device for classifying color development intensity of maize anthocyanin

Similar Documents

Publication Publication Date Title
CN108663339B (en) On-line detection method for mildewed corn based on spectrum and image information fusion
Moscetti et al. Detection of mold-damaged chestnuts by near-infrared spectroscopy
CN109470648B (en) Rapid nondestructive determination method for imperfect grains of single-grain crops
Dong et al. Discrimination of “Hayward” kiwifruits treated with forchlorfenuron at different concentrations using hyperspectral imaging technology
CN116297249A (en) Silage quality grading method, silage quality grading device and storage medium
Ninomiya High-throughput field crop phenotyping: current status and challenges
Iraji Comparison between soft computing methods for tomato quality grading using machine vision
CN110163101A (en) The difference of Chinese medicine seed and grade quick discrimination method
Sharma et al. Rapid ripening stage classification and dry matter prediction of durian pulp using a pushbroom near infrared hyperspectral imaging system
Frizzarin et al. Application of machine-learning methods to milk mid-infrared spectra for discrimination of cow milk from pasture or total mixed ration diets
CN113657158A (en) Google Earth Engine-based large-scale soybean planting region extraction algorithm
Pratama et al. Deep learning for assessing unhealthy lettuce hydroponic using convolutional neural network based on faster R-CNN with Inception V2
Beyaz et al. Meta-learning-based prediction of different corn cultivars from color feature extraction
Devi et al. ThresholdedReLU Orthogonal Layer Weight Regularized Densely Connected Convolutional Networks CNN for Strawberry Disease Prediction
Asriny et al. Transfer learning VGG16 for classification orange fruit images
CN110609011A (en) Near-infrared hyperspectral detection method and system for starch content of single-kernel corn seeds
Yang et al. Application of near infrared spectroscopy to detect mould contamination in tobacco
Fan et al. Non-destructive detection of single-seed viability in maize using hyperspectral imaging technology and multi-scale 3D convolutional neural network
Goyal et al. Tomato ripeness and shelf-life prediction system using machine learning
Mladenov et al. Quality assessment of grain samples using color image analysis
Wang et al. Qualitative and quantitative detection of aflatoxins B1 in maize kernels with fluorescence hyperspectral imaging based on the combination method of boosting and stacking
CN115393715A (en) Plug seed miss-seeding detection method based on machine vision
Pareek et al. Classification of Broken Maize Kernels Using Artificial Neural Network-Assisted Image-Processing Approach
CN113310933A (en) Spectrum identification method for number of days for storing raw buffalo milk
Yao et al. An Efficient and Lightweight Pigeon Age Detection Method Based on LN-STEP-YOLO

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination