A wheat flour quality detection system and method based on computer vision
By constructing a coupled benchmark between a deep visual AI model and a physical calibration model in the wheat flour quality inspection system and monitoring the decoupling index in real time, the problem of difficulty in monitoring the reliability of AI models in industrial settings is solved, enabling the system's autonomous diagnosis and robust control, and ensuring the stability and continuity of the inspection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- LUZHOU VOCATIONAL & TECHN COLLEGE
- Filing Date
- 2026-02-11
- Publication Date
- 2026-04-17
AI Technical Summary
In the absence of real-time external truth labels in industrial settings, existing technologies struggle to effectively monitor the credibility of AI models. This makes it difficult to accurately distinguish the root causes of failures in AI and physical models, potentially leading to false alarms and unnecessary production interventions, which in turn affect the continuity and stability of production.
By constructing a coupling benchmark between a deep vision AI model and a physical calibration model, and monitoring the decoupling index between the two in real time, the system achieves autonomous diagnosis of system reliability and accurate attribution of fault root causes using moving average processing and dynamic arbitration rules. This includes baseline sample feature extraction, mapping model training, feature-physical decoupling index calculation, and hierarchical correction strategies.
It enables autonomous monitoring of system reliability without external real-time labels, accurately diagnoses the root cause of faults, improves the robustness of the system and the continuity of production line operation, avoids erroneous accusations against the AI model due to the failure of the physical model, and ensures the stability and automation level of detection.
Smart Images

Figure CN121686451B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of online automated inspection, specifically to a wheat flour quality inspection system and method based on computer vision. Background Technology
[0002] In the current field of industrial online inspection, computer vision-based AI models are widely used in product quality monitoring. However, these AI models generally face the challenge of credibility drift during long-term operation. Due to the dynamic changes in the production environment, raw materials or equipment status, the performance of AI models may degrade over time. In industrial sites where there is a lack of real-time and accurate external truth labels for continuous calibration, effectively monitoring and diagnosing the credibility status of the AI model itself has become a core problem.
[0003] Existing technologies often struggle to autonomously determine the root cause of errors when dealing with discrepancies between AI model outputs and the calibration results of a deterministic physical model. The system cannot effectively distinguish whether the AI model's performance degrades due to changes in data distribution or whether the physical model used as a reference fails due to changes in its calibration premises. This lack of diagnostic capability may lead the system to erroneously attribute the failure of the physical model to the AI model, thereby triggering false alarms or unnecessary interventions, affecting the continuity and stability of production. Therefore, how to establish a method for reliable self-diagnosis of the detection system without external real-time labels and accurately attributing the source of failure is a technical problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0004] The purpose of this invention is to provide a computer vision-based method and system for wheat flour quality inspection. This aims to solve the problem that AI models, lacking external real-time truth labels, struggle to effectively monitor their reliability during long-term operation. It avoids attributing failures of the physical model (used as a reference) to the AI model, thus preventing unnecessary production interventions. Furthermore, it accurately identifies the root cause of failures, enabling self-diagnosis and robust control of system reliability. Specifically, the technical solution of this invention is as follows:
[0005] A computer vision-based method for wheat flour quality detection includes:
[0006] S1, Acquire microscopic images of the baseline sample;
[0007] S2, Based on the microscopic images of the baseline sample, extract the baseline AI feature vector;
[0008] S3, based on the microscopic image of the baseline sample, extract the baseline physical feature vector;
[0009] S4, based on baseline AI feature vectors and baseline physical feature vectors, trains and generates a mapping model;
[0010] S5, acquire a microscopic image of the current sample;
[0011] S6, Based on the microscopic image of the current sample, extract the current AI feature vector through a preset depth vision AI model;
[0012] S7, based on the current sample's microscopic image, calibrate the current physical feature vector using a preset physical calibration model;
[0013] S8 combines the current AI feature vector with the current physical feature vector and calculates the feature-physics decoupling index through a mapping model;
[0014] S9, based on the time series of the feature-physical decoupling index, the decoupling mean is determined by moving average processing;
[0015] S10: If the decoupling mean is greater than the preset decoupling mean warning threshold, the confidence self-diagnosis process is triggered; if the decoupling mean is less than or equal to the preset decoupling mean warning threshold, S6 to S9 are executed.
[0016] S11, based on the results of the credibility self-diagnosis process, outputs a graded correction strategy through preset dynamic arbitration rules.
[0017] Furthermore, the generative mapping model is trained, including:
[0018] By using baseline AI feature vectors and baseline physical feature vectors, and through regression training, the mapping relationship between baseline physical feature vectors and baseline AI feature vector space is learned to determine the mapping model.
[0019] The mapping model is fixed as the benchmark for subsequent deviation calculations.
[0020] Furthermore, a pre-defined deep vision AI model is used to extract the current AI feature vector related to the microscopic texture of wheat flour;
[0021] A pre-defined physical calibration model is used to calibrate the current physical feature vector related to particle size distribution or protein content based on optical physics theory.
[0022] Furthermore, S8 calculates the characteristic-physical decoupling index, including:
[0023] Input the current physical feature vector into the mapping model to obtain the mapped physical feature vector;
[0024] Based on the cosine distance in the vector space, the deviation between the current AI feature vector and the mapped physical feature vector is calculated and determined as the feature-physical decoupling index.
[0025] Furthermore, the trust self-diagnosis process triggered by S10 includes:
[0026] Step A: Based on the time series of the current AI feature vectors, calculate the feature stability of the AI model and determine the AI variance;
[0027] Step B: Based on the time series of the feature-physical decoupling index, calculate the stability of the bias residuals and determine the residual variance;
[0028] Among them, AI variance and residual variance constitute the results of the credibility self-diagnosis process.
[0029] Furthermore, the preset dynamic arbitration rules in S11 apply AI variance and residual variance, including:
[0030] Rule 1: If the AI variance is greater than or equal to a preset AI threshold, or the residual variance is greater than or equal to a preset residual threshold, then the diagnostic result is determined to be that the AI model has low credibility.
[0031] Rule 2: If the AI variance is less than a preset AI threshold and the residual variance is less than a preset residual threshold, then the diagnosis result is determined to be a physical model failure.
[0032] Furthermore, the graded correction strategy output by S11 includes:
[0033] In response to the diagnostic result indicating low reliability of the AI model, a first-level correction is performed.
[0034] The first-level correction includes: suspending the control of the deep vision AI model over production line decisions and switching to a safe mode;
[0035] In response to the diagnosis that the physical model has failed, a secondary correction is performed;
[0036] The secondary correction includes: temporarily suspending the verification function of the physical calibration model, and continuing to trust the detection results of the deep vision AI model within a preset safe time window.
[0037] A computer vision-based wheat flour quality inspection system includes:
[0038] The image acquisition module is used to acquire microscopic images of the baseline sample and the current sample;
[0039] The baseline feature extraction module is used to extract baseline AI feature vectors and baseline physical feature vectors based on microscopic images of baseline samples.
[0040] The model training module is used to train and generate a mapping model based on baseline AI feature vectors and baseline physical feature vectors.
[0041] The AI feature extraction unit is used to extract the current AI feature vector based on the microscopic image of the current sample using a preset deep vision AI model.
[0042] The physical feature calibration unit is used to calibrate the current physical feature vector based on the current sample's microscopic image using a preset physical calibration model.
[0043] The deviation calculation unit is used to combine the current AI feature vector and the current physical feature vector, and calculate the feature-physics decoupling index through a mapping model;
[0044] The mean monitoring unit is used to determine the decoupling mean by using a moving average process based on the time series of feature-physical decoupling exponents.
[0045] The diagnostic triggering unit is used to trigger the confidence self-diagnosis process when the decoupling mean is greater than the preset decoupling mean warning threshold, and to instruct the AI feature extraction unit, physical feature calibration unit, deviation calculation unit and mean monitoring unit to continue running when the decoupling mean is less than or equal to the preset decoupling mean warning threshold.
[0046] The arbitration correction unit is used to output a graded correction strategy based on the results of the credibility self-diagnosis process and through preset dynamic arbitration rules.
[0047] Furthermore, the system also includes:
[0048] The self-diagnosis module is used to perform a credibility self-diagnosis process to determine the AI variance and residual variance, and use the AI variance and residual variance as the results of the credibility self-diagnosis process.
[0049] The arbitration amendment unit is specifically used for:
[0050] Based on AI variance and residual variance, a pre-defined dynamic arbitration rule is applied to determine the diagnostic result;
[0051] In response to the diagnosis that the AI model has low credibility, a first-level correction instruction is output.
[0052] In response to the diagnosis that the physical model has failed, a secondary correction command is output.
[0053] Among them, the first-level correction instruction is used to pause the control of the deep vision AI model on production line decisions and switch to a safe mode;
[0054] The secondary correction instruction is used to temporarily suspend the verification function of the physical calibration model and continue to trust the detection results of the deep vision AI model within a preset safe time window.
[0055] Compared with the prior art, the present invention has the following beneficial effects:
[0056] 1. This invention constructs a coupling benchmark between a deep vision AI model and a physical calibration model, and monitors the decoupling index between the two in real time. This enables autonomous monitoring and dynamic evaluation of the credibility status within the detection system without the need for external real-time truth labels. This solves the problem that the credibility of the model is difficult to measure due to the lack of continuous calibration methods in industrial settings.
[0057] 2. This invention can accurately diagnose the root cause of a fault, effectively distinguishing between AI model performance drift and failure of the physical model used as a reference. When significant decoupling is detected, the system will attribute the cause by analyzing the stability of AI features and bias residuals, avoiding erroneous accusations against the AI model due to physical model failure, and solving the problem of unclear fault attribution.
[0058] 3. Based on accurate fault diagnosis results, this invention implements a graded correction strategy, which greatly improves the robustness of the system and the continuity of production line operation. When the physical model is determined to be faulty but the AI model is still stable, the system will temporarily trust the judgment of the AI model, avoiding unnecessary downtime due to errors in the verification benchmark and ensuring the detection stability in non-ideal environments.
[0059] 4. This invention constructs a closed-loop adaptive control process from monitoring, diagnosis to correction. This method can not only detect system anomalies, but also autonomously analyze the causes of anomalies and take the most optimized corrective measures. This intelligent design ensures that the detection system can self-adjust when facing changes in the environment or materials, guaranteeing the reliability and automation level of long-term operation. Attached Figure Description
[0060] The present invention will be further explained below with reference to the accompanying drawings and embodiments:
[0061] Figure 1 This is a flowchart of the method of the present invention;
[0062] Figure 2 This is a structural diagram of the system of the present invention. Detailed Implementation
[0063] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to specific embodiments.
[0064] Example 1:
[0065] Please see Figure 1 A computer vision-based method for wheat flour quality detection includes:
[0066] S1, Acquire microscopic images of the baseline sample;
[0067] S2, Based on the microscopic images of the baseline sample, extract the baseline AI feature vector;
[0068] S3, based on the microscopic image of the baseline sample, extract the baseline physical feature vector;
[0069] S4, based on baseline AI feature vectors and baseline physical feature vectors, trains and generates a mapping model;
[0070] S5, acquire a microscopic image of the current sample;
[0071] S6, Based on the microscopic image of the current sample, extract the current AI feature vector through a preset depth vision AI model;
[0072] S7, based on the current sample's microscopic image, calibrate the current physical feature vector using a preset physical calibration model;
[0073] S8 combines the current AI feature vector with the current physical feature vector and calculates the feature-physics decoupling index through a mapping model;
[0074] S9, based on the time series of the feature-physical decoupling index, the decoupling mean is determined by moving average processing;
[0075] S10: If the decoupling mean is greater than the preset decoupling mean warning threshold, the confidence self-diagnosis process is triggered; if the decoupling mean is less than or equal to the preset decoupling mean warning threshold, S6 to S9 are executed.
[0076] S11, based on the results of the credibility self-diagnosis process, outputs a graded correction strategy through preset dynamic arbitration rules.
[0077] This invention provides a computer vision-based method for wheat flour quality detection. This method establishes a coupling verification relationship between a deep vision AI model and a deterministic physical model, and monitors the degree of decoupling of this relationship in real time, thereby autonomously diagnosing the credibility status of the system internally without the need for external real-time labels.
[0078] The initial phase of this method, i.e., the initial stage of system deployment, includes:
[0079] Acquire microscopic images of baseline samples; the purpose of this step is to establish a reference standard for normal or qualified samples; in this embodiment, a microscopic acquisition device is used to acquire a large number of microscopic images of wheat flour samples known to be qualified, which are recorded as the baseline. ;
[0080] Based on the microscopic images of the baseline sample, a baseline AI feature vector is extracted; this feature vector is denoted as the baseline. The aim is to capture the depth statistical features of the microstructure of baseline samples using an AI model;
[0081] Based on the microscopic image of the baseline sample, the baseline physical feature vector is extracted; this feature vector is denoted as the baseline. The aim is to calibrate the interpretable physicochemical properties of baseline samples using deterministic physical models;
[0082] A mapping model is trained based on baseline AI feature vectors and baseline physical feature vectors; the purpose of this step is to establish the mathematical correlation between the AI model and the physical model under normal operating conditions; in this embodiment, a mapping model is trained... To learn the baseline to baseline Spatial mapping relationships; this mapping model Once training is complete, it is fixed and used as a benchmark for subsequent bias calculations;
[0083] After completing the initial coupling verification and fixing the model, the system enters the real-time operation phase on the production line, which includes:
[0084] Acquire microscopic images of the current sample; during real-time operation on the production line, the system updates the image over time. Acquire a microscopic image of the current sample, denoted as . ;
[0085] Based on the microscopic image of the current sample, the current AI feature vector is extracted using a preset depth vision AI model; the preset depth vision AI model is denoted as […] in this embodiment. This refers to a pre-trained deep neural network whose internal weight parameters have been determined through offline training on a large, diverse dataset of wheat flour micrographs; the current AI feature vector is denoted as […] in this embodiment. , refers to the model The output of this method is used to capture high-dimensional statistical features that are difficult for the human eye to perceive and are related to the microscopic texture of wheat flour. The purpose of this extraction process is to map high-dimensional image information to a low-dimensional feature space, and the calculation method is as follows:
[0086] ;
[0087] in, This is the current AI feature vector, and it is the output of this step. It is a pre-defined deep vision AI model; The current microscopic image is the input for this step;
[0088] Based on the current sample's microscopic image, the current physical feature vector is calibrated using a preset physical calibration model; in this embodiment, the preset physical calibration model is denoted as... , refers to a deterministic function based on optical physics theory; its internal parameters have been pre-calibrated in the laboratory using standard samples with known physicochemical properties; the current physical feature vector is denoted as in this embodiment. , refers to the model The output of this algorithm is used to define interpretable physicochemical properties, providing AI features. This provides an interpretable, physics-based reference; the purpose of this calibration process is to quantify the sample from a physics perspective, and the calculation method is as follows:
[0089] ;
[0090] in, This is the current physical feature vector, and it is the output of this step. The physical calibration model is preset; Macroscopic optical properties are derived from current microscopic images. Extracted from;
[0091] By combining the current AI feature vector and the current physical feature vector, a feature-physics decoupling index is calculated using a mapping model; in this embodiment, the feature-physics decoupling index is denoted as... This refers to a method used to quantify AI models. Judgment and physical model A scalar measure of the consistency between the calibrations; the purpose of this step is to calculate the actual output of the AI model in real time. The expected projection of the physical model into the AI space The deviation between them; this deviation is determined as ;
[0092] Based on the time series of the feature-physical decoupling index, a moving average is used to determine the decoupling mean; in this embodiment, the decoupling mean is denoted as... , refers to the recent Decoupling index within each sampling period The moving average; the purpose of this step is to smooth out short-term noise. Instantaneous fluctuations, reflecting a sustained and statistically significant decoupling trend, are calculated as follows:
[0093] ;
[0094] in, The decoupling mean is the output of this step; For the first The decoupling index for each sampling period is derived from the calculation results of the preceding steps; The window size is an adjustable parameter used to balance the sensitivity and stability of the system. Its value is set according to the specific noise characteristics and response time requirements of the production line.
[0095] If the decoupling mean is greater than a preset decoupling mean warning threshold, a reliability self-diagnosis process is triggered; if the decoupling mean is less than or equal to the preset decoupling mean warning threshold, the preceding real-time monitoring steps continue to be executed; the preset decoupling mean warning threshold is denoted as […] in this embodiment. This refers to a benchmark used to determine whether decoupling has reached a significant level; The value is obtained by collecting data during the baseline period when the system is in normal operating condition. The data is determined based on its statistical distribution, for example, by taking the baseline mean plus three standard deviations of the baseline. System comparison and ;like This indicates that the system has experienced continuous and significant decoupling, triggering subsequent self-diagnostic logic; if If the system is running in a normal state where the AI model and the physical model are consistent, the system will return to continue monitoring the next sampling period.
[0096] Based on the results of the credibility self-diagnosis process, a graded correction strategy is output through preset dynamic arbitration rules; this step is executed when the preceding step is triggered; its purpose is not to determine whether decoupling has occurred, as this fact has already been confirmed by the preceding steps, but rather to diagnose the root cause of the decoupling: the AI model. Drift, or physics model? Failure; In this embodiment, the trustworthiness self-diagnosis process analyzes AI features. Sequence and decoupling index Sequence stability, output diagnostic results, such as AI variance and residual variance The preset dynamic arbitration rules analyze these results to determine the source of the fault; based on the diagnosed fault source, the system outputs a corresponding graded correction strategy to achieve closed-loop correction.
[0097] This embodiment establishes a coupling baseline between the AI model and the physical model and monitors the decoupling index between them in real time, thereby achieving dynamic evaluation of the system's credibility. When significant decoupling is detected, it does not simply trigger an alarm and shut down the system, but further triggers self-diagnosis and dynamic arbitration logic, which can autonomously distinguish whether it is AI model drift or physical model premise failure. This design solves the complex problem of physical model failure caused by environmental changes, which in turn leads to the erroneous accusation of AI model collapse. In the absence of external real-time true labels, it ensures the continuity and robustness of the system's detection in high-risk and non-ideal environments.
[0098] Example 2:
[0099] Training the generative mapping model includes:
[0100] By using baseline AI feature vectors and baseline physical feature vectors, and through regression training, the mapping relationship between baseline physical feature vectors and baseline AI feature vector space is learned to determine the mapping model.
[0101] The mapping model is fixed as the benchmark for subsequent deviation calculations.
[0102] Based on Example 1, a specific implementation of the step-by-step training to generate the mapping model is as follows:
[0103] By utilizing baseline AI feature vectors and baseline physical feature vectors, regression training is used to learn the mapping relationship from the baseline physical feature vector space to the baseline AI feature vector space, thereby determining the mapping model. In the initial stage of system deployment, a large number of known qualified baseline samples are used to collect baseline AI feature vectors. and baseline physical feature vector baseline The mapping model is denoted as... In this embodiment, it can be a linear transformation matrix. The aforementioned regression training refers to a supervised learning technique; in this embodiment, the least squares method is used. The purpose of training is to find a... This makes the baseline Valid, i.e., minimizing the baseline ;
[0104] The mapping model is fixed as the benchmark for subsequent deviation calculations; once the model... The parameters are determined through regression training at this stage and will be fixed, not updated during subsequent real-time production line operation; their purpose is to serve as the decoupling index in subsequent steps. A constant benchmark is used to ensure that all real-time deviations are compared relative to the same normal baseline.
[0105] This embodiment uses regression training and a fixed benchmark to abstract the features of the AI model. and the interpretability of physical models A stable and quantifiable mathematical relationship is established between them, thus providing a solid baseline reference for subsequent real-time monitoring of the deviation or decoupling between the two, which is a prerequisite for realizing self-diagnosis of credibility.
[0106] Example 3:
[0107] A pre-defined deep vision AI model is used to extract the current AI feature vector related to the microscopic texture of wheat flour;
[0108] A pre-defined physical calibration model is used to calibrate the current physical feature vector related to particle size distribution or protein content based on optical physics theory.
[0109] Based on Example 1, a specific implementation of the preset depth vision AI model and preset physical calibration model mentioned in the preceding steps is as follows:
[0110] A pre-defined deep vision AI model is used to extract current AI feature vectors related to the microscopic texture of wheat flour; the deep vision AI model It is a deep neural network; the model's internal weight parameters were determined through offline training on a large, diverse dataset of wheat flour micrographs; its design aims to analyze micrographs... The algorithm captures high-dimensional statistical features that are imperceptible to the human eye and are related to the microscopic texture of wheat flour, and encodes them into AI feature vectors. ;
[0111] A pre-defined physical calibration model is used to calibrate the current physical feature vector related to particle size distribution or protein content based on optical physics theory; the physical calibration model It is a deterministic function, constructed based on classical optical physics theory; the model's internal parameters were obtained through calibration using the G01N standard method with standard samples of known physicochemical properties in a laboratory setting; its design aims to extract parameters from images... Macroscopic optical properties extracted Deterministically, it is identified by its corresponding physicochemical properties, such as particle size distribution or protein content, and encoded as a physical feature vector. ;
[0112] This embodiment combines two distinct models to achieve complementary advantages; a deep vision AI model. It offers extremely high sensitivity, capable of capturing microscopic texture anomalies imperceptible to the human eye; while the physical calibration model It provides interpretability and reference benchmarks based on physical principles; this combination of deep models and physical models forms the basis for subsequent decoupling monitoring and credibility arbitration.
[0113] Example 4:
[0114] S8 calculates the characteristic-physical decoupling index, including:
[0115] Input the current physical feature vector into the mapping model to obtain the mapped physical feature vector;
[0116] Based on the cosine distance in the vector space, the deviation between the current AI feature vector and the mapped physical feature vector is calculated and determined as the feature-physical decoupling index.
[0117] Based on Example 1, a specific implementation method for calculating the feature-physical decoupling index is as follows:
[0118] Input the current physical feature vector into the mapping model to obtain the mapped physical feature vector; this step receives the current AI feature vector from the previous step. and the current physical feature vector This step uses the mapping model that was fixed in the baseline phase. ;calculate This is the mapped physical feature vector, which represents the physical model. In AI feature space The expected projection in;
[0119] Based on the cosine distance in vector space, the deviation between the current AI feature vector and the mapped physical feature vector is calculated and determined as the feature-physics decoupling index; the feature-physics decoupling index Through comparison and The direction consistency is used to determine this; the calculation aims to quantify the deviation between the actual output of the AI model and the expected projection of the physical model; in this embodiment, the calculation method is as follows:
[0120] ;
[0121] in, This is the current AI feature vector, which originates from previous steps; This is the current physical feature vector, which originates from previous steps; This is a mapping model, derived from the baseline training phase; this formula is based on the definition of cosine distance in vector space. It is a scalar, and its value range is usually within 1000. between; A value close to 0 indicates that the AI model's judgment is highly consistent with the physical model's calibration. A value close to 1 indicates severe decoupling or conflict between the two.
[0122] This embodiment uses cosine distance to calculate the decoupling index, which makes the monitoring focus on the directional deviation between AI features and physical features in the vector space, rather than the amplitude deviation. This design is not sensitive to the absolute size of the features, but is highly sensitive to changes in the structural relationship between features, i.e., decoupling, thereby improving the stability and signal-to-noise ratio of the deviation signal.
[0123] Example 5:
[0124] The S10-triggered trustworthiness self-diagnosis process includes:
[0125] Step A: Based on the time series of the current AI feature vectors, calculate the feature stability of the AI model and determine the AI variance;
[0126] Step B: Based on the time series of the feature-physical decoupling index, calculate the stability of the bias residuals and determine the residual variance;
[0127] Among them, AI variance and residual variance constitute the results of the credibility self-diagnosis process.
[0128] Based on Example 1, a specific implementation of the triggered trustworthiness self-diagnosis process is as follows:
[0129] This process confirms the decoupling mean in the preceding steps. It is triggered at certain times; its core purpose is to diagnose the root cause of decoupling, that is, to distinguish whether it is an AI model. Drift or Physics Model Failure; the diagnosis is based on the analysis of conflict signals. and deviation signal Its inherent time stability;
[0130] Based on the time series of the current AI feature vectors, the feature stability of the AI model is calculated, and the AI variance is determined; the AI variance is denoted as […] in this embodiment. This refers to a method used to quantify AI models. A scalar measure of the output's fluctuation or dispersion; this step is calculated within the same time window. Inside, preferably, the window of the preceding step Consistent, the feature vector output by the AI model Its own statistical variance;
[0131] ;
[0132] in, The AI variance is the output of this calculation step. For the first Each AI vector originates from the time series of the preceding steps; For window The mean vector within; The window size; this formula is the sum of squared average Euclidean distances of a vector cluster, characterizing its dispersion; a high That is, exceeding the preset threshold This means that the AI model's output is chaotic and unstable, indicating that the AI model... It may be drifting;
[0133] Based on the time series of the feature-physical decoupling index, the stability of the deviation residual is calculated, and the residual variance is determined; the residual variance is denoted as in this embodiment. This refers to a signal used for quantizing bias. The scalar value of inherent stability; this step is calculated within the same time window. Internal, decoupling index Its own statistical variance;
[0134] ;
[0135] in, The residual variance is the output of this calculation step. For the first Each decoupling index is derived from the time series of the preceding steps; The decoupling mean is derived from the calculation results of the preceding steps; Where is the window size; this formula is the definition of variance for a scalar time series.
[0136] Among them, AI variance and residual variance constitute the results of the credibility self-diagnosis process; and These two stability metrics will serve as inputs to subsequent arbitration rules for fault attribution.
[0137] This embodiment innovatively introduces AI features. Sum of deviations and residuals The higher-order stability analysis, rather than simply analyzing the fundamental mean of the bias. This enables in-depth diagnosis of fault sources; this analysis of the fluctuations in the signal itself provides a key criterion for distinguishing between unstable AI models and stable failed physical models, and is the core of realizing subsequent dynamic arbitration.
[0138] Example 6:
[0139] The pre-defined dynamic arbitration rules in S11 apply AI variance and residual variance, including:
[0140] Rule 1: If the AI variance is greater than or equal to a preset AI threshold, or the residual variance is greater than or equal to a preset residual threshold, then the diagnostic result is determined to be that the AI model has low credibility.
[0141] Rule 2: If the AI variance is less than a preset AI threshold and the residual variance is less than a preset residual threshold, then the diagnosis result is determined to be a physical model failure.
[0142] Based on Example 5, a specific implementation of the preset dynamic arbitration rules in the subsequent steps is as follows:
[0143] This rule was confirmed in the preceding steps. That is, under the premise of continuous decoupling, the AI variance output by the preceding steps is applied. and residual variance ;
[0144] Preset AI thresholds used in the rules and preset residual threshold It is a benchmark used to determine whether fluctuations are significant; and All are based on the system in its baseline period, i.e., its normal operating state. and The statistical distribution is used to determine this, for example, by taking the mean plus three times the standard deviation.
[0145] If the AI variance is greater than or equal to a preset AI threshold, or the residual variance is greater than or equal to a preset residual threshold, then the diagnostic result is determined to be low AI model reliability; the logical condition is as follows: and or This situation indicates that there is persistent decoupling, and the AI model output is unstable, or the bias signal itself is unstable, or both are unstable; if the AI model Failure, its output It will become unstable, that is High; this kind of instability This will lead to its relationship with deviation It also becomes unstable, that is High; therefore, the diagnosis is: AI model The credibility of the system is reduced, or the system as a whole is in an unstable state.
[0146] If the AI variance is less than a preset AI threshold and the residual variance is less than a preset residual threshold, then the diagnosis result is determined to be a physical model failure; the logical condition is as follows: and and This situation indicates that there is continuous decoupling, but the AI model output is stable, and the bias signal has converged to a new, stable high value. A typical physical scenario for this is: physical model... Failure; AI model This new feature will be correctly and reliably identified, leading to Shift to a new stable vector, therefore Low; but because The assumption has collapsed, and its output No longer correct, resulting in It has leaped to a new, high, but stable level, namely... High, but Low; therefore, the diagnostic result is: the fault source is most likely the physical model. The calibration premise is invalid;
[0147] This embodiment covers the main logical states during system decoupling through the two complementary and complete arbitration rules mentioned above. It utilizes the combination of AI variance and residual variance to achieve accurate attribution of the two core failure modes, AI model drift and physical model failure, avoiding the erroneous attribution of physical model failure to AI model, thus providing a decision-making basis for subsequent correct hierarchical correction strategies.
[0148] Example 7:
[0149] The graded correction strategy output by S11 includes:
[0150] In response to the diagnostic result indicating low reliability of the AI model, a first-level correction is performed.
[0151] The first-level correction includes: suspending the control of the deep vision AI model over production line decisions and switching to a safe mode;
[0152] In response to the diagnosis that the physical model has failed, a secondary correction is performed;
[0153] The secondary correction includes: temporarily suspending the verification function of the physical calibration model, and continuing to trust the detection results of the deep vision AI model within a preset safe time window.
[0154] Based on Example 6, a specific implementation of the hierarchical correction strategy output in the preceding steps is as follows:
[0155] In response to the diagnostic result indicating low AI model reliability, a Level 1 correction is executed. This Level 1 correction includes suspending the deep vision AI model's control over production line decisions and switching to a safe mode. This correction corresponds to the previous diagnostic result; because the system judges the AI model... If the credibility decreases or the system state becomes unstable, the highest level of security response must be executed; the first-level correction specifically involves pausing the deep vision AI model. Control over production line quality decisions and immediately switch to a safety mode; the safety mode refers to, for example, stopping the production line or activating a backup, more reliable but slower testing solution; simultaneously, the system automatically issues a high-level alert to the operator, requiring the AI model to be checked. and physical model Perform manual verification, recalibration, or retraining;
[0156] In response to the diagnostic result indicating physical model failure, a secondary correction is performed. This secondary correction includes temporarily suspending the verification function of the physical calibration model and continuing to trust the detection results of the deep vision AI model within a preset safety time window. This correction corresponds to the previous diagnostic result. At this point, the system determines the AI model... It remains stable and reliable, serving instead as a physical verification model for verification. Expired; Secondary correction details: Temporarily suspend the physics model. The verification function; its core lies in the fact that the system continues to trust the deep vision AI model within a preset safety time window. The detection results are used to maintain production line operation; the preset safety time window is denoted as in this embodiment. This is a safety parameter whose value is set based on operational risk assessment. It defines the maximum permissible time for the system to operate autonomously without physical verification. Simultaneously, the system automatically sends low-level alerts to maintenance personnel, requesting adjustments to the physical model. The assumptions are manually checked and updated.
[0157] This embodiment achieves a closed-loop robustness of the system through a hierarchical correction strategy. The first-level correction ensures that the system can be safely shut down when the AI model fails or the system state is unclear, preventing false detections. The more innovative second-level correction allows the system to temporarily trust a stable AI model when the physical model fails, avoiding catastrophic false alarm shutdowns caused by errors in the physical verification model, and greatly ensuring the continuity of production line testing in non-ideal environments.
[0158] Example 8:
[0159] Please see Figure 2 A computer vision-based wheat flour quality inspection system includes:
[0160] The image acquisition module is used to acquire microscopic images of the baseline sample and the current sample;
[0161] The baseline feature extraction module is used to extract baseline AI feature vectors and baseline physical feature vectors based on microscopic images of baseline samples.
[0162] The model training module is used to train and generate a mapping model based on baseline AI feature vectors and baseline physical feature vectors.
[0163] The AI feature extraction unit is used to extract the current AI feature vector based on the microscopic image of the current sample using a preset deep vision AI model.
[0164] The physical feature calibration unit is used to calibrate the current physical feature vector based on the current sample's microscopic image using a preset physical calibration model.
[0165] The deviation calculation unit is used to combine the current AI feature vector and the current physical feature vector, and calculate the feature-physics decoupling index through a mapping model;
[0166] The mean monitoring unit is used to determine the decoupling mean by using a moving average process based on the time series of feature-physical decoupling exponents.
[0167] The diagnostic triggering unit is used to trigger the confidence self-diagnosis process when the decoupling mean is greater than the preset decoupling mean warning threshold, and to instruct the AI feature extraction unit, physical feature calibration unit, deviation calculation unit and mean monitoring unit to continue running when the decoupling mean is less than or equal to the preset decoupling mean warning threshold.
[0168] The arbitration correction unit is used to output a graded correction strategy based on the results of the credibility self-diagnosis process and through preset dynamic arbitration rules.
[0169] This invention also provides a computer vision-based wheat flour quality detection system, which is applied to the method described in Example 1, including:
[0170] An image acquisition module is used to acquire microscopic images of the baseline sample and the current sample;
[0171] A baseline feature extraction module is used to extract baseline AI feature vectors and baseline physical feature vectors based on microscopic images of baseline samples.
[0172] A model training module for training and generating a mapping model based on baseline AI feature vectors and baseline physical feature vectors;
[0173] An AI feature extraction unit is used to extract the current AI feature vector based on the microscopic image of the current sample using a preset depth vision AI model;
[0174] A physical feature calibration unit is used to calibrate the current physical feature vector based on the current sample's microscopic image using a preset physical calibration model;
[0175] A bias calculation unit is used to combine the current AI feature vector with the current physical feature vector and calculate the feature-physics decoupling index through a mapping model;
[0176] A mean monitoring unit is used to determine the decoupling mean by using a moving average process based on the time series of feature-physical decoupling exponents.
[0177] A diagnostic triggering unit is used to trigger the confidence self-diagnosis process in response to the decoupling mean being greater than the preset decoupling mean warning threshold, and to instruct the AI feature extraction unit, physical feature calibration unit, deviation calculation unit and mean monitoring unit to continue running in response to the decoupling mean being less than or equal to the preset decoupling mean warning threshold.
[0178] An arbitration correction unit is used to output a graded correction strategy based on the results of the credibility self-diagnosis process and through preset dynamic arbitration rules.
[0179] This embodiment constructs a complete technical closed loop from baseline calibration, real-time monitoring, decoupled calculation, trend smoothing to diagnostic triggering and arbitration correction through the collaborative work of the above modules. The functions of each module of the system are clear, the data flow is clear, and it can automatically execute all the method steps described in Embodiment 1 to achieve autonomous diagnosis and robust control of the reliability of the wheat flour quality detection process.
[0180] Example 9:
[0181] The system also includes:
[0182] The self-diagnosis module is used to perform a credibility self-diagnosis process to determine the AI variance and residual variance, and use the AI variance and residual variance as the results of the credibility self-diagnosis process.
[0183] The arbitration amendment unit is specifically used for:
[0184] Based on AI variance and residual variance, a pre-defined dynamic arbitration rule is applied to determine the diagnostic result;
[0185] In response to the diagnosis that the AI model has low credibility, a first-level correction instruction is output.
[0186] In response to the diagnosis that the physical model has failed, a secondary correction command is output.
[0187] Among them, the first-level correction instruction is used to pause the control of the deep vision AI model on production line decisions and switch to a safe mode;
[0188] The secondary correction instruction is used to temporarily suspend the verification function of the physical calibration model and continue to trust the detection results of the deep vision AI model within a preset safe time window.
[0189] Based on the system described in Example 8, the system further includes:
[0190] A self-diagnostic module is used to perform a credibility self-diagnostic process to determine the AI variance and residual variance, and use the AI variance and residual variance as the results of the credibility self-diagnostic process;
[0191] Specifically, the arbitration correction unit is used for:
[0192] Based on AI variance and residual variance, a pre-defined dynamic arbitration rule is applied to determine the diagnostic result;
[0193] In response to the diagnosis that the AI model has low credibility, a first-level correction instruction is output.
[0194] In response to the diagnosis that the physical model has failed, a secondary correction command is output.
[0195] Among them, the first-level correction instruction is used to pause the control of the deep vision AI model on production line decisions and switch to a safe mode;
[0196] Among them, the secondary correction instruction is used to temporarily suspend the verification function of the physical calibration model and continue to trust the detection results of the deep vision AI model within a preset safe time window;
[0197] This embodiment modularizes the self-diagnostic function by establishing a self-diagnostic module and providing clear instruction outputs to the arbitration correction unit, namely first-level and second-level correction instructions, making the system's fault diagnosis and closed-loop correction logic more explicit. This design separates complex diagnosis, such as variance calculation, from arbitration, such as rule application, and execution, such as instruction output, thereby improving the system's modularity, maintainability, and response accuracy, and ensuring that the hierarchical correction strategy can be executed accurately.
[0198] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.
Claims
1. A method for detecting the quality of wheat flour based on computer vision, characterized in that, include: S1, Acquire microscopic images of the baseline sample; S2, Based on the microscopic images of the baseline sample, extract the baseline AI feature vector; S3, based on the microscopic image of the baseline sample, extract the baseline physical feature vector; S4, based on baseline AI feature vectors and baseline physical feature vectors, trains and generates a mapping model; S5, acquire a microscopic image of the current sample; S6, Based on the microscopic image of the current sample, extract the current AI feature vector through a preset depth vision AI model; S7, based on the current sample's microscopic image, calibrate the current physical feature vector using a preset physical calibration model; S8: Input the current physical feature vector into the mapping model to obtain the mapped physical feature vector; calculate the deviation between the current AI feature vector and the mapped physical feature vector based on the cosine distance of the vector space, and determine it as the feature-physical decoupling index. S9, based on the time series of the feature-physical decoupling index, the decoupling mean is determined by moving average processing; S10, in response to the decoupling mean being greater than the preset decoupling mean warning threshold, the confidence self-diagnosis process is triggered; If the decoupling mean is less than or equal to the preset decoupling mean warning threshold, then continue to execute S5 to S9; The triggered trustworthiness self-diagnosis process includes: Step A: Based on the time series of the current AI feature vectors, calculate the feature stability of the AI model and determine the AI variance; Step B: Based on the time series of the feature-physical decoupling index, calculate the stability of the bias residuals and determine the residual variance; If the AI variance is greater than or equal to a preset AI threshold, or the residual variance is greater than or equal to a preset residual threshold, the diagnosis result is determined to be that the AI model has low credibility. If the AI variance is less than a preset AI threshold and the residual variance is less than a preset residual threshold, then the diagnosis result is determined to be physical model failure.
2. The method for detecting wheat flour quality based on computer vision according to claim 1, characterized in that, Training the generative mapping model includes: By using baseline AI feature vectors and baseline physical feature vectors, and through regression training, the mapping relationship between baseline physical feature vectors and baseline AI feature vector space is learned to determine the mapping model. The mapping model is fixed as the benchmark for subsequent deviation calculations.
3. The method for detecting wheat flour quality based on computer vision according to claim 1, characterized in that... : A pre-defined deep vision AI model is used to extract the current AI feature vector related to the microscopic texture of wheat flour; A pre-defined physical calibration model is used to calibrate the current physical feature vector related to particle size distribution or protein content based on optical physics theory.
4. The method for detecting wheat flour quality based on computer vision according to claim 1, characterized in that, It also includes S11: Based on the results of the confidence self-diagnosis process, output a graded correction strategy; In response to the diagnostic result indicating low reliability of the AI model, a first-level correction is performed. The first-level correction includes: suspending the control of the deep vision AI model over production line decisions and switching to a safe mode; In response to the diagnosis that the physical model has failed, a secondary correction is performed; The secondary correction includes: temporarily suspending the verification function of the physical calibration model, and continuing to trust the detection results of the deep vision AI model within a preset safe time window.
5. A computer vision-based wheat flour quality inspection system, used to execute the computer vision-based wheat flour quality inspection method according to any one of claims 1 to 4, characterized in that, include: The image acquisition module is used to acquire microscopic images of the baseline sample and the current sample; The baseline feature extraction module is used to extract baseline AI feature vectors and baseline physical feature vectors based on microscopic images of baseline samples. The model training module is used to train and generate a mapping model based on baseline AI feature vectors and baseline physical feature vectors. The AI feature extraction unit is used to extract the current AI feature vector based on the microscopic image of the current sample using a preset deep vision AI model. The physical feature calibration unit is used to calibrate the current physical feature vector based on the current sample's microscopic image using a preset physical calibration model. The deviation calculation unit is used to combine the current AI feature vector and the current physical feature vector, and calculate the feature-physics decoupling index through a mapping model; The mean monitoring unit is used to determine the decoupling mean by using a moving average process based on the time series of feature-physical decoupling exponents. The diagnostic trigger unit is used to trigger the confidence self-diagnosis process when the decoupling mean is greater than the preset decoupling mean warning threshold, and to continue to operate the AI feature extraction unit, physical feature calibration unit, deviation calculation unit and mean monitoring unit when the decoupling mean is less than or equal to the preset decoupling mean warning threshold.
6. The wheat flour quality detection system based on computer vision according to claim 5, characterized in that, The system also includes an arbitration correction unit, used to output a graded correction strategy based on the results of the credibility self-diagnosis process; including: In response to the diagnosis that the AI model has low credibility, a first-level correction instruction is output. In response to the diagnosis that the physical model has failed, a secondary correction command is output. Among them, the first-level correction instruction is used to pause the control of the deep vision AI model on production line decisions and switch to a safe mode; The secondary correction instruction is used to temporarily suspend the verification function of the physical calibration model and continue to trust the detection results of the deep vision AI model within a preset safe time window.
Citation Information
Patent Citations
Traffic flow prediction method and system based on embedded physical information deep neural network
CN120452198A
Performance prediction model determination method, performance prediction method and device of fuel cell
CN120562323A