Method for synchronous rapid nondestructive detection of multiple quality indexes of rice
By using a dual-band hyperspectral imaging system and the CARS-SPA algorithm with multi-objective constraints, combined with a spatial-spectral dual-branch fusion model, rapid, accurate, and non-destructive testing of multiple quality indicators of rice was achieved. This solved the problems of low testing efficiency, poor accuracy, and lagging production control in existing technologies, thereby improving the yield of high-quality rice and reducing energy consumption.
Patent Information
- Application Number
- CN202610614043.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-07
- Publication Date
- 2026-08-25
AI Technical Summary
The current rice processing industry suffers from problems such as low testing efficiency, poor accuracy, high destructiveness, lagging production-end control, low rate of high-quality products, and high energy consumption. Existing technologies cannot achieve simultaneous high-precision testing and online real-time control of the six national standard indicators for rice.
By employing a dual-band hyperspectral imaging system combined with the CARS-SPA algorithm with multi-objective constraints and a spatial-spectral dual-branch fusion model, rapid, accurate, and non-destructive testing of multiple quality indicators of rice can be achieved.
It achieves simultaneous high-precision detection of six core indicators of rice, improving detection efficiency by 40 times, increasing the rate of high-quality products by 17.2%, reducing rework rate by 91.3%, and reducing energy consumption by 15%, thus meeting the real-time control needs of industrial production lines.
Smart Images

Figure REF-OBJ-1778124888374-000001 
Figure REF-OBJ-1778124888374-000002 
Figure REF-OBJ-1778124888374-000003
Abstract
Description
Technical Field
[0001] This invention relates to the field of detection technology, and in particular to grain and oil quality detection, specifically a method for simultaneous, rapid and non-destructive detection of multiple quality indicators of rice based on dual-band hyperspectral imaging. Background Technology
[0002] Rice is my country's primary staple food crop, and its quality is directly related to food safety and consumer rights. The national standard GB / T1354-2024 "Rice" clearly stipulates that the quality grade of rice is determined by six core indicators: broken rice rate, chalkiness, moisture content, protein content, amylose content, and fatty acid value. Among them, broken rice rate and chalkiness are physical indicators of appearance, while the other four are internal chemical indicators.
[0003] The current quality control of the rice processing industry faces two significant problems: First, the testing end suffers from low efficiency, poor accuracy, and high destructiveness. Existing national standard testing methods require different equipment and methods for each of the six indicators. For example, moisture is tested using an oven method (testing cycle ≥ 4 hours), protein using the Kjeldahl method (testing cycle ≥ 6 hours), and broken rice rate using manual sieving. A single sample requires 3-4 hours for full testing, which is not only time-consuming and requires destructive pretreatment such as grinding and digestion, but also only allows for post-production sampling and cannot provide real-time intervention in the production process. Second, production-side control is lagging, resulting in low yield and high energy consumption. The current production model only allows for manual sampling and moisture testing every 2 hours. The other five indicators are tested in laboratories after batch processing, making real-time control during production impossible. This leads to large fluctuations in the grade of finished rice, a first-grade yield generally below 70%, a rework rate exceeding 9%, and persistently high drying energy consumption.
[0004] To address these issues, researchers have explored various approaches, one of which is utilizing hyperspectral imaging technology. Hyperspectral imaging combines quantitative spectral detection with spatial imaging capabilities, enabling non-destructive testing of rice. In existing technologies, CN116026795A proposes a non-destructive prediction method for rice grain quality traits based on reflectance-projection spectroscopy. It employs a CARS+SPA combined algorithm for feature selection, using PLSR and CNN-LSTM as candidate modeling methods to achieve non-destructive prediction of rice grain quality. However, it only uses a single spectral imaging system and cannot simultaneously consider the spatial resolution of external physical indicators and the spectral resolution of internal chemical indicators, thus failing to achieve simultaneous high-precision detection of both types of indicators. CARS+SPA involves selecting features one by one for each indicator, without optimizing for the physical overlap of feature peaks across multiple indicators, and cannot eliminate accuracy degradation caused by spectral collinearity interference. Furthermore, CNN and PLST are independent candidate modeling methods and do not achieve feature-level fusion. CN203275285U proposes an online non-destructive testing device for rice quality based on hyperspectral imaging, enabling simultaneous detection of both internal and external rice quality. However, this device can only perform offline sampling and cannot achieve online synchronous detection. Besides this, there have been separate applications of CARS and SPA algorithms in hyperspectral detection of rice, as well as research on hyperspectral detection of broken rice rate and chalkiness, but none of these have addressed a solution for the simultaneous detection of the six national standard indicators for rice.
[0005] Therefore, existing technologies are all limited to offline laboratory testing. The industry needs a solution that can simultaneously perform high-precision testing of six national standard indicators and can be integrated with production equipment for online synchronous testing. Summary of the Invention
[0006] To address the shortcomings of existing technologies, this invention proposes a method for simultaneous, rapid, and non-destructive testing of multiple quality indicators in rice. When used in conjunction with production equipment, this method enables rapid, accurate, and non-destructive quality control of six core quality indicators of rice: moisture content, broken rice rate, chalkiness, amylose content, protein content, and fatty acid value.
[0007] The technical problem to be solved by the present invention is achieved through the following technical solution: A rapid and non-destructive testing method for multiple quality indicators of rice, including the following steps: S1 Sample Pretreatment: The rice sample to be tested is laid out in a single layer without overlap by a vibrating layer feeding device, without the need for destructive pretreatment such as grinding or digestion.
[0008] The rice grains are evenly spread by vibration layering, avoiding spectral aliasing caused by grain overlap. No single grain separation device is required, which is suitable for the high-speed feeding requirements of industrial production lines.
[0009] S2 Dual-Band Synchronous Hyperspectral Image Acquisition: A synchronously triggered dual-band hyperspectral imaging system is used to simultaneously acquire the spatial texture and molecular spectral information of the rice sample under test. A 400-1000 nm visible-near-infrared silicon-based camera acquires two-dimensional spatial texture data of rice grains for feature extraction of two appearance indicators: broken rice rate and chalkiness. A 900-1700 nm short-wave near-infrared InGaAs camera acquires molecular spectral data of rice for quantitative fitting of four chemical indicators: moisture, protein, amylose, and fatty acid value. The two cameras achieve microsecond-level synchronous acquisition through a hardware synchronous trigger, integrating the data to obtain a three-dimensional hyperspectral data cube containing spatial and spectral information. This invention employs a dual-band camera to adapt to the detection requirements of appearance indicators and chemical indicators respectively, thus solving the problem of the inability to simultaneously detect the two types of indicators with high precision from a hardware perspective.
[0010] S3 hyperspectral data preprocessing: The three-dimensional hyperspectral data cube is sequentially subjected to dual-band synchronous black-and-white correction, Savitzky-Golay smoothing and denoising, thresholding background segmentation, and multi-seed dynamic region of interest (ROI) extraction to obtain purified spatial texture feature data and effective spectral data. The specific steps are as follows: Dual-band synchronous black and white correction: For cameras in two bands, a full white image of a first-grade polytetrafluoroethylene standard white board with the corresponding band response range and a full black image with the lens cap closed are acquired respectively. The reflectance of the two bands is synchronously corrected by the formula R=(IB) / (WB), where R is the corrected reflectance image, I is the original hyperspectral image, B is the full black image, and W is the full white image. This is used to eliminate systematic errors caused by uneven light source intensity and camera dark current. Savitzky-Golay smoothing and denoising: A convolutional smoothing algorithm with a window size of 5 and a polynomial degree of 2 is used to eliminate spectral random noise; Background segmentation using thresholding: A reflectance threshold of 0.2 is used to remove background interference from the black stage / transmission belt; Multi-grain dynamic ROI extraction: Using the 8-neighborhood connected component analysis method, broken grains and impurities with an area of less than 1200 pixels were identified, and only the effective data of complete rice grains were retained, providing clean data for subsequent feature extraction.
[0011] S4 Multi-Objective Tianhe Constraint Feature Band Decoupling: Based on the physical overlap characteristics of the feature peaks of the six core quality indicators of rice, a loss function is constructed to minimize the joint prediction error of the six indicators. The CARS-SPA coupling algorithm under multi-objective constraints is used to filter features from the effective spectral data, obtaining the optimal feature band set that is highly correlated with all six indicators and has the lowest collinearity among the bands. The specific steps are as follows: (1) Construction of multi-objective joint loss function: The loss function is constructed with the goal of minimizing the root mean square error of the joint prediction of the six indicators: RMSE i The root mean square error of the prediction of the i-th indicator is used to ensure that the selected feature bands are highly correlated with all six indicators, rather than being adapted to only a single indicator. (2) Initial selection of highly correlated bands: The number of Monte Carlo sampling times was set to 50 and 5-fold cross-validation was used. The competitive adaptive reweighted sampling CARS algorithm was used to initially select 50 candidate bands that were highly correlated with all 6 indicators from the entire band. (3) Low-redundancy band selection: Taking the minimum inter-band variable projection importance value and collinearity as the optimization objective, 25-35 feature bands are selected from the candidate bands through the continuous projection algorithm SPA to form the optimal feature band set.
[0012] This invention addresses the shortcomings of existing single-index CARS+SPA technology, which cannot eliminate the interference of overlapping feature peaks of multiple indices. It adds a joint loss function of 6 indices to achieve feature decoupling of joint constraints of multiple targets, thereby solving the problem of accuracy decay in multi-target detection.
[0013] The optimal feature band set obtained in this step includes the characteristic wavelengths and chemical bond assignments corresponding to the 6 core quality indicators: The characteristic wavelengths corresponding to water are 970 nm, 1200 nm, and 1450 nm, which are the second-order and first-order overtone absorption peaks of the OH bond stretching vibration. The characteristic wavelengths corresponding to the protein are 1020 nm, 1190 nm, and 1510 nm, which are the second-order and first-order overtone absorption peaks of the NH bond stretching vibration. The characteristic wavelengths of amylose are 1040 nm, 1360 nm, and 1580 nm, which are overtone absorption peaks of the stretching vibrations of CH and OH bonds. The characteristic wavelengths corresponding to the fatty acid values are 1210 nm, 1390 nm, and 1650 nm, which are overtone absorption peaks of the stretching vibrations of CH and C=O bonds. The characteristic wavelengths corresponding to the broken rice rate are 450 nm, 550 nm, 680 nm, and 880 nm, which are the visible light characteristic reflection peaks of the grain appearance texture. The characteristic wavelengths corresponding to chalkiness are 550 nm, 680 nm, and 880 nm, which are the visible-near-infrared characteristic reflection peaks of chalky tissue scattering properties.
[0014] S5 Spatial-Spectral Dual-Branch Fusion Multi-Indicator Synchronous Detection: A spatial-spectral dual-branch fusion detection model is constructed. Spatial texture feature data is input into the 1D-CNN feature extraction branch to complete the extraction of appearance features such as broken rice rate and chalkiness. The optimal feature band set is input into the PLSR feature fitting branch to complete the spectral-content fitting of four chemical indicators. After the dual-branch features are spliced by the fusion layer, the quantitative detection results of six core quality indicators are output simultaneously with a single input.
[0015] This invention addresses the shortcomings of existing technologies where CNN and PLSR are independent and cannot simultaneously consider appearance and chemical indicators. It constructs a dual-branch fusion structure, where the 1D-CNN branch is adapted for nonlinear spatial feature extraction of appearance indicators, and the PLSR branch is adapted for linear spectral-content fitting of chemical indicators. After the dual-branch features are fused, the simultaneous output of six indicators is achieved.
[0016] The training method for the multi-output spatial-spectral dual-branch fusion detection model includes: (1) Dataset construction: Rice samples of different varieties (indica rice, japonica rice, glutinous rice), different origins, and different storage times were collected. Hyperspectral data were collected using the method of this invention. At the same time, the true values of 6 core quality indicators were determined using the national standard method to construct a labeled dataset. The true values were determined using the following methods: moisture content was determined using the oven drying method (GB 5009.3-2016); protein content was determined using the Kjeldahl method (GB 5009.3-2016); amylose content was determined using the spectrophotometric method (GB / T 15683-2008); fatty acid value was determined using the titration method (GB / T5510-2011); broken rice rate was determined using the sieving method (GB / T 5494-2019); and chalkiness was determined using the manual counting method (GB / T 17891-2017). (2) Transfer learning pre-training: The 1D-CNN branch is pre-trained using a large dataset of publicly available near-infrared spectra and appearance images of agricultural products to learn the general feature rules of the appearance texture of agricultural product grains and the spectrum of organic molecules. The parameters of the first 3 convolutional layers of the 1D-CNN branch after pre-training are frozen. (3) Fine-tuning training: Using the rice annotation dataset, the remaining layers of the 1D-CNN branch, the PLSR branch and the feature fusion layer are jointly fine-tuned and trained, with the minimum mean square error of the joint prediction of the six indicators as the loss function; (4) Model validation: The model is validated using test set samples that were not used in training. When the model's detection determination coefficient R for the 6 core quality indicators is... 2 Model training is complete when all values are ≥0.93 and the average relative error is ≤2.5%.
[0017] S6's dual closed-loop control system manages the entire production process: Real-time monitoring results are compared with target thresholds in the GB / T 1354-2024 national standard for rice to calculate quality deviations. Through dual closed-loop control logic, the parameters of production equipment in the drying, milling, and polishing processes are adjusted in real-time, achieving full-process closed-loop control of rice quality. Specifically, this includes: (1) Drying process: The moisture content and particle size distribution of the raw materials are detected at the feed inlet, and the initial hot air temperature and feed rate of the drying tower are pre-adjusted via feedforward; the moisture content and breakage rate of the finished product are detected in real time at the discharge outlet, and the hot air temperature and drying time are fine-tuned via feedback. (2) Rice milling process: The rice milling machine detects the particle shape and moisture of the raw materials in the front stage and feeds forward to pre-adjust the initial pressure and speed of the rice milling roller; the rice milling machine detects the broken rice rate in real time in the back stage and feeds back to fine-tune the roller pressure and speed. (3) Polishing process: Before polishing, the whiteness of the product is detected and the polishing pressure and water spray volume are pre-adjusted; after polishing, the whiteness and appearance of the finished product are detected in real time and the polishing parameters are fine-tuned. (4) Finished product grading process: Based on the synchronous test results of 6 core quality indicators, the rice national standard grade determination and storage in separate warehouses are automatically completed.
[0018] This invention deeply integrates the test results with the entire rice processing process. Through the aforementioned methods of feed-in pre-adjustment and process feedback fine-tuning, it achieves full-process quality control from raw materials to finished products.
[0019] This invention supports both offline sampling inspection in the laboratory and online continuous testing in production lines such as rice drying and processing.
[0020] In the laboratory offline sampling mode, the hyperspectral data acquisition adopts the static push-broom mode. The rice to be tested is fixed on the electric translation stage. The scanning speed of the translation stage is 8-12 mm / s, the exposure time of the 400-1000 nm camera is 15-20 ms, and the exposure time of the 900-1700 nm camera is 20-25 ms. In the online continuous detection mode of the production line, the hyperspectral data acquisition adopts the dynamic line scan mode. The rice sample to be tested is laid flat on the production line transmission platform through the vibration feeding device, and the transmission speed is 1-2m / s, which is synchronously matched with the line scan frequency of the dual-band camera. The dual-band synchronous dynamic black and white correction and baseline calibration are set to be performed every 1-2 hours to eliminate detection drift caused by light source aging and temperature and humidity fluctuations.
[0021] The dynamic black-and-white correction and baseline calibration adopt a sliding window standard calibration combined with Kalman filter drift compensation method. Specifically, a standard polytetrafluoroethylene calibration plate with a fixed position is built into the detection chamber of the production line. The spectral data of the calibration plate is automatically collected every 1-2 hours. The detection drift is fitted by the Kalman filter algorithm, and the baseline offset of the model is automatically corrected to ensure that the absolute error of the detection does not exceed the national standard allowable threshold after 48 hours of continuous operation.
[0022] Based on the above detection method, the present invention also includes an online detection and closed-loop management system for multiple quality indicators of rice that implements the above method, including a dual-band hyperspectral imaging detection unit, a PLC central control unit, a production execution unit, and a human-machine interaction unit.
[0023] The dual-band hyperspectral imaging detection unit is installed at the rice production line's feed inlet, before and after the rice milling process, before and after the polishing process, and at the finished product outlet. It is used to simultaneously collect spatial-spectral hyperspectral data of rice and output real-time detection results for six core quality indicators. The PLC central control unit incorporates the detection model and dual closed-loop control algorithm of this invention, used to receive real-time detection results, calculate quality deviations, and output control commands. The production execution unit includes a drying tower hot air furnace actuator, a feeding / discharging frequency converter actuator, a rice milling machine actuator, and a polishing machine actuator, which are used to receive control commands and automatically adjust production operation parameters; The human-machine interaction unit is used to display detection data and equipment operating status in real time, and to receive parameter setting instructions from users.
[0024] Compared with the prior art, the present invention has the following advantages: (1) This application achieves simultaneous input and output of six core indicators of rice according to national standards through a dual-band synchronous imaging system, a multi-target joint decoupling algorithm, and a dual-branch fusion model. The detection time for a single sample is ≤5 minutes, which is about 40 times more efficient than the national standard laboratory method. The detection determination coefficient R of the six indicators is ≤5 minutes. 2 All values are ≥0.93, and the average relative error is ≤2.5%. The detection errors of all indicators meet the national standard requirements, which solves the industry pain point of the accuracy decay of simultaneous detection of multiple indicators in existing technologies. (2) This application supports both offline laboratory sampling and online continuous testing on the production line. In the online mode, it can be adapted to the transmission speed of industrial production lines of 1-2 m / s. Through the dynamic correction method of "sliding window standard product correction + Kalman filter drift compensation", it ensures that the detection error of the system is still controlled within the national standard range after 48 hours of continuous operation, which is suitable for the long-term stable operation requirements of industry. (3) The production control effect of this application is good. In the application of a rice drying and processing production line of 30 tons / day, this invention can increase the first-grade rice finished product rate from 68.5% to 85.7%, an increase of 17.2%; reduce the rework rate from 9.2% to 0.8%, a reduction of 91.3%; and reduce the energy consumption of drying ton of grain from 128 m³ / h to 100 m³ / h. 3 Reduced to 108.8 m 3 The reduction was 15%, enabling closer integration between testing and production; (4) The solution proposed in this application is highly feasible. All hardware uses industrial-grade commercial equipment. The algorithm and control logic can be directly integrated into the PLC control system of the existing rice processing production line without the need for large-scale modification of the existing production line. It is suitable for the actual production needs of the grain and oil processing industry and has extremely high industrial promotion value. Attached Figure Description
[0025] Figure 1 This is the overall process flow diagram of this application; Figure 2 Distribution of the characteristic bands of the six indicators selected for the CARS-SPA combined algorithm in this application; Figure 3 A scatter plot showing the fitting of the test results of the detection method in this application and the national standard method for six indicators; Figure 4 This is a bar chart comparing the core quality control effects of the testing method in this application with those of the original model. Detailed Implementation
[0026] The present invention will be further described below with reference to the accompanying drawings and specific preferred embodiments, but this does not limit the scope of protection of the present invention.
[0027] All embodiments of the present invention were tested using the following hardware and software environment.
[0028] 1. Dual-band hyperspectral imaging system 400-1000 nm silicon baseline array hyperspectral camera: Model GaiaField-V10, spectral range 400-1000 nm, spectral resolution 3.5 nm, spatial resolution 0.2 mm / pixel, effective pixels 696×1313; 900-1700 nm InGaAs linear array hyperspectral camera: Model NIR1700, spectrum 900-1700 nm, spectral resolution 5 nm, effective pixels 320×256; Light source system: 4 200 W halogen uniform light power supplies, with an illumination angle of 45°, uniformly covering the sample detection area; Sweatshirt system: High-precision electric translation stage (offline mode) / food-grade PVC production line transmission platform (online mode), repeatability ±0.1 mm, speed range 0.5-2 m / s; Synchronous Trigger System: Hardware synchronous trigger with time synchronization accuracy ≤10 μs, enabling synchronous acquisition from two cameras.
[0029] 2. Data Processing and Control System Industrial PC: Intel i7-12700H processor, 32GB RAM, RTX 3060 graphics card, Win10 operating system, running MATLAB 2022b algorithm environment; PLC control system: Siemens S7-1200, equipped with analog input / output modules, to realize communication and control command output with production equipment.
[0030] 3. National standard testing equipment Electric constant temperature drying oven, Kjeldahl nitrogen analyzer, UV-Vis spectrophotometer, grain sieve analyzer, fatty acid titration device. Example 1
[0031] This embodiment is used to verify the detection accuracy of the method of the present invention for six core quality indicators of rice in a laboratory setting, such as... Figure 1 and 2 .
[0032] 1. Test sample A total of 120 rice samples were collected from three mainstream varieties: Wuchang long-grain fragrant japonica rice from Heilongjiang, indica rice from Hubei, and glutinous rice from Jiangxi. Among them, there were 80 japonica rice samples, 25 indica rice samples, and 15 glutinous rice samples, covering samples from different production areas and storage times (0-12 months) to verify the model's cross-variety generalization ability.
[0033] 2. Research and development trial and error and parameter optimization This embodiment addresses the accuracy attenuation of simultaneous testing of six national standard indicators for rice: The initial approach uses the conventional CARS feature selection method, which selects feature bands for each of the six indicators individually and models them. The average coefficient of determination R of the six indicators on the test set is calculated. 2 The relative error in the detection of amylose and protein was only 0.87, but the relative error in the detection of chalkiness exceeded the national standard allowable range. 2 With a value of only 0.81, the required accuracy cannot be met. Optimization scheme 1 adopts the general CARS+SPA combined algorithm, without adding multi-objective joint constraints, and the average R on the test set is... 2 The detection error was improved to 0.90, but the detection error of indica rice and glutinous rice samples was significantly higher than that of japonica rice, indicating that the model's generalization ability was insufficient. The final solution incorporates a loss function that minimizes the prediction error of six indicators, constructing a multi-objective constrained CARS-SPA coupled algorithm. Additionally, 10% of the samples are domain-adaptive samples added for different varieties. The final test set shows an average R-value of 6 indicators. 2 The accuracy was improved to above 0.92, with the accuracy of the japonica rice sample remaining stable and meeting the national standard, while the accuracy of the indica rice and glutinous rice samples met the national standard requirements. This solved the problems of multi-index collinearity interference and poor cross-variety generalization.
[0034] 3. Specific Implementation Steps (1) Sample pretreatment: Take about 20g of each sample, remove impurities and insect-damaged particles, and spread it evenly on a black matte polytetrafluoroethylene platform. The seeds are spread in a single layer without overlap by a vibration layering device, without contact or obstruction of the seeds, and no destructive pretreatment is required. (2) Dual-band synchronous hyperspectral data acquisition: The stage is fixed on the electric translation stage, the scanning speed of the translation stage is set to 10 mm / s, the exposure time of the 400-1000nm camera is 18 ms, and the exposure time of the 900-1700nm camera is 22 ms. The synchronous acquisition of the two cameras is achieved through the hardware synchronous trigger to obtain the three-dimensional hyperspectral data cube of each sample. (3) Hyperspectral data preprocessing: The original data were subjected to dual-band synchronous black and white correction, Savitzky-Golay smoothing and denoising (window 5, order 2), 0.2 reflectance threshold background segmentation, 8-neighborhood connected component analysis and multi-seed ROI extraction. Broken seeds with an area of less than 1200 pixels were removed to obtain purified spatial texture feature data and effective spectral data. (4) Multi-objective joint feature decoupling: The multi-objective constrained CARS-SPA coupling algorithm of the present invention is adopted, with 50 Monte Carlo sampling times and 5-fold cross-validation, 50 candidate bands are initially selected, and then 31 feature bands are selected through the SPA algorithm to form the optimal feature band set. The distribution of feature bands is shown in the attached figure. Figure 2 As shown; (5) Model training and validation: Divide the 120 samples into a calibration set (90 samples) and a test set (30 samples) at a ratio of 3:1, construct a spatial-spectral dual-branch fusion detection model, and complete the model training according to the training method described in this manual; (6) Determination of true values of national standards: For 120 samples, the true values of 6 core quality indicators were determined by the corresponding national standard methods, which served as the labeled data for model training and the gold standard for accuracy verification.
[0035] 3. Test Results The detection accuracy verification results of this embodiment are shown in Table 1 below.
[0036] Table 1 compares the offline detection method of this invention with the detection method of the national standard. The scatter plot showing the fitting of the detection results of the method of this invention and the national standard method is attached. Figure 3 As shown in the figure. The results show that the detection results of the method of the present invention for the six core indicators are highly consistent with the national gold standard. The accuracy of easily detectable indicators such as moisture and protein is stable, while the accuracy of difficult-to-detect indicators such as chalkiness and fatty acid value shows reasonable fluctuations, which is consistent with the real experimental law of hyperspectral detection. The average detection error of all indicators meets the national standard requirements, and it has good detection accuracy and cross-variety generalization ability. Example 2
[0037] This embodiment is used to verify the industrial application effect of the method of the present invention in actual rice production regarding online continuous detection and closed-loop control, such as... Figure 1 and 4 .
[0038] 1. Experimental Scenario and Design This experiment was conducted on a free 30-ton / day continuous rice drying and processing production line, which includes five core processes: cleaning, drying, milling, polishing, and grading. The total experimental period was 60 days, divided into three phases: (1) Equipment debugging and baseline calibration period (days 1-5): Dual-band hyperspectral imaging detection units were deployed at the feed inlet, dryer outlet, rice milling machine front and rear, polishing machine outlet and finished product outlet of the production line, and Profinet communication interface with Siemens S7-1200 PLC control system was completed. The test raw material was identified as the same batch of Wuchang long-grain fragrant japonica rice from Heilongjiang Province. The basic operating parameters of the dryer, rice milling machine and polishing machine were calibrated. (2) Original mode control period (days 6-35): The industry-standard traditional production mode was adopted. Samples were taken from the production line every 2 hours by hand, and the moisture content was tested by the oven method of GB 5009.3-2016. Certified operators with more than 5 years of experience manually adjusted the production parameters of drying, rice milling and polishing processes based on the test results. The online detection and closed-loop control system of this invention was not used throughout the process. Core production data were recorded daily to establish a control benchmark. The test covered two typical environmental conditions: normal temperature and low humidity in spring (15-20℃, relative humidity 50%-60%) and high temperature and high humidity in summer (28-32℃, relative humidity 70%-85%). (3) Experimental period of the present invention (days 36-65): The dual-band detection system and dual closed-loop control method of the present invention are activated. The raw material varieties and basic equipment parameters are completely consistent with those of the control period. The only variable is the detection and control mode. Core production data are recorded daily to verify the technical effect of the present invention.
[0039] 2. Specific Implementation Steps (1) Deployment of online detection units: Five sets of dual-band hyperspectral imaging detection units are deployed in the corresponding processes. The transmission platform speed is set to 1.2 m / s to match the production line speed. The line scan frequency of the two cameras is calibrated synchronously with the transmission speed. Dynamic black and white correction and baseline calibration are performed every hour. (2) Dual closed-loop control logic settings: (i) Drying process: The moisture content and particle size distribution of the raw materials are detected at the feed inlet, and the initial hot air temperature and feed rate of the drying tower are pre-adjusted via feedforward; the moisture content and breakage rate of the finished product are detected in real time at the discharge outlet, and the hot air temperature (adjustment range ±5℃) and drying time are fine-tuned based on the target moisture content of 14.5%. (ii) Rice milling process: The raw material particle shape and moisture are detected before the rice milling machine, and the initial pressure of the rice milling roller is pre-adjusted to 0.3 MPa and the speed is 800 r / min. The broken rice rate is detected in real time after the rice milling machine. Based on the target broken rice rate ≤10%, the roller pressure (adjustment range ±0.1 MPa) and speed (adjustment range ±50 r / min) are finely adjusted. (iii) Polishing process: Before polishing, the whiteness of the product is detected and the polishing pressure and water spray volume are pre-adjusted; after polishing, the whiteness of the finished product is detected in real time, and the polishing parameters are fine-tuned based on the target whiteness of ≤2%. (3) Data collection and statistics: Daily records of seven core indicators, including moisture content qualification rate, breakage rate, broken rice rate qualification rate, chalkiness qualification rate, first-grade rice finished product rate, energy consumption per ton of grain drying, and rework rate. Statistical analysis was conducted after the 30-day test. At the same time, the operating data under high temperature and high humidity conditions were separately collected to verify environmental adaptability.
[0040] 3. Experimental Results The core control effect of this embodiment is, for example... Figure 3 As shown in Table 2, the average statistical data for the 30-day full cycle is as follows.
[0041] Table 2 shows the test status of the second and third stages of this embodiment. The experimental results show that the method of the present invention can significantly improve the quality control capability of rice production, greatly reduce energy consumption and rework rate, and has excellent industrial application value. Under high temperature and high humidity conditions, the detection accuracy and control effect of the system are slightly reduced, but still far superior to the original traditional mode, proving that the solution has good environmental adaptability. During the test, there were two instances where the output moisture qualification rate temporarily dropped to 95% due to excessive fluctuations in raw material moisture (initial moisture > 22%). After the system automatically adjusted the drying time, it returned to stable compliance the next day. Example 3
[0042] This embodiment is used to demonstrate the training method of the core model of the present invention.
[0043] 1. Dataset Construction A total of 600 rice samples of different varieties (japonica rice, indica rice, and glutinous rice), different origins, and different storage times were collected. Hyperspectral data of each sample were collected using the method of this invention. At the same time, the true values of 6 core quality indicators were determined using the national standard method to construct a labeled dataset. The dataset was divided into a training set (420 samples), a validation set (120 samples), and a test set (60 samples) in a ratio of 7:2:1. All datasets ensured that samples of different varieties and storage times were evenly distributed. At the same time, 3 abnormal samples with severe mold were removed to avoid affecting the stability of model training.
[0044] 2. Model Network Structure Definition The specific structure of the spatial-spectral dual-branch fusion detection model of the present invention is as follows: (1) 1D-CNN feature extraction branch: It contains 5 convolutional layers, 3 max pooling layers and 1 fully connected layer. The first 3 convolutional layers are transfer learning freeze layers with a kernel size of 3×1, a stride of 1 and an activation function of ReLU. The 4th-5th convolutional layers are fine-tuning layers with a kernel size of 3×1, a stride of 1 and an activation function of ReLU. The pooling layer has a window size of 2×1 and a stride of 2. The fully connected layer has an output dimension of 64. (2) PLSR feature fitting branch: The number of principal components is set to 10, the input is the optimal feature band set, and the output dimension is 64; (3) Feature fusion layer: The output features of the 1D-CNN branch and the PLSR branch are concatenated, and the output dimension is 128; (4) Output layer: Set up 6 output nodes, each corresponding to 6 core quality indicators, and the activation function is a linear function.
[0045] 3. Model Training Process (1) Transfer learning pre-training: The 1D-CNN branch was pre-trained using a large dataset of near-infrared spectra and appearance images of agricultural products (containing 10,000 agricultural product samples). The training batch size was 32, the number of iterations was 100, the optimizer was Adam, and the learning rate was 0.001. After the pre-training was completed, the parameters of the first 3 convolutional layers were frozen. (2) Fine-tuning training parameters: (i) The initial learning rate was set to 0.001. During the training process, the validation set loss oscillated and did not converge. After analysis, it was found that the learning rate was too high and was adjusted to 0.0005. (ii) Overfitting occurred during the second training. The training set loss continued to decrease, but the validation set loss increased. L2 regularization (regularization coefficient 0.001) and Dropout layer (inactivation rate 0.2) were added. At the same time, the training batch size was adjusted from 32 to 16 to solve the overfitting problem. (iii) Final training parameters: training batch size 16, number of iterations 200, optimizer is Adam, initial learning rate 0.0005, learning rate decays by 50% every 50 rounds, loss function is the joint root mean square error of 6 indicators, with L2 regularization constraint added; (3) Model validation: After each round of training, the model is validated using validation set data. When the validation set loss no longer decreases for 10 consecutive rounds, training is terminated early to prevent overfitting. Finally, training was terminated early on the 168th round. (4) Model testing: The final model was tested using test set data that was not used in training. The test results are: the average detection determination coefficient R of the 6 core indicators. 2 The value is 0.924, and the average relative error is ≤2.5%, which meets the detection accuracy requirements. Example 4
[0046] This embodiment is used to verify the stability and dynamic error correction capability of the method of the present invention during continuous online operation.
[0047] 1. Experimental Design In the production line scenario of Example 2, the mode of the present invention was kept running continuously at full load for 48 hours, and detection data was collected every 30 minutes. The national standard detection results of synchronous sampling were used as the true value to verify the change of the detection error of the system. Two parallel experiments were set up, and each experiment was repeated twice. The average value was taken as the final result: the experimental group started the dynamic correction method of the present invention and performed correction once every hour, while the control group did not enable correction and only performed black and white correction once before the start of the experiment. 2. Specific Implementation Methods for Dynamic Correction (1) A primary polytetrafluoroethylene standard calibration plate with a fixed position is installed in the testing chamber of the production line. The reflectivity of the calibration plate has been calibrated by the Metrology Institute to ensure long-term stability. (2) Every hour, the system automatically pauses sample detection, and the translation stage moves the calibration plate to the detection area to collect the full-band spectral data of the calibration plate; (3) The deviation between the current detection value and the calibration value is fitted by the Kalman filter algorithm to construct a drift prediction model and automatically correct the baseline offset of the model; (4) After calibration, the sample testing process is automatically restored. No manual intervention is required throughout the process. The time for a single calibration is ≤10 seconds, which does not affect the continuous operation of the production line.
[0048] 3. Experimental Results During 48 hours of continuous operation, the experimental group (with dynamic correction enabled) showed a maximum absolute error of 0.48% in detecting the core indicator of moisture, close to the national standard's allowable threshold of ±0.5%. Errors at over 95% of detection time points were ≤0.4%, and the system did not exceed the national standard's allowable range throughout the entire process. The detection errors for the other five indicators also remained within the national standard's allowable range, indicating stable system operation without persistent detection drift. In contrast, the control group (without dynamic correction enabled) showed that the moisture detection error began to exceed the national standard's allowable range after 11 hours of operation. After 24 hours, the maximum absolute error reached 0.89%, and after 48 hours, it reached 1.32%, far exceeding the national standard's allowable threshold, exhibiting significant detection drift. The experimental results demonstrate that the dynamic correction method of this invention can effectively suppress detection drift caused by light source aging and temperature and humidity fluctuations, ensuring long-term stable online operation of the system and meeting the needs of continuous industrial production.
[0049] In addition, this invention has good adaptability to the three major commercial rice varieties: japonica rice, indica rice, and glutinous rice. For specialty rice varieties such as black rice and fragrant rice, 20-30 additional labeled samples of the corresponding varieties are required to complete model fine-tuning in order to achieve the same detection accuracy. When the production line transmission speed exceeds 1.5 m / s, insufficient camera exposure time will lead to a decrease in spectral signal-to-noise ratio and a slight reduction in detection accuracy. When the overlap rate of rice grains exceeds 10%, it will lead to an increase in ROI extraction error and a decrease in detection accuracy. It is necessary to control the grain spreading effect through a vibrating feeding device to ensure that the overlap rate is ≤5%. When the ambient temperature and humidity fluctuate by more than ±8℃ or the relative humidity fluctuates by more than ±20%, the dynamic correction interval needs to be shortened to 30 minutes to ensure detection accuracy.
Claims
1. A method for simultaneous, rapid, and non-destructive testing of multiple quality indicators in rice, used for the simultaneous detection and real-time control of two physical appearance indicators (broken rice rate and chalkiness) and four internal chemical indicators (moisture content, protein content, amylose content, and fatty acid value) throughout the entire rice production process. Its features include: Includes the following steps: S1 Sample Pretreatment: The rice sample to be tested is laid out in a single layer without overlap by a vibrating layer feeding device. S2 Dual-Band Synchronous Hyperspectral Image Acquisition: A synchronously triggered dual-band hyperspectral imaging system is used to simultaneously acquire the spatial texture information and molecular spectral information of the rice sample to be tested. The 400-1000 nm visible-near-infrared silicon-based camera acquires the two-dimensional spatial texture data of rice grains, and the 900-1700 nm short-wave near-infrared InGaAs camera acquires the molecular spectral data of rice. The data are integrated to obtain a three-dimensional hyperspectral data cube containing spatial-spectral information. S3 hyperspectral data preprocessing: The three-dimensional hyperspectral data cube is sequentially subjected to dual-band synchronous black and white correction, Savitzky-Golay smoothing and noise reduction, thresholding background segmentation, and multi-seed dynamic region of interest (ROI) extraction to obtain purified spatial texture feature data and effective spectral data. S4 Multi-Objective Joint Constraint Feature Band Decoupling: Based on the physical overlap characteristics of the feature peaks of the six core quality indicators of rice, a loss function that minimizes the joint prediction error of the six indicators is constructed. The effective spectral data is then screened using the CARS-SPA coupling algorithm with multi-objective constraints to obtain the optimal feature band set that is highly correlated with all six indicators and has the lowest collinearity among the bands. S5 Spatial-Spectral Dual-Branch Fusion Multi-Indicator Synchronous Detection: Construct a spatial-spectral dual-branch fusion detection model. Input spatial texture feature data into the 1D-CNN feature extraction branch to complete the appearance feature extraction of broken rice rate and chalkiness. Input the optimal feature band set into the PLSR feature fitting branch to complete the spectral-content fitting of 4 chemical indicators. After the dual-branch features are spliced by the fusion layer, the quantitative detection results of 6 core quality indicators are output simultaneously with one input. S6's dual closed-loop control throughout the entire production process: It compares real-time detection results with national standard target thresholds to calculate quality deviations. Through dual closed-loop control logic, it adjusts the production equipment parameters for drying, rice milling, and polishing processes in real time to achieve full-process closed-loop control of rice quality.
2. The detection method according to claim 1, characterized in that, In step S3, the specific method for dual-band synchronous black-and-white correction is as follows: For cameras in two bands, acquire a full-white image of a primary polytetrafluoroethylene standard white board within the corresponding band response range, and a full-black image with the lens cap closed. The reflectance of the two bands is synchronously corrected using the formula R=(IB) / (WB); where R is the corrected reflectance image, I is the original hyperspectral image, B is the full-black image, and W is the full-white image. The multi-grain dynamic ROI extraction uses connected component analysis to remove broken grains and impurities with an area lower than a preset threshold, retaining only the effective data of intact rice grains.
3. The detection method according to claim 1, characterized in that, In step S4, the specific steps of the CARS-SPA coupling algorithm with multi-objective constraints are as follows: S4-1: With the goal of minimizing the root mean square error of the joint prediction of the six core quality indicators, the Monte Carlo sampling number is set to 50 times and 5-fold cross-validation is used. The competitive adaptive reweighted sampling CARS algorithm is used to initially select 50 candidate bands that are highly correlated with all six indicators from the entire band. S4-2: With the minimum inter-band variable projection importance (VIP) value and collinearity as the optimization objectives, 25-35 characteristic bands are selected from the candidate bands through the continuous projection algorithm SPA to form the optimal characteristic band set.
4. The detection method according to claim 3, characterized in that, In step S4, the optimal characteristic band set includes the characteristic wavelengths and chemical bond assignments corresponding to six core quality indicators: Moisture corresponds to characteristic bands of 970 nm, 1200 nm, and 1450 nm, representing second- and first-order overtone absorption peaks of OH bond stretching vibrations; Protein corresponds to characteristic bands of 1020 nm, 1190 nm, and 1510 nm, representing second- and first-order overtone absorption peaks of NH bond stretching vibrations; Amylose corresponds to characteristic bands of 1040 nm, 1360 nm, and 1580 nm, representing overtone absorption peaks of CH and OH bond stretching vibrations; Fatty acid value corresponds to characteristic bands of 1210 nm, 1390 nm, and 1650 nm, representing overtone absorption peaks of CH and C=O bond stretching vibrations; Broken rice rate corresponds to characteristic bands of 450 nm, 550 nm, 680 nm, and 880 nm, representing visible light characteristic reflectance peaks of grain appearance texture; Chalkiness corresponds to characteristic bands of 550 nm, 680 nm, and 880 nm. nm represents the visible-near-infrared characteristic reflection peak of chalky tissue scattering properties.
5. The detection method according to claim 1, characterized in that: In step S5, the training method for the spatial-spectral dual-branch fusion detection model includes the following steps: S5-1 Dataset Construction: Rice samples of different varieties, origins, and storage times were collected, and hyperspectral data were collected using the method described in claim 1. At the same time, the true values of six core quality indicators were determined using national standard methods to construct a labeled dataset, wherein the true value determination methods all adopted national standard methods. S5-2 Transfer Learning Pre-training: The 1D-CNN branch is pre-trained using a large dataset of publicly available near-infrared spectra and appearance images of agricultural products to learn the general feature rules of the appearance texture of agricultural product grains and the spectrum of organic molecules. The parameters of the first 3 convolutional layers of the 1D-CNN branch after pre-training are frozen. S5-3 Fine-tuning Training: Using the rice-labeled dataset, the remaining layers of the 1D-CNN branch, the PLSR branch, and the feature fusion layer are jointly fine-tuned and trained, with the minimum joint prediction mean square error of the six indicators as the loss function. S5-4 Model Validation: The model was validated using test set samples that were not used in training. The determination coefficient R0 of the model for the six core quality indicators was calculated. 2 Model training is complete when all values are ≥0.93 and the average relative error is ≤2.5%.
6. The detection method according to claim 1, characterized in that, The detection method is applicable to the laboratory offline sampling mode. In step S2, the hyperspectral data acquisition adopts the static push-broom mode. The rice to be tested is fixed on the electric translation stage. The scanning speed of the translation stage is 8-12 mm / s. The exposure time of the 400-1000 nm camera is 15-20 ms, and the exposure time of the 900-1700 nm camera is 20-25 ms.
7. The detection method according to claim 1, characterized in that, The detection method is applicable to the online continuous detection mode of rice drying and processing production lines. In step S2, the hyperspectral data acquisition adopts the dynamic line scan mode. The rice sample to be tested is laid flat on the production line transmission platform through a vibrating feeding device. The transmission speed is 1-2 m / s, which is synchronously matched with the line scan frequency of the dual-band camera. The dual-band synchronous dynamic black and white correction and baseline calibration are set to be performed every 1-2 hours to eliminate the detection drift caused by light source aging and temperature and humidity fluctuations.
8. The detection method according to claim 7, characterized in that, In the online continuous detection mode, the dynamic black-and-white correction and baseline calibration adopt a sliding window standard calibration combined with Kalman filter drift compensation method. Specifically, a standard polytetrafluoroethylene calibration plate with a fixed position is built into the detection chamber of the production line. The spectral data of the calibration plate is automatically collected every 1-2 hours. The detection drift is fitted by the Kalman filter algorithm, and the baseline offset of the model is automatically corrected to ensure that the absolute error of the detection does not exceed the national standard allowable threshold after 48 hours of continuous operation.
9. The detection method according to claim 1, characterized in that, In step S6, the dual closed-loop control specifically includes: S6-1 Drying process: The feed inlet detects the moisture content and particle size distribution of the raw materials, and feeds forward to pre-adjust the initial hot air temperature and feed rate of the drying tower; the discharge outlet detects the finished product moisture content and breakage rate in real time, and provides feedback to fine-tune the hot air temperature and drying time. S6-2 Rice milling process: The rice milling machine detects the raw material particle shape and moisture content, and feeds forward to pre-adjust the initial pressure and speed of the rice milling roller; the rice milling machine detects the broken rice rate in real time and feeds back to fine-tune the roller pressure and speed. S6-3 Polishing process: Before polishing, chalkiness is detected and polishing pressure and water spray volume are pre-adjusted; After polishing, the chalkiness and appearance of the finished product are detected in real time and polishing parameters are fine-tuned based on feedback. S6-4 Finished Product Grading Process: Based on the synchronous testing results of 6 core quality indicators, the rice national standard grade determination and separate storage are automatically completed.
10. A multi-quality index online detection and closed-loop control system for rice, used to implement the method described in any one of claims 1-9, characterized in that, The system includes a dual-band hyperspectral imaging detection unit, a PLC central control unit, a production execution unit, and a human-machine interaction unit. The dual-band hyperspectral imaging detection unit is installed at the rice production line's feed inlet, before and after the rice milling process, before and after the polishing process, and at the finished product outlet. It is used to synchronously collect spatial-spectral hyperspectral data of rice and output real-time detection results for six core quality indicators. The PLC central control unit incorporates the detection model and dual closed-loop control algorithm described in claim 1, used to receive real-time detection results, calculate quality deviations, and output control commands. The production execution unit includes a drying tower hot air furnace actuator, a feeding / discharging frequency converter actuator, a rice milling machine actuator, and a polishing machine actuator, used to receive control commands and automatically adjust production operating parameters. The human-machine interaction unit is used to display detection data and equipment operating status in real time and receive parameter setting commands from users.
Citation Information
Patent Citations
Rice quality online nondestructive testing device based on hyperspectral imaging
CN203275285U