A rice quality detection method based on hyperspectral nutrient sparse features

By constructing a detection model for hyperspectral nutrient sparse features and integrating starch, protein and amino acid moisture models, the problem of low accuracy of hyperspectral imaging technology in rice quality detection was solved, efficient and accurate rice quality detection was achieved, and the applicability and environmental adaptability of the equipment were improved.

CN120522105BActive Publication Date: 2025-10-03NORTHEAST INST OF GEOGRAPHY & AGRIECOLOGY C A S
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511029211.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-25
Publication Date
2025-10-03
Estimated Expiration
2045-07-25

AI Technical Summary

Technical Problem

Existing rice quality detection methods based on hyperspectral imaging have problems of low precision and large detection errors, especially in actual scenarios, which are affected by temperature fluctuations, changes in light intensity and airborne suspended matter, resulting in a decrease in detection accuracy.

Method used

A detection method based on hyperspectral nutrient sparse features was adopted. By constructing a multi-association description model of starch spectral features, a multi-association description model of protein spectral features, and an amino acid and moisture description model, these models were integrated to construct a rice quality detection model based on hyperspectral nutrient sparse features. The trained model was used to perform quality grading on the hyperspectral data of the rice to be tested.

Benefits of technology

It improves the accuracy and efficiency of rice quality detection, reduces detection errors, improves the applicability and environmental robustness of the equipment, and realizes universal detection of rice quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120522105B_ABST
    Figure CN120522105B_ABST
Patent Text Reader

Abstract

A rice quality detection method based on hyperspectral nutrient sparse features relates to the field of rice quality analysis. This invention addresses the low precision and large detection errors of existing rice quality detection methods based on hyperspectral imaging. The method comprises: utilizing a rice starch percentage list, a rice protein percentage list, a rice moisture percentage list, and a rice amino acid percentage list to obtain a dataset comprising a starch spectral feature multi-association description dataset, a protein spectral feature multi-association description dataset, and an amino acid and moisture description dataset; training a starch spectral feature multi-association description model; training a protein spectral feature multi-association description model; and training an amino acid and moisture description model; constructing a rice quality model using these three description models; and obtaining the quality of the rice to be measured using the rice quality model. The present invention is used to determine rice quality based on rice hyperspectral data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of rice quality analysis, and in particular to a rice quality detection method based on hyperspectral nutrient sparse features. Background Art

[0002] Hyperspectral imaging technology, a significant breakthrough in modern optical inspection, plays a key role in precision agricultural management and agricultural product quality control. By acquiring continuous spectral signatures through contactless detection, hyperspectral imaging enables quantitative characterization of rice components (protein, starch, moisture, etc.). Compared to traditional detection methods, this significantly improves the efficiency and accuracy of component analysis while maintaining sample integrity. This technology provides a technical path for building an intelligent grain quality assessment system and has significant practical value in promoting the digital transformation of the agricultural industry.

[0003] Hyperspectral imaging technology currently uses spectral features from rice samples across hundreds of continuous, narrow bands (with nanometer-level resolution) within the 400-1000nm spectral range. Combined with a multivariate regression model, it enables quantitative analysis of key components such as starch (characteristic peak at 980nm), protein (characteristic peak at 860nm), moisture, and amino acids. This method achieves high prediction accuracy under laboratory conditions, but in real-world scenarios, temperature fluctuations, light intensity variations, and airborne particles are present. Furthermore, this method places stringent requirements on wavelength and radiometric calibration, which can reduce the spectral signal-to-noise ratio by 30%-40%, leading to a 2-3 times increase in detection error in real-world applications compared to laboratory measurements. Furthermore, the limited number of bands currently available can lead to starch-protein spectral confusion, resulting in low detection accuracy (a 15-20% decrease). Summary of the Invention

[0004] The purpose of the present invention is to solve the problems of low precision and large detection error in the existing rice quality detection method based on hyperspectral imaging, and to propose a rice quality detection method based on hyperspectral nutrient sparse features.

[0005] A rice quality detection method based on hyperspectral nutrient sparse features, comprising:

[0006] S1. Input the hyperspectral rice quality dataset DBGGP, obtain the rice starch ratio list DBDFList, rice protein ratio list DBDBZList, rice moisture ratio list DBSFList, and rice amino acid ratio list DBAJSList, and obtain the starch-protein correlation value DFDBZGL and the protein-water correlation value DBZSFGL;

[0007] S2. Establish a starch spectral feature multi-association description model DBDFZModel, use DBGGP, DBDFList, DFDBZGL and DBDBZList to construct a starch spectral feature multi-association description dataset DBDFZData, use DBDFZData to train DBDFZModel, and obtain the trained DBDFZModel;

[0008] The starch spectral feature multi-association description model DBDFZModel includes: an input layer, a first intermediate layer, a second intermediate layer and an output layer;

[0009] The input layer corresponds to 12-dimensional input, and the 1st to 10th dimension inputs of the input layer are directly multiplied by 0; the 11th and 12th dimensions use a linear transfer function;

[0010] The first intermediate layer, the second intermediate layer and the output layer adopt a linear transfer function;

[0011] S3. Establish a protein spectral feature multi-association description model DBDBZZModel, use DBGGP, DBDBZList, DFDBZGL, DBZSFGL and DBDFList to construct a protein spectral feature multi-association description dataset DBDBZZData, use DBDBZZData to train DBDBZZModel, and obtain the trained DBDBZZModel;

[0012] S4. Establish an amino acid and moisture description model DBAJSSModel, use DBGGP, DBAJSList and DBSFList to construct an amino acid and moisture description dataset DBAJSSData, use DBAJSSData to train DBAJSSModel, and obtain a trained DBAJSSModel;

[0013] S5. Use DBDFZModel, DBDBZZModel, and DBAJSSModel to construct a rice quality detection model XSPZModel based on hyperspectral nutrient sparse features. Then, use DBGGP data to train XSPZModel to obtain a trained XSPZModel. Input the hyperspectral data TestGP of the rice to be tested into the trained XSPZModel to obtain the quality grade of the rice to be tested.

[0014] The rice quality grade to be tested is an integer between 0 and 9; a larger value indicates a lower rice quality, 0 indicates the best quality, and 9 indicates the worst quality.

[0015] Furthermore, the hyperspectral rice quality dataset DBGGP is input in S1 to obtain the rice starch proportion list DBDFList, the rice protein proportion list DBDBZList, the rice moisture proportion list DBSFList and the rice amino acid proportion list DBAJSList, and the starch-protein correlation value DFDBZGL and the protein-water correlation value DBZSFGL, specifically:

[0016] S101, input hyperspectral rice quality dataset DBGGP;

[0017] The DBGGP includes the following fields: hyperspectral data corresponding to rice DBGuangPu, percentage of rice starch in total weight DBDF, percentage of rice protein in total weight DBDBZ, percentage of rice moisture in total weight DBSF, percentage of rice amino acids in total weight DBAJS and quality grade DBZL;

[0018] The hyperspectral data DBGuangPu corresponding to the rice is 12-dimensional data, which is used to store spectral information within different bands;

[0019] The percentage DBDF of described rice starch accounted for gross weight, the percentage DBDBZ of rice protein accounted for gross weight, the percentage DBSF of rice moisture accounted for gross weight and the percentage DBAJS of rice amino acid accounted for gross weight are all floating point numbers between 0-1;

[0020] The quality grade DBZL is an integer between 0 and 9; a larger value indicates lower rice quality, with 0 indicating the highest quality and 9 indicating the worst quality;

[0021] S102. Use DBGGP to construct a rice starch proportion list DBDFList, specifically:

[0022] Perform K-Means clustering on the DBDF of DBGGP, set the number of clusters to 10, and output the values ​​of the cluster centers from small to large to form a list of rice starch proportions;

[0023] S103, using DBGGP to construct a rice protein proportion list DBDBZList, specifically:

[0024] K-Means clustering was performed on DBDBZ of DBGGP, with the number of clusters set to 10. The values ​​of the cluster centers were output from small to large to form a list of rice protein percentages.

[0025] S104. Use DBGGP to construct a rice moisture percentage list DBSFList, specifically:

[0026] Perform K-Means clustering on the DBSF of DBGGP, set the number of clusters to 10, and output the values ​​of the cluster centers from small to large to form a list of rice moisture percentages;

[0027] S105. Use DBGGP to construct a rice amino acid percentage list DBAJSList, specifically:

[0028] Perform K-Means clustering on DBAJS of DBGGP, set the number of clusters to 10, and output the values ​​of cluster centers from small to large to form a list of rice amino acid proportions;

[0029] S106, starch protein association value DFDBZGL = cosine similarity of DBDFList and DBDBZList;

[0030] S107. Protein-moisture correlation value DBZSFGL=cosine similarity of DBDBZList and DBSFList.

[0031] Furthermore, the hyperspectral data DBGuangPu corresponding to the rice is 12-dimensional data, specifically:

[0032] The wavelength range stored in the first dimension is: the spectral band is greater than 400 nanometers and less than or equal to 450 nanometers;

[0033] The wavelength range stored in the second dimension is: the spectral band is greater than 450 nanometers and less than or equal to 500 nanometers;

[0034] The wavelength range stored in the third dimension is: the spectral wavelength is greater than 500 nanometers and less than or equal to 550 nanometers;

[0035] The wavelength range stored in the fourth dimension is: the spectral band is greater than 550 nanometers and less than or equal to 600 nanometers;

[0036] The wavelength range stored in the fifth dimension is: the spectral band is greater than 600 nanometers and less than or equal to 650 nanometers;

[0037] The wavelength range stored in the sixth dimension is: the spectral band is greater than 650 nanometers and less than or equal to 700 nanometers;

[0038] The wavelength range stored in the 7th dimension is: the spectral wavelength is greater than 700 nanometers and less than or equal to 750 nanometers;

[0039] The wavelength range stored in the eighth dimension is: the spectral wavelength is greater than 750 nanometers and less than or equal to 800 nanometers;

[0040] The wavelength range stored in the 9th dimension is: the spectral wavelength is greater than 800 nanometers and less than or equal to 850 nanometers;

[0041] The wavelength range stored in the 10th dimension is: the spectral band is greater than 850 nanometers and less than or equal to 900 nanometers;

[0042] The wavelength range stored in the 11th dimension is: the spectral wavelength is greater than 900 nanometers and less than or equal to 950 nanometers;

[0043] The wavelength range stored in the 12th dimension is: the spectral wavelength is greater than 950 nanometers and less than or equal to 1000 nanometers.

[0044] Furthermore, the starch spectral feature multi-association description model DBDFZModel is established in S2, and the starch spectral feature multi-association description dataset DBDFZData is constructed using DBGGP, DBDFList, DFDBZGL and DBDBZList. DBDFZModel is trained using DBDFZData to obtain the trained DBDFZModel, specifically:

[0045] S201, establishing a starch spectral feature multi-association description dataset DBDFZData;

[0046] The DBDFZData dataset includes the following fields: starch spectral feature multi-association description hyperspectral data DBDFZDataGP, starch spectral feature multi-association description vector DBDFZDataVector;

[0047] S202, initialize starch spectral feature multi-association description data counter DBDFZCounter=1;

[0048] S203, obtaining the first temporary variable DBDFZTemp1 of the starch spectral feature multi-association description model = taking out the DBDFZCounterth data of DBGGP;

[0049] S204, initialize the second temporary variable DBDFZTemp2 of the starch spectral feature multi-association description model, specifically:

[0050] Set DBDFZTemp2 to a vector containing 10 elements and initialize all elements in DBDFZTemp2 to 0;

[0051] S205, initialize the third temporary variable DBDFZTemp3 of the starch spectral feature multi-association description model, specifically:

[0052] Set DBDFZTemp3 to a vector containing 10 elements and initialize all elements in DBDFZTemp3 to 0;

[0053] S206, obtaining the first position variable DBDFZPos1 of the starch spectral feature multi-association description model:

[0054] First, get the first list:

[0055] First list = ABS (DBDFList-DBDFZTemp1's DBDF field value)

[0056] Among them, ABS is the calculated absolute value;

[0057] Then, the position of the element with the smallest element value in the first list is taken as DBDFZPos1;

[0058] S207. Update the value of the DBDFZPos1th element of DBDFZTemp2 to 1;

[0059] S208, obtaining the second position variable DBDFZPos2 of the starch spectral feature multi-association description model:

[0060] First, get the second list:

[0061] Second list = ABS (DBDBZList - the value of DBDBZ field in DBDFZTemp1);

[0062] Then, the position of the element with the smallest element value in the second list is used as DBDFZPos2;

[0063] S209. Update the value of the DBDFZPos2th element of DBDFZTemp3 to DFDBZGL.

[0064] S210. Create a new row for DBDFZData:

[0065] Combine DBDFZTemp2 and DBDFZTemp3 into one vector as DBDFZDataVector for the new row of DBDFZData;

[0066] Use the DBGuangPu data of DBDFZTemp1 as the DBDFZDataGP of the new row of DBDFZData;

[0067] S211, set DBDFZCounter=DBDFZCounter+1;

[0068] S212. If DBDFZCounter is less than or equal to the total number of rows DBNum of DDGGP, go to S203; otherwise, go to S213.

[0069] S213, establishing a starch spectral feature multi-correlation description model DBDFZModel;

[0070] S214. Use all the data in DBDFZData to train DBDFZModel to obtain a trained DBDFZModel.

[0071] The input of the DBDFZModel is DBDFZDataGP of DBDFZData, and the output of the DBDFZModel is DBDFZDataVector of DBDFZData.

[0072] Furthermore, the protein spectral feature multi-association description model DBDBZZModel is established in S3, and the protein spectral feature multi-association description dataset DBDBZZData is constructed using DBGGP, DBDBZList, DFDBZGL, DBZSFGL and DBDFList. DBDBZZModel is trained using DBDBZZData to obtain the trained DBDBZZModel, specifically:

[0073] S301, establishing a protein spectral feature multi-association description dataset DBDBZZData;

[0074] The DBDBZZData dataset includes the following fields: protein spectral feature multi-association description hyperspectral data DBDBZZDataGP, protein spectral feature multi-association description vector DBDBZZDataVector;

[0075] S302, initialize the protein spectral feature multi-association description data counter DBDBZZCounter=1;

[0076] S303, obtaining the first temporary variable DBDBZZTemp1 of the protein spectral feature multi-association description model = taking out the DBDBZZCounterth data of DBGGP;

[0077] S304, initialize the second temporary variable DBDBZZTemp2 of the protein spectral feature multi-correlation description model, specifically:

[0078] Set DBDBZZTemp2 to a vector containing 10 elements and initialize all element values ​​in DBDBZZTemp2 to 0;

[0079] S305, initialize the third temporary variable DBDBZZTemp3 of the protein spectral feature multi-association description model, specifically:

[0080] Set DBDBZZTemp3 to a vector containing 20 elements and initialize all element values ​​in DBDBZZTemp3 to 0;

[0081] S306, using DBDBZList and DBDBZZTemp1 to obtain the first position variable DBDBZZPos1 of the protein spectral feature multi-association description model;

[0082] S307. Update the value of the DBDBZZPos1th element of DBDBZZTemp2 to 1;

[0083] S308. Obtain the second position variable DBDBZZPos2 of the protein spectral feature multi-association description model:

[0084] First, get the fourth list:

[0085] The fourth list = ABS (DBDFList-DBDBZZTemp1 DBDF field value)

[0086] Then, the position of the element with the smallest element value in the fourth list is taken as DBDBZZPos2;

[0087] S309, obtaining the third position variable DBDBZZPos3 of the protein spectral feature multi-association description model:

[0088] First, get the fifth list:

[0089] The fifth list = ABS (DBSFList-DBDBZZTemp1 DBSF field value)

[0090] Then, the position of the element with the smallest element value in the fifth list is taken as DBDBZZPos3;

[0091] S310, update the value of the DBDBZZPos2 position of DBDBZZTemp3 to DFDBZGL, and update the value of the 10th+DBDBZZPos3 position of DBDBZZTemp3 to DBZSFGL;

[0092] S311. Create a new row for DBDBZZData:

[0093] Combine DBDFZTemp2 and DBDFZTemp3 into one vector as DBDBZZDataVector for the newly created row of DBDBZZData;

[0094] Use the DBGuangPu data of DBDBZZTemp1 as the DBDBZZDataGP of the new row of DBDBZZData;

[0095] S312, set DBDBZZCounter=DBDBZZCounter+1;

[0096] S313. If DBDBZZCounter is less than or equal to the total number of rows DBNum of DDGGP, go to S303; otherwise, go to S314.

[0097] S314, establish a protein spectral feature multi-correlation description model DBDBZZModel;

[0098] S315. Use all the data in DBDBZZData to train DBDBZZModel to obtain the trained DBDBZZModel;

[0099] The input of the DBDBZZModel is DBDBZZDataGP of DBDBZZData, and the output of the DBDBZZModel is DBDBZZDataVector of DBDBZZData.

[0100] Furthermore, the first position variable DBDBZZPos1 of the protein spectral feature multi-association description model is obtained by using DBDBZList and DBDBZZTemp1 in S306, specifically:

[0101] First, get the third list:

[0102] The third list = ABS (DBDBZList-DBDBZZTemp1's DBDBZ field value)

[0103] Then, the position of the element with the smallest element value in the third list is taken as DBDBZZPos1.

[0104] Furthermore, the DBDBZZModel comprises: an input layer, a first intermediate layer, a second intermediate layer, and an output layer;

[0105] The input layer corresponds to 12-dimensional input, the 1st to 9th dimension inputs of the input layer are directly multiplied by 0, and the 10-12 dimensions use a linear transfer function;

[0106] The first intermediate layer, the second intermediate layer and the output layer adopt linear transfer functions.

[0107] Furthermore, the step S4 of establishing an amino acid and moisture description model DBAJSSModel, constructing an amino acid and moisture description dataset DBAJSSData using DBGGP, DBAJSList, and DBSFList, and training DBAJSSModel using DBAJSSData to obtain a trained DBAJSSModel is as follows:

[0108] S401, establishing amino acid and moisture description data set DBAJSSData;

[0109] The DBAJSSData dataset includes the following fields: amino acid and moisture description multispectral data DBAJSSDataGP, amino acid and moisture description vector DBAJSSDataVector;

[0110] S402, initialize the amino acid and water description data counter DBAJSSCounter=1;

[0111] S403, establish the amino acid and moisture description model. The first temporary variable DBAJSSTemp1 = retrieves the DBAJSSCounterth data from DBGGP;

[0112] S404, initialize the second temporary variable DBAJSSTemp2 of the amino acid and moisture description model, specifically:

[0113] Set DBAJSSTemp2 to a vector containing 10 elements and initialize all element values ​​in DBAJSSTemp2 to 0;

[0114] S405, initialize the third temporary variable DBAJSSTemp3 of the amino acid and moisture description model, specifically:

[0115] Set DBAJSSTemp3 to a vector containing 10 elements and initialize all element values ​​in DBAJSSTemp3 to 0;

[0116] S406, establish the first position variable DBAJSSPos1 of the amino acid and moisture description model, specifically:

[0117] First, get the sixth list:

[0118] The sixth list = calculate ABS (DBAJSList-DBAJSSTemp1's DBAJS field value)

[0119] Then, the position of the element with the smallest element value in the sixth list is taken as DBAJSSPos1;

[0120] S407. Update the value of the DBAJSSPos1th element of DBAJSSTemp2 to 1;

[0121] S408, establish the second position variable DBAJSSPos2 of the amino acid and moisture description model, specifically:

[0122] First, get the seventh list:

[0123] The seventh table = calculate ABS (DBSFList - the value of the DBSF field of DBAJSSTemp1);

[0124] Then, the position of the element with the smallest element value in the seventh list is taken as DBAJSSPos2;

[0125] S409. Update the DBDBZZPos2 position of DBAJSSTemp3 to 1.

[0126] S410. Create a new row for DBAJSSData:

[0127] Merge DBAJSSTemp2 and DBAJSSTemp3 into one vector as DBAJSSDataVector for the new row of DBAJSSData;

[0128] Use the DBGuangPu data of DBAJSSTemp1 as DBAJSSDataGP of the new row of DBAJSSData;

[0129] S411, set DBAJSSCounter=DBAJSSCounter+1;

[0130] S412. If DBAJSSCounter is less than or equal to DBNum, go to S403; otherwise, go to S413.

[0131] S413. Establish an amino acid and moisture description model DBAJSSModel, including an input layer, a first intermediate layer, a second intermediate layer, and an output layer;

[0132] The input layer corresponds to 12-dimensional input, the 10th to 12th dimension inputs of the input layer are directly multiplied by 0, and the 1st to 9th dimensions use a linear transfer function;

[0133] The first intermediate layer, the second intermediate layer and the output layer adopt a linear transfer function;

[0134] S414. Use all the data in DBAJSSData to train DBAJSSModel to obtain the trained DBAJSSModel.

[0135] The input of the DBAJSSModel is DBAJSSDataGP of DBAJSSData, and the output of the DBAJSSModel is DBAJSSDataVector of DBAJSSData.

[0136] Furthermore, in S5, the rice quality detection model XSPZModel based on hyperspectral nutrient sparse features is constructed using DBDFZModel, DBDBZZModel, and DBAJSSModel. Then, the XSPZModel is trained using DBGGP data to obtain a trained XSPZModel. The hyperspectral data TestGP of the rice to be detected is input into the trained XSPZModel to obtain the quality grade of the rice to be detected, specifically:

[0137] S501, using DBDFZModel, DBDBZZModel and DBAJSSModel to construct a rice quality detection model XSPZModel based on hyperspectral nutrient sparse features;

[0138] S502, using all the data in DBGGP to train XSPZModel and obtain a trained XSPZModel;

[0139] The input of the XSPZModel is DBGuangPu of DBGGP, and the output of the XSPZModel is DBZL of DBGGP;

[0140] S503 , obtaining the hyperspectral data TestGP of the rice to be tested, inputting TestGP into the trained XSPZModel, and obtaining the quality grade Predict of the rice to be tested.

[0141] Furthermore, the rice quality model XSPZModel for detecting hyperspectral nutrient sparse features in S5 includes: an input layer, a nutrient sparse feature layer, a first intermediate layer, a second intermediate layer, a third intermediate layer and an output layer;

[0142] The input of the input layer is the hyperspectral data corresponding to rice;

[0143] The nutrient sparse feature layer includes: DBDFZModel model sublayer, DBDBZZModel model sublayer, DBAJSSModel model sublayer and feature merging sublayer;

[0144] The inputs of the DBDFZModel model sublayer, the DBDBZZModel model sublayer and the DBAJSSModel model sublayer are all hyperspectral data corresponding to rice;

[0145] The feature merging sublayer is used to merge the outputs of the DBDFZModel model sublayer, the DBDBZZModel model sublayer, and the DBAJSSModel model sublayer to obtain nutrient sparse features;

[0146] The first intermediate layer, the second intermediate layer, the third intermediate layer and the output layer adopt a linear transfer function.

[0147] The beneficial effects of the present invention are:

[0148] The present invention designs a rice quality detection method based on hyperspectral nutrient sparse features. By integrating the starch spectral feature multi-association description model, the protein spectral feature multi-association description model, and the amino acid and moisture description model, on the basis of tolerating a certain degree of confusion, the hyperspectral nutrient sparse feature expression is realized, and then a rice quality detection model of hyperspectral nutrient sparse features is constructed, which improves the detection efficiency and accuracy of rice quality and reduces detection errors. The present invention greatly improves the applicability and environmental robustness of the equipment, and provides a practical technical path for the large-scale application of hyperspectral technology in the field of food quality control. The present invention constructs an intelligent analysis system based on hyperspectral nutrient sparse features, which can realize universal detection of rice quality on conventional hyperspectral equipment. Compared with traditional methods, the present invention greatly improves the applicability and environmental robustness of the equipment while ensuring detection accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0149] Figure 1 It is a flow chart of the present invention. DETAILED DESCRIPTION

[0150] Specific implementation method 1: Figure 1 As shown, the specific process of the rice quality detection method based on hyperspectral nutrient sparse features in this embodiment is as follows:

[0151] S1. Input the hyperspectral rice quality dataset DBGGP, obtain the rice starch ratio list DBDFList, rice protein ratio list DBDBZList, rice moisture ratio list DBSFList, and rice amino acid ratio list DBAJSList, and obtain the starch-protein correlation value DFDBZGL and the protein-water correlation value DBZSFGL, specifically:

[0152] S101, input hyperspectral rice quality dataset DBGGP;

[0153] The DBGGP includes the following fields: hyperspectral data corresponding to rice DBGuangPu, percentage of rice starch in total weight DBDF, percentage of rice protein in total weight DBDBZ, percentage of rice moisture in total weight DBSF, percentage of rice amino acids in total weight DBAJS and quality grade DBZL;

[0154] The hyperspectral data DBGuangPu corresponding to rice is 12-dimensional data, which is used to store spectral information in different bands; dimensions 1 to 12 correspond to the following bands respectively:

[0155] The spectral range corresponding to the first dimension is: the spectral band is greater than 400 nanometers and less than or equal to 450 nanometers;

[0156] The spectral range corresponding to the second dimension is: the spectral band is greater than 450 nanometers and less than or equal to 500 nanometers;

[0157] The spectral range corresponding to the third dimension is: the spectral band is greater than 500 nanometers and less than or equal to 550 nanometers;

[0158] The spectral range corresponding to the fourth dimension is: the spectral band is greater than 550 nanometers and less than or equal to 600 nanometers;

[0159] The spectral range corresponding to the fifth dimension is: the spectral band is greater than 600 nanometers and less than or equal to 650 nanometers;

[0160] The spectral range corresponding to the sixth dimension is: the spectral band is greater than 650 nanometers and less than or equal to 700 nanometers;

[0161] The spectral range corresponding to the 7th dimension is: the spectral band is greater than 700 nanometers and less than or equal to 750 nanometers;

[0162] The spectral range corresponding to the 8th dimension is: the spectral band is greater than 750 nanometers and less than or equal to 800 nanometers;

[0163] The spectral range corresponding to the 9th dimension is: the spectral band is greater than 800 nanometers and less than or equal to 850 nanometers;

[0164] The spectral range corresponding to the 10th dimension is: the spectral band is greater than 850 nanometers and less than or equal to 900 nanometers;

[0165] The spectral range corresponding to the 11th dimension is: the spectral band is greater than 900 nanometers and less than or equal to 950 nanometers;

[0166] The spectral range corresponding to the 12th dimension is: the spectral band is greater than 950 nanometers and less than or equal to 1000 nanometers;

[0167] The percentage DBDF of described rice starch accounted for gross weight, the percentage DBDBZ of rice protein accounted for gross weight, the percentage DBSF of rice moisture accounted for gross weight and the percentage DBAJS of rice amino acid accounted for gross weight are all floating point numbers between 0-1;

[0168] The quality grade DBZL is an integer between 0 and 9; a larger value indicates lower rice quality, with 0 indicating the highest quality and 9 indicating the worst quality;

[0169] S102. Use DBGGP to construct a rice starch proportion list DBDFList, specifically:

[0170] Perform K-Means clustering on the DBDF of DBGGP, set the number of clusters to 10, and output the values ​​of the cluster centers from small to large to form a list of rice starch proportions;

[0171] S103, using DBGGP to construct a rice protein proportion list DBDBZList, specifically:

[0172] K-Means clustering was performed on DBDBZ of DBGGP, with the number of clusters set to 10. The values ​​of the cluster centers were output from small to large to form a list of rice protein percentages.

[0173] S104. Use DBGGP to construct a rice moisture percentage list DBSFList, specifically:

[0174] Perform K-Means clustering on the DBSF of DBGGP, set the number of clusters to 10, and output the values ​​of the cluster centers from small to large to form a list of rice moisture percentages;

[0175] S105. Use DBGGP to construct a rice amino acid percentage list DBAJSList, specifically:

[0176] Perform K-Means clustering on DBAJS of DBGGP, set the number of clusters to 10, and output the values ​​of cluster centers from small to large to form a list of rice amino acid proportions;

[0177] S106, starch protein association value DFDBZGL=calculate the cosine similarity of DBDFList and DBDBZList;

[0178] S107. Protein-moisture correlation value DBZSFGL=calculates the cosine similarity between DBDBZList and DBSFList.

[0179] S2. Establish a starch spectral feature multi-association description model DBDFZModel, use DBGGP, DBDFList, DFDBZGL and DBDBZList to construct a starch spectral feature multi-association description dataset DBDFZData, use DBDFZData to train DBDFZModel, and obtain the trained DBDFZModel, specifically:

[0180] S201, establishing a starch spectral feature multi-association description dataset DBDFZData;

[0181] The DBDFZData dataset includes the following fields: starch spectral feature multi-association description hyperspectral data DBDFZDataGP, starch spectral feature multi-association description vector DBDFZDataVector;

[0182] S202, initialize starch spectral feature multi-association description data counter DBDFZCounter=1;

[0183] S203, obtaining the first temporary variable DBDFZTemp1 of the starch spectral feature multi-association description model = taking out the DBDFZCounterth data of DBGGP;

[0184] S204, initialize the second temporary variable DBDFZTemp2 of the starch spectral feature multi-association description model, specifically:

[0185] Set DBDFZTemp2 to a vector containing 10 elements and initialize all elements in DBDFZTemp2 to 0;

[0186] S205, initialize the third temporary variable DBDFZTemp3 of the starch spectral feature multi-association description model, specifically:

[0187] Set DBDFZTemp3 to a vector containing 10 elements and initialize all elements in DBDFZTemp3 to 0;

[0188] S206, obtaining the first position variable DBDFZPos1 of the starch spectral feature multi-association description model:

[0189] First, get the first list:

[0190] First list = ABS (DBDFList-DBDFZTemp1's DBDF field value)

[0191] ABS is the calculated absolute value, and the value of the DBDF field of DBDFList-DBDFZTemp1 represents the value of each element in DBDFList minus the value of the DBDF field of DBDFZTemp1.

[0192] Then, the position of the element with the smallest element value in the first list is taken as DBDFZPos1;

[0193] S207. Update the value of the DBDFZPos1th element of DBDFZTemp2 to 1;

[0194] S208, obtaining the second position variable DBDFZPos2 of the starch spectral feature multi-association description model:

[0195] First, get the second list:

[0196] Second list = ABS (DBDBZList - the value of DBDBZ field in DBDFZTemp1);

[0197] Then, the position of the element with the smallest element value in the second list is used as DBDFZPos2;

[0198] S209. Update the value of the DBDFZPos2th element of DBDFZTemp3 to DFDBZGL.

[0199] S210. Create a new row for DBDFZData:

[0200] Combine DBDFZTemp2 and DBDFZTemp3 into one vector as DBDFZDataVector for the new row of DBDFZData;

[0201] DBDFZDataGP of the newly created row of DBDFZData=DBDFZTemp1's DBGuangPu data;

[0202] S211, set DBDFZCounter=DBDFZCounter+1;

[0203] S212. If DBDFZCounter is less than or equal to the total number of rows DBNum of DDGGP, go to S203; otherwise, go to S213.

[0204] S213, establishing a starch spectral feature multi-correlation description model DBDFZModel;

[0205] Model DBDFZModel is a regression analysis model;

[0206] The DBDFZModel includes in sequence: an input layer, a first intermediate layer, a second intermediate layer, and an output layer;

[0207] The input layer corresponds to 12-dimensional input, and the 1st to 10th dimension inputs of the input layer are directly multiplied by 0; the 11th and 12th dimensions use a linear transfer function;

[0208] The first intermediate layer, the second intermediate layer and the output layer adopt a linear transfer function;

[0209] The linear transfer function in this step is in the form of y=wx+b; the output of the input layer is the input of the first intermediate layer, the output of the first intermediate layer is the input of the second intermediate layer, and the output of the second intermediate layer is the input of the output layer;

[0210] Where w is the weight, b is the bias, x is the input, and y is the output;

[0211] S214. Use all the data in DBDFZData to train DBDFZModel to obtain a trained DBDFZModel.

[0212] The input of the DBDFZModel is DBDFZDataGP of DBDFZData, and the output of the DBDFZModel is DBDFZDataVector of DBDFZData.

[0213] S3. Establish a protein spectral feature multi-association description model DBDBZZModel. Use DBGGP, DBDBZList, DFDBZGL, DBZSFGL, and DBDFList to construct a protein spectral feature multi-association description dataset DBDBZZData. Use DBDBZZData to train DBDBZZModel to obtain the trained DBDBZZModel. Specifically:

[0214] S301, establishing a protein spectral feature multi-association description dataset DBDBZZData;

[0215] The DBDBZZData dataset includes the following fields: protein spectral feature multi-association description hyperspectral data DBDBZZDataGP, protein spectral feature multi-association description vector DBDBZZDataVector;

[0216] S302, initialize the protein spectral feature multi-association description data counter DBDBZZCounter=1;

[0217] S303, obtaining the first temporary variable DBDBZZTemp1 of the protein spectral feature multi-association description model = taking out the DBDBZZCounterth data of DBGGP;

[0218] S304, initialize the second temporary variable DBDBZZTemp2 of the protein spectral feature multi-correlation description model, specifically:

[0219] Set DBDBZZTemp2 to a vector containing 10 elements and initialize all element values ​​in DBDBZZTemp2 to 0;

[0220] S305, initialize the third temporary variable DBDBZZTemp3 of the protein spectral feature multi-association description model, specifically:

[0221] Set DBDBZZTemp3 to a vector containing 20 elements and initialize all element values ​​in DBDBZZTemp3 to 0;

[0222] S306. Obtain the first position variable DBDBZZPos1 of the protein spectral feature multi-association description model:

[0223] First, get the third list:

[0224] The third list = ABS (DBDBZList-DBDBZZTemp1's DBDBZ field value)

[0225] Then, the position of the element with the smallest element value in the third list is taken as DBDBZZPos1;

[0226] S307. Update the value of the DBDBZZPos1th element of DBDBZZTemp2 to 1;

[0227] S308. Obtain the second position variable DBDBZZPos2 of the protein spectral feature multi-association description model:

[0228] First, get the fourth list:

[0229] The fourth list = ABS (DBDFList-DBDBZZTemp1 DBDF field value)

[0230] Then, the position of the element with the smallest element value in the fourth list is taken as DBDBZZPos2;

[0231] S309, obtaining the third position variable DBDBZZPos3 of the protein spectral feature multi-association description model:

[0232] First, get the fifth list:

[0233] The fifth list = ABS (DBSFList-DBDBZZTemp1 DBSF field value)

[0234] Then, the position of the element with the smallest element value in the fifth list is taken as DBDBZZPos3;

[0235] S310, update the value of the DBDBZZPos2th position of DBDBZZTemp3 to DFDBZGL, and update the value of the 10th+DBDBZZPos3th position of DBDBZZTemp3 to DBZSFGL;

[0236] S311. Create a new row for DBDBZZData:

[0237] Combine DBDFZTemp2 and DBDFZTemp3 into one vector as DBDBZZDataVector for the newly created row of DBDBZZData;

[0238] The DBDBZZDataGP of the newly created row of DBDBZZData=DBDBZZTemp1's DBGuangPu data;

[0239] S312, set DBDBZZCounter=DBDBZZCounter+1;

[0240] S313. If DBDBZZCounter is less than or equal to the total number of rows DBNum of DDGGP, go to S303; otherwise, go to S314.

[0241] S314, establish a protein spectral feature multi-correlation description model DBDBZZModel;

[0242] The DBDBZZModel is a regression analysis model;

[0243] The DBDBZZModel model consists of 4 layers: input layer, first intermediate layer, second intermediate layer, and output layer.

[0244] The input layer corresponds to 12-dimensional input, the 1st to 9th dimension inputs of the input layer are directly multiplied by 0, and the 10-12 dimensions use a linear transfer function;

[0245] The first intermediate layer, the second intermediate layer and the output layer adopt a linear transfer function;

[0246] The linear transfer function in this step is of the form y = wx + b;

[0247] Where w is the weight, b is the bias, x is the input, and y is the output; the output of the input layer is the input of the first intermediate layer, the output of the first intermediate layer is the input of the second intermediate layer, and the output of the second intermediate layer is the input of the output layer;

[0248] S315. Use all the data in DBDBZZData to train DBDBZZModel to obtain the trained DBDBZZModel;

[0249] The input of the DBDBZZModel is DBDBZZDataGP of DBDBZZData, and the output of the DBDBZZModel is DBDBZZDataVector of DBDBZZData.

[0250] S4. Establish an amino acid and moisture description model DBAJSSModel. Use DBGGP, DBAJSList, and DBSFList to construct an amino acid and moisture description dataset DBAJSSData. Use DBAJSSData to train DBAJSSModel to obtain the trained DBAJSSModel. Specifically:

[0251] S401, establishing amino acid and moisture description data set DBAJSSData;

[0252] The DBAJSSData dataset includes the following fields: amino acid and moisture description multispectral data DBAJSSDataGP, amino acid and moisture description vector DBAJSSDataVector;

[0253] S402, initialize the amino acid and water description data counter DBAJSSCounter=1;

[0254] S403, establish the amino acid and moisture description model. The first temporary variable DBAJSSTemp1 = retrieves the DBAJSSCounterth data from DBGGP;

[0255] S404, initialize the second temporary variable DBAJSSTemp2 of the amino acid and moisture description model, specifically:

[0256] Set DBAJSSTemp2 to a vector containing 10 elements and initialize all element values ​​in DBAJSSTemp2 to 0;

[0257] S405, initialize the third temporary variable DBAJSSTemp3 of the amino acid and moisture description model, specifically:

[0258] Set DBAJSSTemp3 to a vector containing 10 elements and initialize all element values ​​in DBAJSSTemp3 to 0;

[0259] S406, establish the first position variable DBAJSSPos1 of the amino acid and moisture description model, specifically:

[0260] First, get the sixth list:

[0261] The sixth list = calculate ABS (DBAJSList-DBAJSSTemp1's DBAJS field value)

[0262] Then, the position of the element with the smallest element value in the sixth list is taken as DBAJSSPos1;

[0263] S407. Update the value of the DBAJSSPos1th element of DBAJSSTemp2 to 1;

[0264] S408, establish the second position variable DBAJSSPos2 of the amino acid and moisture description model, specifically:

[0265] First, get the seventh list:

[0266] The seventh table = calculate ABS (DBSFList - the value of the DBSF field of DBAJSSTemp1);

[0267] Then, the position of the element with the smallest element value in the seventh list is taken as DBAJSSPos2;

[0268] S409. Update the DBDBZZPos2 position of DBAJSSTemp3 to 1.

[0269] S410. Create a new row for DBAJSSData:

[0270] Merge DBAJSSTemp2 and DBAJSSTemp3 into one vector as DBAJSSDataVector for the new row of DBAJSSData;

[0271] The DBGuangPu data of the newly created row of DBAJSSData is DBAJSSDataGP=DBAJSSTemp1;

[0272] S411, set DBAJSSCounter=DBAJSSCounter+1;

[0273] S412. If DBAJSSCounter is less than or equal to DBNum, go to S403; otherwise, go to S413.

[0274] S413. Establish amino acid and moisture description model DBAJSSModel:

[0275] The DBAJSSModel is a regression analysis model;

[0276] The DBAJSSModel consists of 4 layers: input layer, first intermediate layer, second intermediate layer, and output layer;

[0277] The input layer corresponds to 12-dimensional input, the 10th to 12th dimension inputs of the input layer are directly multiplied by 0, and the 1st to 9th dimensions use a linear transfer function;

[0278] The first intermediate layer, the second intermediate layer and the output layer adopt a linear transfer function;

[0279] The linear transfer function in this step is in the form of y=wx+b; the output of the input layer is the input of the first intermediate layer, the output of the first intermediate layer is the input of the second intermediate layer, and the output of the second intermediate layer is the input of the output layer;

[0280] Here, w is the weight, b is the bias, x is the input, and y is the output.

[0281] S414. Use all the data in DBAJSSData to train DBAJSSModel to obtain the trained DBAJSSModel.

[0282] The input of the DBAJSSModel is DBAJSSDataGP of DBAJSSData, and the output of the DBAJSSModel is DBAJSSDataVector of DBAJSSData.

[0283] S5. Use DBDFZModel, DBDBZZModel, and DBAJSSModel to construct a rice quality detection model XSPZModel based on hyperspectral nutrient sparse features. Then use DBGGP data to train XSPZModel to obtain a trained XSPZModel. Input the hyperspectral data TestGP of the rice to be tested into the trained XSPZModel to obtain the quality grade of the rice to be tested. Specifically:

[0284] S501, using DBDFZModel, DBDBZZModel and DBAJSSModel to construct a rice quality detection model XSPZModel based on hyperspectral nutrient sparse features;

[0285] The XSPZModel is a regression model, comprising: an input layer, a nutrient sparse feature layer, a first intermediate layer, a second intermediate layer, a third intermediate layer, and an output layer;

[0286] The input of the input layer is 12-dimensional hyperspectral data corresponding to rice;

[0287] The nutrient sparse feature layer includes: DBDFZModel model sublayer, DBDBZZModel model sublayer, DBAJSSModel model sublayer, and feature merging sublayer;

[0288] The inputs of the DBDFZModel model sublayer, the DBDBZZModel model sublayer and the DBAJSSModel model sublayer are all hyperspectral data corresponding to rice;

[0289] The feature merging sublayer is used to merge the outputs of the DBDFZModel model sublayer, the DBDBZZModel model sublayer, and the DBAJSSModel model sublayer to obtain a 70-dimensional nutrient sparse feature;

[0290] The first intermediate layer, the second intermediate layer, the third intermediate layer and the output layer adopt a linear transfer function;

[0291] The linear transfer function in this step is in the form of y=wx+b; the output of the input layer is the input of the nutrient sparse feature layer, the output of the nutrient sparse feature layer is the input of the first intermediate layer, the output of the first intermediate layer is the input of the second intermediate layer, and the output of the second intermediate layer is the input of the output layer;

[0292] Where w is the weight, b is the bias, x is the input, and y is the output;

[0293] S502, using all the data in DBGGP to train XSPZModel and obtain a trained XSPZModel;

[0294] The input of the XSPZModel is DBGuangPu of DBGGP, and the output of the XSPZModel is DBZL of DBGGP;

[0295] S503 , obtaining the hyperspectral data TestGP of the rice to be tested, inputting TestGP into the trained XSPZModel, and obtaining the quality grade Predict of the rice to be tested.

Claims

1. A rice quality detection method based on hyperspectral nutrient sparse features, characterized by: The specific process of the method is: S1. Input the hyperspectral rice quality dataset DBGGP, obtain the rice starch ratio list DBDFList, rice protein ratio list DBDBZList, rice moisture ratio list DBSFList, and rice amino acid ratio list DBAJSList, and obtain the starch-protein correlation value DFDBZGL and the protein-water correlation value DBZSFGL, specifically: S101, input hyperspectral rice quality dataset DBGGP; The DBGGP includes the following fields: hyperspectral data corresponding to rice DBGuangPu, percentage of rice starch in total weight DBDF, percentage of rice protein in total weight DBDBZ, percentage of rice moisture in total weight DBSF, percentage of rice amino acids in total weight DBAJS and quality grade DBZL; The hyperspectral data DBGuangPu corresponding to the rice is 12-dimensional data, which is used to store spectral information within different bands; The percentage DBDF of described rice starch accounted for gross weight, the percentage DBDBZ of rice protein accounted for gross weight, the percentage DBSF of rice moisture accounted for gross weight and the percentage DBAJS of rice amino acid accounted for gross weight are all floating point numbers between 0-1; The quality grade DBZL is an integer between 0 and 9; a larger value indicates lower rice quality, with 0 indicating the highest quality and 9 indicating the worst quality; S102. Use DBGGP to construct a rice starch proportion list DBDFList, specifically: Perform K-Means clustering on the DBDF of DBGGP, set the number of clusters to 10, and output the values ​​of the cluster centers from small to large to form a list of rice starch proportions; S103, using DBGGP to construct a rice protein proportion list DBDBZList, specifically: K-Means clustering was performed on DBDBZ of DBGGP, with the number of clusters set to 10. The values ​​of the cluster centers were output from small to large to form a list of rice protein percentages. S104. Use DBGGP to construct a rice moisture percentage list DBSFList, specifically: Perform K-Means clustering on the DBSF of DBGGP, set the number of clusters to 10, and output the values ​​of the cluster centers from small to large to form a list of rice moisture percentages; S105. Use DBGGP to construct a rice amino acid percentage list DBAJSList, specifically: Perform K-Means clustering on DBAJS of DBGGP, set the number of clusters to 10, and output the values ​​of cluster centers from small to large to form a list of rice amino acid proportions; S106, starch protein association value DFDBZGL = cosine similarity of DBDFList and DBDBZList; S107, protein-moisture correlation value DBZSFGL=cosine similarity of DBDBZList and DBSFList; S2. Establish a starch spectral feature multi-association description model DBDFZModel, use DBGGP, DBDFList, DFDBZGL and DBDBZList to construct a starch spectral feature multi-association description dataset DBDFZData, use DBDFZData to train DBDFZModel, and obtain the trained DBDFZModel; The starch spectral feature multi-association description model DBDFZModel includes: an input layer, a first intermediate layer, a second intermediate layer and an output layer; The input layer corresponds to 12-dimensional input, and the 1st to 10th dimension inputs of the input layer are directly multiplied by 0; the 11th and 12th dimensions use a linear transfer function; The first intermediate layer, the second intermediate layer and the output layer adopt a linear transfer function; S3. Establish a protein spectral feature multi-association description model DBDBZZModel, use DBGGP, DBDBZList, DFDBZGL, DBZSFGL and DBDFList to construct a protein spectral feature multi-association description dataset DBDBZZData, use DBDBZZData to train DBDBZZModel, and obtain the trained DBDBZZModel; S4. Establish an amino acid and moisture description model DBAJSSModel, use DBGGP, DBAJSList and DBSFList to construct an amino acid and moisture description dataset DBAJSSData, use DBAJSSData to train DBAJSSModel, and obtain a trained DBAJSSModel; S5. Use DBDFZModel, DBDBZZModel, and DBAJSSModel to construct a rice quality detection model XSPZModel based on hyperspectral nutrient sparse features. Then, use DBGGP data to train XSPZModel to obtain a trained XSPZModel. Input the hyperspectral data TestGP of the rice to be tested into the trained XSPZModel to obtain the quality grade of the rice to be tested. The rice quality grade to be tested is an integer between 0 and 9; a larger value indicates a lower rice quality, 0 indicates the best quality, and 9 indicates the worst quality.

2. The rice quality detection method based on hyperspectral nutrient sparse features according to claim 1, characterized in that: The hyperspectral data DBGuangPu corresponding to the rice is 12-dimensional data, specifically: The wavelength range stored in the first dimension is: the spectral band is greater than 400 nanometers and less than or equal to 450 nanometers; The wavelength range stored in the second dimension is: the spectral band is greater than 450 nanometers and less than or equal to 500 nanometers; The wavelength range stored in the third dimension is: the spectral wavelength is greater than 500 nanometers and less than or equal to 550 nanometers; The wavelength range stored in the fourth dimension is: the spectral band is greater than 550 nanometers and less than or equal to 600 nanometers; The wavelength range stored in the fifth dimension is: the spectral band is greater than 600 nanometers and less than or equal to 650 nanometers; The wavelength range stored in the sixth dimension is: the spectral band is greater than 650 nanometers and less than or equal to 700 nanometers; The wavelength range stored in the 7th dimension is: the spectral wavelength is greater than 700 nanometers and less than or equal to 750 nanometers; The wavelength range stored in the eighth dimension is: the spectral wavelength is greater than 750 nanometers and less than or equal to 800 nanometers; The wavelength range stored in the 9th dimension is: the spectral wavelength is greater than 800 nanometers and less than or equal to 850 nanometers; The wavelength range stored in the 10th dimension is: the spectral band is greater than 850 nanometers and less than or equal to 900 nanometers; The wavelength range stored in the 11th dimension is: the spectral wavelength is greater than 900 nanometers and less than or equal to 950 nanometers; The wavelength range stored in the 12th dimension is: the spectral wavelength is greater than 950 nanometers and less than or equal to 1000 nanometers.

3. The rice quality detection method based on hyperspectral nutrient sparse features according to claim 2, characterized in that: The step S2 of establishing a starch spectral feature multi-association description model DBDFZModel, constructing a starch spectral feature multi-association description dataset DBDFZData using DBGGP, DBDFList, DFDBZGL, and DBDBZList, and training DBDFZModel using DBDFZData to obtain a trained DBDFZModel is as follows: S201, establishing a starch spectral feature multi-association description dataset DBDFZData; The DBDFZData includes the following fields: starch spectral feature multi-association description hyperspectral data DBDFZDataGP, starch spectral feature multi-association description vector DBDFZDataVector; S202, initialize starch spectral feature multi-association description data counter DBDFZCounter=1; S203, obtaining the first temporary variable DBDFZTemp1 of the starch spectral feature multi-association description model = taking out the DBDFZCounterth data of DBGGP; S204, initialize the second temporary variable DBDFZTemp2 of the starch spectral feature multi-association description model, specifically: Set DBDFZTemp2 to a vector containing 10 elements and initialize all elements in DBDFZTemp2 to 0; S205, initialize the third temporary variable DBDFZTemp3 of the starch spectral feature multi-association description model, specifically: Set DBDFZTemp3 to a vector containing 10 elements and initialize all elements in DBDFZTemp3 to 0; S206, obtaining the first position variable DBDFZPos1 of the starch spectral feature multi-association description model: First, get the first list: First list = ABS (DBDFList - the value of the DBDF field of DBDFZTemp1) Among them, ABS is the calculated absolute value; Then, the position of the element with the smallest element value in the first list is taken as DBDFZPos1; S207. Update the value of the DBDFZPos1th element of DBDFZTemp2 to 1; S208, obtaining the second position variable DBDFZPos2 of the starch spectral feature multi-association description model: First, get the second list: Second list = ABS (DBDBZList - the value of the DBDBZ field of DBDFZTemp1); Then, the position of the element with the smallest element value in the second list is used as DBDFZPos2; S209. Update the value of the DBDFZPos2th element of DBDFZTemp3 to DFDBZGL. S210. Create a new row for DBDFZData: Combine DBDFZTemp2 and DBDFZTemp3 into one vector as DBDFZDataVector for the new row of DBDFZData; Use the DBGuangPu data of DBDFZTemp1 as the DBDFZDataGP of the new row of DBDFZData; S211, set DBDFZCounter=DBDFZCounter+1; S212. If DBDFZCounter is less than or equal to the total number of rows DBNum of DDGGP, go to S203; otherwise, go to S213. S213, establishing a starch spectral feature multi-correlation description model DBDFZModel; S214. Use all the data in DBDFZData to train DBDFZModel to obtain a trained DBDFZModel. The input of the DBDFZModel is DBDFZDataGP of DBDFZData, and the output of the DBDFZModel is DBDFZDataVector of DBDFZData.

4. The rice quality detection method based on hyperspectral nutrient sparse features according to claim 3, characterized in that: The method of establishing a protein spectral feature multi-association description model DBDBZZModel in S3 is as follows: constructing a protein spectral feature multi-association description dataset DBDBZZData using DBGGP, DBDBZList, DFDBZGL, DBZSFGL and DBDFList; training DBDBZZModel using DBDBZZData to obtain a trained DBDBZZModel; and S301, establishing a protein spectral feature multi-association description dataset DBDBZZData; The DBDBZZData dataset includes the following fields: protein spectral feature multi-association description hyperspectral data DBDBZZDataGP, protein spectral feature multi-association description vector DBDBZZDataVector; S302, initialize protein spectrum feature multi-association description data counter DBDBZZCounter=1; S303, obtaining the first temporary variable DBDBZZTemp1 of the protein spectral feature multi-association description model = taking out the DBDBZZCounterth piece of data from DBGGP; S304, initialize the second temporary variable DBDBZZTemp2 of the protein spectral feature multi-correlation description model, specifically: Set DBDBZZTemp2 to a vector containing 10 elements and initialize all element values ​​in DBDBZZTemp2 to 0; S305, initialize the third temporary variable DBDBZZTemp3 of the protein spectral feature multi-association description model, specifically: Set DBDBZZTemp3 to a vector containing 20 elements and initialize all element values ​​in DBDBZZTemp3 to 0; S306, using DBDBZList and DBDBZZTemp1 to obtain the first position variable DBDBZZPos1 of the protein spectral feature multi-association description model; S307. Update the value of the DBDBZZPos1th element of DBDBZZTemp2 to 1; S308. Obtain the second position variable DBDBZZPos2 of the protein spectral feature multi-association description model: First, get the fourth list: Fourth list = ABS (DBDFList - the value of the DBDF field of DBDBZZTemp1) Then, the position of the element with the smallest element value in the fourth list is taken as DBDBZZPos2; S309, obtaining the third position variable DBDBZZPos3 of the protein spectral feature multi-association description model: First, get the fifth list: Fifth list = ABS (DBSFList - the value of the DBSF field of DBDBZZTemp1) Then, the position of the element with the smallest element value in the fifth list is taken as DBDBZZPos3; S310, update the value of the DBDBZZPos2 position of DBDBZZTemp3 to DFDBZGL, and update the value of the 10th+DBDBZZPos3 position of DBDBZZTemp3 to DBZSFGL; S311. Create a new row for DBDBZZData: Combine DBDFZTemp2 and DBDFZTemp3 into one vector as DBDBZZDataVector for the newly created row of DBDBZZData; Use the DBGuangPu data of DBDBZZTemp1 as the DBDBZZDataGP of the new row of DBDBZZData; S312, set DBDBZZCounter=DBDBZZCounter+1; S313. If DBDBZZCounter is less than or equal to the total number of rows DBNum of DDGGP, go to S303; otherwise, go to S314. S314, establish a protein spectral feature multi-correlation description model DBDBZZModel; S315. Use all the data in DBDBZZData to train DBDBZZModel to obtain the trained DBDBZZModel; The input of the DBDBZZModel is DBDBZZDataGP of DBDBZZData, and the output of the DBDBZZModel is DBDBZZDataVector of DBDBZZData.

5. The rice quality detection method based on hyperspectral nutrient sparse features according to claim 4, characterized in that: The method of S306 using DBDBZList and DBDBZZTemp1 to obtain the first position variable DBDBZZPos1 of the protein spectral feature multi-association description model is as follows: First, get the third list: The third list = ABS (DBDBZList-the value of the DBDBZ field of DBDBZZTemp1) Then, the position of the element with the smallest element value in the third list is taken as DBDBZZPos1.

6. The rice quality detection method based on hyperspectral nutrient sparse features according to claim 5, characterized in that: The DBDBZZModel includes: an input layer, a first intermediate layer, a second intermediate layer and an output layer; The input layer corresponds to 12-dimensional input, the 1st to 9th dimension inputs of the input layer are directly multiplied by 0, and the 10-12 dimensions use a linear transfer function; The first intermediate layer, the second intermediate layer and the output layer adopt linear transfer functions.

7. The rice quality detection method based on hyperspectral nutrient sparse features according to claim 6, characterized in that: The step S4 involves establishing an amino acid and moisture description model DBAJSSModel, constructing an amino acid and moisture description dataset DBAJSSData using DBGGP, DBAJSList, and DBSFList, and training DBAJSSModel using DBAJSSData to obtain a trained DBAJSSModel. Specifically, S401, establishing amino acid and moisture description data set DBAJSSData; The DBAJSSData dataset includes the following fields: amino acid and moisture description multispectral data DBAJSSDataGP, amino acid and moisture description vector DBAJSSDataVector; S402, initialize the amino acid and moisture description data counter DBAJSSCounter=1; S403, establish amino acid and moisture description model. The first temporary variable DBAJSSTemp1 = retrieves the DBAJSSCounterth data of DBGGP; S404, initialize the second temporary variable DBAJSSTemp2 of the amino acid and moisture description model, specifically: Set DBAJSSTemp2 to a vector containing 10 elements and initialize all element values ​​in DBAJSSTemp2 to 0; S405, initialize the third temporary variable DBAJSSTemp3 of the amino acid and moisture description model, specifically: Set DBAJSSTemp3 to a vector containing 10 elements and initialize all element values ​​in DBAJSSTemp3 to 0; S406, establish the first position variable DBAJSSPos1 of the amino acid and moisture description model, specifically: First, get the sixth list: Sixth list = calculate ABS(DBAJSList - the value of the DBAJS field in DBAJSSTemp1) Then, the position of the element with the smallest element value in the sixth list is taken as DBAJSSPos1; S407. Update the value of the DBAJSSPos1th element of DBAJSSTemp2 to 1; S408, establish the second position variable DBAJSSPos2 of the amino acid and moisture description model, specifically: First, get the seventh list: The seventh table = calculate ABS (DBSFList - the value of the DBSF field of DBAJSSTemp1); Then, the position of the element with the smallest element value in the seventh list is taken as DBAJSSPos2; S409. Update the DBDBZZPos2 position of DBAJSSTemp3 to 1. S410. Create a new row for DBAJSSData: Merge DBAJSSTemp2 and DBAJSSTemp3 into one vector as DBAJSSDataVector for the new row of DBAJSSData; Use the DBGuangPu data of DBAJSSTemp1 as DBAJSSDataGP of the new row of DBAJSSData; S411, set DBAJSSCounter=DBAJSSCounter+1; S412. If DBAJSSCounter is less than or equal to DBNum, go to S403; otherwise, go to S413. S413. Establish an amino acid and moisture description model DBAJSSModel, including an input layer, a first intermediate layer, a second intermediate layer, and an output layer; The input layer corresponds to 12-dimensional input, the 10th to 12th dimension inputs of the input layer are directly multiplied by 0, and the 1st to 9th dimensions use a linear transfer function; The first intermediate layer, the second intermediate layer and the output layer adopt a linear transfer function; S414. Use all the data in DBAJSSData to train DBAJSSModel to obtain the trained DBAJSSModel. The input of the DBAJSSModel is DBAJSSDataGP of DBAJSSData, and the output of the DBAJSSModel is DBAJSSDataVector of DBAJSSData.

8. The rice quality detection method based on hyperspectral nutrient sparse features according to claim 7, characterized in that: In the step S5, the rice quality detection model XSPZModel based on hyperspectral nutrient sparse features is constructed using DBDFZModel, DBDBZZModel, and DBAJSSModel. The XSPZModel is then trained using DBGGP data to obtain a trained XSPZModel. The hyperspectral data TestGP of the rice to be detected is input into the trained XSPZModel to obtain the quality grade of the rice to be detected, specifically: S501, using DBDFZModel, DBDBZZModel and DBAJSSModel to construct a rice quality detection model XSPZModel based on hyperspectral nutrient sparse features; S502, using all the data in DBGGP to train XSPZModel and obtain a trained XSPZModel; The input of the XSPZModel is DBGuangPu of DBGGP, and the output of the XSPZModel is DBZL of DBGGP; S503 , obtaining the hyperspectral data TestGP of the rice to be tested, inputting TestGP into the trained XSPZModel, and obtaining the quality grade Predict of the rice to be tested.

9. The rice quality detection method based on hyperspectral nutrient sparse features according to claim 8, characterized in that: The rice quality detection model XSPZModel for hyperspectral nutrient sparse features in S5 includes: an input layer, a nutrient sparse feature layer, a first intermediate layer, a second intermediate layer, a third intermediate layer and an output layer; The input of the input layer is the hyperspectral data corresponding to rice; The nutrient sparse feature layer includes: DBDFZModel model sublayer, DBDBZZModel model sublayer, DBAJSSModel model sublayer and feature merging sublayer; The inputs of the DBDFZModel model sublayer, the DBDBZZModel model sublayer and the DBAJSSModel model sublayer are all hyperspectral data corresponding to rice; The feature merging sublayer is used to merge the outputs of the DBDFZModel model sublayer, the DBDBZZModel model sublayer, and the DBAJSSModel model sublayer to obtain nutrient sparse features; The first intermediate layer, the second intermediate layer, the third intermediate layer and the output layer adopt a linear transfer function.

Citation Information

Patent Citations

  • Rice nutrient information measuring method based on visible / near infrared multispectral imaging

    CN101210876A

  • Method for rapidly detecting amylose content in rice by near infrared spectrum and visible light analyzer

    CN103575689A