Cereal food component rapid detection method and system based on spectral imaging technology

By applying spectral imaging technology and stoichiometric processing in cereal food detection, feature wavelengths are extracted and quantitative analysis is carried out, the problems of low efficiency and poor accuracy of traditional detection methods are solved, fast and accurate detection results are achieved, and food safety guarantees are improved.

CN119643466AActive Publication Date: 2025-03-18GUANGDONG JUGULAI HEALTH FOOD CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411854903.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-16
Publication Date
2025-03-18
Estimated Expiration
2044-12-16

AI Technical Summary

Technical Problem

Traditional cereal food testing methods are inefficient and have poor accuracy, and cannot meet the needs of fast and accurate testing.

Method used

The rapid detection method based on spectral imaging technology is adopted, and the detection spectral data of the sample is obtained through hyperspectral imaging technology, and the characteristic wavelengths are extracted in combination with stoichiometric processing, and quantitative models are used to perform component analysis to generate detection reports and food safety recommendations.

Benefits of technology

It improves the accuracy and efficiency of testing, reduces costs, enhances food safety guarantees, and reduces manual operations, making testing faster and more reliable.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119643466A_ABST
    Figure CN119643466A_ABST
Patent Text Reader

Abstract

The invention relates to a rapid detection method for cereal food components based on a spectral imaging technology. The method comprises the following steps: obtaining a cereal food model, matching a component table in a product library, and generating a prediction spectrum as a detection reference; scanning the sample by using a hyperspectral imaging technology to obtain detection spectral data; extracting a characteristic wavelength through chemometrics, and carrying out quantitative analysis to generate a chemical component detection result; comparing the detection result with the component table to generate initial deviation data; comparing the detection spectrum with the prediction spectrum to generate spectrum difference data, and correcting component deviation; and finally, generating corrected component deviation data, and outputting a food component detection report and a food safety suggestion. According to the scheme, the components of the cereal food can be rapidly and accurately detected, and the safety of the cereal food is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of food detection, and in particular to a method and system for rapid detection of cereal food ingredients based on spectral imaging technology. Background Art

[0002] Traditional methods for testing cereal foods mainly rely on manual sensory evaluation, Kjeldahl nitrogen determination, drying, spectrophotometry, DNA molecular labeling, protein electrophoresis, etc. These methods have many limitations, such as large workload, strong subjectivity, low efficiency, cumbersome operation, poor timeliness, high cost, and harm to human health. For example, manual testing methods have been gradually eliminated because they rely on manual sensory evaluation and have large errors. In addition, although near-infrared spectroscopy (NIRS) is widely used, the complex spectral bands can easily lead to errors in data collation, affecting the final results.

[0003] With respect to the above-mentioned prior art, the following technical problems exist: the traditional method has low efficiency and poor accuracy and cannot meet the requirements of rapid and accurate detection, and therefore needs to be improved. Summary of the invention

[0004] In order to improve the efficiency of detecting the ingredients of cereal foods, the present application provides a method and system for rapid detection of the ingredients of cereal foods based on spectral imaging technology.

[0005] In the first aspect, the above-mentioned invention objective of the present application is achieved through the following technical solutions:

[0006] A method for rapid detection of cereal food ingredients based on spectral imaging technology, the method comprising the steps of:

[0007] Obtain the model of the cereal food to be tested and input it into the pre-set product library to match the corresponding production ingredient table;

[0008] Generate a corresponding ingredient table prediction spectrum according to the production ingredient table, wherein the ingredient table prediction spectrum is used as a detection reference;

[0009] Use hyperspectral imaging technology to scan samples of cereal foods to obtain detection spectrum data of the samples;

[0010] Processing the detected spectral data by chemometrics to extract characteristic wavelengths related to cereal food ingredients;

[0011] Analyze the characteristic wavelengths according to a preset quantitative model to quantitatively analyze the chemical components in the cereal food, thereby generating chemical component detection results according to the quantitative analysis results;

[0012] Comparing the chemical composition test results with the production composition table to generate initial composition deviation data;

[0013] Comparing the detected spectrum data with the spectrum predicted by the composition table to generate spectrum difference data, and generating corresponding composition difference correction data based on the spectrum difference data, wherein the spectrum difference data is used to analyze actual composition differences;

[0014] comparing the composition difference correction data with the initial composition deviation data to generate corrected composition deviation data;

[0015] A food ingredient detection report is generated based on the corrected ingredient deviation data, and a food safety recommendation is generated based on the food ingredient detection report.

[0016] By adopting the above technical scheme, using hyperspectral imaging technology combined with chemometric processing, this method can accurately extract characteristic wavelengths related to cereal food ingredients and use quantitative models to perform accurate ingredient analysis. This method not only improves the accuracy and efficiency of detection, reduces costs, but also enhances food safety assurance. The automated detection process reduces manual operations, making the detection process faster and more reliable. In addition, this scheme includes ingredient difference correction data and corrected ingredient deviation data to further correct the test results, making the test results of this scheme more realistic and accurate, and easier to discover ingredient differences and make adjustments. At the same time, the data-driven test reports and food safety recommendations generated by this scheme provide producers with scientific decision-making support based on actual data, further improving food safety.

[0017] In a preferred example, the present application can be further configured as follows: in the step of scanning the sample of the grain food for detection using the hyperspectral imaging technology to obtain the detection spectrum data of the sample, the steps are as follows:

[0018] Acquire image data of different dimensions of the sample, and preprocess the image data to obtain processed image data;

[0019] constructing a three-dimensional model of the sample based on the pre-processed processed image data;

[0020] The preset partition model partitions the three-dimensional model through a region of interest extraction algorithm to determine the detection partition of the sample;

[0021] The different detection partitions are spectrally scanned by using a hyperspectral imaging technique to obtain detection spectrum data of each partition.

[0022] By adopting the above technical scheme, this scheme realizes accurate zoning detection of cereal food samples. This method not only improves the accuracy and efficiency of detection, reduces costs, but also enhances food safety assurance. Compared with traditional detection methods, this scheme can provide more detailed internal information of the sample. Through the construction of three-dimensional models and extraction of regions of interest, different parts of the sample can be located more accurately, so as to perform targeted spectral analysis. This method reduces manual operations and makes the detection process faster and more reliable. In addition, the zoning detection of this scheme can more accurately discover the differences in ingredients and make adjustments.

[0023] In a preferred example, the present application may be further configured as follows: after the step of performing spectral scanning on different detection partitions to obtain detection spectral data of each partition by using the hyperspectral imaging technology, the following steps are included:

[0024] Determine the detection weight ratio of the i-th detection area based on the area size and area importance of the detection partition;

[0025] The overall detection result is calculated by the overall detection calculation formula and the detection spectrum data of each partition, where the overall detection calculation formula is:

[0026] Specifically, T j is the detection result of the jth component, area u Represents the detection result of the jth component corresponding to the i-th region, and the weight u Represents the weight ratio of the ith region.

[0027] By adopting the above technical solution, this formula can calculate the whole according to the partition detection results to improve the accuracy of detection.

[0028] In a preferred example, the present application may be further configured as follows: after acquiring image data of different dimensions of the sample and preprocessing the image data to obtain processed image data, the following steps are included:

[0029] Acquire image data of different dimensions, wherein the image data includes image clarity, image abnormal point data, and image noise detection data;

[0030] Acquire preprocessing history data corresponding to the image data, wherein the preprocessing history data includes luminance compensation data and pixel compensation data;

[0031] The preset image compensation analysis model analyzes the image data and preprocessed historical data based on a machine self-learning algorithm to generate an image credibility weight;

[0032] The preset regional credibility analysis model performs analysis based on the detection partitions and the corresponding image credibility weights to generate regional confidences, and the regional confidences are used to represent the confidence level of each regional detection result based on the image analysis result.

[0033] By adopting the above technical solution, combined with hyperspectral imaging technology and machine self-learning algorithm, accurate zoning detection of cereal food samples and in-depth analysis of image data are achieved. This method not only improves the accuracy and efficiency of detection, reduces costs, but also enhances food safety assurance. Compared with traditional detection methods, this solution can provide more detailed internal information of the sample. Through the construction of three-dimensional models and extraction of regions of interest, different parts of the sample can be more accurately located, thereby performing targeted spectral analysis. This method reduces manual operations and makes the detection process faster and more reliable.

[0034] In a preferred example, the present application can be further configured as follows: after the step of analyzing the detection partition and the corresponding image credibility weight based on the preset regional credibility analysis model to generate the regional credibility weight, the overall detection calculation formula is: The confidence i Indicates the confidence level of the detection result of the i-th region.

[0035] By adopting the above technical solution, a "confidence" value is assigned to each area, which reflects the reliability of the detection result of the area. Then, this value is multiplied by the detection result and weight of the area to obtain a weighted detection result. Finally, the weighted detection results of all areas are added together and divided by the sum of the products of the weights and confidence of all areas to obtain the overall detection result, thereby improving the accuracy of the detection result.

[0036] In a preferred example, the present application may be further configured as follows: after the step of comparing the component difference correction data with the initial component deviation data to generate the corrected component deviation data, the following steps are included:

[0037] Associating the historical correction component deviation data with the corresponding historical image data based on the detection batch to construct a deviation-image data set;

[0038] The preset deviation analysis model analyzes the deviation-image data set based on a machine self-learning algorithm to generate an image influence factor, wherein the image influence factor is used to predict the detection component deviation corresponding to different image data;

[0039] The preset deviation prediction model analyzes the detected image data and the image influencing factors based on a machine self-learning algorithm to generate predicted component deviation data, and the predicted component deviation data is used to compensate for the initial component deviation data.

[0040] By adopting the above technical solution, through combining hyperspectral imaging technology and machine self-learning algorithm, accurate prediction and compensation of ingredient deviations of cereal food samples can be achieved. This method not only improves the accuracy and efficiency of detection, reduces costs, but also enhances food safety assurance.

[0041] In a preferred example, the present application can be further configured as follows: the preset quantitative model includes a continuous projection algorithm and a multi-weight optimized soft shrinkage algorithm.

[0042] In the second aspect, the above invention objective of the present application is achieved through the following technical solutions:

[0043] A method and device for rapid detection of cereal food ingredients based on spectral imaging technology, the device comprising: a production ingredient table matching unit, for obtaining the model of the cereal food to be detected, and inputting it into a pre-set product library to match the corresponding production ingredient table;

[0044] A component table prediction spectrum generating unit, used for generating a corresponding component table prediction spectrum according to the production component table, wherein the component table prediction spectrum is used as a detection reference;

[0045] A detection spectrum data acquisition unit is used to scan the sample of the detected cereal food using the hyperspectral imaging technology to acquire the detection spectrum data of the sample;

[0046] A characteristic wavelength extraction unit, used for processing the detection spectrum data by chemometrics to extract characteristic wavelengths related to cereal food ingredients;

[0047] A chemical component detection result generating unit is used to pre-set a quantitative model to analyze the characteristic wavelengths to perform quantitative analysis on the chemical components in the cereal food, thereby generating a chemical component detection result according to the quantitative analysis result;

[0048] an initial component deviation data generating unit, configured to compare the chemical component detection result with the production component table to generate initial component deviation data;

[0049] an actual component difference analysis unit, used for comparing the detected spectrum data with the spectrum predicted by the component table to generate spectrum difference data, and generating corresponding component difference correction data based on the spectrum difference data, wherein the spectrum difference data is used for analyzing actual component differences;

[0050] a corrected component deviation data generating unit, configured to compare the component difference correction data with the initial component deviation data to generate corrected component deviation data;

[0051] A food ingredient detection report generating unit is used to generate a food ingredient detection report based on the corrected ingredient deviation data, and to generate food safety recommendations based on the food ingredient detection report.

[0052] On the third aspect, the above-mentioned purpose of the present application is achieved through the following technical solutions:

[0053] An electronic device comprises a memory, a processor and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the above-mentioned method for rapid detection of cereal food ingredients based on spectral imaging technology are implemented.

[0054] Fourthly, the above-mentioned purpose of the present application is achieved through the following technical solutions:

[0055] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the above-mentioned method for rapid detection of cereal food ingredients based on spectral imaging technology.

[0056] In summary, the present application includes at least one of the following beneficial technical effects:

[0057] 1. By combining hyperspectral imaging technology with chemometric processing, this method can accurately extract characteristic wavelengths related to cereal food ingredients and use quantitative models to perform accurate ingredient analysis. This method not only improves the accuracy and efficiency of detection, reduces costs, but also enhances food safety assurance. The automated detection process reduces manual operations, making the detection process faster and more reliable. In addition, this solution includes ingredient difference correction data and ingredient deviation correction data to further correct the test results, making the test results of this solution more in line with reality and easier to find ingredient differences and make adjustments. At the same time, the data-driven test reports and food safety recommendations generated by this solution provide producers with scientific decision-making support based on actual data, further improving food safety.

[0058] 2. This scheme realizes accurate partition detection of cereal food samples. This method not only improves the accuracy and efficiency of detection, reduces costs, but also enhances food safety. Compared with traditional detection methods, this scheme can provide more detailed internal information of samples. Through the construction of three-dimensional models and extraction of regions of interest, different parts of the samples can be more accurately located, so as to conduct targeted spectral analysis. This method reduces manual operations and makes the detection process faster and more reliable. In addition, the partition detection of this scheme can more accurately discover the differences in ingredients and make adjustments;

[0059] 3. According to the three-dimensional model of the wheat flour sample, different detection areas are divided, such as the central area, the edge area, etc. Then, the regional credibility analysis model is applied, combined with the image credibility weight of each area, to calculate the confidence of each area. This confidence will be used to evaluate the reliability of the detection results of each area. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] Figure 1 This is a flow chart of a method for rapid detection of cereal food ingredients based on spectral imaging technology in an embodiment of the present application;

[0061] Figure 2 This is a principle block diagram of a device for rapid detection of cereal food ingredients based on spectral imaging technology in one embodiment of the present application;

[0062] Figure 3 It is a schematic diagram of an electronic device in an embodiment of the present application.

[0063] Figure Number:

[0064] 1. Production ingredient table matching unit; 2. Ingredient table prediction spectrum generation unit; 3. Detection spectrum data acquisition unit; 4. Characteristic wavelength extraction unit; 5. Chemical component detection result generation unit; 6. Initial component deviation data generation unit; 7. Actual component difference analysis unit; 8. Corrected component deviation data generation unit; 9. Food component detection report generation unit. DETAILED DESCRIPTION

[0065] The present application is further described in detail below in conjunction with the accompanying drawings.

[0066] In one embodiment, if Figure 1 As shown, the present application discloses a method for rapid detection of cereal food ingredients based on spectral imaging technology, which specifically includes the following steps:

[0067] S10: Obtain the model of the cereal food to be tested, and input it into a pre-set product library to match the corresponding production ingredient table;

[0068] S20: generating a corresponding ingredient table prediction spectrum according to the production ingredient table, wherein the ingredient table prediction spectrum is used as a detection reference;

[0069] S30: Scan the sample of the grain food to be tested by using the hyperspectral imaging technology to obtain the test spectrum data of the sample;

[0070] S40: Processing the detected spectrum data by chemometrics to extract characteristic wavelengths related to cereal food ingredients;

[0071] S50: Analyzing the characteristic wavelength according to a preset quantitative model to quantitatively analyze the chemical components in the cereal food, thereby generating a chemical component detection result according to the quantitative analysis result;

[0072] S60: Compare the chemical composition test result with the production composition table to generate initial composition deviation data;

[0073] S70: Compare the detected spectrum data with the spectrum predicted by the component table to generate spectrum difference data, and generate corresponding component difference correction data based on the spectrum difference data;

[0074] Wherein, the spectral difference data is used to analyze the actual composition difference;

[0075] S80: comparing the component difference correction data with the initial component deviation data to generate corrected component deviation data;

[0076] S90: Generate a food ingredient detection report based on the corrected ingredient deviation data, and generate food safety recommendations based on the food ingredient detection report.

[0077] Specifically, with respect to steps S10-S90, in the embodiment of the present application:

[0078] Step S10: The inspector inputs the model number of wheat flour "WF-2024" into the product library, and the system automatically matches the production ingredient table corresponding to the model number, showing that the main components of wheat flour are protein, carbohydrates and fat.

[0079] Step S20: The system generates a predicted spectrum of the ingredient list based on the production ingredient list of "WF-2024" and using the standard spectral data of proteins, carbohydrates and fats in the database through a chemometric method.

[0080] Step S30: Scan the wheat flour sample using a hyperspectral imager to obtain detection spectrum data of the sample. During the scanning process, the hyperspectral imager collects data within a wavelength range of 400-1000 nm.

[0081] Step S40: Through chemometric processing, in the embodiment of the present application, chemometrics includes partial least squares regression (PLSR) and successive projection algorithm (SPA), to extract characteristic wavelengths related to proteins, carbohydrates and fats from the detected spectral data.

[0082] Step S50: Using a preset quantitative model, in the embodiment of the present application, the preset quantitative model includes a continuous projection algorithm, a multi-weight optimized soft shrinkage algorithm and a support vector machine (SVM) model to analyze the extracted characteristic wavelengths, quantitatively analyze the chemical components in the wheat flour, and generate chemical component detection results.

[0083] Step S60: Compare the chemical composition test results with the production composition table to generate initial composition deviation data, such as a protein content deviation of 2% and a carbohydrate deviation of 1.5%.

[0084] Step S70: Compare the detected spectrum data with the spectrum predicted by the ingredient table to generate spectrum difference data, and generate ingredient difference correction data based on the data to correct the deviation of protein and carbohydrates.

[0085] Step S80: Compare the component difference correction data with the initial component deviation data to generate corrected component deviation data. The final protein content correction deviation is 1.8%, and the carbohydrate correction deviation is 1.2%.

[0086] Step S90: Generate a food ingredient test report based on the corrected ingredient deviation data, which shows that the protein and carbohydrate contents of the wheat flour are within acceptable ranges. Generate food safety recommendations based on the test report, suggesting that the proportion of wheat flour used in making bread be adjusted to optimize the taste.

[0087] In summary, compared with the existing technology, this scheme adopts hyperspectral imaging technology combined with chemometric processing. This method can accurately extract characteristic wavelengths related to cereal food ingredients and use quantitative models for accurate ingredient analysis. This method not only improves the accuracy and efficiency of detection, reduces costs, but also enhances food safety. The automated detection process reduces manual operations, making the detection process faster and more reliable. In addition, this scheme includes ingredient difference correction data and corrected ingredient deviation data, which further corrects the test results, making the test results of this scheme more in line with reality, easier to find ingredient differences, and make adjustments. At the same time, the data-driven test reports and food safety recommendations generated by this scheme provide producers with scientific decision-making support based on actual data, further improving food safety.

[0088] In the step of S30: scanning the sample of the cereal food to be tested using the hyperspectral imaging technology to obtain the test spectrum data of the sample, the following steps are included:

[0089] S31: Acquire image data of different dimensions of the sample, and preprocess the image data to obtain processed image data;

[0090] Specifically, in the embodiment of the present application, a hyperspectral imaging system is used to scan wheat samples to obtain image data at different wavelengths. Image processing software, such as OpenCV, is used to perform preprocessing operations such as denoising and contrast enhancement on the original image to improve the accuracy of subsequent analysis.

[0091] S32: constructing a three-dimensional model of the sample based on the pre-processed image data;

[0092] Specifically, the preprocessed image data is used to construct a three-dimensional model of the wheat sample through three-dimensional reconstruction technology, such as structured light scanning or stereo vision. This three-dimensional model can provide geometric and spectral information of the sample, providing a basis for subsequent partition detection.

[0093] S33: partitioning the three-dimensional model using a region of interest extraction algorithm using a preset partitioning model to determine a detection partition of the sample;

[0094] Specifically, a region of interest (RoI) extraction algorithm, such as RoI Align, is applied to partition the 3D model. The algorithm divides the model into multiple regions, each of which corresponds to a specific feature or potential abnormal area of ​​the sample. For example, different grain parts in a wheat sample, such as the germ, endosperm, etc., can be identified.

[0095] S34: performing spectral scanning on the different detection partitions by using a hyperspectral imaging technology to obtain detection spectral data of each partition;

[0096] Specifically, each partition is scanned with hyperspectral imaging to obtain detailed spectral data. For example, for wheat samples, the spectral characteristics of components such as protein, moisture, and starch in different regions can be obtained, and these data will be used for subsequent chemical composition analysis.

[0097] In summary, this scheme realizes accurate zoning detection of cereal food samples. This method not only improves the accuracy and efficiency of detection, reduces costs, but also enhances food safety. Compared with traditional detection methods, this scheme can provide more detailed internal information of the sample. Through the construction of three-dimensional models and extraction of regions of interest, different parts of the sample can be located more accurately, so as to perform targeted spectral analysis. This method reduces manual operations and makes the detection process faster and more reliable. In addition, the zoning detection of this scheme can more accurately detect differences in ingredients and make adjustments.

[0098] After the step of performing spectral scanning on different detection partitions by using a hyperspectral imaging technology to obtain detection spectral data of each partition, the following steps are included:

[0099] Determine the detection weight ratio of the i-th detection area based on the area size and area importance of the detection partition;

[0100] The overall detection result is calculated by the overall detection calculation formula and the detection spectrum data of each partition, where the overall detection calculation formula is:

[0101] Specifically, Tj is the detection result of the jth component, area i Represents the detection result of the jth component corresponding to the i-th region, and the weight i The formula represents the weight proportion of the i-th region. This formula calculates the overall detection result by multiplying the detection result of each region by its corresponding weight, then summing it, and finally dividing it by the sum of all weights. This ensures that the detection result of each region contributes to the overall result, and the size of the contribution is determined by its weight.

[0102] For example, taking T1 as moisture, suppose we have three regions with test results of 80%, 85%, and 90%, and their weights are 2, 3, and 1, respectively. Then the overall test result is calculated as follows:

[0103] T1={(80%×2)+(85%×3)+(90%×1)} / (2+3+1)=(160%+255%+90%) / 6=505% / 6=84.17%,

[0104] Therefore, the overall detection result T1 corresponding to the moisture content is 84.17%.

[0105] This formula can be used to calculate the whole according to the partition detection results to improve the accuracy of the detection.

[0106] After the step of S31: acquiring image data of different dimensions of the sample and preprocessing the image data to obtain processed image data, the following steps are included:

[0107] S311: Acquire image data of different dimensions, wherein the image data includes image clarity, image abnormal point data, and image noise detection data;

[0108] Specifically, a hyperspectral imaging system is used to scan wheat flour samples to obtain image data at different wavelengths. These data include image clarity information, which is used to identify the particle size and distribution in wheat flour; image anomaly data, which is used to identify possible foreign matter or impurities; and image noise detection data, which is used for subsequent noise filtering.

[0109] S312: Acquire preprocessing history data corresponding to the image data, wherein the preprocessing history data includes luminance compensation data and pixel compensation data;

[0110] Specifically, based on the previous wheat flour sample detection data, the luminance compensation data and pixel compensation data are collected, which are used to correct the image deviation caused by uneven illumination or sensor characteristics.

[0111] S313: The preset image compensation analysis model analyzes the image data and the pre-processed historical data based on a machine self-learning algorithm to generate an image credibility weight;

[0112] Specifically, a machine learning algorithm, such as a random forest or a neural network, is used to train the model to identify key features in the image and assign a credibility weight to each feature, which reflects the degree of influence of the feature on the final analysis result, combined with image data and preprocessed historical data.

[0113] S313: a preset regional credibility analysis model performs analysis based on the detection partition and the corresponding image credibility weight to generate a regional confidence, wherein the regional confidence is used to represent the confidence level of each regional detection result based on the image analysis result;

[0114] Specifically, according to the three-dimensional model of the wheat flour sample, different detection areas are divided, such as the central area, edge area, etc. Then, the regional credibility analysis model is applied, combined with the image credibility weight of each area, to calculate the confidence of each area. This confidence will be used to evaluate the reliability of the detection results of each area.

[0115] In summary, by combining hyperspectral imaging technology and machine self-learning algorithms, accurate zoning detection of cereal food samples and in-depth analysis of image data are achieved. This method not only improves the accuracy and efficiency of detection, reduces costs, but also enhances food safety assurance. Compared with traditional detection methods, this scheme can provide more detailed internal information of the sample. Through the construction of a three-dimensional model and the extraction of regions of interest, different parts of the sample can be more accurately located, thereby performing targeted spectral analysis. This method reduces manual operations and makes the detection process faster and more reliable.

[0116] Further, after the preset regional credibility analysis model performs analysis based on the detection partition and the corresponding image credibility weight to generate the regional credibility weight, the overall detection calculation formula is: The confidence i Indicates the confidence level of the detection result of the i-th region.

[0117] By adopting the above technical solution, a "confidence" value is assigned to each area, which reflects the reliability of the detection result of the area. Then, this value is multiplied by the detection result and weight of the area to obtain a weighted detection result. Finally, the weighted detection results of all areas are added together and divided by the sum of the products of the weights and confidence of all areas to obtain the overall detection result, thereby improving the accuracy of the detection result.

[0118] After the step S80 of comparing the component difference correction data with the initial component deviation data to generate the modified component deviation data, the following steps are included:

[0119] S81: associating the historical correction component deviation data with the corresponding historical image data based on the detection batch to construct a deviation-image data set;

[0120] Specifically, the corrected component deviation data of all wheat flour test batches in the past year are collected, including the deviation values ​​of protein, moisture, and starch content. At the same time, the image data of the corresponding batches are collected, such as the particle size distribution and color intensity of wheat flour. These data are associated to construct a deviation-image dataset for subsequent analysis.

[0121] S82: The preset deviation analysis model analyzes the deviation-image data set based on a machine self-learning algorithm to generate an image influence factor, where the image influence factor is used to predict the detection component deviation corresponding to different image data;

[0122] Using machine learning algorithms, such as random forests or neural networks, the deviation-image dataset is trained to identify the relationship between image features and component deviation. The model will output a set of image influencing factors that can predict how image features affect component detection results. For example, the uniformity of particle size distribution may be correlated with the deviation of protein content.

[0123] S83: the preset deviation prediction model analyzes the detected image data and the image influencing factors based on a machine self-learning algorithm to generate predicted component deviation data, wherein the predicted component deviation data is used to compensate the initial component deviation data;

[0124] Specifically, in the detection of a new wheat flour sample, the image data of the sample is first obtained, and then the image influencing factors trained in step S82 are used to predict the component deviation of the new sample through the deviation prediction model. This prediction result will be used to adjust the initial component deviation data to improve the accuracy of the detection.

[0125] In summary, by combining hyperspectral imaging technology and machine self-learning algorithm, accurate prediction and compensation of ingredient deviations of cereal food samples can be achieved. This method not only improves the accuracy and efficiency of detection, reduces costs, but also enhances food safety assurance.

[0126] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0127] In one embodiment, a method and device for rapid detection of cereal food ingredients based on spectral imaging technology is provided, and the method and device for rapid detection of cereal food ingredients based on spectral imaging technology corresponds one to one with the method for rapid detection of cereal food ingredients based on spectral imaging technology in the above embodiment. Figure 2 As shown, the method and device for rapid detection of cereal food ingredients based on spectral imaging technology includes a production ingredient table matching unit, which is used to obtain the model of the cereal food to be detected and input it into a pre-set product library to match the corresponding production ingredient table;

[0128] A component table prediction spectrum generating unit, used for generating a corresponding component table prediction spectrum according to the production component table, wherein the component table prediction spectrum is used as a detection reference;

[0129] A detection spectrum data acquisition unit is used to scan the sample of the detected cereal food using the hyperspectral imaging technology to acquire the detection spectrum data of the sample;

[0130] A characteristic wavelength extraction unit, used for processing the detection spectrum data by chemometrics to extract characteristic wavelengths related to cereal food ingredients;

[0131] A chemical component detection result generating unit is used to pre-set a quantitative model to analyze the characteristic wavelengths to perform quantitative analysis on the chemical components in the cereal food, thereby generating a chemical component detection result according to the quantitative analysis result;

[0132] an initial component deviation data generating unit, configured to compare the chemical component detection result with the production component table to generate initial component deviation data;

[0133] an actual component difference analysis unit, used for comparing the detected spectrum data with the spectrum predicted by the component table to generate spectrum difference data, and generating corresponding component difference correction data based on the spectrum difference data, wherein the spectrum difference data is used for analyzing actual component differences;

[0134] a corrected component deviation data generating unit, configured to compare the component difference correction data with the initial component deviation data to generate corrected component deviation data;

[0135] A food ingredient detection report generating unit is used to generate a food ingredient detection report based on the corrected ingredient deviation data, and to generate food safety recommendations based on the food ingredient detection report.

[0136] For the specific definition of the device for rapid detection of cereal food ingredients based on spectral imaging technology, please refer to the definition of the method for rapid detection of cereal food ingredients based on spectral imaging technology mentioned above, which will not be repeated here. Each module in the above-mentioned device for rapid detection of cereal food ingredients based on spectral imaging technology can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the electronic device in the form of hardware, or can be stored in the memory in the electronic device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0137] In one embodiment, an electronic device is provided. The electronic device may be a server, and its internal structure diagram may be as follows: Figure 3 As shown. The electronic device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the electronic device is used to store a database. The network interface of the electronic device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for rapid detection of cereal food ingredients based on spectral imaging technology is implemented.

[0138] In one embodiment, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program:

[0139] Obtain the model of the cereal food to be tested and input it into the pre-set product library to match the corresponding production ingredient table;

[0140] Generate a corresponding ingredient table prediction spectrum according to the production ingredient table, wherein the ingredient table prediction spectrum is used as a detection reference;

[0141] Use hyperspectral imaging technology to scan samples of cereal foods to obtain detection spectrum data of the samples;

[0142] Processing the detected spectral data by chemometrics to extract characteristic wavelengths related to cereal food ingredients;

[0143] Analyze the characteristic wavelengths according to a preset quantitative model to quantitatively analyze the chemical components in the cereal food, thereby generating chemical component detection results according to the quantitative analysis results;

[0144] Comparing the chemical composition test results with the production composition table to generate initial composition deviation data;

[0145] Comparing the detected spectrum data with the spectrum predicted by the composition table to generate spectrum difference data, and generating corresponding composition difference correction data based on the spectrum difference data, wherein the spectrum difference data is used to analyze actual composition differences;

[0146] comparing the composition difference correction data with the initial composition deviation data to generate corrected composition deviation data;

[0147] A food ingredient detection report is generated based on the corrected ingredient deviation data, and a food safety recommendation is generated based on the food ingredient detection report.

[0148] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0149] Obtain the model of the cereal food to be tested and input it into the pre-set product library to match the corresponding production ingredient table;

[0150] Generate a corresponding ingredient table prediction spectrum according to the production ingredient table, wherein the ingredient table prediction spectrum is used as a detection reference;

[0151] Use hyperspectral imaging technology to scan samples of cereal foods to obtain detection spectrum data of the samples;

[0152] Processing the detected spectral data by chemometrics to extract characteristic wavelengths related to cereal food ingredients;

[0153] Analyze the characteristic wavelengths according to a preset quantitative model to quantitatively analyze the chemical components in the cereal food, thereby generating chemical component detection results according to the quantitative analysis results;

[0154] Comparing the chemical composition test results with the production composition table to generate initial composition deviation data;

[0155] Comparing the detected spectrum data with the spectrum predicted by the composition table to generate spectrum difference data, and generating corresponding composition difference correction data based on the spectrum difference data, wherein the spectrum difference data is used to analyze actual composition differences;

[0156] comparing the composition difference correction data with the initial composition deviation data to generate corrected composition deviation data;

[0157] A food ingredient detection report is generated based on the corrected ingredient deviation data, and a food safety recommendation is generated based on the food ingredient detection report.

[0158] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0159] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0160] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A method for rapid detection of cereal food ingredients based on spectral imaging technology, characterized in that: The ... method comprises the steps of: obtaining the model of the cereal food to be tested and inputting it into a pre-set product library to match the corresponding production ingredient table; Generate a corresponding ingredient table prediction spectrum according to the production ingredient table, wherein the ingredient table prediction spectrum is used as a detection reference; Use hyperspectral imaging technology to scan samples of cereal foods to obtain detection spectrum data of the samples; Processing the detected spectral data by chemometrics to extract characteristic wavelengths related to cereal food ingredients; Analyze the characteristic wavelengths according to a preset quantitative model to quantitatively analyze the chemical components in the cereal food, thereby generating chemical component detection results according to the quantitative analysis results; Comparing the chemical composition test results with the production composition table to generate initial composition deviation data; Comparing the detected spectrum data with the spectrum predicted by the composition table to generate spectrum difference data, and generating corresponding composition difference correction data based on the spectrum difference data, wherein the spectrum difference data is used to analyze actual composition differences; comparing the composition difference correction data with the initial composition deviation data to generate corrected composition deviation data; A food ingredient detection report is generated based on the corrected ingredient deviation data, and a food safety recommendation is generated based on the food ingredient detection report.

2. The method for rapid detection of cereal food ingredients based on spectral imaging technology according to claim 1, characterized in that: In the step of scanning the sample of the grain food for testing using the hyperspectral imaging technology to obtain the detection spectrum data of the sample, the steps include: Acquire image data of different dimensions of the sample, and preprocess the image data to obtain processed image data; constructing a three-dimensional model of the sample based on the pre-processed processed image data; The preset partition model partitions the three-dimensional model through a region of interest extraction algorithm to determine the detection partition of the sample; The different detection partitions are spectrally scanned by using a hyperspectral imaging technique to obtain detection spectrum data of each partition.

3. The method for rapid detection of cereal food ingredients based on spectral imaging technology according to claim 2, characterized in that: After the step of performing spectral scanning on the different detection partitions to obtain detection spectral data of each partition by using the hyperspectral imaging technology, the following steps are included: Determine the detection weight ratio of the i-th detection area based on the area size and area importance of the detection partition; The overall detection result is calculated by the overall detection calculation formula and the detection spectrum data of each partition, where the overall detection calculation formula is: Specifically, T j is the detection result of the jth component, area u Represents the detection result of the jth component corresponding to the i-th region, and the weight u Represents the weight ratio of the ith region.

4. The method for rapid detection of cereal food ingredients based on spectral imaging technology according to claim 3, characterized in that: After obtaining image data of different dimensions of the sample and preprocessing the image data to obtain processed image data, the following steps are included: Acquire image data of different dimensions, wherein the image data includes image clarity, image abnormal point data, and image noise detection data; Acquire preprocessing history data corresponding to the image data, wherein the preprocessing history data includes luminance compensation data and pixel compensation data; The preset image compensation analysis model analyzes the image data and preprocessed historical data based on a machine self-learning algorithm to generate an image credibility weight; The preset regional credibility analysis model performs analysis based on the detection partitions and the corresponding image credibility weights to generate regional confidences, and the regional confidences are used to represent the confidence level of each regional detection result based on the image analysis result.

5. The method for rapid detection of cereal food ingredients based on spectral imaging technology according to claim 4, characterized in that: After the step of analyzing the detection partitions and the corresponding image credibility weights by the preset regional credibility analysis model to generate regional credibility weights, the overall detection calculation formula is: The confidence i Indicates the confidence level of the detection result of the i-th region.

6. The method for rapid detection of cereal food ingredients based on spectral imaging technology according to claim 1, characterized in that: After the step of comparing the component difference correction data with the initial component deviation data to generate the corrected component deviation data, the following steps are included: Associating the historical correction component deviation data with the corresponding historical image data based on the detection batch to construct a deviation-image data set; The preset deviation analysis model analyzes the deviation-image data set based on a machine self-learning algorithm to generate an image influence factor, wherein the image influence factor is used to predict the detection component deviation corresponding to different image data; The preset deviation prediction model analyzes the detected image data and the image influencing factors based on a machine self-learning algorithm to generate predicted component deviation data, and the predicted component deviation data is used to compensate for the initial component deviation data.

7. The method for rapid detection of cereal food ingredients based on spectral imaging technology according to claim 1, characterized in that: The preset quantitative model includes a continuous projection algorithm and a multi-weight optimized soft shrinkage algorithm.

8. A device for rapid detection of cereal food ingredients based on spectral imaging technology, applied to the method for rapid detection of cereal food ingredients based on spectral imaging technology according to any one of claims 1 to 7, characterized in that: The device includes a production ingredient table matching unit for obtaining the model of the cereal food to be tested and inputting it into a pre-set product library to match the corresponding production ingredient table; A component table prediction spectrum generating unit, used for generating a corresponding component table prediction spectrum according to the production component table, wherein the component table prediction spectrum is used as a detection reference; A detection spectrum data acquisition unit is used to scan the sample of the detected cereal food using the hyperspectral imaging technology to acquire the detection spectrum data of the sample; A characteristic wavelength extraction unit, used for processing the detection spectrum data by chemometrics to extract characteristic wavelengths related to cereal food ingredients; A chemical component detection result generating unit is used to pre-set a quantitative model to analyze the characteristic wavelengths to perform quantitative analysis on the chemical components in the cereal food, thereby generating a chemical component detection result according to the quantitative analysis result; an initial component deviation data generating unit, configured to compare the chemical component detection result with the production component table to generate initial component deviation data; an actual component difference analysis unit, used for comparing the detected spectrum data with the spectrum predicted by the component table to generate spectrum difference data, and generating corresponding component difference correction data based on the spectrum difference data, wherein the spectrum difference data is used for analyzing actual component differences; a corrected component deviation data generating unit, configured to compare the component difference correction data with the initial component deviation data to generate corrected component deviation data; A food ingredient detection report generating unit is used to generate a food ingredient detection report based on the corrected ingredient deviation data, and to generate food safety recommendations based on the food ingredient detection report.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of a method for rapid detection of cereal food ingredients based on spectral imaging technology as described in any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method for rapid detection of cereal food ingredients based on spectral imaging technology as claimed in any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Hyperspectrum-based method for determining starch content of whole potato flour noodles

    CN113984683A

  • Wheat growth period nutrient information detection method

    CN114252406A

  • Method for detecting tannin content in wine brewing grains

    CN117288692A

  • Method and device for testing quality of grains

    CN1353304A

  • Apparatus and method to discriminate production place of agricultural products using hyperspectral image

    KR101498096B1