A rice milling control method and system based on rice processing precision

By integrating an industrial camera into a rice milling machine to acquire dynamic image sequences of rice grains in real time, extracting multi-dimensional visual features and constructing a dynamic prediction model, the problems of detection lag and poor control accuracy in existing rice milling control methods are solved, achieving real-time and precise rice milling control.

CN122098752BActive Publication Date: 2026-06-30SINOGRAIN CHENGDU STORAGE RESEARCH INSTITUTE CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SINOGRAIN CHENGDU STORAGE RESEARCH INSTITUTE CO LTD
Filing Date
2026-04-29
Publication Date
2026-06-30

AI Technical Summary

Technical Problem

Existing rice milling control methods suffer from detection lag, poor control accuracy, and inability to adapt to the processing requirements of new batches of brown rice. Furthermore, traditional visual inspection solutions cannot achieve real-time feedback and dynamic control.

Method used

By integrating an industrial camera into a rice milling machine to acquire dynamic image sequences of rice grains in real time, multi-dimensional visual features are extracted. Combined with a time-aware cross-attention mechanism and a long short-term memory network, a dynamic prediction model is constructed to achieve real-time processing accuracy prediction and automatic shutdown control.

Benefits of technology

It achieves real-time and precise rice milling control, improves the consistency of processing accuracy and control efficiency, and is suitable for laboratory scenarios with fixed sample quantities and independent batches.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122098752B_ABST
    Figure CN122098752B_ABST
Patent Text Reader

Abstract

This invention relates to the field of grain processing control technology, and discloses a rice milling control method and system based on rice processing precision. It aims to solve the problems of existing methods, such as detection lag, poor control precision, and inability to adapt to the processing requirements of new batches of brown rice. The solution mainly includes: acquiring dynamic images of rice milling using an industrial camera and extracting multi-dimensional visual features; extracting initial features of brown rice before milling and retrieving benchmark parameters from a database; dividing the milling stage according to dynamic temporal features and adjusting the sampling frequency; fusing the features through cross-attention and a temporal network to obtain a visual milling index, which is then mapped to processing precision; dynamically predicting the remaining time based on the visual index and benchmark parameters, and automatically stopping the machine when deviation and time conditions are met. This invention achieves in-situ dynamic visual perception and closed-loop adaptive control of the rice milling process, solves the cold start problem in batch-independent scenarios, and significantly improves the consistency of rice milling precision and control efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of grain processing control technology, specifically to a rice milling control method and system based on rice processing precision. Background Technology

[0002] Rice milling process control is a core element determining the quality and economic benefits of rice processing. The core objective of rice milling is to maximize the head rice yield and minimize energy consumption while processing brown rice to the desired precision. However, due to batch-to-batch variations in raw material characteristics such as paddy variety, moisture content, and origin, as well as dynamic changes in equipment status and environmental conditions during processing, achieving precise rice milling process control has always been a challenge for the industry.

[0003] Existing rice milling process control methods mainly fall into three categories: first, open-loop timed control, which sets a fixed milling time based on experience; this method cannot adapt to fluctuations in raw materials and suffers from poor consistency in processing accuracy; second, offline feedback control, which involves manually adjusting parameters after stopping the machine to take samples for testing; this method is inefficient and wasteful of samples; and third, database matching control, which establishes a database linking raw material information with control parameters; this method has poor adaptability to new varieties and new operating conditions and lacks real-time prediction and endpoint decision-making capabilities. For laboratory rice milling scenarios with fixed sample quantities and independent batches, none of the above methods can achieve precise control with a single sample preparation and no sampling throughout the entire process.

[0004] In evaluating the effectiveness of rice milling control, rice processing precision is a core indicator for measuring the quality of the rice milling process and the finished product. Currently, the detection of processing precision mainly relies on methods specified in relevant standards, including comparative observation, instrumental testing, and direct observation. These methods generally have the following limitations: First, the testing process requires pretreatment of the sample, such as staining and stabilization, which constitutes destructive sampling, altering the original state of the sample, and the test results lag significantly behind the production process; second, it relies on manual comparison or sensory judgment of each grain, resulting in low efficiency, poor consistency, and difficulty in guaranteeing reproducibility.

[0005] In recent years, machine vision technology has been attempted to be applied to the control of rice milling processes. For example, patent application CN121091769A discloses a fully automated control method and system for rice milling machines based on multimodal data fusion. This method establishes a "raw material information-control parameters-processing results" association library, performs similarity matching on new raw materials, and then calls historical control parameters. However, this method relies on a large-scale historical database, has poor adaptability to new varieties and new operating conditions, and lacks real-time prediction and shutdown decision-making capabilities.

[0006] For example, application publication number CN116593466A discloses an automated detection method for rice processing precision. This method first samples rice from the production line, arranges the rice grains in a single layer without stacking using a arranging device, and then allows them to slide down a chute. Next, images of the rice grains in the chute are acquired from different angles to obtain preliminary images. Then, the images from different angles of the same batch are preprocessed to obtain feature parameters. Finally, an automated detection terminal obtains the processing precision detection result for each individual grain of rice according to a preset detection model, and adjusts the processing parameters accordingly via a controller. Although this method incorporates machine vision, it requires sampling from the production line, offline arrangement, and grain-by-grain detection in a static or quasi-static chute. It cannot achieve in-situ real-time observation within the grinding chamber, and the detection process interrupts normal production, resulting in a lag in the detection results. This makes it difficult to meet the continuous feedback and closed-loop control requirements for processing precision during dynamic grinding. Summary of the Invention

[0007] This invention aims to solve the problems of existing rice milling control methods, such as detection lag, poor control accuracy, and inability to adapt to the processing requirements of new batches of brown rice. It proposes a rice milling control method and system based on the processing accuracy of rice.

[0008] The technical solution adopted by the present invention to solve the above-mentioned technical problems is as follows:

[0009] In a first aspect, the present invention provides a rice milling control method based on rice processing precision, the method comprising:

[0010] Step 1: In the rice milling machine, an optical viewing window is integrated, and an industrial camera deployed at the optical viewing window is used to capture a dynamic image sequence of rice grains in a tumbling motion inside the whitening chamber.

[0011] Step 2: Perform moving target detection and tracking on the dynamic image sequence, extract the annular region of interest of the rice grain group under centrifugal state, and extract multi-dimensional visual features after preprocessing the image in the annular region of interest; the multi-dimensional visual features include: color features, texture features and shape features representing the properties of the rice grain itself, as well as spatial distribution features and dynamic temporal features representing the environmental properties of the milling process;

[0012] Step 3: At the beginning of the milling process, the initial static feature vector of the brown rice is extracted, and the pre-constructed milling database is retrieved based on the initial static feature vector to obtain the reference kinetic parameters of the current batch of brown rice samples. The reference kinetic parameters include the reference characteristic time constant and the reference steady-state physical limit.

[0013] Step 4: Based on the pre-built grinding database, determine the statistical critical threshold set of dynamic time-series features using an unsupervised clustering algorithm, and determine the current grinding stage based on the comparison results between the real-time extracted dynamic time-series features and the statistical critical threshold set. Dynamically adjust the sampling frequency of the industrial camera according to the current grinding stage; the grinding stage includes the early grinding stage, the middle grinding stage, or the late grinding stage.

[0014] Step 5: Decouple and reconstruct the multi-dimensional visual features into target vector and environment vector. Based on a time-aware cross-attention mechanism, fuse the target vector and environment vector to obtain a fused feature vector. Based on the fused feature vector and a pre-built time-aware long short-term memory network, obtain the visual abrasion degree index. Based on a pre-built regression mapping model, map the visual abrasion degree index to the corresponding real-time processing accuracy prediction value.

[0015] Step 6: Obtain the target processing accuracy set by the user, and convert it into a target visual abrasion degree index through the regression mapping model; based on the real-time output visual abrasion degree index and the benchmark dynamic parameters, construct and continuously update a dynamic prediction model describing the abrasion process, and estimate the predicted remaining processing time required to reach the target visual abrasion degree index in real time according to the dynamic prediction model.

[0016] Step 7: When the deviation between the visual abrasion degree index and the target visual abrasion degree index is less than or equal to the preset error, and the predicted remaining processing time meets the preset safe shutdown conditions, a shutdown command is generated, and the rice milling motor is controlled to stop according to the shutdown command.

[0017] Further, in step 4, determining the current grinding stage specifically includes:

[0018] Step 401: Based on the initial static feature vector, retrieve the pre-constructed milling database, and use the database mapping function to retrieve the division threshold matching the current batch of brown rice samples, i.e.:

[0019] ;

[0020] in, For the initial static feature vector, For a pre-built grinding database, This is a database mapping function. To determine the watershed threshold between the early and middle stages of grinding, To determine the watershed threshold from the middle to the later stages of grinding;

[0021] Step 402: In real-time dynamic processing, introduce a length of [length missing] based on the dynamically extracted time-series features. A sliding time window, where the sampling time of each frame within the window is... Extract the corresponding The feature values ​​of each feature dimension constitute the feature vector. ,Right now:

[0022] ;

[0023] in, Indicates the first Each feature dimension at time... eigenvalues, , Indicates matrix transpose;

[0024] Step 403: Use the least squares method to fit the local linear trend of the dynamic time-series feature values ​​within the window, and solve for the slope of each feature dimension:

[0025] ;

[0026] in, For the first The slope of the local linear trend of the feature values ​​of each feature dimension within the window. The corresponding intercept, The frame number within the sliding time window. The frame number at the current moment;

[0027] Step 404: Construct the current time step using the slopes of each feature dimension obtained from the fitting. Multidimensional feature evolution gradient vector ,Right now:

[0028] ;

[0029] Step 405: Introduce the offline calibrated physical sensitivity weight vector Calculate the weighted L2 norm of the gradient vector to obtain the overall dynamic grinding efficiency. :

[0030] ;

[0031] in, This is the physical sensitivity weight vector. For the first Weight coefficients for each feature dimension This indicates element-wise multiplication. Represents the L2 norm;

[0032] Step 406: Calculate the overall dynamic grinding efficiency. And determine the current grinding stage by dividing the threshold:

[0033] When satisfied At that time, it was determined to be the early stage of grinding, in which, The hysteresis interval;

[0034] When satisfied At that time, it was determined to be the middle stage of grinding;

[0035] When satisfied At that time, it was determined to be in the later stage of grinding.

[0036] Further, in step 5, the multi-dimensional visual features are decoupled and reconstructed into target vectors and environment vectors, specifically including:

[0037] The extracted color features, texture features, and shape features are used to construct a target vector, and the extracted spatial distribution features and dynamic temporal features are used to construct an environment vector, i.e.:

[0038] ;

[0039] ;

[0040] in, Indicates the current moment. For the target vector, For environment vectors, Represents the color feature vector. Represents texture feature vectors, Represents the shape feature vector. Represents the spatial distribution feature vector. Represents dynamic time-series feature vectors. This indicates the matrix transpose.

[0041] Furthermore, in step 5, the target vector and the environment vector are fused based on a time-aware cross-attention mechanism, specifically including:

[0042] Step 501: Transfer the environment vector As the query vector, the target vector Mapping to key vectors and value vectors generates a matrix:

[0043] ;

[0044] ;

[0045] ;

[0046] in, Indicates the current moment. For query vector, For key vectors, For value vectors, , , The weight matrix is ​​a learnable matrix. , , It is the bias vector;

[0047] Step 502: Calculate the current time step by using the inner product of the query vector and the key vector. Attention weights are assigned to each feature within the image region:

[0048] ;

[0049] in, This is the dynamic attention weight vector. For normalized exponential functions, Key vector The feature dimension size, Scaling factor , , These are the attention weights for color, texture, and shape features, respectively.

[0050] Step 503: Utilize the dynamic attention weight vector Sum value vector , thus obtaining the fused feature vector :

[0051] .

[0052] Further, in step 5, obtaining the fused feature vector specifically includes:

[0053] Step 511: Input the non-equidistant time intervals caused by frequency conversion sampling as independent time gating parameters to generate a time gate. :

[0054] ;

[0055] in, The time interval between the current moment and the previous moment. It is the Sigmoid activation function. , Here are the learnable weight matrix and bias vector for the time gate. For time gates;

[0056] Step 512: Generate candidate memories based on the fused feature vector, and dynamically update the temporal memory cells using the time gate:

[0057] ;

[0058] in, This refers to the current state of memory cells. For long-term memory of the previous moment, The fused feature vector based on the current time step The generated candidate memories;

[0059] Step 513: Update the temporal memory cell state As a temporal feature embedding, it is input into a regression network and outputs a visual abrasion degree index;

[0060] During training, the time-aware long short-term memory network incorporates a monotonicity constraint penalty term in its loss function.

[0061] ;

[0062] in, As a monotonicity constraint penalty term, As a penalty weighting coefficient, The total number of frames in the time series. To find the maximum value function, , These are the visual abrasion indexes output at the current and previous moments, respectively. This is the preset monotonic relaxation amount.

[0063] Furthermore, in step 5, the method for constructing the regression mapping model includes:

[0064] Construct an end-to-end aligned dataset, and based on the end-to-end aligned dataset, train a regression mapping model to establish a mapping relationship between the visual abrasion degree index and the actual physical tannin retention, so that the regression mapping model can convert the visual abrasion degree index into the corresponding actual physical tannin retention, which is the quantitative indicator of rice processing precision.

[0065] The end-to-end aligned dataset is constructed as follows:

[0066] At the instant the discharge command is issued, the multidimensional visual feature flow of rice in a tumbling and flowing state in the whitening chamber is captured as transient visual feature; after the discharge command is issued, the finished rice in a static state that has fallen into the dewatering chamber is extracted, and the real physical husk retention degree obtained by chemical staining method is used as steady-state physicochemical label; the transient visual feature is paired with the physicochemical label to construct an end-to-end aligned dataset.

[0067] Furthermore, in step 6, the dynamic prediction model is constructed based on a first-order nonlinear dynamic physical evolution equation:

[0068] ;

[0069] in, This represents the visual wear and tear index at the current moment. For steady-state physical limits, This is the initial visual abrasion index. is the base of the natural logarithm. The characteristic time constant;

[0070] The predicted remaining processing time is obtained by inversely deriving the target visual abrasion degree index into the latest first-order nonlinear dynamic physical evolution equation:

[0071] ;

[0072] in, To predict the remaining processing time, The feature time constant for real-time identification, For real-time identification of steady-state physical limits, Represents the natural logarithm. The visual abrasion index of the target.

[0073] Furthermore, in step 7, the preset safety shutdown condition is:

[0074] ;

[0075] in, To predict the remaining processing time, Total delay for electromechanical execution, The confidence coefficient is... This represents the uncertainty of the current dynamic prediction model.

[0076] Furthermore, the method also includes:

[0077] After each convergence of parameter identification for the dynamic prediction model, the kinetic degradation index of the current batch of brown rice samples is calculated. :

[0078] ;

[0079] in, The feature time constant for real-time identification, The reference time constant;

[0080] Using historical batches of brown rice samples from the local database The sequence is estimated online for its probability density distribution, and the alarm threshold under the current grinding disc state is dynamically calculated. ;

[0081] when If the wear and tear continues for more than the preset period, the system will determine if the grinding disc is worn or has rice oil residue, and output a corresponding diagnostic report.

[0082] Secondly, the present invention provides a rice milling control system based on rice processing precision, for implementing the rice milling control method based on rice processing precision as described in the first aspect, the system comprising:

[0083] An industrial camera, deployed at the optical viewing window of the rice milling machine, is used to capture dynamic image sequences of rice grains in a tumbling motion within the whitening chamber.

[0084] The visual feature extraction module is used to detect and track moving targets in the dynamic image sequence, extract the annular region of interest of the rice grain group under centrifugal state, and extract multi-dimensional visual features after preprocessing the image in the annular region of interest. The multi-dimensional visual features include: color features, texture features and shape features that characterize the properties of the rice grain itself, as well as spatial distribution features and dynamic temporal features that characterize the environmental properties of the milling process.

[0085] The variable frequency sampling control module is used to determine the statistical critical threshold set of dynamic time-series features based on a pre-built grinding database through an unsupervised clustering algorithm, and to determine the current grinding stage based on the comparison results of the dynamically extracted time-series features and the statistical critical threshold set. The module then dynamically adjusts the sampling frequency of the industrial camera according to the current grinding stage. The grinding stage includes the early grinding stage, the middle grinding stage, or the late grinding stage.

[0086] The processing accuracy prediction module is used to decouple and reconstruct the multi-dimensional visual features into target vectors and environment vectors, fuse the target vectors and environment vectors based on a time-aware cross-attention mechanism to obtain a fused feature vector; obtain a visual abrasion degree index based on the fused feature vector and a pre-built time-aware long short-term memory network; and map the visual abrasion degree index to the corresponding real-time processing accuracy prediction value based on a pre-built regression mapping model.

[0087] The reference kinetic parameter determination module is used to extract an initial static feature vector at the beginning of the milling stage, and retrieve a pre-constructed milling database based on the initial static feature vector to obtain the reference kinetic parameters of the current batch of brown rice samples. The reference kinetic parameters include a reference characteristic time constant and a reference steady-state physical limit.

[0088] The remaining processing time prediction module is used to obtain the target processing accuracy set by the user, and convert it into a target visual abrasion degree index through the regression mapping model; based on the real-time output visual abrasion degree index and the benchmark dynamic parameters, a dynamic prediction model describing the abrasion process is constructed and continuously updated, and the predicted remaining processing time required to reach the target visual abrasion degree index is estimated in real time according to the dynamic prediction model.

[0089] The shutdown control module is used to generate a shutdown command when the deviation between the visual abrasion degree index and the target visual abrasion degree index is less than or equal to a preset error, and the predicted remaining processing time meets the preset safe shutdown conditions, and to control the rice milling motor to stop according to the shutdown command.

[0090] The beneficial effects of this invention are as follows: The rice milling control method and system based on rice processing precision provided by this invention overcomes the drawbacks of traditional offline detection lag and destructive sampling by real-time acquisition of dynamic image sequences of rice grains during the milling process and extraction of multi-dimensional visual features; by extracting the initial static features of brown rice before milling and retrieving benchmark parameters from the database, the cold start problem in batch-independent scenarios is solved; by dynamically dividing the milling stages and adjusting the sampling frequency, both process response and computing efficiency are taken into account; by multimodal visual feature fusion and temporal network modeling, a continuous and monotonic visual milling degree index is obtained and mapped to a processing precision prediction value, overcoming the defects of single-frame static analysis being susceptible to dust and stacking interference; a dynamic prediction model based on real-time visual index and benchmark parameters is constructed and continuously updated to estimate the remaining processing time in real time, achieving accurate prediction of the endpoint; finally, the machine automatically stops when both deviation and time conditions are met, thus constructing a complete real-time closed-loop control based on visual feedback. Therefore, this invention upgrades rice milling control from static time-distance control that relies on human experience to dynamic adaptive control based on visual feedback. It is especially suitable for laboratory precision sample preparation scenarios with fixed sample quantities and independent batches, significantly improving the consistency of rice milling accuracy and control efficiency. Attached Figure Description

[0091] Figure 1 A schematic flowchart of a rice milling control method based on rice processing precision provided in an embodiment;

[0092] Figure 2 This is a schematic diagram of the structure of a rice milling control system based on rice processing precision, provided as an example. Detailed Implementation

[0093] To enable those skilled in the art to better understand the present invention, the technical solutions in this embodiment will be clearly and completely described below with reference to the accompanying drawings.

[0094] Existing rice milling control methods struggle to achieve real-time closed-loop control based on visual feedback, primarily due to two reasons: First, traditional processing accuracy detection relies on offline sampling and destructive preprocessing, resulting in detection results that lag significantly behind the production process and fail to provide continuous feedback signals for real-time control. Second, existing visual detection schemes are mostly based on static, off-site single-frame image analysis, which is ill-suited to the dynamic conditions of dust-laden, high-speed tumbling and stacking of rice grains during milling. Single-frame features are easily affected by noise, disrupting the temporal trend of milling state evolution over time. Furthermore, control strategies generally employ open-loop timing control or rely on historical database matching, lacking the ability to identify and adaptively adjust the dynamic characteristics of the current batch of brown rice. This leads to poor control accuracy and an inability to accurately predict the processing endpoint when faced with batch fluctuations in varieties, moisture content, and freshness.

[0095] Based on this, the technical solution of this invention is proposed. In this invention, firstly, an industrial camera integrated into the optical window of the rice milling machine is used to acquire real-time dynamic image sequences of the high-speed tumbling of rice grains inside the whitening chamber. After moving target detection and extraction of the circular region of interest, multi-dimensional visual features such as color, texture, shape, spatial distribution, and dynamic temporal sequence are obtained. Simultaneously, before milling begins, the initial static feature vector of the brown rice is extracted. By retrieving a pre-constructed milling database, the baseline dynamic parameters of the current batch of brown rice are obtained, solving the cold start problem in batch-independent scenarios. Based on this, by comparing the dynamic temporal features with statistical critical thresholds in the database, the milling process is dynamically divided into early, middle, and late stages, and the sampling frequency is adaptively adjusted to balance the sensitivity of the process response and computational power. Efficiency; Subsequently, the multi-dimensional visual features are decoupled and reconstructed into target vectors and environment vectors, which are then fused through a time-aware cross-attention mechanism and processed by a time-aware long short-term memory network to obtain a continuous and monotonic visual abrasion degree index. This index is then converted into a real-time processing accuracy prediction value through a regression mapping model. Finally, the target visual abrasion degree index is calculated in reverse based on the user-defined target processing accuracy. A dynamic prediction model is constructed and continuously updated by combining the real-time visual index with the baseline dynamic parameters to estimate the remaining processing time required to reach the target in real time. When the visual index deviation and the remaining time simultaneously meet the preset conditions, a stop command is automatically generated, thus forming a complete closed-loop control from "perception" to "prediction" to "decision execution".

[0096] The technical solutions in this embodiment will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments.

[0097] Figure 1 A flowchart illustrating a rice milling control method based on rice processing precision is shown. Please refer to [link / reference]. Figure 1 The method includes the following steps:

[0098] Step 1: In the rice milling machine, an integrated optical viewing window is used to capture a dynamic image sequence of rice grains in a tumbling motion within the whitening chamber using an industrial camera deployed at the optical viewing window.

[0099] Specifically, to enable in-situ observation of rice grains in the whitening chamber under complex flow conditions such as high-speed tumbling, stacking, and frictional whitening, this embodiment integrates a high-transmittance, high-wear-resistant hard optical viewing window above the whitening chamber of the rice milling machine, and deploys a global shutter industrial camera at this window. By setting short exposure time and high-resolution imaging parameters, and with active light source illumination, image trailing and deformation distortion caused by high-speed movement of rice grains are eliminated. The camera uses continuous acquisition or external strobe triggering to continuously capture dynamic image sequences of rice grains in the whitening chamber at a high frame rate, ensuring that the acquired images are continuous in time, providing a clear and stable raw data foundation for subsequent moving target detection and feature extraction.

[0100] Step 2: Perform moving target detection and tracking on the dynamic image sequence, extract the annular region of interest of the rice grain group under centrifugal state, and extract multi-dimensional visual features after preprocessing the image in the annular region of interest; the multi-dimensional visual features include: color features, texture features and shape features representing the properties of the rice grain itself, as well as spatial distribution features and dynamic temporal features representing the environmental properties of the milling process.

[0101] Specifically, to extract effective information from high frame rate dynamic image sequences, firstly, moving target detection and tracking algorithms (such as optical flow and target matching algorithms) are used to identify and locate the rice grains undergoing circular tumbling motion under centrifugal force in the whitening chamber. Based on this, the annular region of interest (ROI) of the rice grains under centrifugal force is dynamically extracted. To address motion blur, dust adhesion, and background interference within this region, preprocessing operations such as median filtering and fixed threshold filtering are performed sequentially to enhance image quality and highlight rice grain edges and the skin-retaining area. Subsequently, multi-dimensional visual features are extracted from the preprocessed annular ROI, including:

[0102] (1) Color features: The preprocessed annular region of interest image is mapped to multiple color spaces (such as RGB, HSV, Lab, etc.), and the mean, standard deviation, skewness, kurtosis and other statistical quantities of each channel are calculated. A color histogram is constructed to quantify the degree of residual cortex and color change on the surface of rice grains.

[0103] (2) Texture features: Local binary mode and gray-level co-occurrence matrix are used to extract texture statistics (such as contrast, correlation, energy, homogeneity, etc.). Combined with morphological operations, the texture distribution pattern of the rice grain skin area and the dorsal groove is analyzed in order to capture the local details of the skin peeling process.

[0104] (3) Shape characteristics: Extract the geometric parameters of rice grains, including Hu invariant moment, projected area, perimeter, aspect ratio, roundness, solidity, etc., to describe the shape contour characteristics of a single grain of rice, and provide morphological basis for subsequent matching with variety information in the milling database.

[0105] (4) Spatial distribution characteristics: Based on the global image within the frame or the annular region of interest, the gray-level histogram statistics, gray-level gradient amplitude distribution and the proportion of rice grain gap area are analyzed to quantify the stacking density and spatial distribution uniformity of rice grains in the whitening chamber in real time, reflecting the group stacking state during the grinding process.

[0106] (5) Dynamic temporal characteristics: This includes two dimensions: kinematic characteristics and temporal evolution characteristics. Kinematic characteristics are extracted by inter-frame optical flow calculation or target matching algorithm to extract macroscopic motion speed, tumbling intensity, collision frequency and other flow parameters of the rice grain group, which characterize the dynamic state in the grinding chamber. Temporal evolution characteristics are obtained by mathematical difference analysis of the temporal sequence of the aforementioned color, texture, shape and spatial distribution characteristics, and extracting derivative characteristics such as rate of change, acceleration, fluctuation amplitude, change period and overall trend, which are used to reveal the dynamic evolution law of the grinding state over time and provide a basis for the subsequent division of grinding stages.

[0107] The joint extraction of the above multidimensional features provides a state representation basis for subsequent fusion modeling.

[0108] Step 3: At the beginning of the milling process, the initial static feature vector of the brown rice is extracted, and the pre-constructed milling database is retrieved based on the initial static feature vector to obtain the reference kinetic parameters of the current batch of brown rice samples. The reference kinetic parameters include the reference characteristic time constant and the reference steady-state physical limit.

[0109] Specifically, to address the cold-start problem in batch-independent scenarios—where a lack of prior knowledge about new brown rice prevents the direct activation of dynamic prediction models—this embodiment acquires static images of brown rice samples using an industrial camera during a brief, relatively static window before milling begins, i.e., before the rice grain bran has peeled off. Feature vectors reflecting the intrinsic properties of brown rice are extracted from these images, including but not limited to grain shape, aspect ratio, roundness, initial color distribution, and texture, forming the initial static feature vector of the brown rice. Subsequently, using this initial static feature vector as an index, a pre-built milling database is retrieved. This database stores a large amount of historical data. The intrinsic characteristics and corresponding prior kinetic parameters of the historical batch of brown rice are used to obtain the baseline kinetic parameters that best match the current batch of brown rice samples through feature similarity matching or mapping function calculation. The baseline feature time constant represents the peeling rate characteristics of the batch of brown rice under standard working conditions, and the baseline steady-state physical limit represents the limit of visual milling degree index that the batch of brown rice may reach after full milling. The obtained baseline parameters will serve as the initial iteration baseline of the subsequent dynamic prediction model, enabling the rapid establishment of a high-confidence prediction starting point when facing unknown batches, thereby ensuring the accuracy and convergence speed of closed-loop control.

[0110] Step 4: Based on the pre-built grinding database, determine the statistical critical threshold set of dynamic time-series features using an unsupervised clustering algorithm, and determine the current grinding stage based on the comparison results between the real-time extracted dynamic time-series features and the statistical critical threshold set. Dynamically adjust the sampling frequency of the industrial camera according to the current grinding stage; the grinding stage includes the early grinding stage, the middle grinding stage, or the late grinding stage.

[0111] Specifically, the sampling frequency is dynamically adjusted according to the current grinding stage to balance system computing power and control accuracy. In the early stage of grinding, when the target accuracy is far away, low-frequency sampling is used to save computing power; in the middle stage of grinding, when the target accuracy is gradually approached, medium-frequency sampling is used to capture trend changes; and in the later stage of grinding, high-frequency sampling is used to ensure the accuracy of the shutdown time.

[0112] In this embodiment, determining the current grinding stage specifically includes:

[0113] Step 401: Based on the initial static feature vector, retrieve the pre-constructed milling database, and use the database mapping function to retrieve the division threshold matching the current batch of brown rice samples, i.e.:

[0114] ;

[0115] in, For the initial static feature vector, For a pre-built grinding database, This is a database mapping function. To determine the watershed threshold between the early and middle stages of grinding, To determine the watershed threshold from the middle to the later stages of grinding;

[0116] Step 402: In real-time dynamic processing, introduce a length of [length missing] based on the dynamically extracted time-series features. A sliding time window, where the sampling time of each frame within the window is... Extract the corresponding The feature values ​​of each feature dimension constitute the feature vector. ,Right now:

[0117] ;

[0118] in, Indicates the first Each feature dimension at time... eigenvalues, , Indicates matrix transpose;

[0119] Step 403: Use the least squares method to fit the local linear trend of the dynamic time-series feature values ​​within the window, and solve for the slope of each feature dimension:

[0120] ;

[0121] in, For the first The slope of the local linear trend of the feature values ​​of each feature dimension within the window. The corresponding intercept, The frame number within the sliding time window. The frame number at the current moment;

[0122] Step 404: Construct the current time step using the slopes of each feature dimension obtained from the fitting. Multidimensional feature evolution gradient vector ,Right now:

[0123] ;

[0124] Step 405: Introduce the offline calibrated physical sensitivity weight vector Calculate the weighted L2 norm of the gradient vector to obtain the overall dynamic grinding efficiency. :

[0125] ;

[0126] in, This is the physical sensitivity weight vector. For the first Weight coefficients for each feature dimension This indicates element-wise multiplication. Represents the L2 norm;

[0127] Step 406: Calculate the overall dynamic grinding efficiency. And determine the current grinding stage by dividing the threshold:

[0128] When satisfied At that time, it was determined to be the early stage of grinding, in which, The hysteresis interval;

[0129] When satisfied At that time, it was determined to be the middle stage of grinding;

[0130] When satisfied At that time, it was determined to be in the later stage of grinding.

[0131] Specifically, the dynamic division of the grinding stage is achieved through the following process:

[0132] First, based on the initial static feature vector of brown rice extracted before milling begins... Retrieve pre-built grinding database Using database mapping functions Get the segmentation threshold that matches the current batch of brown rice. These two thresholds serve as the benchmark for subsequent judgments; during real-time processing, a length of... A sliding time window is used to extract frames one by one within the window. The eigenvalues ​​of each feature dimension are used to form a sequence of feature vectors. The least squares method is used to perform local linear fitting on the change trend of each feature within the window, and the slope of each feature at the current time is calculated. These slopes together constitute the multi-dimensional feature evolution gradient vector. This is used to quantitatively describe the rate of change of dynamic temporal characteristics in each dimension; subsequently, an offline-calibrated physical sensitivity weight vector is introduced. The weighted L2 norm of the gradient vector is calculated to obtain the overall dynamic grinding efficiency. This scalar value comprehensively reflects the changes in the tribological state within the grinding chamber; finally, With the threshold for division, a hysteresis interval is formed. Numerical comparison: when At this time, it is determined to be the early stage of milling, when the rice grain bran is intact and undergoes drastic dynamic changes; when At this point, it is determined to be the middle stage of grinding, when the cortex gradually peels off and the rate of change slows down; when At this point, it is determined to be the late stage of milling, when the brown rice is close to the target precision and the dynamic changes tend to be gradual.

[0133] Step 5: Decouple and reconstruct the multi-dimensional visual features into target vector and environment vector, and fuse the target vector and environment vector based on a time-aware cross-attention mechanism to obtain a fused feature vector; obtain the visual abrasion degree index based on the fused feature vector and a pre-built time-aware long short-term memory network; map the visual abrasion degree index to the corresponding real-time processing accuracy prediction value based on a pre-built regression mapping model.

[0134] Specifically, this step aims to progressively convert multi-dimensional visual features into quantifiable processing accuracy predictions. First, the extracted multi-dimensional visual features are decoupled and reconstructed into two types of vectors: a target vector composed of color, texture, and shape, used to directly represent the degree of peeling of the rice grains; and an environmental vector composed of spatial distribution and dynamic temporal sequence, used to reflect the fluid environment and working conditions changes within the whitening chamber. Then, a time-aware cross-attention mechanism is introduced, using the environmental vector as a query condition to dynamically calculate the attention weights of each feature in the target vector, and then weighted and fused to obtain a fused feature vector. This fused feature vector is input into a time-aware long short-term memory network (LSTM). By introducing non-equidistant time intervals as gating parameters, the LTM is compatible with variable frequency sampling mechanisms, learns the dynamic evolution of the whitening process in the temporal dimension, and outputs a continuous, monotonic visual whitening degree index. Finally, through a pre-constructed regression mapping model, the visual whitening degree index is mapped to the corresponding real-time processing accuracy prediction value, thus achieving end-to-end quantitative representation from raw visual features to processing accuracy, providing high-fidelity feedback signals for subsequent closed-loop control.

[0135] In this embodiment, a time-aware cross-attention mechanism is used to fuse the target vector and the environment vector, specifically including:

[0136] Step 501: Transfer the environment vector As the query vector, the target vector Mapping to key vectors and value vectors generates a matrix:

[0137] ;

[0138] ;

[0139] ;

[0140] in, Indicates the current moment. For query vector, For key vectors, For value vectors, , , The weight matrix is ​​a learnable matrix. , , It is the bias vector;

[0141] Step 502: Calculate the current time step by using the inner product of the query vector and the key vector. Attention weights are assigned to each feature within the image region:

[0142] ;

[0143] in, This is the dynamic attention weight vector. For normalized exponential functions, Key vector The feature dimension size, Scaling factor , , These are the attention weights for color, texture, and shape features, respectively.

[0144] Step 503: Utilize the dynamic attention weight vector Sum value vector , thus obtaining the fused feature vector :

[0145] .

[0146] In practical applications, firstly, the environment vector is... As a query vector, it is used to characterize the environmental state of the current grinding stage; the target vector is used as a query vector. A learnable weight matrix is ​​used to map key vectors and value vectors, respectively. The key vectors are used for relevance matching with the query vector, while the value vectors carry the ontological feature information to be weighted. Then, the inner product of the query vector and the key vector is calculated, normalized by a scaling factor, and then... Function converted to attention weight vector The three components of this vector correspond to the weight coefficients of color, texture, and shape features, respectively. Their values ​​are influenced by the current environmental state. For example, in the later stages of milling, when environmental features tend to stabilize, the attention weights dynamically focus on the color features that best reflect the degree of skin retention, while in the early stages of milling, more attention may be paid to shape features to assist in variety identification. Finally, the calculated attention weight vector and value vector are weighted and summed to obtain the fused feature vector. Through this mechanism, environmental vectors serve as gating conditions to dynamically adjust the contribution of ontological features in the fusion process. This allows the model to adaptively focus on the most discriminative feature dimensions based on the grinding stage, thereby effectively suppressing the impact of environmental disturbances such as dust and stacking on ontological feature extraction and providing a more robust state representation for subsequent temporal modeling.

[0147] In this embodiment, obtaining the fused feature vector specifically includes:

[0148] Step 511: Input the non-equidistant time intervals caused by frequency conversion sampling as independent time gating parameters to generate a time gate. :

[0149] ;

[0150] in, The time interval between the current moment and the previous moment. It is the Sigmoid activation function. , Here are the learnable weight matrix and bias vector for the time gate. For time gates;

[0151] Step 512: Generate candidate memories based on the fused feature vector, and dynamically update the temporal memory cells using the time gate:

[0152] ;

[0153] in, This refers to the current state of memory cells. For long-term memory of the previous moment, The fused feature vector based on the current time step The generated candidate memories;

[0154] Step 513: Update the temporal memory cell state As a temporal feature embedding, it is input into a regression network and outputs a visual abrasion degree index;

[0155] During training, the time-aware long short-term memory network incorporates a monotonicity constraint penalty term in its loss function.

[0156] ;

[0157] in, As a monotonicity constraint penalty term, As a penalty weighting coefficient, The total number of frames in the time series. To find the maximum value function, , These are the visual abrasion indexes output at the current and previous moments, respectively. This is the preset monotonic relaxation amount.

[0158] Specifically, the Time-Aware Long Short-Term Memory (LSTM) network achieves effective modeling of non-equidistant time series under variable-frequency sampling by introducing a time gating mechanism and monotonicity constraints. First, the Time-Aware LSM network addresses the non-equidistant time intervals caused by variable-frequency sampling. The time difference between the current frame and the previous frame is used as an independent time gating parameter input, which is then mapped by the Sigmoid activation function to generate the time gate. The time gate, ranging from 0 to 1, reflects the impact of time interval length on memory updates. The longer the time interval, the closer the time gate is to 1, indicating faster decay of short-term memory weights, thus effectively overcoming the phase distortion problem of traditional time-series networks under variable frequency conditions. Subsequently, the time-aware long short-term memory network uses the fused feature vector at the current moment... Generate candidate memories It also uses time gates to dynamically update memory cells, and the updated state of memory cells... From the long-term memory of the previous moment The current candidate memory state is weighted and combined with the existing candidate memory state, with the weights controlled by a time gate. This allows the time-aware long short-term memory network to adaptively adjust the fusion ratio of historical and current information according to the actual time interval, achieving temporal alignment of cross-frequency features. The updated memory cell state is embedded as a temporal feature and input into the regression network, outputting a visual abrasion index. .

[0159] Furthermore, to ensure that the output index continuously and monotonically reflects the irreversibility of the grinding process, the Time-Aware Long Short-Term Memory (TSSMemory) network adds a monotonicity constraint penalty term to the loss function during the training phase. This term penalizes non-physical increases in the output of adjacent frames (i.e., the current frame index is greater than the previous frame index by exceeding the relaxation amount), forcing the TSSMemory network to learn a monotonically decreasing mapping relationship that conforms to the unidirectional evolution law of the grinding process. Through the above design, the TSSMemory network not only accommodates the frequency conversion sampling mechanism but also ensures the physical rationality of the output visual grinding degree index, providing a reliable temporal feature basis for subsequent processing accuracy mapping.

[0160] In this embodiment, the method for constructing the regression mapping model includes:

[0161] Construct an end-to-end aligned dataset, and based on the end-to-end aligned dataset, train a regression mapping model to establish a mapping relationship between the visual abrasion degree index and the actual physical tannin retention, so that the regression mapping model can convert the visual abrasion degree index into the corresponding actual physical tannin retention, which is the quantitative indicator of rice processing precision.

[0162] The end-to-end aligned dataset is constructed as follows:

[0163] At the instant the discharge command is issued, the multidimensional visual feature flow of rice in a tumbling and flowing state in the whitening chamber is captured as transient visual feature; after the discharge command is issued, the finished rice in a static state that has fallen into the dewatering chamber is extracted, and the real physical husk retention degree obtained by chemical staining method is used as steady-state physicochemical label; the transient visual feature is paired with the physicochemical label to construct an end-to-end aligned dataset.

[0164] Specifically, the regression mapping model aims to establish a non-linear mapping relationship between the visual abrasion degree index and the standard skin retention, achieving a quantitative conversion from real-time visual features to final processing accuracy. The model's construction includes two core components: the construction of an end-to-end aligned dataset and the training of the mapping model.

[0165] In constructing the end-to-end aligned dataset, this embodiment employs a spatiotemporal alignment method between transient visual features and steady-state physicochemical labels to eliminate errors introduced by downtime and mechanical inertia in traditional calibration methods. Specifically, at the instant the discharge command is issued, the multidimensional visual feature flow of rice still in a stable tumbling flow state within the whitening chamber is captured as the transient visual feature. After the discharge command is issued, once the finished rice has completely fallen into the dewatering chamber and is stationary, its true physical husk retention is detected using a chemical staining method, serving as the steady-state physicochemical label. The transient visual features corresponding to the same discharge command are paired with the steady-state physicochemical labels to construct the end-to-end aligned dataset. Through this alignment method, the model can implicitly learn the additional mechanical cutting work during training, from "issuance of the discharge command" to "complete removal of rice grains from the whitening chamber." This ensures that the visual grinding degree index output during online simulation no longer corresponds to the instantaneous accuracy within the whitening chamber, but rather to "the true processing accuracy if grinding were stopped at this moment, ultimately falling into the dewatering chamber."

[0166] Based on the aforementioned end-to-end aligned dataset, a regression mapping model (which can employ structures such as multilayer perceptron or support vector regression) is trained to establish a mapping relationship between the visual abrasion degree index and the actual physical husk retention. Since the actual physical husk retention is a quantitative indicator of rice processing precision, this regression mapping model enables the real-time output of the visual abrasion degree index to be accurately converted into a predicted value of rice processing precision that conforms to relevant standards, thereby providing quantitative feedback consistent with relevant standards for closed-loop control.

[0167] Step 6: Obtain the target processing accuracy set by the user, and convert it into a target visual abrasion degree index through the regression mapping model; based on the real-time output visual abrasion degree index and the benchmark dynamic parameters, construct and continuously update a dynamic prediction model describing the abrasion process, and estimate the predicted remaining processing time required to reach the target visual abrasion degree index in real time according to the dynamic prediction model.

[0168] Specifically, this step aims to build a dynamic prediction model that can adapt to the characteristics of the current batch of brown rice, and based on this dynamic prediction model, to estimate in real time the remaining processing time required to achieve the target accuracy.

[0169] In practical applications, firstly, the user-defined target processing precision (such as the tannin retention range corresponding to "appropriate milling" or "fine milling") is obtained. This target processing precision is then converted into a corresponding target visual milling degree index using a pre-built regression mapping model, ensuring that subsequent control targets remain consistent with relevant standard definitions. Subsequently, based on the real-time output visual milling degree index and the baseline dynamic parameters (including the baseline feature time constant and the baseline steady-state physical limit) obtained in step 3, a dynamic prediction model describing the milling process is constructed. During the milling process, using the newly output visual milling degree index for each frame, key parameters in the dynamic prediction model, including the real-time feature time constant and the real-time steady-state physical limit, are continuously updated through an online learning algorithm (such as recursive least squares). This allows the dynamic prediction model to dynamically adapt to the actual milling characteristics differences in the current batch of brown rice caused by factors such as variety, moisture content, and freshness. Based on the updated dynamic prediction model, the predicted remaining processing time required to reach the target visual milling degree index is calculated in reverse. By employing a mechanism of initialization, continuous updating, and reverse prediction, accurate endpoint prediction for individual batches of brown rice is achieved, providing dynamic time-based data for subsequent shutdown decisions based on the actual milling process. This effectively overcomes the limitations of traditional timed control or fixed models that cannot adapt to batch fluctuations in brown rice.

[0170] In this embodiment, the dynamic prediction model is constructed based on a first-order nonlinear dynamic physical evolution equation:

[0171] ;

[0172] in, This represents the visual wear and tear index at the current moment. For steady-state physical limits, This is the initial visual abrasion index. is the base of the natural logarithm. The characteristic time constant;

[0173] The predicted remaining processing time is obtained by inversely deriving the target visual abrasion degree index into the latest first-order nonlinear dynamic physical evolution equation:

[0174] ;

[0175] in, To predict the remaining processing time, The feature time constant for real-time identification, For real-time identification of steady-state physical limits, Represents the natural logarithm. The visual abrasion index of the target.

[0176] Specifically, the aforementioned first-order nonlinear kinetic physical evolution equation describes the nonlinear characteristics of rice grain bran peeling in an exponentially decaying manner. The peeling rate is relatively fast in the initial stage of milling, but as the bran gradually thins and the friction coefficient changes, the peeling rate slows down exponentially, eventually approaching the steady-state physical limit. This form is consistent with the actual physical characteristics of the rice milling process. The equation contains three key parameters: the steady-state physical limit... This represents the limit value that the visual abrasion index can reach after thorough abrasion, and is a characteristic time constant. The rate of peeling, and the initial visual abrasion index. This is the initial value at the start of the grinding process.

[0177] In actual control, the visual smoothing index of each newly output frame is used. The characteristic time constant and steady-state physical limit are identified in real time using an online learning algorithm, resulting in the real-time identified characteristic time constant. and the steady-state physical limit of real-time identification This allows the dynamic prediction model to dynamically adapt to the actual milling characteristics differences of the current batch of brown rice caused by factors such as variety, moisture content, and freshness. Based on the updated model parameters, the target visual milling degree index set by the user is obtained by inversely solving the exponential equation. Substitute the values ​​and calculate the predicted remaining processing time required to reach the target accuracy from the current state. This reverse engineering process fully utilizes the physical laws of the milling process. Even with independent batches of brown rice and no historical data, the dynamic prediction model can still dynamically predict the processing endpoint based on real-time observation, providing a reliable time basis for subsequent shutdown decisions.

[0178] Step 7: When the deviation between the visual abrasion degree index and the target visual abrasion degree index is less than or equal to the preset error, and the predicted remaining processing time meets the preset safe shutdown conditions, a shutdown command is generated, and the rice milling motor is controlled to stop according to the shutdown command.

[0179] In this embodiment, the preset safety shutdown condition is:

[0180] ;

[0181] in, To predict the remaining processing time, Total delay for electromechanical execution, The confidence coefficient is... This represents the uncertainty of the current dynamic prediction model.

[0182] Specifically, the shutdown decision in this step does not rely solely on a single visual index bias judgment, but introduces a multi-condition triggering mechanism that integrates the remaining prediction time, hardware latency, and model uncertainty to ensure the accuracy and robustness of the shutdown timing.

[0183] In practical applications, the deviation between the current visual abrasion degree index and the target visual abrasion degree index is monitored in real time. When this deviation falls within the preset error range, it indicates that the accuracy is close to the target. Simultaneously, the remaining processing time is calculated and predicted. and compare it with the total delay of electromechanical execution. and confidence coefficient With model uncertainty The sum of the products is compared only when... Only when the current time window is satisfied is it confirmed that the target accuracy is sufficiently approximated while also allowing ample lead time to compensate for the mechanical and electrical delays from the issuance of the command to the actual stop of the motor. Furthermore, an adaptive margin is provided for the model prediction error by multiplying the confidence coefficient and the model uncertainty, avoiding false triggering due to transient disturbances. Only when both of the above conditions are met is a stop command officially generated and the rice milling motor controlled to stop. This effectively suppresses false stops caused by dynamic disturbances such as rice grain tumbling and dust obstruction, while ensuring that the processing accuracy does not overshoot, thus achieving zero overshoot and high reliability of automatic endpoint control.

[0184] In this embodiment, the method further includes:

[0185] After each convergence of parameter identification for the dynamic prediction model, the kinetic degradation index of the current batch of brown rice samples is calculated. :

[0186] ;

[0187] in, The feature time constant for real-time identification, The reference time constant;

[0188] Using historical batches of brown rice samples from the local database The sequence is estimated online for its probability density distribution, and the alarm threshold under the current grinding disc state is dynamically calculated. ;

[0189] when If the wear and tear continues for more than the preset period, the system will determine if the grinding disc is worn or has rice oil residue, and output a corresponding diagnostic report.

[0190] Specifically, after each convergence of parameter identification for the dynamic prediction model, the kinetic degradation index of the current batch of brown rice samples is calculated. That is, the feature time constant for real-time identification. With reference time constant The ratio. Wherein, the reference time constant... The prior parameters obtained from the milling database based on the initial static feature vector of brown rice in step 3 characterize the peeling rate characteristics of this batch of brown rice under standard working conditions; the feature time constant is identified in real time. This reflects the combined peeling rate resulting from the coupling of changes in the milling disc's condition (such as wear and rice oil adhesion) and the characteristics of brown rice during the actual milling process. When the milling disc is worn or adhered with rice oil, the milling efficiency decreases, leading to a decrease in the time constant for real-time identification. Relative to the baseline value Increase, therefore The value can effectively quantify the macroscopic degree of decline in grinding efficiency.

[0191] Based on this, this embodiment utilizes historical batches stored in a local database. The sequence is estimated online for its probability density distribution, and the alarm threshold under the current grinding disc state is dynamically calculated. This threshold is adaptively updated based on historical data accumulation, capable of distinguishing between natural fluctuations in brown rice and equipment degradation. To avoid false alarms caused by a single instance of non-standard brown rice, a multi-period judgment mechanism is introduced, only detecting errors when... The value continuously exceeds the dynamic threshold Furthermore, only when the preset cycle is exceeded is it determined that the grinding wheel has suffered severe wear or is covered with rice oil, and a corresponding diagnostic report and maintenance suggestions (such as cleaning the grinding wheel, lightly grinding, or replacing the grinding wheel) are output to the host computer. Through the above mechanism, this embodiment realizes quantitative early warning and graded guidance for the wear of the grinding wheel in the whitening chamber, providing an objective basis for equipment maintenance and effectively ensuring the stability of control accuracy during long-term cross-batch processing.

[0192] In summary, the rice milling control method based on rice processing precision provided in this embodiment achieves in-situ, continuous quantification of processing precision by real-time acquisition of dynamic images of rice grains and extraction of multi-dimensional visual features, avoiding the lag and destructive sampling of traditional offline detection. By extracting the initial static features of brown rice before milling and retrieving benchmark parameters from the database, the cold start problem in batch-independent scenarios is solved, enabling the method to adapt to brown rice samples of different varieties and states. By dynamically dividing the milling stages and adaptively adjusting the sampling frequency, computational power is saved in non-critical stages, while feedback accuracy is ensured in critical stages, balancing the contradiction between computational power bottlenecks and control precision. By decoupling and reconstructing visual features and fusing them with a temporal network through a cross-attention mechanism, dust and stacking are effectively suppressed. The system outputs a continuous and monotonous visual milling degree index to mitigate interference from dynamic operating conditions. By constructing an end-to-end regression mapping model, a quantitative conversion between the visual index and standard processing precision is achieved. A continuously updated dynamic prediction model, built upon real-time visual indices and benchmark parameters, can identify brown rice characteristics in real time and inversely extrapolate the remaining processing time, enabling accurate prediction of the processing endpoint. The shutdown decision integrates both precision deviation and remaining time conditions, and introduces electromechanical delay and model uncertainty as safety margins, effectively suppressing false triggers and achieving highly reliable automatic shutdown. Furthermore, by comparing real-time identification with the benchmark time constant to calculate the kinetic degradation index, and combining historical data to dynamically calculate alarm thresholds, quantitative early warning and graded guidance for mill disc wear or rice oil adhesion are achieved. Therefore, this embodiment constructs a complete perception-prediction-decision-execution closed-loop control system, upgrading rice milling control from static time-distance control relying on human experience to dynamic adaptive control based on visual feedback. This is particularly suitable for laboratory precision sample preparation scenarios with fixed sample quantities and independent batches, significantly improving the consistency of rice milling precision and control efficiency.

[0193] Based on the above technical solution, this embodiment also proposes a rice milling control system based on rice processing precision, used to implement the rice milling control method based on rice processing precision as described in the embodiment. Please refer to [link to relevant documentation]. Figure 2 The system includes:

[0194] An industrial camera, deployed at the optical viewing window of the rice milling machine, is used to capture dynamic image sequences of rice grains in a tumbling motion within the whitening chamber.

[0195] The visual feature extraction module is used to detect and track moving targets in the dynamic image sequence, extract the annular region of interest of the rice grain group under centrifugal state, and extract multi-dimensional visual features after preprocessing the image in the annular region of interest. The multi-dimensional visual features include: color features, texture features and shape features that characterize the properties of the rice grain itself, as well as spatial distribution features and dynamic temporal features that characterize the environmental properties of the milling process.

[0196] The variable frequency sampling control module is used to determine the statistical critical threshold set of dynamic time-series features based on a pre-built grinding database through an unsupervised clustering algorithm, and to determine the current grinding stage based on the comparison results of the dynamically extracted time-series features and the statistical critical threshold set. The module then dynamically adjusts the sampling frequency of the industrial camera according to the current grinding stage. The grinding stage includes the early grinding stage, the middle grinding stage, or the late grinding stage.

[0197] The processing accuracy prediction module is used to decouple and reconstruct the multi-dimensional visual features into target vectors and environment vectors, fuse the target vectors and environment vectors based on a time-aware cross-attention mechanism to obtain a fused feature vector; obtain a visual abrasion degree index based on the fused feature vector and a pre-built time-aware long short-term memory network; and map the visual abrasion degree index to the corresponding real-time processing accuracy prediction value based on a pre-built regression mapping model.

[0198] The reference kinetic parameter determination module is used to extract an initial static feature vector at the beginning of the milling stage, and retrieve a pre-constructed milling database based on the initial static feature vector to obtain the reference kinetic parameters of the current batch of brown rice samples. The reference kinetic parameters include a reference characteristic time constant and a reference steady-state physical limit.

[0199] The remaining processing time prediction module is used to obtain the target processing accuracy set by the user, and convert it into a target visual abrasion degree index through the regression mapping model; based on the real-time output visual abrasion degree index and the benchmark dynamic parameters, a dynamic prediction model describing the abrasion process is constructed and continuously updated, and the predicted remaining processing time required to reach the target visual abrasion degree index is estimated in real time according to the dynamic prediction model.

[0200] The shutdown control module is used to generate a shutdown command when the deviation between the visual abrasion degree index and the target visual abrasion degree index is less than or equal to a preset error, and the predicted remaining processing time meets the preset safe shutdown conditions, and to control the rice milling motor to stop according to the shutdown command.

[0201] It is understood that since the rice milling control system based on rice processing precision described in this embodiment is a system for implementing the rice milling control method based on rice processing precision described in the embodiment, the system disclosed in the embodiment is relatively simple to describe because it corresponds to the method disclosed in the embodiment. For relevant parts, please refer to the description of the method, and it will not be repeated here.

Claims

1. A rice milling control method based on rice processing precision, characterized in that, The method includes: Step 1: In the rice milling machine, an optical viewing window is integrated, and an industrial camera deployed at the optical viewing window is used to capture a dynamic image sequence of rice grains in a tumbling motion inside the whitening chamber. Step 2: Perform moving target detection and tracking on the dynamic image sequence, extract the annular region of interest of the rice grain group under centrifugal state, and extract multi-dimensional visual features after preprocessing the image in the annular region of interest; the multi-dimensional visual features include: color features, texture features and shape features representing the properties of the rice grain itself, as well as spatial distribution features and dynamic temporal features representing the environmental properties of the milling process; Step 3: At the beginning of the milling process, the initial static feature vector of the brown rice is extracted, and the pre-constructed milling database is retrieved based on the initial static feature vector to obtain the reference kinetic parameters of the current batch of brown rice samples. The reference kinetic parameters include the reference characteristic time constant and the reference steady-state physical limit. Step 4: Based on the pre-built grinding database, determine the statistical critical threshold set of dynamic time-series features using an unsupervised clustering algorithm, and determine the current grinding stage based on the comparison results between the real-time extracted dynamic time-series features and the statistical critical threshold set. Dynamically adjust the sampling frequency of the industrial camera according to the current grinding stage; the grinding stage includes the early grinding stage, the middle grinding stage, or the late grinding stage. Step 5: Decouple and reconstruct the multi-dimensional visual features into target vector and environment vector. Based on a time-aware cross-attention mechanism, fuse the target vector and environment vector to obtain a fused feature vector. Based on the fused feature vector and a pre-built time-aware long short-term memory network, obtain the visual abrasion degree index. Based on a pre-built regression mapping model, map the visual abrasion degree index to the corresponding real-time processing accuracy prediction value. Step 6: Obtain the target processing accuracy set by the user, and convert it into a target visual abrasion degree index through the regression mapping model; based on the real-time output visual abrasion degree index and the benchmark dynamic parameters, construct and continuously update a dynamic prediction model describing the abrasion process, and estimate the predicted remaining processing time required to reach the target visual abrasion degree index in real time according to the dynamic prediction model. Step 7: When the deviation between the visual abrasion degree index and the target visual abrasion degree index is less than or equal to the preset error, and the predicted remaining processing time meets the preset safe shutdown conditions, a shutdown command is generated, and the rice milling motor is controlled to stop according to the shutdown command.

2. The rice milling control method based on rice processing precision according to claim 1, characterized in that, Step 4, determining the current grinding stage, specifically includes: Step 401: Based on the initial static feature vector, retrieve the pre-constructed milling database, and use the database mapping function to retrieve the division threshold matching the current batch of brown rice samples, i.e.: ; in, For the initial static feature vector, For a pre-built grinding database, This is a database mapping function. To determine the watershed threshold between the early and middle stages of grinding, To determine the watershed threshold from the middle to the later stages of grinding; Step 402: In real-time dynamic processing, introduce a length of [length missing] based on the dynamically extracted time-series features. A sliding time window, where the sampling time of each frame within the window is... Extract the corresponding The feature values ​​of each feature dimension constitute the feature vector. ,Right now: ; in, Indicates the first Each feature dimension at time... eigenvalues, , Indicates matrix transpose; Step 403: Use the least squares method to fit the local linear trend of the dynamic time-series feature values ​​within the window, and solve for the slope of each feature dimension: ; in, For the first The slope of the local linear trend of the feature values ​​of each feature dimension within the window. The corresponding intercept, The frame number within the sliding time window. The frame number at the current moment; Step 404: Construct the current time step using the slopes of each feature dimension obtained from the fitting. Multidimensional feature evolution gradient vector ,Right now: ; Step 405: Introduce the offline calibrated physical sensitivity weight vector Calculate the weighted L2 norm of the gradient vector to obtain the overall dynamic grinding efficiency. : ; in, This is the physical sensitivity weight vector. For the first Weight coefficients for each feature dimension This indicates element-wise multiplication. Represents the L2 norm; Step 406: Calculate the overall dynamic grinding efficiency. And determine the current grinding stage by dividing the threshold: When satisfied At that time, it was determined to be the early stage of grinding, in which, The hysteresis interval; When satisfied At that time, it was determined to be the middle stage of grinding; When satisfied At that time, it was determined to be in the later stage of grinding.

3. The rice milling control method based on rice processing precision according to claim 1, characterized in that, In step 5, the multi-dimensional visual features are decoupled and reconstructed into target vectors and environment vectors, specifically including: The extracted color features, texture features, and shape features are used to construct a target vector, and the extracted spatial distribution features and dynamic temporal features are used to construct an environment vector, i.e.: ; ; in, Indicates the current moment. For the target vector, For environment vectors, Represents the color feature vector. Represents texture feature vectors, Represents the shape feature vector. Represents the spatial distribution feature vector. Represents dynamic time-series feature vectors. This indicates the matrix transpose.

4. The rice milling control method based on rice processing precision according to claim 1, characterized in that, In step 5, the target vector and the environment vector are fused based on a time-aware cross-attention mechanism, specifically including: Step 501: Transfer the environment vector As the query vector, the target vector Mapping to key vectors and value vectors generates a matrix: ; ; ; in, Indicates the current moment. For query vector, For key vectors, For value vectors, , , The weight matrix is ​​a learnable matrix. , , It is the bias vector; Step 502: Calculate the current time step by using the inner product of the query vector and the key vector. Attention weights are assigned to each feature within the image region: ; in, This is the dynamic attention weight vector. For normalized exponential functions, Key vector The size of the feature dimension. Scaling factor , , These are the attention weights for color, texture, and shape features, respectively. Step 503: Utilize the dynamic attention weight vector Sum value vector , thus obtaining the fused feature vector : 。 5. The rice milling control method based on rice processing precision according to claim 1, characterized in that, Step 5, obtaining the fused feature vector, specifically includes: Step 511: Input the non-equidistant time intervals caused by frequency conversion sampling as independent time gating parameters to generate a time gate. : ; in, The time interval between the current moment and the previous moment. It is the Sigmoid activation function. , Here are the learnable weight matrix and bias vector for the time gate. For time gates; Step 512: Generate candidate memories based on the fused feature vector, and dynamically update the temporal memory cells using the time gate: ; in, This refers to the current state of memory cells. For long-term memory of the previous moment, The fused feature vector based on the current time step The generated candidate memories; Step 513: Update the temporal memory cell state As a temporal feature embedding, it is input into a regression network and outputs a visual abrasion degree index; During training, the time-aware long short-term memory network incorporates a monotonicity constraint penalty term in its loss function. ; in, As a monotonicity constraint penalty term, As a penalty weighting coefficient, The total number of frames in the time series. To find the maximum value function, , These are the visual abrasion indexes output at the current and previous moments, respectively. This is the preset monotonic relaxation amount.

6. The rice milling control method based on rice processing precision according to claim 1, characterized in that, In step 5, the method for constructing the regression mapping model includes: Construct an end-to-end aligned dataset, and based on the end-to-end aligned dataset, train a regression mapping model to establish a mapping relationship between the visual abrasion degree index and the actual physical tannin retention, so that the regression mapping model can convert the visual abrasion degree index into the corresponding actual physical tannin retention, which is the quantitative indicator of rice processing precision. The end-to-end aligned dataset is constructed as follows: At the instant the discharge command is issued, the multidimensional visual feature flow of rice in a tumbling and flowing state in the whitening chamber is captured as transient visual feature; after the discharge command is issued, the finished rice in a static state that has fallen into the dewatering chamber is extracted, and the real physical husk retention degree obtained by chemical staining method is used as steady-state physicochemical label; the transient visual feature is paired with the physicochemical label to construct an end-to-end aligned dataset.

7. The rice milling control method based on rice processing precision according to claim 1, characterized in that, In step 6, the dynamic prediction model is constructed based on the first-order nonlinear dynamic physical evolution equation: ; in, This represents the visual wear and tear index at the current moment. For steady-state physical limits, This is the initial visual abrasion index. is the base of the natural logarithm. The characteristic time constant; The predicted remaining processing time is obtained by inversely deriving the target visual abrasion degree index into the latest first-order nonlinear dynamic physical evolution equation: ; in, To predict the remaining processing time, The feature time constant for real-time identification, For real-time identification of steady-state physical limits, Represents the natural logarithm. The visual abrasion index of the target.

8. The rice milling control method based on rice processing precision according to claim 1, characterized in that, In step 7, the preset safety shutdown condition is: ; in, To predict the remaining processing time, Total delay for electromechanical execution, The confidence coefficient is... This represents the uncertainty of the current dynamic prediction model.

9. The rice milling control method based on rice processing precision according to claim 1, characterized in that, The method further includes: After each convergence of parameter identification for the dynamic prediction model, the kinetic degradation index of the current batch of brown rice samples is calculated. : ; in, The feature time constant for real-time identification, The reference time constant; Using historical batches of brown rice samples from the local database The sequence is estimated online for its probability density distribution, and the alarm threshold under the current grinding disc state is dynamically calculated. ; when If the wear and tear continues for more than the preset period, the system will determine if the grinding disc is worn or has rice oil residue, and output a corresponding diagnostic report.

10. A rice milling control system based on rice processing precision, characterized in that, For implementing the rice milling control method based on rice processing precision as described in any one of claims 1 to 9, the system comprises: An industrial camera, deployed at the optical viewing window of the rice milling machine, is used to capture dynamic image sequences of rice grains in a tumbling motion within the whitening chamber. The visual feature extraction module is used to detect and track moving targets in the dynamic image sequence, extract the annular region of interest of the rice grain group under centrifugal state, and extract multi-dimensional visual features after preprocessing the image in the annular region of interest. The multi-dimensional visual features include: color features, texture features and shape features that characterize the properties of the rice grain itself, as well as spatial distribution features and dynamic temporal features that characterize the environmental properties of the milling process. The variable frequency sampling control module is used to determine the statistical critical threshold set of dynamic time-series features based on a pre-built grinding database through an unsupervised clustering algorithm, and to determine the current grinding stage based on the comparison results of the dynamically extracted time-series features and the statistical critical threshold set. The module then dynamically adjusts the sampling frequency of the industrial camera according to the current grinding stage. The grinding stage includes the early grinding stage, the middle grinding stage, or the late grinding stage. The processing accuracy prediction module is used to decouple and reconstruct the multi-dimensional visual features into target vectors and environment vectors, fuse the target vectors and environment vectors based on a time-aware cross-attention mechanism to obtain a fused feature vector; obtain a visual abrasion degree index based on the fused feature vector and a pre-built time-aware long short-term memory network; and map the visual abrasion degree index to the corresponding real-time processing accuracy prediction value based on a pre-built regression mapping model. The reference kinetic parameter determination module is used to extract an initial static feature vector at the beginning of the milling stage, and retrieve a pre-constructed milling database based on the initial static feature vector to obtain the reference kinetic parameters of the current batch of brown rice samples. The reference kinetic parameters include a reference characteristic time constant and a reference steady-state physical limit. The remaining processing time prediction module is used to obtain the target processing accuracy set by the user, and convert it into a target visual abrasion degree index through the regression mapping model; based on the real-time output visual abrasion degree index and the benchmark dynamic parameters, a dynamic prediction model describing the abrasion process is constructed and continuously updated, and the predicted remaining processing time required to reach the target visual abrasion degree index is estimated in real time according to the dynamic prediction model. The shutdown control module is used to generate a shutdown command when the deviation between the visual abrasion degree index and the target visual abrasion degree index is less than or equal to a preset error, and the predicted remaining processing time meets the preset safe shutdown conditions, and to control the rice milling motor to stop according to the shutdown command.