Rice storage year classification method, system and equipment based on mid-infrared spectrum detection technology and storage medium
Through mid-infrared spectral detection technology and PCA feature extraction combined with sparrow optimization algorithm to optimize the parameters of the support vector machine, the problem of quickly and accurately distinguishing rice storage years is solved to ensure food safety and market order.
Patent Information
- Application Number
- CN202510489916.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-18
- Publication Date
- 2025-07-22
AI Technical Summary
The lack of methods in the prior art that can quickly, accurately and conveniently distinguish rice storage years, resulting in food safety and market order being threatened.
Mid-infrared spectral detection technology is used to scan rice flour, and combined with PCA feature extraction and sparrow optimization algorithm to optimize the parameters of the support vector machine to realize the classification of rice storage years.
It has achieved rapid and accurate distinction between rice storage years, improved testing efficiency, and ensured food safety and market order.
Smart Images

Figure CN120356566A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of agricultural product quality detection and testing, and particularly to a method, system, device, and storage medium for classifying the storage years of rice based on mid-infrared spectroscopy detection technology. Background Art
[0002] The long-term storage of rice leads to changes in its eating quality, which may pose a great threat to food safety and human health. Since the commodity price of aged rice is relatively low, some unscrupulous elements use it to sell as fresh rice, seriously disrupting the normal trade in the rice market. Compared with fresh rice, the quality change caused by one-year storage is relatively low, with a slight decline. However, due to no obvious change in surface color, it is not easy to detect. About three years of storage will lead to obvious changes in surface properties and an impact on the taste, and the cooked rice looks slightly darker than its color. Rice stored for five years will taste bitter. In addition, long-term storage increases the possibility of microbial contamination and may produce toxic substances (i.e., aflatoxin), posing a great threat to human health.
[0003] Currently, the methods mainly used to determine the quality of rice are manual tasting and chemical analysis. Manual tasting is subjective, and the tasting results may vary depending on the age, gender, and region of the taster. Lavanya Devraj et al. used chemical methods to determine the storage time of rice by measuring properties such as the fatty acid value and pH value of rice. These methods are reliable, but the analysis steps are time-consuming, the detection time is long, the detection steps are relatively cumbersome, and it is difficult to meet the test requirements of a large number of samples. Therefore, in order to ensure food safety and standardize the staple food market, there is an urgent need for a fast, accurate, and convenient method to distinguish the storage years of rice.
[0004] In summary, in the prior art, there is a lack of a method that can quickly, accurately, and conveniently distinguish the storage years of rice. Summary of the Invention
[0005] The present invention solves the problem that there is a lack of a method in the prior art that can quickly, accurately, and conveniently distinguish the storage years of rice.
[0006] A method for classifying the storage years of rice based on mid-infrared spectroscopy detection technology according to the present invention includes the following steps:
[0007] Step S1, after respectively processing rice with different and unknown storage years within six years, rice flour with different storage times is respectively obtained;
[0008] Step S2, based on mid-infrared spectroscopy detection technology, the rice flour with different storage years is respectively scanned, and the spectra corresponding to the rice flour with different storage years are respectively obtained;
[0009] Step S3: The spectra corresponding to rice flour of different storage years are successively subjected to normalization processing and feature extraction;
[0010] Step S4: Optimize the parameters of the support vector machine based on the sparrow optimization algorithm to obtain a support vector machine with optimized parameters;
[0011] Step S5: Classify the spectra corresponding to rice flour of different storage years after feature extraction based on the support vector machine with optimized parameters, and then complete the classification of rice of different storage years.
[0012] Further, in an embodiment of the present invention, in the above-mentioned step S3, when performing feature extraction on the spectra corresponding to rice flour of different storage years, specifically:
[0013] The spectra corresponding to rice flour of different storage years are all subjected to feature extraction using PCA.
[0014] Further, in an embodiment of the present invention, in the above-mentioned step S4, when jointly optimizing the regularization parameter C and the kernel function γ of the support vector machine based on the sparrow optimization algorithm.
[0015] Further, in an embodiment of the present invention, when jointly optimizing the regularization parameter C and the kernel function γ of the support vector machine based on the sparrow optimization algorithm, specifically:
[0016] Respectively determine the search ranges of the regularization parameter C and the kernel function γ of the support vector machine, and find the optimal regularization parameter C and the optimal kernel function γ of the support vector machine based on the sparrow optimization algorithm.
[0017] Further, in an embodiment of the present invention, the search range of the regularization parameter C of the support vector machine is C ∈ [10 -3 , 10 3 ;
[0018] The search range of the kernel function γ of the support vector machine is γ ∈ [10 -5 , 10 2 .
[0019] A rice storage year classification system based on mid-infrared spectroscopy detection technology according to the present invention includes the following modules:
[0020] Module S1: After processing rice of different and unknown storage years within six years respectively, obtain rice flour of different storage times respectively;
[0021] Module S2: Based on mid-infrared spectroscopy detection technology, scan rice flour of different storage years respectively to obtain spectra corresponding to rice flour of different storage years respectively;
[0022] Module S3, the spectra corresponding to rice flour of different storage years are sequentially subjected to standardization processing and feature extraction;
[0023] Module S4, the parameters of the support vector machine are optimized based on the sparrow optimization algorithm to obtain a support vector machine with optimized parameters;
[0024] Module S5, the spectra corresponding to rice flour of different storage years after feature extraction are classified based on the support vector machine with optimized parameters, and then the classification of rice of different storage years is completed.
[0025] An electronic device according to the present invention includes a processor, a communication interface, a memory, and a communication bus. Among them, the processor, the communication interface, and the memory complete communication with each other through the communication bus;
[0026] The memory is used to store computer programs;
[0027] The processor is used to implement the method steps described in any one of the above methods when executing the program stored on the memory.
[0028] A computer-readable storage medium according to the present invention stores a computer program therein, and the computer program implements the method steps described in any one of the above methods when executed by a processor.
[0029] The present invention solves the problem in the prior art that there is a lack of a method for quickly, accurately, and conveniently distinguishing the storage years of rice. The specific beneficial effects include:
[0030] 1. A method for classifying the storage years of rice based on mid-infrared spectroscopy detection technology. In the prior art, there is a lack of a method for quickly, accurately, and conveniently distinguishing the storage years of rice. To solve the above technical problems, a spectroscopic detection method is used to detect rice flour samples of different storage years, and mid-infrared spectra of the rice flour are collected. The mid-infrared spectroscopy technology does not require sample destruction and maintains the integrity of the rice. The mid-infrared spectrum is sensitive to molecular vibrations and can capture subtle changes. Due to the large data dimension, PCA is used to perform feature extraction and dimensionality reduction processing on the spectral data feature points. In order to shorten the classification operation time and improve the classification accuracy, the SSA optimization algorithm is used to optimize the classification algorithm SVM. By finding the optimal regularization parameter C and kernel parameter γ, a method with the shortest operation time and the highest classification accuracy is achieved;
[0031] 2. For a rice storage year classification method based on mid-infrared spectroscopy detection technology according to the present invention, in order to obtain a classifier suitable for classifying the storage years of rice, the present invention uses the SSA optimization algorithm to optimize the parameters in the classification algorithm SVM. However, classifying the storage years of rice by the SVM classification algorithm optimized with other parameters cannot achieve accurate classification of the rice storage years. Therefore, the present invention finally selects the regularization parameter C and the kernel function γ of the SVM classification algorithm for optimization, and in order to balance the bias-variance of the model, these two parameters need to be jointly optimized, and the best classification effect can be obtained only when both reach the optimal state at the same time. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] The above and / or additional aspects and advantages of the present invention will become apparent and easy to understand from the following description of the embodiments in conjunction with the drawings, wherein:
[0033] Figure 1 is a flowchart of a method for identifying the storage years of rice based on mid-infrared detection technology described in Embodiment 1;
[0034] Figure 2 is a graph of the classification accuracy and confusion matrix of the training set and test set before the algorithm optimization described in Embodiment 1;
[0035] Figure 3 is a graph of the classification accuracy and confusion matrix of the training set and test set after the algorithm optimization described in Embodiment 1. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0036] The following will clearly and completely describe various embodiments of the present invention in conjunction with the drawings. The embodiments described by referring to the drawings are exemplary and are intended to explain the present invention, and should not be construed as a limitation to the present invention.
[0037] Embodiment 1. A method for classifying the storage years of rice based on mid-infrared spectroscopy detection technology described in this embodiment includes the following steps:
[0038] Step S1, after processing the rice with different and unknown storage years within six years respectively, rice flour with different storage times is obtained respectively;
[0039] Step S2, based on mid-infrared spectroscopy detection technology, the rice flour with different storage years is scanned respectively, and the spectra corresponding to the rice flour with different storage years are obtained respectively;
[0040] Step S3, the spectra corresponding to the rice flour with different storage years are all subjected to standardization processing and feature extraction in sequence;
[0041] Step S4, optimize the parameters of the support vector machine based on the sparrow optimization algorithm to obtain a support vector machine with optimized parameters;
[0042] Step S5: Classify the spectra corresponding to the rice flour of different storage years after feature extraction based on the support vector machine with optimized parameters, and then complete the classification of rice of different storage years.
[0043] In this embodiment, in step S3, feature extraction is performed on the spectra corresponding to the rice flour of different storage years. Specifically:
[0044] PCA is used to perform feature extraction on the spectra corresponding to the rice flour of different storage years.
[0045] In this embodiment, in step S4, the regularization parameter C and kernel function γ of the support vector machine are jointly optimized based on the sparrow optimization algorithm.
[0046] In this embodiment, the joint optimization of the regularization parameter C and kernel function γ of the support vector machine based on the sparrow optimization algorithm is specifically as follows:
[0047] The search ranges of the regularization parameter C and kernel function γ of the support vector machine are determined respectively, and the optimal regularization parameter C and optimal kernel function γ of the support vector machine are found based on the sparrow optimization algorithm.
[0048] In this embodiment, the search range of the regularization parameter C of the support vector machine is C ∈ [10 -3 , 10 3 ;
[0049] The search range of the kernel function γ of the support vector machine is γ ∈ [10 -5 , 10 2 .
[0050] In the prior art, there is a problem of lacking a method that can quickly, accurately and conveniently distinguish the storage years of rice.
[0051] To solve the above technical problems, as Figure 1 shown, this embodiment proposes a method for classifying the storage years of rice based on mid-infrared spectroscopy detection technology, including the following steps:
[0052] Step S1: Prepare experimental samples, and select rice flour of 5 different storage years (2016 - 2022) as experimental samples;
[0053] Step S1.1: Screen the rice paddy samples, and select the paddy with plump grains, no black spots, no mildew, and no defects on the surface.
[0054] Step S2: Process the experimental samples, and perform operations such as selection, shelling, skin grinding, and grinding on the samples required for the experiment;
[0055] Step S2.1: Screen the rice paddy samples, and select brown rice grains that are plump, have no black spots, no mildew, and no defects on the surface.
[0056] Step S2.2: Use a Jinsong brand hulling machine to hull the japonica rice paddy. The model is JLGJ-45, the motor voltage is 220V, the power is 120W, and the hulling rate exceeds 99%, meeting the requirements of the newly promulgated national standards GB 1350-1999 and GB / T 17891-1999. After hulling the japonica rice paddy, it becomes brown rice. Select brown rice grains that are intact, plump, and undamaged, and place the selected brown rice in a breathable mesh bag for storage at low temperature.
[0057] Step S2.3: Prepare the rice flour by grinding with a grinder, and set the grinding time to 40s. This selection is to ensure that the grinding time places the state of the brown rice flour at the upper limit that can be ground, avoiding errors caused by inconsistent particle sizes of the ground powder. At the same time, select 40s as the grinding time to avoid excessive heat generated due to a long grinding time. After grinding, the brown rice flour passes through a standard sample splitter and a 100-mesh sieve (the standard 100-mesh sieve is measured according to the standard GB / T 6003.1-2012), and then is placed in a grinding bottle for storage. Before the experiment, each type of brown rice is sampled and ground more than three times, and the brown rice flour of the same year is placed in the same sample bag.
[0058] Step S3: Collect mid-infrared spectra.
[0059] Step S3.1: The experimental equipment is a Nicolet iS50 Fourier transform infrared (FTIR) spectrometer from Thermo Scientific (Waltham, MA, USA), equipped with a He-Ne laser, and the spectral resolution is better than 0.09 cm-1. The equipment is completely sealed during the experiment. The instrument is completely sealed, and all data acquisitions are carried out in the laboratory environment.
[0060] Step S3.2: The experiment is carried out by the tablet pressing method; after cleaning the grinding tool with an alcohol cotton ball, put 1mg of rice flour and 100mg of potassium bromide into an agate mortar, grind for 1-2 minutes to form a fine powder, mix evenly, and press into a translucent tablet with a tablet press. The diameter of the pressed rice flour disk is 0.7 cm, and the thickness is 0.04 ± 0.01 mm. Make 5 sample tablets for each year.
[0061] Step S3.3: Put the sample tablet into the sample chamber for mid-infrared spectral analysis. The number of scans of the spectrometer is set to 32 times, and the resolution is set to 4 cm-1. Collect 8 mid-infrared spectra for each sample tablet. A total of 40 mid-infrared spectra are collected for one sample.
[0062] Step S4: Preprocess the data prepared in the database. The data preprocessing process is as follows:
[0063] Step S4.1: Perform baseline removal on the data obtained from the experiment to eliminate baseline drift in the spectrum, so as to more accurately analyze the characteristic absorption peaks of the sample.
[0064] Step S4.2: Perform normalization processing on the spectral data to eliminate spectral differences.
[0065] Determine the minimum and maximum values in the dataset: First, find the minimum value X min and the maximum value X max .
[0066] Apply the formula for normalization: Apply the above formula to each data point to convert it into a normalized value. The normalization formula is as follows:
[0067]
[0068] where X is a value in the original data, X min is the minimum value in the original dataset, X max is the maximum value in the original dataset, and X norm is the normalized data value, and its range is usually [0, 1].
[0069] The normalized data value X norm will be compressed between [0, 1]. Specifically:
[0070] When X = X min , the normalized value X norm = 0.
[0071] When X = X max , the normalized value X norm = 1.
[0072] Other data points will be linearly mapped to values between 0 and 1.
[0073] Check the results: Ensure that all normalized data values are within the range of [0, 1].
[0074] Step S5: Extract features from the spectral data to separate the characteristic wavelengths of the spectrum.
[0075] The mid-infrared spectra of rice flour with different storage years are collected by a mid-infrared spectrometer. Each spectrum has 7,585 characteristic wavelengths. After inputting all the spectral data, the steps for PCA feature extraction are as follows:
[0076] Step S5.1: Input the original data and perform standardization processing on the original data;
[0077] Assume the sample observation data matrix is:
[0078]
[0079] Then, the original data can be standardized as follows:
[0080]
[0081] Among them,
[0082] Step S5.2, calculate the sample correlation coefficient matrix:
[0083] For convenience, assume that the original data is still denoted as after standardization. Then, the correlation coefficient of the data after standardization is:
[0084]
[0085] Among them,
[0086] Step S5.3, calculate the eigenvalues and corresponding eigenvectors of the correlation coefficient matrix R:
[0087] Eigenvalues: λ1, λ2…, λ p ;
[0088] Eigenvectors: a i =(a i1 , a i2 , …, a ip ), i = 1, 2…, p;
[0089] Step S5.4, select important principal components and write the principal component expressions:
[0090] Principal component analysis can obtain P principal components. However, since the variances of the principal components are decreasing and the amount of information they contain is also decreasing, in actual analysis, generally, instead of selecting P principal components, the first k principal components are selected according to the cumulative contribution of each principal component. Here, the contribution rate refers to the proportion of the variance of a certain principal component to the total variance, which is actually the proportion of a certain eigenvalue to the sum of all eigenvalues, that is
[0091]
[0092] The larger the contribution rate, the more information of the original variables the principal component contains. The selection of the number k of principal components is mainly determined by the cumulative contribution rate of the principal components, that is, generally, it is required that the cumulative contribution rate reaches more than 85%, so as to ensure that the comprehensive quantity can include the vast majority of information of the original variables.
[0093] Step S5.5, calculate the principal component scores:
[0094] According to the standardized original data, substituting into the principal component expression for each sample respectively, the new data of each sample under each principal component can be obtained, which is the principal component score. The specific form is as follows:
[0095]
[0096] Among them, F ij = a j1 x i1 + a j2 x i2 +…+ a jp x ip , i = 1, 2, …, n; j = 1, 2, …, k;
[0097] The feature forms extracted from each spectrum are as follows:
[0098] Feature = {S1, S2, S3, …, S K}.
[0099] Step S6, optimize the input parameters of the support vector machine (SVM):
[0100] Step S6.1, the mathematical model of the sparrow search algorithm (SSA):
[0101] (1) Parameter definition:
[0102] Optimize the parameters, C (regularization parameter) and γ (RBF kernel parameter) of SVM.
[0103] Search range (logarithmic scale): C ∈ [10 -3 , 10 3 , γ ∈ [10 -5 , 10 2 ;
[0104] Sparrow position: The position vector x i of the i-th sparrow = [log 10 (C), log 10 (γ)].
[0105] (2) Fitness function:
[0106] The fitness value is the 5-fold cross-validation accuracy rate:
[0107] Among them, Accuracy is the classification correct rate.
[0108] (3) Sparrow position update formula:
[0109] The core update rules of SSA are divided into two categories: discoverers (optimal sparrows) and followers (other sparrows):
[0110] 1. Discoverer update (current optimal individual):
[0111]
[0112] where α ∈ [0, 1] is the step size control factor, r1 is a random vector, r1 ~ N(0, 1), and X mean is the average position of the current population.
[0113] 2. Follower update (other individuals):
[0114]
[0115] where β and γ are weight coefficients, r2 is a random vector, r2 ~ N(0, 1), and X rand is a newly generated random position.
[0116] 3. Boundary handling:
[0117]
[0118] where lower j and upper j are the lower and upper bounds for searching parameters C and γ.
[0119] Step S6.2, the mathematical model of the SVM classifier
[0120] (1) Optimization problem (primal form):
[0121]
[0122] Constraints:
[0123]
[0124] φ(·) is the RBF kernel function mapping:
[0125] (2) Decision function:
[0126]
[0127] (3) Output the optimal parameters:
[0128]
[0129] It should be noted that the present embodiment aims to solve the problem in the prior art that there is a lack of a method for quickly, accurately and conveniently distinguishing the storage years of rice, and it is necessary to improve the existing classification algorithm SVM. To this end, the present embodiment optimizes the parameters of the classification algorithm SVM by using the sparrow optimization algorithm, that is, finally selects the regularization parameter c and the kernel function γ of the classification algorithm SVM for optimization. Before selecting the kernel function γ for optimization, the present embodiment finds through experiments that optimizing other kernel functions (such as kernel function α and kernel function β, etc.) in the classification algorithm SVM will result in either a small impact on the classification algorithm SVM or can be effectively set through experience or default values. That is to say, optimizing other kernel functions of the classification algorithm SVM cannot solve the technical problems existing in the prior art described in the present embodiment. Therefore, the present embodiment optimizes the regularization parameter C and the kernel function γ in the classification algorithm SVM by using the sparrow optimization algorithm, which directly control the complexity and non-linear expression ability of the model, and further determine the bias-variance trade-off of the model.
[0130] Therefore, how to adjust these two parameters is the key step in optimizing the performance of SVM. The present embodiment also finds that only by jointly adjusting the regularization parameter C and the kernel function γ in the classification algorithm SVM can the bias-variance trade-off of the model be determined. If these two parameters are not set well at the same time, the model may either overfit or underfit, and cannot achieve good results. Only when both reach the optimal can the best classification effect be obtained.
[0131] Step S7: Classify the spectra corresponding to the rice flour of different storage years after feature extraction based on the support vector machine with optimized parameters, and then complete the classification of rice of different storage years.
[0132] To better illustrate the method for classifying the storage years of rice based on mid-infrared spectroscopy detection technology described in the present embodiment, the following examples are used for detailed description:
[0133] As Figure 2 shown, the classification accuracy rates and confusion matrix diagrams of the training set and the test set based on the support vector machine optimization before parameter optimization are as Figure 3 shown. The classification accuracy rates and confusion matrix diagrams of the training set and the test set based on the support vector machine optimization after parameter optimization can be seen. The classification accuracy rates of the training set and the test set based on the support vector machine optimization after parameter optimization are higher, and the confusion matrix diagrams are more regular.
[0134] In summary, in this embodiment, the rice flour of different storage years is detected by a Thermo Scientific Nicolet iS50 Fourier transform infrared (FT-IR) spectrometer. When the interfering light passes through the sample, the light of a specific wavelength is absorbed, forming the infrared absorption spectrum of the sample. The spectrogram shows the absorption intensity of the sample at different wave numbers, which is used to analyze the molecular structure and chemical composition of the sample and obtain information about the structure and properties of the substance. Since the year difference is essentially a gradual change in certain components in the rice sample. A method combining experimental spectral data with a classification algorithm is adopted to perform baseline removal and normalization processing on the collected original spectral data, extract features through PCA, optimize the algorithm of SVM (support vector machine) using SSA (sparrow search algorithm), and finally classify the processed data through a classification modeling method. Through this method, the quality of agricultural products can be quickly detected, and the storage years of rice can be quickly distinguished.
[0135] Embodiment 2. A rice storage year classification system based on mid-infrared spectroscopy detection technology described in this embodiment includes the following modules:
[0136] Module S1: After processing rice with different and unknown storage years within six years respectively, rice flour with different storage times is obtained respectively.
[0137] Module S2: Based on mid-infrared spectroscopy detection technology, the rice flour of different storage years is scanned respectively, and the spectra corresponding to the rice flour of different storage years are obtained respectively.
[0138] Module S3: The spectra corresponding to the rice flour of different storage years are all subjected to standardization processing and feature extraction in sequence.
[0139] Module S4: Based on the sparrow search algorithm, the parameters of the support vector machine are optimized to obtain a support vector machine with optimized parameters.
[0140] Module S5: Based on the support vector machine with optimized parameters, the spectra corresponding to the rice flour of different storage years after feature extraction are classified, and then the classification of rice with different storage years is completed.
[0141] Embodiment 3. An electronic device described in this embodiment includes a processor, a communication interface, a memory, and a communication bus. Among them, the processor, the communication interface, and the memory complete mutual communication through the communication bus;
[0142] The memory is used to store a computer program;
[0143] The processor is used to implement the method steps described in Embodiment 1 when executing the program stored on the memory.
[0144] Embodiment 4. A computer-readable storage medium described in this embodiment, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the method steps described in Embodiment 1 are implemented.
[0145] The above has introduced in detail a rice storage year classification method, system, device and storage medium based on mid-infrared spectroscopy detection technology proposed by the present invention. Specific examples are used in this article to elaborate on the principle and implementation manner of the present invention. The description of the above embodiments is only used to help understand the method and its core idea of the present invention; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present invention.
Claims
1. A classification method for the storage years of rice based on mid-infrared spectroscopy detection technology, characterized in that, It includes the following steps: Step S1: After processing rice with different and unknown storage years within six years respectively, rice flour with different storage times is obtained respectively; Step S2: Based on mid-infrared spectroscopy detection technology, the rice flour with different storage years is scanned respectively, and the spectra corresponding to the rice flour with different storage years are obtained respectively; Step S3: The spectra corresponding to the rice flour with different storage years are all subjected to normalization processing and feature extraction in sequence; Step S4: Based on the sparrow optimization algorithm, the parameters of the support vector machine are optimized to obtain a support vector machine with optimized parameters; Step S5: Based on the support vector machine with optimized parameters, the spectra corresponding to the rice flour with different storage years after feature extraction are classified, and then the classification of rice with different storage years is completed.
2. The rice storage year classification method based on mid-infrared spectroscopy detection technology according to claim 1, characterized in that In the said Step S3, for the spectra corresponding to the rice flour with different storage years, feature extraction is carried out specifically as follows: The spectra corresponding to the rice flour with different storage years all adopt PCA for feature extraction.
3. A method for classifying the storage years of rice based on mid-infrared spectroscopy detection technology according to claim 1, characterized in that, In the said Step S4, based on the sparrow optimization algorithm, the regularization parameter C and kernel function γ of the support vector machine are jointly optimized.
4. A method for classifying the storage years of rice based on mid-infrared spectroscopy detection technology according to claim 3, characterized in that, Based on the sparrow optimization algorithm, the regularization parameter C and kernel function γ of the support vector machine are jointly optimized specifically as follows: The search ranges of the regularization parameter C and kernel function γ of the support vector machine are determined respectively, and the optimal regularization parameter C and optimal kernel function γ of the support vector machine are found based on the sparrow optimization algorithm.
5. A method for classifying the storage years of rice based on mid-infrared spectroscopy detection technology according to claim 4, characterized in that, The search range of the regularization parameter C of the support vector machine is C ∈ [10 -3 , 10 3 ; The search range of the kernel function γ of the support vector machine is γ ∈ [10 -5 , 10 2 .
6. A rice storage year classification system based on mid-infrared spectroscopy detection technology, characterized in that, It includes the following modules: Module S1: After processing rice with different and unknown storage years within six years respectively, rice flour with different storage times is obtained respectively; Module S2: Based on mid-infrared spectroscopy detection technology, the rice flour with different storage years is scanned respectively, and the spectra corresponding to the rice flour with different storage years are obtained respectively; Module S3: The spectra corresponding to the rice flour with different storage years are all subjected to normalization processing and feature extraction in sequence; Module S4: Based on the sparrow optimization algorithm, the parameters of the support vector machine are optimized to obtain a support vector machine with optimized parameters; Module S5: Based on the support vector machine with optimized parameters, the spectra corresponding to the rice flour with different storage years after feature extraction are classified, and then the classification of rice with different storage years is completed.
7. An electronic device, characterized in that, It includes a processor, a communication interface, a memory and a communication bus. Among them, the processor, communication interface and memory complete communication with each other through the communication bus; The memory is used for storing computer programs; The processor is used for implementing the method steps described in any one of claims 1 - 5 when executing the programs stored on the memory.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor, the method steps described in any one of claims 1 - 5 are implemented.
Citation Information
Patent Citations
Construction method and application of KNN model for detecting rice years
CN113049529A
Millet origin traceability method based on mid-infrared spectrum technology and feature extraction
CN113191618A
Terahertz time-domain spectroscopy quantitative detection method for new and old millets
CN116879218A
Method and apparatus for sorting seeds
WO2023088892A1
Cited By
Rice component detection method based on visible near-infrared spectrum and two-way inversion method
CN122524729A
Rice component detection method based on visible near-infrared spectrum and two-way inversion method
CN122524729B