A visual image processing system for titanium rod surface defect detection
By using a dynamic background model and an adaptive threshold mechanism, the conflict between sensitivity and robustness caused by texture drift in the titanium rod production process of traditional visual inspection systems is resolved, achieving highly sensitive detection of weak defects and monitoring of process stability.
Patent Information
- Application Number
- CN202511836963.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-08
- Publication Date
- 2026-03-03
- Estimated Expiration
- 2045-12-08
AI Technical Summary
Traditional visual inspection systems struggle to maintain a balance between high sensitivity and robustness when dealing with legitimate texture drift during titanium rod production, making them prone to false alarms or missed defects.
A dynamic background model and adaptive threshold mechanism are adopted. By acquiring image features of the titanium rod surface in real time, a dynamic background model is constructed, the context anomaly score of local feature vectors is calculated, and process warnings are given when texture drift occurs. The model parameters are updated by combining the exponential moving average method.
It achieves high sensitivity detection of weak defects under legal texture drift conditions, resolves the conflict between detection sensitivity and robustness, and provides proactive early warning by monitoring process stability through model parameters.
Smart Images

Figure CN121259007B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of visual image processing and industrial surface defect detection technology, specifically a visual image processing system for detecting surface defects in titanium rods. Background Technology
[0002] In high-end industrial manufacturing, such as the production of titanium rods, precise inspection of product surface quality is crucial, and vision inspection systems are a key technology for achieving automated quality control.
[0003] However, during the production of industrial products such as titanium rods, the surface micro-textures undergo legitimate, slow changes due to batch changes in raw materials, minor adjustments to equipment status, or normal fluctuations in process parameters—a phenomenon known as texture drift. Traditional visual inspection systems typically rely on static baseline models or fixed defect criteria established during the initialization phase. This approach faces significant challenges when dealing with legitimate texture drift: if the system employs a strict fixed threshold to maintain high sensitivity, it is prone to misclassifying legitimate texture drift as defects, leading to an increased false alarm rate; conversely, relaxing the criteria to accommodate texture changes reduces the system's ability to detect subtle defects, resulting in missed detections. This exposes the inherent conflict between detection sensitivity and system robustness in traditional methods. Therefore, how to construct a detection mechanism that can dynamically adapt to legitimate texture drift while maintaining high sensitivity to real defects has become a pressing technical problem in this field. Summary of the Invention
[0004] To address the aforementioned technical problems, this invention provides a visual image processing system for detecting surface defects in titanium rods. Specifically, the technical solution of this invention includes:
[0005] The feature acquisition module is used to acquire continuous image frames of the titanium rod surface in real time, divide the continuous image frames into local regions, and calculate the local feature vectors of the local regions.
[0006] The baseline modeling module is used to determine the baseline mean vector and baseline covariance matrix based on the collected and confirmed defect-free local feature vectors during the system initialization phase; and to construct a dynamic baseline model based on the baseline mean vector and baseline covariance matrix.
[0007] The defect identification module is used to calculate the context anomaly score of the local feature vector to be detected in the future based on the dynamic background model; and to determine the judgment result as a defect when the context anomaly score is greater than the preset defect judgment threshold; and to determine the judgment result as normal when the context anomaly score is less than or equal to the defect judgment threshold.
[0008] The model update module is used to determine the corresponding local feature vector as a high-confidence baseline sample when the context anomaly score is less than a preset adaptive threshold, and to update the dynamic baseline model using the high-confidence baseline sample; and to determine the corresponding local feature vector as a non-high-confidence baseline sample when the context anomaly score is greater than or equal to the adaptive threshold.
[0009] The drift monitoring module is used to calculate the texture drift index based on the dynamic baseline model before and after the batch switch when a batch switch is detected; it is also used to output a process warning when the texture drift index is greater than the preset process control threshold; and it is used not to output a process warning when the texture drift index is less than or equal to the process control threshold.
[0010] Preferably, the defect identification module, used to calculate the context anomaly score, includes:
[0011] Call the background mean vector and background covariance matrix of the dynamic background model;
[0012] The Mahalanobis distance of local eigenvectors is calculated based on the background mean vector and the background covariance matrix.
[0013] Mahalanobis distance was used to determine the context anomaly score.
[0014] Preferably, the model update module is used to update the dynamic background model, including:
[0015] The exponential moving average method is used to perform online smoothing updates of the background mean vector and the background covariance matrix;
[0016] Among them, the adaptive threshold is less than the defect determination threshold.
[0017] Preferably, online smooth updates are performed, including:
[0018] Calculate the difference vector between the high-confidence background sample and the background mean vector of the dynamic background model;
[0019] Based on the difference vector and the preset learning rate, the baseline mean vector is recursively updated;
[0020] Calculate the outer product of the difference vectors;
[0021] Based on the outer product of the difference vectors and the learning rate, combined with the background covariance matrix of the dynamic background model, the background covariance matrix is updated stably.
[0022] Preferably, the drift monitoring module is used to calculate the texture drift index, including:
[0023] The dynamic baseline model before storage batch switching and the dynamic baseline model after adapting to the new batch;
[0024] Based on Mahalanobis distance in information theory, the difference between the dynamic background model before and after the switch is calculated;
[0025] The difference was defined as the texture drift index.
[0026] Preferably, the feature acquisition module is used to calculate the local feature vector of a local region, including:
[0027] For each local region, a multi-dimensional local feature vector is calculated using feature extraction operators;
[0028] Feature extraction operators include LBP operator or HOG operator.
[0029] Preferably, the baseline modeling module, used to determine the background mean vector and the background covariance matrix, includes:
[0030] Collect and confirm that there are no defects in the local feature vectors as the initial dataset;
[0031] Calculate the statistical distribution of the initial dataset;
[0032] The mean vector of the statistical distribution is determined as the background mean vector;
[0033] The covariance matrix of the statistical distribution is determined as the background covariance matrix.
[0034] Preferably, the defect determination threshold is set based on a trade-off between the subject's operating characteristic curve and the actual performance curve.
[0035] Preferably, the process control threshold is set by the process engineer based on production experience.
[0036] Compared with the prior art, the present invention has the following beneficial effects:
[0037] 1. This system sets up a safety buffer for adaptive threshold and defect judgment threshold through a dynamic background model safety update mechanism; this solution can maintain high sensitivity to weak defects while gradually adapting to legitimate texture drift, thus resolving the conflict between detection sensitivity and robustness.
[0038] 2. This system uses the exponential moving average method to smoothly update the dynamic background model, ensuring that the changes in the background mean vector and covariance matrix are gradual; avoiding sudden changes in model parameters due to fluctuations in a single sample, and ensuring the long-term stability of the system's detection performance;
[0039] 3. This system calculates the Mahalanobis distance of local feature vectors as the context anomaly score, which not only measures the deviation of features from the baseline mean, but also uses the baseline covariance matrix to evaluate the statistical rationality of the deviation; this enables the system to intelligently distinguish between legitimate texture fluctuations and real subtle defects.
[0040] 4. This system has added a drift monitoring module, which calculates the texture drift index between the old and new dynamic background models when switching batches, and uses the changes in model parameters as a digital probe; it realizes quantitative monitoring and proactive early warning of upstream process stability, and shifts from passive defect detection to proactive process insight. Attached Figure Description
[0041] The present invention will be further explained below with reference to the accompanying drawings and embodiments:
[0042] Figure 1 This is a structural diagram of the system of the present invention. Detailed Implementation
[0043] 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.
[0044] Example 1:
[0045] Please see Figure 1 A visual image processing system for detecting surface defects in titanium rods, comprising:
[0046] The feature acquisition module is used to acquire continuous image frames of the titanium rod surface in real time, divide the continuous image frames into local regions, and calculate the local feature vectors of the local regions.
[0047] The baseline modeling module is used to determine the baseline mean vector and baseline covariance matrix based on the collected and confirmed defect-free local feature vectors during the system initialization phase; and to construct a dynamic baseline model based on the baseline mean vector and baseline covariance matrix.
[0048] The defect identification module is used to calculate the context anomaly score of the local feature vector to be detected in the future based on the dynamic background model; and to determine the judgment result as a defect when the context anomaly score is greater than the preset defect judgment threshold; and to determine the judgment result as normal when the context anomaly score is less than or equal to the defect judgment threshold.
[0049] The model update module is used to determine the corresponding local feature vector as a high-confidence baseline sample when the context anomaly score is less than a preset adaptive threshold, and to update the dynamic baseline model using the high-confidence baseline sample; and to determine the corresponding local feature vector as a non-high-confidence baseline sample when the context anomaly score is greater than or equal to the adaptive threshold.
[0050] The drift monitoring module is used to calculate the texture drift index based on the dynamic baseline model before and after the batch switch when a batch switch is detected; it is also used to output a process warning when the texture drift index is greater than the preset process control threshold; and it is used not to output a process warning when the texture drift index is less than or equal to the process control threshold.
[0051] A visual image processing system for detecting surface defects in titanium rods is provided. In this embodiment, the system is deployed at the quality inspection station of the titanium rod production line and includes: a feature acquisition module, a baseline modeling module, a defect identification module, a model update module, and a drift monitoring module.
[0052] The feature acquisition module aims to convert continuous visual images into structured feature data that can be processed by the model; this module acquires continuous image frames of the titanium rod surface in real time using an industrial camera. and the acquired image frames Divided into a series of local areas For each local area This module calculates a multi-dimensional local feature vector using specific feature extraction operators. The vector It is a mathematical representation of the micro-texture of this local area;
[0053] The baseline modeling module aims to construct a mathematical model that can characterize the statistical properties of the surface texture of normal titanium rods. This module runs during the system initialization phase or the early stages of a new batch of production. It is based on a set of collected data. A confirmed defect-free local feature vector Through statistical analysis, the baseline mean vector of this defect-free sample set was determined. and background covariance matrix ; Baseline mean vector This refers to the statistical center of the group of defect-free samples in the feature space; the background covariance matrix. This describes the changes and correlations of the sample set in various dimensions of the feature space, i.e., the legal fluctuation range of normal textures; based on and The system constructs a dynamic background model. ;
[0054] The defect identification module aims to determine in real time whether a newly entered surface area is a defect; this module is based on a dynamic baseline model. ,Depend on and Characterization, calculating the local feature vector to be detected subsequently. Context anomaly score Context anomaly score It is a scalar used to measure the current feature. Its dynamic background The statistical difference between them; the module then... With a preset defect judgment threshold Compare; when When this occurs, it means that the texture features of the current region have statistically deviated significantly from the normal background, and the system determines the judgment result. As a defect, that is ;when When, it means that the texture fluctuation in the current area is Within the defined normal range, the system determines the judgment result. This is normal, that is ;
[0055] The model update module aims to enable the system to adapt to legitimate, slow texture drift during production; this module introduces an adaptive threshold. Adaptive threshold It is a key model safety parameter. It must be less than the defect judgment threshold. ,Right now This technology aims to prevent potentially defective samples from being flagged. The value may be located in and The information was incorrectly used to update the baseline model; when At that time, the system determines the corresponding local feature vector. High-confidence background samples and utilize this Update dynamic background model ;when When this sample is deemed a non-high-confidence background sample, the system does not use it to update the model.
[0056] The drift monitoring module aims to use changes in model parameters to gain insights into the stability of upstream processes. When the system detects a batch change, such as when triggered by a production execution system signal, this module uses the dynamic baseline model from before the changeover. With the switched dynamic background model Calculate the texture drift index between the two. The module will then... With preset process control thresholds Compare; when When this occurs, it means that the microscopic texture difference between the old and new batches exceeds the allowable range of the process, and the system will output a process warning; when When the batch switching is within a controllable range, no process warning will be issued;
[0057] This embodiment constructs a dynamic, context-aware defect detection system through the synergistic effect of the above five modules; it no longer relies on fixed defect criteria, but instead uses a dynamic baseline model. To define normal operation in real time; through the security update logic of the model update module. The system can maintain high sensitivity to minor defects while gradually adapting to legitimate texture changes brought about by new batches, thus resolving the conflict between sensitivity and robustness. At the same time, the drift monitoring module uses model parameters as digital probes to achieve quantitative monitoring of the stability of upstream processes.
[0058] Example 2:
[0059] The defect identification module is used to calculate context anomaly scores, including:
[0060] Call the background mean vector and background covariance matrix of the dynamic background model;
[0061] The Mahalanobis distance of local eigenvectors is calculated based on the background mean vector and the background covariance matrix.
[0062] Mahalanobis distance was used to determine the context anomaly score.
[0063] As a preferred implementation of the defect identification module in Embodiment 1, this embodiment clarifies the context anomaly scoring. The calculation process; this module calls the dynamic background model. The current baseline mean vector and background covariance matrix ;
[0064] To achieve context awareness, this embodiment is based on and calculate The Mahalanobis distance; in the technical context of this invention, the Mahalanobis distance not only considers the feature vectors with the mean The Euclidean distance between them is further utilized using the covariance matrix. This difference was normalized; in this embodiment, the square of the Mahalanobis distance is determined as the context anomaly score. The calculation formula is as follows:
[0065] ;
[0066] in, Context anomaly score, a dimensionless scalar, is calculated in this step and serves as input for subsequent defect determination and model updates;
[0067] : The local feature vector of the current region to be detected, a D×1 dimensional vector, which is calculated in real time by the feature acquisition module;
[0068] : The background mean vector, a D×1 dimensional vector, derived from the dynamic background model supply;
[0069] The background covariance matrix is a D×D dimensional matrix, derived from the dynamic background model. supply;
[0070] Covariance matrix The inverse matrix, a D×D dimensional matrix;
[0071] From a data structure perspective, yes dimension, yes dimension, yes Dimension, final product result It is Scalars with consistent dimensions; to ensure the background covariance matrix Stability in numerical computation, preventing issues caused by feature collinearity or insufficient initial samples. Singular and invertible, this embodiment calculates... In this case, regularization is preferred, i.e., in actual computation ,in It is the identity matrix. For a preset, extremely small positive number, such as This is to ensure that the matrix is always invertible;
[0072] If a feature Although compared with the mean There is some deviation, but the direction of the deviation is... The high variance direction defined in the model is the legitimate fluctuation direction of the background texture. This deviation will be scaled, meaning any illegal fluctuations that the model has not seen before, even if the absolute distance of the deviation is small. It will also amplify it, making The value is very high;
[0073] By employing Mahalanobis distance as the context anomaly score, the defect identification module can intelligently distinguish genuine, subtle defects, i.e., high-resolution defects. Values and legal texture fluctuations, i.e., low This value greatly improves the robustness and sensitivity of the detection system against complex texture backgrounds.
[0074] Example 3:
[0075] The model update module is used to update the dynamic baseline model, including:
[0076] The exponential moving average method is used to perform online smoothing updates of the background mean vector and the background covariance matrix;
[0077] Among them, the adaptive threshold is less than the defect determination threshold;
[0078] Perform smooth online updates, including:
[0079] Calculate the difference vector between the high-confidence background sample and the background mean vector of the dynamic background model;
[0080] Based on the difference vector and the preset learning rate, the baseline mean vector is recursively updated;
[0081] Calculate the outer product of the difference vectors;
[0082] Based on the outer product of the difference vectors and the learning rate, combined with the background covariance matrix of the dynamic background model, the background covariance matrix is updated stably.
[0083] As a preferred implementation of the model update module in Example 1, this example clarifies the dynamic background model. ,Right now and The update logic;
[0084] As mentioned above, this embodiment ensures adaptive thresholding. Less than the defect judgment threshold The technical consideration behind this design is to establish a safety buffer, ensuring that only samples that are highly certain of being normal are used. Only then can it participate in model updates, thereby preventing minor defects from contaminating the baseline model; in this embodiment, the adaptive threshold The setting can be based on the defect judgment threshold. To make trade-offs, for example, it could be set as A fixed ratio, such as , in order to and A clear buffer of suspicious samples, namely non-high-confidence background samples, is maintained between them;
[0085] When a local feature vector Determined as a high-confidence background sample Then, the system uses the Exponential Moving Average (EMA) method to analyze the baseline mean vector. and background covariance matrix Online smoothing updates are performed; this online smoothing update employs a computationally efficient and numerically stable recursive algorithm to ensure that the model parameters ( It can gradually and smoothly adapt to new batches of valid textures, assuming the current one is... At time , the model parameters of the previous time step are and :
[0086] The specific steps for this online smooth update include:
[0087] calculate and Time-old base mean vector difference vector :
[0088] ;
[0089] Based on this difference vector and a preset learning rate Recursive update The mean vector at time intervals :
[0090] ;
[0091] Calculate the outer product of the difference vectors The outer product here refers to a dimensional vector With Dimension transpose Multiply, and you get a A dimensional scatter matrix;
[0092] The outer product based on this difference vector and learning rate , combined The background covariance matrix at time 1 Stable updates The background covariance matrix at time 1 :
[0093] ;
[0094] in, : The updated model parameters will be used as... For Defect identification at any given moment;
[0095] : The old model parameters at time step 1 are output from this module at the previous time step 2.
[0096] High-confidence baseline samples are determined by the defect identification module. Later obtained;
[0097] Difference vector, a D×1 dimensional vector, representing intermediate variables in the calculation;
[0098] The learning rate is a scalar between (0, 1) and a hyperparameter derived from empirical tuning on a validation dataset to balance the speed at which the model adapts to new textures with the model's stability; for example, it can be set at... Within the range;
[0099] In terms of dimensions, The update is A linear combination of dimensional vectors; The update is A linear combination of 3D matrices with consistent dimensions;
[0100] This plan is approved. The safety mechanism, combined with the smooth update mechanism of EMA, achieves a safe and smooth online adaptive mechanism; the EMA recursive formula ensures... and The changes are gradual, avoiding sudden changes in model parameters due to drastic fluctuations in a single sample, thus ensuring the long-term stability of detection performance; this defect identification uses... With model updates, generate The logical closed loop is the core of this system's ability to automatically adapt to batch changes.
[0101] Example 4:
[0102] The drift monitoring module is used to calculate the texture drift index, including:
[0103] The dynamic baseline model before storage batch switching and the dynamic baseline model after adapting to the new batch;
[0104] Based on Mahalanobis distance in information theory, the difference between the dynamic background model before and after the switch is calculated;
[0105] The difference was defined as the texture drift index.
[0106] As a preferred implementation of the drift monitoring module in Example 1, this example clarifies the texture drift index. The calculation process;
[0107] When a batch switch is detected, the module stores the dynamic baseline model before the switch. and the dynamic background model after adapting to the new batch ;
[0108] The core function of the drift monitoring module is to calculate the difference between the two Gaussian distribution models. In this embodiment, the calculation is based on the Mahalanobis distance in information theory, which can comprehensively quantify the differences between the two probability distributions in terms of mean and covariance. The calculated difference is determined as the texture drift index. The calculation formula is as follows:
[0109] ;
[0110] in, Texture drift index, a dimensionless scalar, is calculated in this step and is used in conjunction with the process control threshold. Compare;
[0111] The mean vector and covariance matrix of the model before the switch are derived from the final output of the model update module before the batch switch.
[0112] The mean vector and covariance matrix of the model after adapting to the new batch are derived from the stable output of the model update module after adapting to the new batch.
[0113] The average matrix of the old and new covariance matrices, a D×D dimensional matrix, is derived from... ;
[0114] : Matrix determinant operations result in a scalar;
[0115] The formula consists of two parts: the first term is the mean. The first term is a Mahalanobis-like distance term used to measure the mean shift of the background texture; the second term is the covariance. The determinant terms between them are used to measure the drift of the background texture fluctuation pattern; both are dimensionless scalars, and the sum of them is... It is still a scalar, which is logical;
[0116] By adopting this approach, the present invention addresses the byproducts of the model update logic, namely... and As a high-value data source, it provides a quantitative, model-based objective indicator. This technology enables the monitoring of process stability, achieving a technological leap from passive defect detection to proactive process insight.
[0117] Example 5:
[0118] The feature acquisition module is used to calculate the local feature vector of a local region, including:
[0119] For each local region, a multi-dimensional local feature vector is calculated using feature extraction operators;
[0120] Feature extraction operators include LBP operator or HOG operator.
[0121] As a preferred implementation of the feature acquisition module in Embodiment 1, this embodiment clarifies the local feature vector. The calculation method;
[0122] In this embodiment, the feature acquisition module targets each local region. Multi-dimensional local feature vectors are calculated using feature extraction operators. Feature extraction operators refer to a class of algorithms that convert image pixels, i.e. unstructured data, into fixed-dimensional feature vectors, i.e. structured data, to extract robust features that are not sensitive to interference such as lighting but are sensitive to changes in texture.
[0123] In this embodiment, the feature extraction operator preferably includes: an LBP operator or a HOG operator; if an LBP operator is used, then It is a histogram vector describing the texture pattern of this local region; if the HOG operator is used, then... It is a histogram vector describing the distribution of the edges and gradient directions of the local region;
[0124] By employing well-known and mature feature extraction operators such as LBP or HOG, this scheme ensures accurate local feature vector extraction from the original image. The effectiveness and reproducibility of this crucial step provide high-quality, highly discriminative input data for subsequent dynamic baseline modeling and defect identification.
[0125] Example 6:
[0126] The baseline modeling module, used to determine the background mean vector and background covariance matrix, includes:
[0127] Collect and confirm that there are no defects in the local feature vectors as the initial dataset;
[0128] Calculate the statistical distribution of the initial dataset;
[0129] The mean vector of the statistical distribution is determined as the background mean vector;
[0130] The covariance matrix of the statistical distribution is determined as the background covariance matrix.
[0131] As a preferred implementation of the baseline modeling module in Example 1 during the system initialization phase, this example clarifies the background mean vector. and background covariance matrix The initial determination process;
[0132] The baseline modeling module collects data during system initialization or the start of a new batch. A confirmed defect-free local feature vector And use them as the initial dataset; confirming that there are no defects means that the source of this batch of samples is a good sample that has been verified manually or by other reliable means;
[0133] The module calculates the statistical distribution of the initial dataset; in this embodiment, the statistical distribution is assumed to be a multidimensional Gaussian distribution. The mean vector of the statistical distribution is determined as the background mean vector. :
[0134] ;
[0135] The covariance matrix of the statistical distribution is determined as the background covariance matrix. :
[0136] ;
[0137] Through this implementation method, the system establishes an objective initial baseline model based on the statistical characteristics of actual good samples at startup. This model forms the initial benchmark for all subsequent context anomaly score calculations, ensuring that the system has the ability to distinguish between normal fluctuations and abnormal defects from the very beginning.
[0138] Example 7:
[0139] The defect determination threshold is set based on a trade-off between the subject's operating characteristic curve and the actual performance characteristics curve.
[0140] As a supplementary explanation to Example 1, this example illustrates the defect determination threshold. The basis for its setting;
[0141] Defect judgment threshold These are key parameters used in the defect identification module to distinguish between normal and defective components; in this embodiment, The source is determined by a trade-off based on the receiver operating characteristic curve;
[0142] Technicians prepare a validation dataset containing known normal samples and known defective samples; the system uses this dataset to calculate the context anomaly score for all samples. ; through different Under the given values, the true positive rate and false positive rate of the system are calculated respectively, and ROC curves are plotted. The final value is determined by the technical staff through trade-offs on the ROC curve, choosing the optimal balance point that meets business needs. For example, within an acceptable FPR, the value that maximizes TPR. value;
[0143] Using the scientific method of ROC curves to set This solution transforms threshold setting from a vague empirical value into a statistically based, quantifiable, and optimizable decision-making process, ensuring that the detection system achieves a balance between sensitivity and specificity that meets actual production requirements.
[0144] Example 8:
[0145] Among them, the process control threshold is set by process engineers based on production experience.
[0146] As a supplementary explanation to Example 1, this example illustrates the process control threshold. The basis for its setting;
[0147] Process control threshold It is used in the drift monitoring module to determine whether the texture drift between batches is too large. The key parameters; in this embodiment, The source is determined by process engineers based on production experience;
[0148] The method for determining it is as follows: This is a business parameter that defines the acceptable upper limit of texture variation between batches; process engineers combine historical production data and quality control standards, and observe the switching of several batches with known process stability. For batch switching with low values and known process anomalies, Higher values Value distribution, set a suitable Values are used to distinguish between the two;
[0149] By By delegating the setting permissions to process engineers, this solution ensures that the output of the drift monitoring module is closely integrated with actual production management needs and process experience, thus ensuring that technical warnings have real business guidance significance.
[0150] 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 visual image processing system for titanium rod surface defect detection, characterized by, The method comprises the following steps: A feature acquisition module is configured to acquire continuous image frames of the surface of a titanium rod in real time, divide the continuous image frames into local regions, and calculate local feature vectors of the local regions; A baseline modeling module is configured to determine a background mean vector and a background covariance matrix based on the acquired local feature vectors confirmed to be defect-free during a system initialization phase, and construct a dynamic background model based on the background mean vector and the background covariance matrix; A defect identification module is configured to calculate a contextual anomaly score of a subsequent local feature vector to be detected based on the dynamic background model, determine a defect when the contextual anomaly score is greater than a preset defect determination threshold, and determine normal when the contextual anomaly score is less than or equal to the defect determination threshold; A model updating module is configured to determine that the corresponding local feature vector is a high-confidence background sample when the contextual anomaly score is less than a preset adaptive threshold, and update the dynamic background model using the high-confidence background sample, and determine that the corresponding local feature vector is a non-high-confidence background sample when the contextual anomaly score is greater than or equal to the adaptive threshold; A drift monitoring module is configured to calculate a texture drift index based on the dynamic background model before a batch switch and the dynamic background model after the batch switch when the batch switch is monitored, and output a process warning when the texture drift index is greater than a preset process control threshold, and not output the process warning when the texture drift index is less than or equal to the process control threshold; The defect identification module is configured to calculate the contextual anomaly score, comprising: calling the background mean vector and the background covariance matrix of the dynamic background model; calculating the Mahalanobis distance of the local feature vector based on the background mean vector and the background covariance matrix; determining the Mahalanobis distance as the contextual anomaly score; The baseline modeling module is configured to determine the background mean vector and the background covariance matrix, comprising: acquiring the local feature vectors confirmed to be defect-free as an initial data set; calculating the statistical distribution of the initial data set; determining the mean vector of the statistical distribution as the background mean vector; determining the covariance matrix of the statistical distribution as the background covariance matrix. The model updating module is configured to update the dynamic background model, comprising:
2. A visual image processing system for surface defect detection of titanium rods as claimed in claim 1 wherein, using an exponential moving average method to perform online smoothing update on the background mean vector and the background covariance matrix; wherein the adaptive threshold is less than the defect determination threshold. The online smoothing update comprises:
3. A visual image processing system for surface defect detection of titanium rods as claimed in claim 2 wherein, calculating a difference vector of the high-confidence background sample and the background mean vector of the dynamic background model; recursively updating the background mean vector based on the difference vector and a preset learning rate; calculating the outer product of the difference vector; stably updating the background covariance matrix based on the outer product of the difference vector and the learning rate, in combination with the background covariance matrix of the dynamic background model. The drift monitoring module is configured to calculate the texture drift index, comprising:
4. The visual image processing system for surface defect detection of titanium rods as claimed in claim 1 wherein, storing the dynamic background model before the batch switch and the dynamic background model after adapting to the new batch; calculating the difference between the dynamic background models before and after the switch based on the Mahalanobis distance in information theory; determining the difference as the texture drift index. The feature acquisition module is configured to calculate the local feature vectors of the local regions, comprising:
5. A visual image processing system for surface defect detection of titanium rods as claimed in claim 1, wherein For each local region, a multi-dimensional local feature vector is calculated by a feature extraction operator; The feature extraction operator includes an LBP operator or an HOG operator. 6.The visual image processing system for titanium rod surface defect detection according to claim 1, wherein wherein The defect determination threshold is set according to a receiver operating characteristic curve. 7.The visual image processing system for titanium rod surface defect detection according to claim 1, wherein wherein The process control threshold is set by a process engineer according to production experience.
Citation Information
Patent Citations
Bar grinding device
CN116728178A
Visual inspection system and method for tiny flaws of industrial products
CN120612327A