Millet maturity detection method, system and equipment based on near infrared spectrum and medium
Through the detection method based on near-infrared spectroscopy, the traditional millet maturity detection is solved, and the detection results are inaccurate, achieving fast, lossless and accurate millet nutrition quality detection is achieved, and the detection accuracy and efficiency are improved.
Patent Information
- Application Number
- CN202411874868.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-19
- Publication Date
- 2025-03-28
AI Technical Summary
The existing Xiaomi maturity detection method is time-consuming and labor-intensive, and may damage the sample, and there are shortcomings in feature band selection and data correlation modeling, resulting in inaccurate detection results.
Using a detection method based on near-infrared spectroscopy, the near-infrared spectral data of Xiaomi samples were obtained, the normalized spectral index and the optimized spectral index were calculated, and the characteristic bands related to Xiaomi's nutrient components were screened out. The Xiaomi nutrition quality index was calculated based on the characteristic band and correlation model. This index was used for feature extraction, a maturity model was constructed, and the detection was performed.
It realizes fast, lossless and accurate millet nutrition quality inspection, improves detection accuracy and efficiency, avoids sample damage, and provides scientific agricultural management data support.
Smart Images

Figure CN119715453A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of agricultural product growth detection, and in particular to a millet maturity detection method, system, equipment and medium based on near infrared spectroscopy. Background Art
[0002] Millet (Setaria italica) has been one of China's main grain crops since ancient times and is still widely grown and consumed around the world, especially in arid and semi-arid regions of Asia. The maturity of millet is one of the important indicators to measure its quality, which directly affects the taste, nutritional value and market value of millet. Traditional methods for detecting millet maturity are time-consuming and labor-intensive, and may damage samples. With the development of spectral analysis technology, non-destructive and efficient detection using near-infrared spectroscopy technology has become possible. However, existing methods still have shortcomings in feature band selection and data association modeling.
[0003] With the advancement of science and technology, especially the development of spectral analysis technology, new possibilities have been provided for the rapid and accurate determination of the nutritional content of millet grains and the subsequent judgment of the maturity of millet. As an advanced technical means that is non-destructive, efficient and capable of simultaneous detection of multiple components, near-infrared spectroscopy has shown great application potential in the field of agricultural product quality testing. This technology can capture information closely related to the composition and structure of a substance by measuring the absorption, reflection or transmission spectrum of a substance in the near-infrared region. At the same time, combined with advanced technologies such as chemometrics and machine learning, it can effectively reveal the complex relationship between spectral data and chemical composition, and achieve accurate prediction of the content of multiple nutrients in the sample.
[0004] However, different nutrients contain different elements; even if they contain the same elements, their chemical bond composition and vibration mode are different. This difference leads to differences in the sensitive bands of each nutrient to the near-infrared spectrum, which in turn affects the accuracy of the characteristic band selection. Therefore, when testing the nutrient content of millet from the filling stage to the maturity stage, the test results may be inaccurate due to the inaccurate selection of the characteristic band, which in turn has a negative impact on agriculture. Summary of the invention
[0005] The purpose of the present invention is to provide a millet maturity detection method, system, equipment and medium based on near infrared spectroscopy, which can quickly, non-destructively and accurately detect the nutritional quality of millet.
[0006] To achieve the above object, the present invention provides the following solutions:
[0007] A method for detecting millet maturity based on near infrared spectroscopy, comprising:
[0008] Acquire near infrared spectrum data of millet samples in the target area; the near infrared spectrum data includes absorbance or reflectance information at different wavelengths;
[0009] Calculating the normalized spectral index and the optimized spectral index of the near-infrared spectral data, and screening out characteristic bands related to various nutritional components of millet in each spectrum;
[0010] Calculating the millet nutritional quality index according to the characteristic bands and the correlation model; the correlation model is used to describe the correlation between known nutritional components and spectral data;
[0011] The near infrared spectrum data is subjected to feature extraction using the millet nutritional quality index to obtain millet maturity-related feature parameters; the millet maturity-related feature parameters are the proportion or change trend of the nutritional components;
[0012] A maturity model is constructed according to the millet maturity-related characteristic parameters, and the near-infrared spectrum data to be detected is detected using the maturity model to determine the maturity of the millet to be detected.
[0013] Optionally, the calculation formulas of the normalized spectral index and the optimized spectral index are respectively:
[0014]
[0015] Among them, GYZ is the normalized spectral index, YHZ is the optimized spectral index, and λ i and λ i are any two wavelengths in the near-infrared band, P λi and P λj They are i and λ j The reflectivity corresponding to the wavelength, L is a system parameter, and its value is 0.5.
[0016] Optionally, screening out characteristic bands related to various nutrients of millet in each spectrum specifically includes:
[0017] Initialize particle swarm parameters: randomly set the initial position x of the particle n and initial flight speed v n , the value range of the target optimization parameter M is [0,1], the learning factors c1 and c2 are both 0.01, the initial population size is 10, the inertia weight w is 0.1, the maximum number of iterations T is 30, and x n and v n The calculation of is as follows:
[0018] x n =(x n,1 , x n,2 ...x n,d )
[0019] v n =(v n,1 , v n,2 ...v n,d )
[0020] Among them, n represents the nth particle, and d represents the dimension of the space where the nth particle is located;
[0021] Calculate the fitness value of each particle, and take the current position of the particle as the individual best position, recorded as pbest. By comparing the size of the fitness value of each particle, determine the best position of the population, and record the best position of the population as gbest.
[0022] Update the particle's velocity and position according to the following formula:
[0023] v n,d (t+1)=wv n,d +c1r1[p n,d -x n,d (t)]+c2r2[p g,d -x n,d (t)]
[0024] x n,d (t+1)=x n,d (t)+v n,d (t+1)
[0025] Among them, t is the number of iterations; w is the inertia weight, p n,d is the best historical position experienced by the nth particle, p g,d is the best position experienced by all particles in the group, r1 and r2 are random numbers between 0 and 1 that follow a uniform distribution;
[0026] Determine the termination condition: recalculate the fitness value of each particle according to the updated position and speed of the particle, and continue to iterate and optimize. n (t)≥pbest, then pbest=x n (t); if x n (t)≥gbest, then gbest=x n (t); continuously update pbest and gbest until the maximum number of iterations T is reached, the optimization is completed, and the optimal solution is output; the optimal solution is the value of the target optimization parameter M;
[0027] Based on the target optimization parameter M, the optimal band combination is determined, the sum of the normalized spectral index and the optimized spectral index is calculated, and the Euclidean distance between the sum and the parameter M is calculated. The selected band of the near-infrared spectrum is obtained according to the Euclidean distance and a preset ratio; the selected band of the near-infrared spectrum is a characteristic band related to each nutritional component of millet.
[0028] Optionally, calculating the millet nutritional quality index according to the characteristic band and the association model specifically includes:
[0029] Obtain the characteristic wavelength reflectance increasing relationship diagram of the preset nutritional quality, and add the selected band to the characteristic wavelength reflectance increasing relationship diagram. Select three characteristic vectors R1, R2, and R3 for the selected band. The wavelengths corresponding to each vector are λ1, λ2, and λ3 respectively. Calculate the nutritional quality index DCI according to the following formula:
[0030]
[0031] Among them, the ratios of the reflectivity differences of the three eigenvectors in the axial projection direction are equal.
[0032] Optionally, the millet nutritional quality index is used to perform feature extraction on the near infrared spectrum data to obtain millet maturity-related feature parameters, specifically including:
[0033] Divide the collected near-infrared spectral data into multiple band intervals, evaluate the fluctuation of the spectral data according to the millet nutritional quality index, and if the millet nutritional quality index of a certain band interval exceeds a preset threshold, it is regarded as a key band and marked as an area to be extracted with millet maturity characteristics;
[0034] For the area to be extracted, the third-order central moment feature extraction method is used to extract features and obtain the maturity shape features:
[0035]
[0036] Among them, S m is the maturity shape feature, m represents the number of bands in the near infrared data, and I α,β It represents the spectral intensity value of the αth band at the βth data point, N represents the number of data points, μ α Represents the mean intensity of the αth band.
[0037] The present invention also provides a millet maturity detection system based on near infrared spectroscopy, comprising:
[0038] A near infrared spectrum data acquisition module is used to obtain near infrared spectrum data of millet samples in a target area; the near infrared spectrum data includes absorbance or reflectance information at different wavelengths;
[0039] A characteristic spectral index optimization screening module is used to calculate the normalized spectral index and the optimized spectral index of the near-infrared spectral data, and screen out characteristic bands related to various nutrients in millet in each spectrum;
[0040] A millet nutritional quality index calculation module, used to calculate the millet nutritional quality index according to the characteristic band and the correlation model; the correlation model is used to describe the correlation between the known nutritional components and the spectral data;
[0041] A millet nutritional quality feature extraction module is used to extract features from the near infrared spectrum data using the millet nutritional quality index to obtain millet maturity-related feature parameters; the millet maturity-related feature parameters are the proportion or change trend of nutritional components;
[0042] The millet maturity feature recognition and analysis module is used to construct a maturity model according to the millet maturity-related feature parameters, and use the maturity model to detect the near-infrared spectrum data to be detected to determine the maturity of the millet to be detected.
[0043] The present invention also provides an electronic device, including a memory and a processor, wherein the memory is used to store a computer program, and the processor runs the computer program to enable the electronic device to execute the above-mentioned millet maturity detection method based on near-infrared spectroscopy.
[0044] The present invention also provides a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the above-mentioned millet maturity detection method based on near infrared spectroscopy.
[0045] According to the specific embodiments provided by the present invention, the present invention discloses the following technical effects:
[0046] The invention discloses a method, system, device and medium for detecting the maturity of millet based on near infrared spectroscopy. The method comprises calculating the normalized spectral index and the optimized spectral index of the near infrared spectral data of the millet sample, and screening out the characteristic bands related to the various nutrients of the millet in each spectrum; calculating the millet nutritional quality index according to the characteristic bands and the correlation model; extracting the features of the near infrared spectral data by using the millet nutritional quality index to obtain the millet maturity-related characteristic parameters; the millet maturity-related characteristic parameters are the proportion or change trend of the nutrients; constructing a maturity model according to the millet maturity-related characteristic parameters, and using the maturity model to detect the near infrared spectral data to be detected to determine the maturity of the millet to be detected. The invention can detect the nutritional quality of millet quickly, non-destructively and accurately. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0048] Figure 1 The present invention is a flow chart of the method for detecting millet maturity based on near infrared spectroscopy. DETAILED DESCRIPTION
[0049] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0050] The purpose of the present invention is to provide a millet maturity detection method, system, equipment and medium based on near infrared spectroscopy, which can quickly, non-destructively and accurately detect the nutritional quality of millet.
[0051] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0052] like Figure 1 As shown, the present invention provides a method for detecting millet maturity based on near infrared spectroscopy, comprising:
[0053] Step 100: Acquire near-infrared spectrum data of a millet sample in a target area; the near-infrared spectrum data includes absorbance or reflectance information at different wavelengths.
[0054] Step 200: Calculate the normalized spectral index and the optimized spectral index of the near-infrared spectral data, and screen out characteristic bands related to various nutrients in millet in each spectrum.
[0055] Step 300: Calculate the millet nutritional quality index according to the characteristic band and the correlation model; the correlation model is used to describe the correlation between known nutritional components and spectral data.
[0056] Step 400: extracting features from the near-infrared spectrum data using the millet nutritional quality index to obtain millet maturity-related feature parameters; the millet maturity-related feature parameters are the proportion or change trend of nutritional components.
[0057] Step 500: constructing a maturity model according to the millet maturity-related characteristic parameters, and using the maturity model to detect the near-infrared spectrum data to be detected to determine the maturity of the millet to be detected.
[0058] As a specific implementation method, the following specific implementation steps are provided.
[0059] In this embodiment, the near-infrared spectral data includes absorbance or reflectance information at different wavelengths; these data are then sent to the characteristic spectral index optimization screening module for processing. By determining the selected near-infrared spectrum band corresponding to the optimal characteristic spectral index through normalized spectral index and optimized spectral index, the present invention can accurately select the most representative characteristic wavelength for millet nutritional quality detection; further calculate the millet nutritional quality index based on the selected near-infrared spectrum band; further extract characteristic parameters related to millet maturity based on the millet nutritional quality index, which not only covers the nutritional component information of millet, but also reflects the maturity changes during its growth process; finally, the maturity spectral characteristics of millet are identified and analyzed to obtain identification results.
[0060] During the growth process of millet, by continuously collecting and analyzing near-infrared spectral data, the present invention can track the nutritional quality and maturity changes of millet in real time, providing scientific and accurate data support for millet growth management. This monitoring method not only avoids the damage to samples caused by traditional detection methods, but also greatly improves the efficiency and accuracy of monitoring.
[0061] In step 200, the preset parameter definition λ in the wavelength information is i and λ j The band screening range is the full near-infrared band (780-2500nm), and the normalized spectral index GYZ and the optimized spectral index YHZ are calculated:
[0062]
[0063] Among them, GYZ is the normalized spectral index, YHZ is the optimized spectral index, and λ i and λ i are any two wavelengths in the near-infrared band, P λi and P λj They are i and λ j The reflectivity corresponding to the wavelength, L is a system parameter, and its value is 0.5.
[0064] Furthermore, the characteristic bands related to the nutrients of millet in each spectrum were screened out, including:
[0065] Initialize particle swarm parameters: randomly set the initial position x of the particle nand initial flight speed v n , the value range of the target optimization parameter M is [0,1], the learning factors c1 and c2 are both 0.01, the initial population size is 10, the inertia weight w is 0.1, the maximum number of iterations T is 30, and x n and v n The calculation of is as follows:
[0066] x n =(x n,1 , x n,2 ...x n,d )
[0067] v n =(v n,1 , v n,2 ...v n,d )
[0068] Among them, n represents the nth particle, and d represents the spatial dimension where the nth particle is located.
[0069] The fitness value fitness of each particle is calculated, and the current position of the particle is taken as the individual best position, recorded as pbest. By comparing the size of the fitness value of each particle, the best position of the population is determined, and the best position of the population is recorded as gbest.
[0070] Update the particle's velocity and position according to the following formula:
[0071] v n,d (t+1)=wv n,d +c1r1[p n,d -x n,d (t)]+c2r2[p g,d -x n,d (t)]
[0072] x n,d (t+1)=x n,d (t)+v n,d (t+1)
[0073] Among them, t is the number of iterations; w is the inertia weight, p n,d is the best historical position experienced by the nth particle, p g,d is the best position experienced by all particles in the group, and r1 and r2 are random numbers between 0 and 1 that follow a uniform distribution.
[0074] Determine the termination condition: recalculate the fitness value of each particle according to the updated position and speed of the particle, and continue to iterate and optimize. n (t)≥pbest, then pbest=x n (t); if x n(t)≥gbest, then gbest=x n (t); continuously update pbest and gbest until the maximum number of iterations T is reached, the optimization is completed, and the optimal solution is output; the optimal solution is the value of the target optimization parameter M.
[0075] Based on the target optimization parameter M, the optimal band combination is determined, the sum of the normalized spectral index and the optimized spectral index is calculated, and the Euclidean distance between the sum and the parameter M is calculated. The selected band of the near-infrared spectrum is obtained according to the Euclidean distance and a preset ratio; the selected band of the near-infrared spectrum is a characteristic band related to each nutritional component of millet.
[0076] In step 300, the millet nutritional quality index is calculated according to the characteristic band and the correlation model, specifically including:
[0077] Obtain the characteristic wavelength reflectance increasing relationship diagram of the preset nutritional quality, and add the selected band to the characteristic wavelength reflectance increasing relationship diagram. Select three characteristic vectors R1, R2, and R3 for the selected band. The wavelengths corresponding to each vector are λ1, λ2, and λ3 respectively. Calculate the nutritional quality index DCI according to the following formula:
[0078]
[0079] Among them, the ratios of the reflectivity differences of the three eigenvectors in the axial projection direction are equal.
[0080] In step 400, the near infrared spectrum data is subjected to feature extraction using the millet nutritional quality index to obtain millet maturity-related feature parameters, specifically including:
[0081] Divide the collected near-infrared spectral data into multiple band intervals, evaluate the fluctuation of the spectral data according to the millet nutritional quality index, and if the millet nutritional quality index of a certain band interval exceeds a preset threshold, it is regarded as a key band and marked as an area to be extracted with millet maturity characteristics;
[0082] For the area to be extracted, the third-order central moment feature extraction method is used to extract features and obtain the maturity shape features:
[0083]
[0084] Among them, S m is the maturity shape feature, m represents the number of bands in the near infrared data, and I α,β It represents the spectral intensity value of the αth band at the βth data point, N represents the number of data points, μ α Represents the mean intensity of the αth band.
[0085] Furthermore, the specific steps in step 500 include the following process:
[0086] S1: Data preparation, spectrum collection: Collect spectral data of millet at different maturity levels, including the grain filling stage, milky stage, waxy stage and full maturity stage from the beginning of grain formation to full maturity;
[0087] Data annotation: Annotate the spectra to clarify the millet growth period corresponding to each spectrum;
[0088] Data enhancement: Multiple different near-infrared spectral models are integrated by voting, averaging or weighting to improve the generalization ability of the model;
[0089] S2: Model selection and training, partial least squares method is selected as the training model;
[0090] Model training: The model is trained using preprocessed and annotated near-infrared spectroscopy datasets to learn the ability to extract key features from spectral data and associate them with target chemical values;
[0091] Parameter adjustment and optimization: The prediction accuracy and generalization ability of the model can be enhanced by adjusting hyperparameters such as learning rate, regularization strength, number of iterations, and optimizing the preprocessing steps of spectral data (such as smoothing, denoising, baseline correction, etc.).
[0092] S3: Testing and Evaluation
[0093] Test set preparation: Prepare an independent test set to evaluate the performance of the model;
[0094] Model evaluation: Use the test set to test the model, calculate the accuracy, recall, and F1 score indicators, and evaluate the model's ability to identify the nutritional quality characteristics of millet at different growth stages;
[0095] S4: Input the nutritional quality characteristics of millet into the millet maturity characteristic recognition and analysis module, and output the maturity type of millet.
[0096] In addition, the present invention also provides a millet maturity detection system based on near infrared spectroscopy, comprising:
[0097] A near infrared spectrum data acquisition module is used to obtain near infrared spectrum data of millet samples in a target area; the near infrared spectrum data includes absorbance or reflectance information at different wavelengths;
[0098] A characteristic spectral index optimization screening module is used to calculate the normalized spectral index and the optimized spectral index of the near-infrared spectral data, and screen out characteristic bands related to various nutrients in millet in each spectrum;
[0099] A millet nutritional quality index calculation module, used to calculate the millet nutritional quality index according to the characteristic band and the correlation model; the correlation model is used to describe the correlation between the known nutritional components and the spectral data;
[0100] A millet nutritional quality feature extraction module is used to extract features from the near infrared spectrum data using the millet nutritional quality index to obtain millet maturity-related feature parameters; the millet maturity-related feature parameters are the proportion or change trend of nutritional components;
[0101] The millet maturity feature recognition and analysis module is used to construct a maturity model according to the millet maturity-related feature parameters, and use the maturity model to detect the near-infrared spectrum data to be detected to determine the maturity of the millet to be detected.
[0102] The present invention also provides an electronic device, including a memory and a processor, wherein the memory is used to store a computer program, and the processor runs the computer program to enable the electronic device to execute the above-mentioned millet maturity detection method based on near-infrared spectroscopy.
[0103] The present invention also provides a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the above-mentioned millet maturity detection method based on near infrared spectroscopy.
[0104] Compared with the existing solutions, the present invention achieves the following beneficial effects: the present invention collects near-infrared spectral data in the target area, which contains absorbance or reflectance information at different wavelengths; these data are then sent to the characteristic spectral index optimization screening module for processing. By normalizing the spectral index and optimizing the spectral index to determine the selected band of the near-infrared spectrum corresponding to the optimal characteristic spectral index, the present invention can accurately select the most representative characteristic wavelength for the detection of millet nutritional quality; the millet nutritional quality index is further calculated based on the selected band of the near-infrared spectrum; based on the millet nutritional quality index, characteristic parameters related to millet maturity are further extracted, which not only cover the nutritional component information of millet, but also reflect the changes in maturity during its growth process; finally, the maturity spectral characteristics of millet are identified and analyzed to obtain identification results.
[0105] The present invention has significant advantages and demonstrates innovation in terms of technical accuracy, detection efficiency, sustainability, and other aspects. First, the optimized spectral index screening technology is used to effectively improve the accuracy of millet nutrient content and maturity detection; second, non-destructive near-infrared spectroscopy technology is used to achieve real-time and continuous monitoring, avoiding the damage to samples caused by traditional detection; modular system design ensures the efficiency and automation of the detection process, while the flexibility of the algorithm enables it to adapt to the needs of different crops; in addition, the technology is green and environmentally friendly, reduces dependence on chemical reagents, helps reduce costs and achieve sustainable agricultural development; finally, by integrating nutrient content analysis with maturity feature extraction, it provides a scientific basis for agricultural planting management and market evaluation, showing a wide range of application potential.
[0106] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0107] This article uses specific examples to illustrate the principles and implementation methods of the present invention. The above examples are only used to help understand the core idea of the present invention. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting the present invention.
Claims
1. A method for detecting millet maturity based on near infrared spectroscopy, characterized in that: include: Acquire near infrared spectrum data of millet samples in the target area; the near infrared spectrum data includes absorbance or reflectance information at different wavelengths; Calculating the normalized spectral index and the optimized spectral index of the near-infrared spectral data, and screening out characteristic bands related to various nutritional components of millet in each spectrum; Calculating the millet nutritional quality index according to the characteristic bands and the correlation model; the correlation model is used to describe the correlation between known nutritional components and spectral data; Using the millet nutritional quality index to perform feature extraction on the near infrared spectrum data, to obtain millet maturity-related feature parameters; The millet maturity-related characteristic parameter is the ratio or change trend of the nutritional components; A maturity model is constructed according to the millet maturity-related characteristic parameters, and the near-infrared spectrum data to be detected is detected using the maturity model to determine the maturity of the millet to be detected.
2. The millet maturity detection method based on near infrared spectroscopy according to claim 1, characterized in that: The calculation formulas of the normalized spectral index and the optimized spectral index are respectively: Among them, GYZ is the normalized spectral index, YHZ is the optimized spectral index, and λ i and λ i are any two wavelengths in the near-infrared band, P λi and P λj They are i and λ j The reflectivity corresponding to the wavelength, L is a system parameter, and its value is 0.
5.
3. The millet maturity detection method based on near infrared spectroscopy according to claim 1, characterized in that: The method of screening out characteristic bands related to various nutrients of millet in each spectrum specifically includes: Initialize particle swarm parameters: randomly set the initial position x of the particle n and initial flight speed v n , the value range of the target optimization parameter M is [0,1], the learning factors c1 and c2 are both 0.01, the initial population size is 10, the inertia weight w is 0.1, the maximum number of iterations T is 30, and x n and v n The calculation of is as follows: x n =(x n,1 ,x n,2 ...x n,d ) v n =(v n,1 ,v n,2 ...v n,d ) Among them, n represents the nth particle, and d represents the dimension of the space where the nth particle is located; Calculate the fitness value of each particle, and take the current position of the particle as the individual best position, recorded as pbest. By comparing the size of the fitness value of each particle, determine the best position of the population, and record the best position of the population as gbest. Update the particle's velocity and position according to the following formula: v n,d (t+1)=wv n,d +c1r1[p n,d -x n,d (t)]+c2r2[p g,d -x n,d (t)] x n,d (t+1)=x n,d (t)+v n,d (t+1) Among them, t is the number of iterations; w is the inertia weight, p n,d is the best historical position experienced by the nth particle, p g,d is the best position experienced by all particles in the group, r1 and r2 are random numbers between 0 and 1 that follow a uniform distribution; Determine the termination condition: recalculate the fitness value of each particle according to the updated position and speed of the particle, and continue to iterate and optimize. n (t)≥pbest, then pbest=x n (t); if x n (t)≥gbest, then gbest=x n (t); continuously update pbest and gbest until the maximum number of iterations T is reached, the optimization is completed, and the optimal solution is output; the optimal solution is the value of the target optimization parameter M; Based on the target optimization parameter M, the optimal band combination is determined, the sum of the normalized spectral index and the optimized spectral index is calculated, and the Euclidean distance between the sum and the parameter M is calculated. The selected band of the near-infrared spectrum is obtained according to the Euclidean distance and a preset ratio; the selected band of the near-infrared spectrum is a characteristic band related to each nutritional component of millet.
4. The millet maturity detection method based on near infrared spectroscopy according to claim 1, characterized in that: The millet nutritional quality index is calculated according to the characteristic bands and the correlation model, specifically including: Obtain the characteristic wavelength reflectance increasing relationship diagram of the preset nutritional quality, and add the selected band to the characteristic wavelength reflectance increasing relationship diagram. Select three characteristic vectors R1, R2, and R3 for the selected band. The wavelengths corresponding to each vector are λ1, λ2, and λ3 respectively. Calculate the nutritional quality index DCI according to the following formula: Among them, the ratios of the reflectivity differences of the three eigenvectors in the axial projection direction are equal.
5. The millet maturity detection method based on near infrared spectroscopy according to claim 1, characterized in that: The millet nutritional quality index is used to extract features from the near infrared spectrum data to obtain millet maturity-related feature parameters, which specifically include: Divide the collected near-infrared spectral data into multiple band intervals, evaluate the fluctuation of the spectral data according to the millet nutritional quality index, and if the millet nutritional quality index of a certain band interval exceeds a preset threshold, it is regarded as a key band and marked as an area to be extracted with millet maturity characteristics; For the area to be extracted, the third-order central moment feature extraction method is used to extract features and obtain the maturity shape features: Among them, S m is the maturity shape feature, m represents the number of bands in the near infrared data, and I α,β It represents the spectral intensity value of the αth band at the βth data point, N represents the number of data points, μ α Represents the mean intensity of the αth band.
6. A millet maturity detection system based on near infrared spectroscopy, characterized in that: include: A near infrared spectrum data acquisition module is used to obtain near infrared spectrum data of millet samples in a target area; the near infrared spectrum data includes absorbance or reflectance information at different wavelengths; A characteristic spectral index optimization screening module is used to calculate the normalized spectral index and the optimized spectral index of the near-infrared spectral data, and screen out characteristic bands related to various nutrients in millet in each spectrum; A millet nutritional quality index calculation module, used to calculate the millet nutritional quality index according to the characteristic band and the correlation model; the correlation model is used to describe the correlation between the known nutritional components and the spectral data; A millet nutritional quality feature extraction module is used to extract features from the near infrared spectrum data using the millet nutritional quality index to obtain millet maturity-related feature parameters; the millet maturity-related feature parameters are the proportion or change trend of nutritional components; The millet maturity feature recognition and analysis module is used to construct a maturity model according to the millet maturity-related feature parameters, and use the maturity model to detect the near-infrared spectrum data to be detected to determine the maturity of the millet to be detected.
7. An electronic device, characterized in that: It comprises a memory and a processor, the memory is used to store a computer program, and the processor runs the computer program to enable the electronic device to execute the millet maturity detection method based on near infrared spectroscopy according to any one of claims 1-5.
8. A computer-readable storage medium, characterized in that: The device stores a computer program, which, when executed by a processor, implements the millet maturity detection method based on near infrared spectroscopy as described in any one of claims 1 to 5.
Citation Information
Cited By
Construction method and device of turbidity test system based on photoelectric detector
CN120385654A
Near infrared spectrum analysis method and device based on characteristic spectrum region recombination data enhancement
CN121049202A