Defect detection system based on machine vision

By binding the synchronous processing of images and interference data and the coupling effect model, and dynamically adjusting the threshold and weight matching, the problem of inter-frame defect alignment under dynamic grayscale drift in machine vision defect detection system is solved, and high-precision detection of minute defects is achieved.

CN121544564APending Publication Date: 2026-02-17FUZHOU UNIV
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202511719401.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-21
Publication Date
2026-02-17

AI Technical Summary

Technical Problem

Existing machine vision defect detection systems based on multi-frame image fusion struggle to accurately align inter-frame defects in dynamic grayscale drift scenarios, leading to missed or false detections and failing to meet the requirements for high-precision detection.

Method used

By binding each frame of image with the corresponding interference data through the image acquisition and interference synchronization unit, and combining the coupling effect model of the multi-source interference coupling analysis unit to quantify the gray-scale drift effect, a dynamic threshold and weight matching strategy is adopted to achieve accurate correlation of inter-frame defects and filtering of false defects.

Benefits of technology

It effectively solves the problems of difficult alignment of inter-frame defects and missed detection and false detection caused by dynamic grayscale drift, improves the accuracy and stability of micro-defect detection, and meets the needs of high-precision industrial inspection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121544564A_ABST
    Figure CN121544564A_ABST
Patent Text Reader

Abstract

The invention discloses a defect detection system based on machine vision, and relates to the technical field of machine vision defect detection. Comprising an image acquisition and interference synchronization unit used for acquiring a visible light image and a near-infrared image of a target area, establishing an image-interference linkage channel with a multi-source interference coupling analysis unit, and binding each frame of image with corresponding interference data; and the multi-source interference coupling analysis unit is used for integrating the interference data and calculating a comprehensive influence coefficient of the interference data on the gray drift through a coupling effect model. According to the invention, each frame of image and corresponding interference data are bound through the image acquisition and interference synchronization unit, and the coupling effect model of the multi-source interference coupling analysis unit is combined to quantify the comprehensive influence of interference on gray scale drift, so that the problem that the interference is difficult to accurately evaluate is solved; the defect feature genetic extraction module converts potential defects into a multi-dimensional feature gene string, and the limitation of a single gray feature is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of machine vision defect detection technology, specifically to a machine vision-based defect detection system. Background Technology

[0002] In high-precision industrial inspection, such as defect detection in tiny areas like pins of microelectronic components and gates of precision injection molded parts, machine vision-based defect detection systems often employ "multi-frame image fusion" technology to improve detection accuracy. These systems acquire images of the target area multiple times from the same viewpoint and then use algorithms to superimpose and fuse the effective information from multiple frames. This reduces the interference of random noise and uneven local exposure in single-frame images, thus more clearly presenting the detailed features of tiny defects and meeting the needs for defect recognition at the micrometer or even sub-micrometer level.

[0003] Existing machine vision defect detection systems based on multi-frame image fusion face the technical challenge of accurately aligning defect features between frames when detecting small regions with dynamic gray-level drift. Dynamic gray-level drift refers to the irregular changes in gray-level values ​​of the same defect in different frames of images during multi-frame acquisition due to factors such as slight fluctuations in ambient light intensity and temperature drift of the image sensor during long-term operation. For example, CN110599433B discloses a dual-exposure image fusion method based on dynamic scenes. This invention acquires a first exposure image and a second exposure image, processes the images according to an adaptive threshold to obtain a binary image, performs brightness balancing processing on the image according to Retinex theory, and finally fuses the processed images. However, this invention uses a fixed grayscale threshold as the feature matching basis. When the grayscale value of the defect dynamically drifts, it either fails to accurately associate the same defect in different frames, resulting in fragmented defect features after fusion, or misjudges the differences caused by grayscale drift as new defects, ultimately causing missed or false detections of minor defects, making it difficult to meet the stability requirements of high-precision detection scenarios. Summary of the Invention

[0004] To address the shortcomings of existing technologies, this invention provides a machine vision-based defect detection system, which solves the problems of difficulty in aligning inter-frame defects and easy missed or false detections in dynamic grayscale drift scenarios.

[0005] To achieve the above objectives, the present invention provides the following technical solution: a defect detection system based on machine vision, comprising: The image acquisition and interference synchronization unit is used to acquire visible light and near-infrared images of the target area, and establish an image-interference linkage channel with the multi-source interference coupling analysis unit to bind each frame of image with the corresponding interference data. The multi-source interference coupling analysis unit is used to integrate interference data, calculate the comprehensive influence coefficient of interference data on grayscale drift through the coupling effect model, output the comprehensive influence coefficient to the dynamic threshold inversion module, and output interference features to the defect feature learning unit. The defect feature gene extraction module is used to convert potential defects in an image into a feature gene string containing spatial coordinate anchor points, contour topology, gray-level gradient distribution and texture entropy value. The dynamic threshold inversion module is used to calculate the gray-scale fluctuation range and gray-scale gradient allowable deviation value of the defect based on the comprehensive influence coefficient, and generate a dynamic inversion threshold. The dynamic weight matching module is used to dynamically adjust the matching weight of each feature in the feature gene string according to the interference intensity, and compare the feature gene string with the defect gene similarity algorithm of cosine similarity, and verify it in combination with the dynamic inversion threshold. The adaptive image fusion module is used to perform layered fusion strategy for defect regions based on the matching results of the dynamic weight matching module, and to perform gray-level correction on regions with large gray-level drift before fusion, thus filtering out false defect regions. The defect feature learning unit is used to store historical detection data and optimize the coupling effect model and weight allocation strategy through a stochastic gradient descent incremental learning algorithm.

[0006] Preferably, the image acquisition and interference synchronization unit uses a dual-mode industrial camera with time-division exposure and multispectral imaging, which simultaneously outputs visible light images and near-infrared images; the multi-source interference coupling analysis unit integrates ambient light intensity, sensor temperature, and target surface reflectivity to form an interference feature package, and the interference feature package is bound to each frame of image acquired by the image acquisition and interference synchronization unit.

[0007] Preferably, the multi-source interference coupling analysis unit calculates the comprehensive influence coefficient using a coupling effect model, and the calculation formula is as follows: ; in, This represents the comprehensive impact coefficient, reflecting the overall impact of interference data on grayscale drift; Indicates ambient light intensity; Indicates the sensor temperature; The reflectivity of the target surface is represented and obtained by inversion from near-infrared images. This represents the coefficient indicating the influence of ambient light intensity on grayscale shift. This represents the coefficient indicating the influence of sensor temperature on grayscale drift. This represents the coefficient that indicates the influence of the reflectivity of the target surface on grayscale drift.

[0008] Preferably, the defect feature gene extraction module converts potential defects into feature gene strings, including: receiving a visible light image, first optimizing the visible light image by multispectral fusion denoising, then converting each potential defect in the optimized image into a feature gene string, and simultaneously marking the interference feature packet identifier corresponding to the feature gene string.

[0009] Preferably, the dynamic threshold inversion module calculates the grayscale fluctuation range and the allowable deviation value of the grayscale gradient using the following formula: ; ; in, This indicates the lower limit of the grayscale fluctuation range; Indicates the upper limit of the grayscale fluctuation range; The baseline grayscale value representing the defect; Indicated by the comprehensive influence coefficient The determined grayscale drift amplitude is used to dynamically adjust the grayscale threshold range; This indicates the allowable deviation value for the grayscale gradient; This is the scaling factor for the allowable deviation of the grayscale gradient.

[0010] Preferably, the dynamic weight matching module dynamically adjusts the matching weight of each feature in the feature gene string according to the interference intensity, including a built-in real-time weight allocator. When the interference intensity is small, the real-time weight allocator increases the matching weight of the gray-level gradient distribution feature; when the interference intensity is large, the real-time weight allocator increases the weight ratio of the contour topology feature and the spatial coordinate anchor point feature.

[0011] Preferably, the dynamic weight matching module compares the overlap of feature gene strings using a cosine similarity defect gene similarity algorithm to determine if they are the same defect, and marks the matching confidence level. The calculation formula is: ; in, Indicates the number of features in the feature gene string; Indicates the first The dynamic matching weights of each feature code are dynamically given by the real-time weight allocator based on the interference intensity. The first defect in the current frame One feature code The first defect of the reference frame One feature code Similarity metric between them.

[0012] Preferably, the adaptive image fusion module employs a defect region hierarchical fusion strategy, including: Defects with a matching confidence level higher than a preset threshold are fused. When the gray-level drift of the defect is small, pixel mean superposition is used to enhance the details. When the gray-level drift of the defect is large, feature gene alignment is first performed, gray-level deviation is corrected according to the dynamic inversion threshold, and then detail fusion is performed. At the same time, pseudo-defect regions with gene similarity lower than the preset threshold are automatically filtered out.

[0013] Preferably, the defect feature learning unit is continuously optimized using a stochastic gradient descent incremental learning algorithm, including: The defective gene string, corresponding interference feature package, matching result and fusion effect obtained from each detection are included in the historical database, and the accuracy of interference coefficient calculation of the coupling effect model is continuously updated based on the historical database.

[0014] Preferably, the defect feature learning unit is continuously optimized using a stochastic gradient descent incremental learning algorithm, and further includes: Based on historical databases, the dynamic weight allocation strategy of the dynamic weight matching module is revised to optimize the matching weight allocation under different interference scenarios; and the judgment threshold of the defect gene similarity algorithm is updated to continuously improve the matching accuracy of the dynamic weight matching module.

[0015] Compared with the prior art, the beneficial effects of the present invention are as follows: This invention addresses the challenge of accurately assessing interference by binding each frame of image with corresponding interference data through an image acquisition and interference synchronization unit, and quantifying the comprehensive impact of interference on grayscale drift using a coupling effect model from a multi-source interference coupling analysis unit. A defect feature gene extraction module transforms potential defects into multi-dimensional feature gene strings, avoiding the limitations of single grayscale features. A dynamic threshold inversion module generates dynamic inversion thresholds based on comprehensive influence coefficients, replacing traditional fixed thresholds to adapt to grayscale drift. A dynamic weight matching module adjusts feature weights according to interference intensity and combines them with a defect gene similarity algorithm to achieve accurate inter-frame defect association. An adaptive image fusion module hierarchically fuses defects and filters out false defects, avoiding defect feature fragmentation and misjudgment. A defect feature learning unit optimizes the model and weight strategy through incremental learning, continuously improving system adaptability. This effectively solves the problems of inter-frame defect alignment difficulties, missed detections, and false detections caused by dynamic grayscale drift, improving the accuracy and stability of micro-defect detection and meeting the needs of high-precision industrial inspection. Attached Figure Description

[0016] Figure 1 This is a system structure diagram of the present invention; Figure 2 This is a flowchart of the interference analysis and dynamic threshold generation process of the present invention; Figure 3 This is a flowchart of the defect matching and fusion decision-making process of the present invention. Detailed Implementation

[0017] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0018] Please see Figure 1-3 This invention provides a machine vision-based defect detection system, comprising: The image acquisition and interference synchronization unit is used to acquire visible light and near-infrared images of the target area, and establish an image-interference linkage channel with the multi-source interference coupling analysis unit to bind each frame of image with the corresponding interference data. The multi-source interference coupling analysis unit is used to integrate interference data, calculate the comprehensive influence coefficient of interference data on grayscale drift through the coupling effect model, output the comprehensive influence coefficient to the dynamic threshold inversion module, and output interference features to the defect feature learning unit. The defect feature gene extraction module is used to convert potential defects in an image into a feature gene string containing spatial coordinate anchor points, contour topology, gray-level gradient distribution and texture entropy value. The dynamic threshold inversion module is used to calculate the gray-scale fluctuation range and gray-scale gradient allowable deviation value of the defect based on the comprehensive influence coefficient, and generate a dynamic inversion threshold. The dynamic weight matching module is used to dynamically adjust the matching weight of each feature in the feature gene string according to the interference intensity, and compare the feature gene string with the defect gene similarity algorithm of cosine similarity, and verify it in combination with the dynamic inversion threshold. The adaptive image fusion module is used to perform layered fusion strategy for defect regions based on the matching results of the dynamic weight matching module, and to perform gray-level correction on regions with large gray-level drift before fusion, thus filtering out false defect regions. The defect feature learning unit is used to store historical detection data and optimize the coupling effect model and weight allocation strategy through a stochastic gradient descent incremental learning algorithm.

[0019] Specifically, this implementation is applied to the detection of micron-level defects in the pins of microelectronic components, specifically addressing issues such as difficulty in aligning inter-frame defect features, missed detections, and false detections caused by dynamic grayscale drift. The image acquisition and interference synchronization unit deploys a dual-mode industrial camera with time-division exposure and multispectral imaging. This camera can switch imaging modes within the 500nm to 900nm spectral range, simultaneously acquiring visible light and near-infrared images of the target area. The acquisition frame rate is set to 30 frames per second to ensure rapid capture of the instantaneous state of minute defects. During acquisition, this unit establishes a low-latency image-interference linkage channel with the multi-source interference coupling analysis unit via industrial Ethernet. After each image frame is acquired, it is immediately bound to the synchronously acquired interference data, achieving a one-to-one correspondence between the image and interference information. This lays the foundation for subsequent accurate analysis of the impact of interference on grayscale drift.

[0020] The multi-source interference coupling analysis unit integrates three types of core interference data in real time, calculates the comprehensive influence coefficient through a preset coupling effect model, and quantifies the degree of interference's effect on gray-level drift. After receiving the visible light image, the defect feature gene extraction module first optimizes the image quality through multispectral fusion denoising processing, and then transforms each potential defect into a feature gene string containing spatial coordinate anchor points, contour topology, gray-level gradient distribution, and texture entropy value. This multi-dimensional feature combination breaks through the limitations of traditional methods that rely solely on gray-level features. Even if the defect gray-level value dynamically drifts, it can still achieve accurate identification through stable spatial coordinates and contour features.

[0021] The dynamic threshold inversion module dynamically calculates the grayscale fluctuation range and allowable deviation value of the grayscale gradient of the defect based on the comprehensive influence coefficient, generating a dynamic inversion threshold adapted to the current interference environment. This replaces the traditional fixed threshold and effectively adapts to the irregular changes in grayscale values. The dynamic weight matching module adjusts the matching weight of each feature in the feature gene string in real time according to the interference intensity. It compares the feature gene strings of different frames using a cosine similarity defect gene similarity algorithm and verifies the matching results in conjunction with the dynamic inversion threshold, ensuring that the same defect is accurately associated in different frames.

[0022] The adaptive image fusion module employs a layered fusion strategy for defect regions. Defects with reliable matching results are fused in a targeted manner, while areas with significant grayscale drift are corrected before fusion. Simultaneously, false defect regions are automatically filtered to avoid misclassifying grayscale drift differences as new defects. The defect feature learning unit continuously stores complete data from each detection and continuously optimizes the coupling effect model and weight allocation strategy through a stochastic gradient descent incremental learning algorithm, gradually improving the system's ability to adapt to different interference scenarios.

[0023] In this embodiment, the image acquisition and interference synchronization unit uses a dual-mode industrial camera with time-division exposure and multispectral imaging, which simultaneously outputs visible light images and near-infrared images; the multi-source interference coupling analysis unit integrates ambient light intensity, sensor temperature, and target surface reflectivity to form an interference feature package, which is then bound to each frame of image acquired by the image acquisition and interference synchronization unit.

[0024] Specifically, the image acquisition and interference synchronization unit utilizes a dual-mode industrial camera with time-division exposure and multispectral imaging. The time-division exposure time can be adjusted as needed between 10 and 100 microseconds. For example, for detecting pins of highly reflective microelectronic components, the exposure time can be set to 20 microseconds to avoid overexposure and loss of defect details. The multispectral imaging mode can switch between the visible light band (500nm to 700nm) and the near-infrared band (700nm to 900nm). The two bands complement each other, capturing both the appearance details of defects and reflecting the material properties of the target surface.

[0025] The interference feature package integrated by the multi-source interference coupling analysis unit contains three types of key data: ambient light intensity is acquired through a high-precision light intensity sensor deployed above the detection station, with a measurement range of 0 to 10000 lux; sensor temperature is acquired in real time through a temperature sensor built into the industrial camera, with a measurement accuracy of ±0.1℃; and target surface reflectance is obtained through near-infrared image inversion, utilizing the sensitivity of near-infrared light to the target surface material to calculate the reflectance parameter. After the interference feature package is generated, each frame of image and its corresponding interference feature package are assigned a unique 16-bit binary identifier to achieve precise binding between the two, ensuring that the interference environment corresponding to each frame of image can be quickly traced during subsequent analysis.

[0026] In this embodiment, the multi-source interference coupling analysis unit calculates the comprehensive influence coefficient using a coupling effect model. The calculation formula is as follows: ; in, This represents the comprehensive impact coefficient, reflecting the overall impact of interference data on grayscale drift; Indicates ambient light intensity; Indicates the sensor temperature; The reflectivity of the target surface is represented and obtained by inversion from near-infrared images. This represents the coefficient indicating the influence of ambient light intensity on grayscale shift. This represents the coefficient indicating the influence of sensor temperature on grayscale drift. This represents the coefficient that indicates the influence of the reflectivity of the target surface on grayscale drift.

[0027] Specifically, the multi-source interference coupling analysis unit calculates the comprehensive influence coefficient using a coupling effect model. Since the dimensions of ambient light intensity, sensor temperature, and target surface reflectivity are inconsistent, the three parameters must first undergo max-min normalization to map them uniformly to the range of 0 to 1. The calculation formula for the coupling effect model is as follows: ; in, This represents the comprehensive impact coefficient, reflecting the overall impact of interference data on grayscale drift. This represents the normalized ambient light intensity; This represents the normalized sensor temperature. This represents the normalized reflectivity of the target surface. The influence coefficient of ambient light intensity on grayscale shift ranges from 0.2 to 0.4. The coefficient representing the influence of sensor temperature on grayscale drift ranges from 0.3 to 0.5. The coefficient representing the influence of the target surface reflectivity on grayscale shift ranges from 0.2 to 0.4 and satisfies the following condition: , , , The initial values ​​were determined through a control experiment under 100 sets of standard interference scenarios: Within the full range of ambient light intensity (0-10000 lux), sensor temperature (20-60℃), and target surface reflectivity (0.1-0.9), a test point was set at 5% intervals, and the measured grayscale drift values ​​for each point were collected. The initial coefficients were obtained by fitting using the least squares method, with a fitting error ≤0.02. The fitting formula is:

[0028] Where j is the test point number, and the other parameters are the same as those in the above formula.

[0029] For example, in the scenario of precision injection molding part gate inspection, when the normalized value of ambient light intensity is 0.6, the normalized value of sensor temperature is 0.3, and the normalized value of target surface reflectivity is 0.5, and... , , When the time comes, the comprehensive influence coefficient can be calculated. This formula quantifies the influence weight of each interference factor, enabling a precise assessment of the overall impact of grayscale drift. This provides a scientific basis for subsequent dynamic threshold adjustment, allowing the system to proactively adapt to changes in the interference environment.

[0030] In this embodiment, the defect feature gene extraction module converts potential defects into feature gene strings, including: receiving a visible light image, first optimizing the visible light image by multispectral fusion denoising, then converting each potential defect in the optimized image into a feature gene string, and simultaneously marking the interference feature packet identifier corresponding to the feature gene string.

[0031] Specifically, after receiving the visible light image, the defect feature gene extraction module first uses a wavelet transform fusion denoising algorithm to optimize the image quality. This algorithm first performs two-level wavelet decomposition on the visible light image and the near-infrared image respectively to extract low-frequency and high-frequency components. The low-frequency components are fused using a weighted average method, and the high-frequency components are fused using the absolute value maximum method. Then, the optimized image is reconstructed through inverse wavelet transform, effectively removing random noise and local exposure unevenness in the image.

[0032] The optimized image then enters the defect feature extraction stage, where each potential defect is transformed into a feature gene string. Spatial coordinate anchor points are determined based on the image pixel coordinate system. For example, with the top left corner of the image as the origin, the horizontal axis as the x-axis, and the vertical axis as the y-axis, the coordinates of the four vertices of the defect edge contour are taken as spatial coordinate anchor points. The contour topology is extracted using the Canny edge detection algorithm, and then converted into topological feature codes using chain code encoding. The gray-level gradient distribution is calculated using the Sobel operator to calculate the gradient value of each pixel within the defect region, constructing a gradient distribution vector. The texture entropy value is calculated based on the gray-level co-occurrence matrix, taking the co-occurrence matrix parameters with a distance of 1 and an angle of 0°, and obtaining the texture entropy value using the entropy formula.

[0033] While generating the feature gene string, it is labeled with the corresponding interference feature packet identifier. This identifier is consistent with the identifier bound in the image-interference linkage channel, ensuring that the defect features can be quickly associated with the corresponding interference environment information in the subsequent analysis process, thereby improving the accuracy of defect identification.

[0034] In this embodiment, the dynamic threshold inversion module calculates the grayscale fluctuation range and the allowable deviation value of the grayscale gradient. The calculation formula is as follows: ; ; in, This indicates the lower limit of the grayscale fluctuation range; Indicates the upper limit of the grayscale fluctuation range; The baseline grayscale value representing the defect; Indicated by the comprehensive influence coefficient The determined grayscale drift amplitude is used to dynamically adjust the grayscale threshold range; This indicates the allowable deviation value for the grayscale gradient; This is the scaling factor for the allowable deviation of the grayscale gradient.

[0035] Specifically, the dynamic threshold inversion module, based on the comprehensive influence coefficient output by the multi-source interference coupling analysis unit, calculates the gray-level fluctuation range and allowable deviation value of the gray-level gradient of the defect using a preset formula. The formula for calculating the gray-level fluctuation range is: ; in, This represents the lower limit of the grayscale fluctuation range. This indicates the upper limit of the grayscale fluctuation range. The baseline grayscale value representing the defect is obtained by calculating the mean grayscale value by acquiring 100 frames of defect images under interference-free conditions. Indicated by the comprehensive influence coefficient The determined grayscale shift amplitude is calculated using the following formula: , This is the grayscale drift ratio coefficient, with a value ranging from 5 to 15, used to dynamically adjust the grayscale threshold range.

[0036] The formula for calculating the allowable deviation value of grayscale gradient is: ; in, This represents the allowable deviation value of the grayscale gradient. This is the proportional coefficient for the allowable deviation of the grayscale gradient, which is set according to the accuracy requirements of the detection scenario. For example, it is set to 3 in the detection of pins of micro-electronic components.

[0037] Due to the comprehensive influence coefficient Normalization has been performed. and All are dimensionless coefficients, and the dimensions of each parameter in the formula are consistent.

[0038] In this embodiment, the dynamic weight matching module dynamically adjusts the matching weight of each feature in the feature gene string according to the interference intensity. This includes a built-in real-time weight allocator. When the interference intensity is low, the real-time weight allocator increases the matching weight of the gray-level gradient distribution feature. When the interference intensity is high, the real-time weight allocator increases the weight ratio of the contour topology feature and the spatial coordinate anchor point feature.

[0039] Specifically, the dynamic weight matching module has a built-in real-time weight allocator, which is preset with interference intensity judgment criteria to comprehensively assess the impact coefficient. As a basis for judgment, when When the interference intensity is determined to be relatively small, The interference intensity is judged to be relatively high at times, and medium at times in between.

[0040] When the interference intensity is low, grayscale features are less affected by the interference. The real-time weight allocator increases the matching weight of grayscale gradient distribution features. For example, the weight of spatial coordinate anchor points is set to 0.2, the weight of contour topology is set to 0.2, the weight of grayscale gradient distribution is set to 0.5, and the weight of texture entropy is set to 0.1, making full use of the detailed information of grayscale gradient distribution to improve matching accuracy. When the interference intensity is high, the stability of grayscale features decreases. The real-time weight allocator increases the weight ratio of contour topology features and spatial coordinate anchor points. For example, the weight of spatial coordinate anchor points is adjusted to 0.3, the weight of contour topology is 0.4, the weight of grayscale gradient distribution is 0.1, and the weight of texture entropy is 0.2, relying on the more stable spatial and contour features to ensure matching reliability.

[0041] The real-time weight allocator achieves millisecond-level weight adjustment through industrial control chips, ensuring that weight allocation is synchronized with changes in the interference environment. This enables the system to select the optimal feature matching strategy under different interference scenarios, improving the adaptability of defect identification.

[0042] In this embodiment, the dynamic weighted matching module compares the overlap of feature gene strings using a cosine similarity defect gene similarity algorithm to determine if they are the same defect, and marks the matching confidence level. The calculation formula is: ; in, Indicates the number of features in the feature gene string; Indicates the first The dynamic matching weights of each feature code are dynamically given by the real-time weight allocator based on the interference intensity. The first defect in the current frame One feature code The first defect of the reference frame One feature code Cosine similarity between them.

[0043] Specifically, the dynamic weighted matching module compares the overlap of feature gene strings using a cosine similarity-based defect gene similarity algorithm to determine the same defect in different frames. The matching confidence of this algorithm... The calculation formula is: ; in, This indicates the number of signatures in the feature gene string, as described in this embodiment. These correspond to four types of feature codes: spatial coordinate anchor points, contour topology, gray-level gradient distribution, and texture entropy value, respectively. Indicates the first The dynamic matching weights of each feature code are dynamically given by the real-time weight allocator based on the interference intensity. The first defect in the current frame One feature code The first defect of the reference frame One feature code The cosine similarity between the two vectors is calculated using the cosine similarity algorithm, with values ​​ranging from 0 to 1. The specific steps are: converting the feature codes into 128-dimensional normalized vectors; calculating the ratio of the dot product to the product of the magnitudes of the two vectors, i.e., the formula: ; in, , The first, representing the defect of the reference frame A unique identifier.

[0044] The reference frame is selected as the image frame with the least interference and clear defect features, and its feature gene string is stored in the system's local cache. For example, when the interference intensity is low, the similarity between the current frame and the reference frame is 0.95 for spatial coordinate anchor points, 0.92 for contour topology, 0.96 for gray-level gradient distribution, and 0.88 for texture entropy, with corresponding dynamic weights of 0.2, 0.2, 0.5, and 0.1, respectively. The matching confidence can then be calculated. .

[0045] The system presets a matching confidence threshold. If the value is above a threshold, it is determined to be the same defect; if the value is below the threshold, it is determined to be a different defect or a pseudo-defect. This algorithm improves the reliability of defect matching by using a multi-feature weighted fusion method, and effectively avoids misjudgment caused by changes in a single feature.

[0046] In this embodiment, the adaptive image fusion module adopts a defect region hierarchical fusion strategy, including: Defects with a matching confidence level higher than a preset threshold are fused. When the gray-level drift of the defect is small, pixel mean superposition is used to enhance the details. When the gray-level drift of the defect is large, feature gene alignment is first performed, gray-level deviation is corrected according to the dynamic inversion threshold, and then detail fusion is performed. At the same time, pseudo-defect regions with gene similarity lower than the preset threshold are automatically filtered out.

[0047] Specifically, the adaptive image fusion module adopts a layered fusion strategy for defect regions. It first obtains the matching confidence score output by the dynamic weight matching module, and presets the matching confidence score threshold to 0.75. Only defects with a matching confidence score higher than this threshold are fused to ensure the reliability of the fusion object.

[0048] When determining the degree of grayscale drift of a defect, the ratio of the difference between the current frame's defect grayscale value and the reference grayscale value to the reference grayscale value is calculated. When the ratio is less than 10%, the grayscale drift is considered minor. In this case, pixel mean superposition is used to enhance details. That is, the average grayscale value of the same pixel in the defect area of ​​multiple frames is taken as the grayscale value of that pixel after fusion, preserving the fine structural features of the defect. When the ratio is greater than or equal to 10%, the grayscale drift is considered major. First, precise alignment is performed using spatial coordinate anchor points and contour topology in the feature gene string to ensure that defects in different frames completely overlap in spatial position. Then, the grayscale deviation of each frame is corrected according to the grayscale fluctuation range in the dynamic inversion threshold, adjusting the current frame's defect grayscale value to near the reference grayscale value. Finally, a weighted average fusion algorithm is used for detail fusion. The fusion weight is set according to the matching confidence; the higher the matching confidence, the greater the weight.

[0049] During the fusion process, the system automatically calculates the similarity of defect feature gene strings in different frames and sets the gene similarity threshold to 0.5. When the similarity is lower than this threshold, it is identified as a false defect region and filtered out, which effectively reduces false detections caused by grayscale drift and improves the defect recognition accuracy of the fused image.

[0050] In this embodiment, the defect feature learning unit is continuously optimized using a stochastic gradient descent incremental learning algorithm, including: The defective gene string, corresponding interference feature package, matching result and fusion effect obtained from each detection are included in the historical database, and the accuracy of interference coefficient calculation of the coupling effect model is continuously updated based on the historical database.

[0051] Specifically, the defect feature learning unit incorporates a large-capacity solid-state drive as the storage medium for the historical database. After each detection, it automatically incorporates the defect gene string, corresponding interference feature package, matching results, and fusion effect evaluation indicators acquired during the detection process into the historical database. The fusion effect evaluation indicators include defect edge clarity and false defect filtering rate, providing data support for subsequent optimization.

[0052] This unit employs stochastic gradient descent as the incremental learning algorithm, setting the learning rate to 0.001. Iterates once for every 1000 new detection data sets, with a convergence condition of the difference between the model's predicted comprehensive influence coefficient and the coefficient corresponding to the measured gray-scale drift being ≤0.01. During each iteration, model parameters are updated only based on the newly added data, eliminating the need to retrain on historical data and ensuring real-time performance. After each new detection data set, the normalized ambient light intensity, normalized sensor temperature, normalized target surface reflectivity, and the corresponding measured gray-scale drift values ​​from the interference feature packet are input into the coupling effect model. By minimizing the difference between the model's predicted comprehensive influence coefficient and the coefficient corresponding to the actual gray-scale drift, the influence coefficients of ambient light intensity, sensor temperature, and target surface reflectivity on gray-scale drift are updated.

[0053] Through continuous incremental learning, the accuracy of interference coefficient calculation in the coupling effect model is constantly improved, enabling more precise quantification of the impact of various interferences on grayscale drift. This provides more reliable input parameters for the dynamic threshold inversion module and the dynamic weight matching module, gradually enhancing the system's adaptability to interference environments.

[0054] In this embodiment, the defect feature learning unit is continuously optimized through an incremental learning algorithm, and also includes: Based on historical databases, the dynamic weight allocation strategy of the dynamic weight matching module is revised to optimize the matching weight allocation under different interference scenarios; and the judgment threshold of the defect gene similarity algorithm is updated to continuously improve the matching accuracy of the dynamic weight matching module.

[0055] Specifically, the defect feature learning unit continuously refines the dynamic weight allocation strategy of the dynamic weight matching module using an incremental learning algorithm based on a large amount of detection data in the historical database. The system periodically calculates the matching accuracy corresponding to the matching weights of each feature within different interference intensity ranges. When the weight of the contour topology feature in a certain interference intensity range is 0.3, the matching accuracy is low. The system then adjusts the weight of this feature in that range to 0.4 using an incremental learning algorithm, while simultaneously adjusting the weights of other features accordingly to ensure that the total weight remains at 1, thus optimizing the matching weight allocation under different interference scenarios.

[0056] The system dynamically updates the decision threshold for the defect gene similarity algorithm based on changes in the false negative and false positive rates in historical detection data. When historical data shows an increase in the false negative rate, the decision threshold is appropriately lowered to allow more potential defects to be identified; when the false positive rate increases, the decision threshold is appropriately raised to reduce false positives. Through this dynamic update mechanism, the decision threshold of the defect gene similarity algorithm can adapt to the needs of different detection scenarios, continuously improving the matching accuracy of the dynamic weight matching module. This allows the system's performance to be continuously optimized over long-term use, meeting the requirements of more complex and high-precision detection scenarios.

[0057] In summary, this invention solves the problem of inaccurate interference assessment by binding each frame of image with corresponding interference data through an image acquisition and interference synchronization unit, and quantifying the comprehensive impact of interference on grayscale drift using a coupling effect model of a multi-source interference coupling analysis unit. The defect feature gene extraction module transforms potential defects into multi-dimensional feature gene strings, avoiding the limitations of single grayscale features. The dynamic threshold inversion module generates dynamic inversion thresholds based on comprehensive influence coefficients, replacing traditional fixed thresholds to adapt to grayscale drift. The dynamic weight matching module adjusts feature weights according to interference intensity and combines them with a defect gene similarity algorithm to achieve accurate inter-frame defect association. The adaptive image fusion module fuses defects hierarchically and filters out false defects, avoiding defect feature fragmentation and misjudgment. The defect feature learning unit optimizes the model and weight strategy through incremental learning, continuously improving system adaptability. This effectively solves the problems of difficult inter-frame defect alignment, missed detection, and false detection caused by dynamic grayscale drift, improving the accuracy and stability of micro-defect detection and meeting the needs of high-precision industrial inspection.

[0058] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.

[0059] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A machine vision based defect detection system, characterized in that, The system comprises: an image acquisition and interference synchronization unit for acquiring visible light images and near-infrared images of a target area and establishing an image-interference linkage channel with a multi-source interference coupling analysis unit, and binding each frame of image with corresponding interference data; a multi-source interference coupling analysis unit for integrating interference data, calculating a comprehensive influence coefficient of the interference data on gray drift through a coupling effect model, and outputting the comprehensive influence coefficient to a dynamic threshold inversion module and outputting interference features to a defect feature learning unit; a defect feature gene extraction module for converting potential defects in the images into feature gene strings containing spatial coordinate anchor points, contour topological structures, gray gradient distributions, and texture entropy values; a dynamic threshold inversion module for calculating a gray fluctuation interval and a gray gradient allowable deviation value of the defects based on the comprehensive influence coefficient, and generating a dynamic inversion threshold; a dynamic weight matching module for dynamically adjusting the matching weights of each feature in the feature gene string according to the interference intensity, and comparing the feature gene strings through a defect gene similarity algorithm based on cosine similarity, and verifying in combination with the dynamic inversion threshold; an adaptive image fusion module for adopting a defect area hierarchical fusion strategy based on the matching results of the dynamic weight matching module, and fusing after gray correction of areas with large gray drift, and filtering pseudo-defect areas; a defect feature learning unit for storing historical detection data and optimizing the coupling effect model and the weight distribution strategy through a stochastic gradient descent type incremental learning algorithm.

2. The machine vision-based defect detection system of claim 1, wherein, The image acquisition and interference synchronization unit adopts a time-sharing exposure and multi-spectral imaging dual-mode industrial camera to simultaneously output visible light images and near-infrared images; the multi-source interference coupling analysis unit integrates ambient light intensity, sensor temperature, and target surface reflectivity to form an interference feature package, which is bound with each frame of image acquired by the image acquisition and interference synchronization unit.

3. The machine vision-based defect detection system of claim 1, wherein, The multi-source interference coupling analysis unit calculates the comprehensive influence coefficient through the coupling effect model, and the calculation formula is: ; wherein, represents a comprehensive influence coefficient, reflecting the comprehensive influence of the interference data on the gray drift; represents the ambient light intensity; represents the sensor temperature; represents the target surface reflectivity, which is obtained by inversion of the near-infrared image; represents the influence coefficient of the ambient light intensity on the gray drift; represents the influence coefficient of the sensor temperature on the gray drift; represents the influence coefficient of the target surface reflectivity on the gray drift.

4. The machine vision-based defect detection system of claim 1, wherein, The defect feature gene extraction module converts potential defects into feature gene strings, including: receiving visible light images, first optimizing the visible light images through multi-spectral fusion denoising, and then converting each potential defect in the optimized images into a feature gene string, while marking the interference feature package identifier corresponding to the feature gene string.

5. The machine vision-based defect detection system of claim 1, wherein, The dynamic threshold inversion module calculates the gray fluctuation interval and the gray gradient allowable deviation value, and the calculation formula is: ; ; wherein, represents the lower limit of the gray scale fluctuation interval; represents the upper limit of the gray scale fluctuation interval; represents the reference gray scale value of the defect; represents the gray scale drift amplitude determined by the comprehensive influence coefficient for dynamically adjusting the gray scale threshold range; represents the gray scale gradient allowable deviation value; is the proportional coefficient of the gray scale gradient allowable deviation.

6. The machine vision-based defect detection system of claim 1, wherein, The dynamic weight matching module dynamically adjusts the matching weights of each feature in the feature gene string according to the interference intensity, including a built-in real-time weight distributor that increases the matching weight of the gray gradient distribution feature when the interference intensity is small, and increases the weight proportion of the contour topological structure feature and the spatial coordinate anchor point feature when the interference intensity is large.

7. The machine vision-based defect detection system of claim 1, wherein, The dynamic weight matching module compares the coincidence degree of the characteristic gene string by the defect gene similarity algorithm of the cosine similarity to determine the same defect, and marks the matching confidence The calculation formula of the matching confidence is: ; in, Indicates the number of features in the feature gene string; Indicates the first The dynamic matching weights of each feature code are dynamically given by the real-time weight allocator based on the interference intensity. The first defect in the current frame One feature code The first defect of the reference frame One feature code The cosine similarity measure between them.

8. The machine vision-based defect detection system of claim 1, wherein, The adaptive image fusion module adopts a defect area hierarchical fusion strategy, including: The defects with a matching confidence higher than a preset threshold are fused, when the gray drift degree of the defects is small, pixel mean superposition is used to strengthen details, when the gray drift degree of the defects is large, first, the defects are aligned through a feature gene, the gray deviation is corrected according to a dynamic inversion threshold, then, the details are fused, and meanwhile, the pseudo-defect regions with a gene similarity lower than a preset threshold are automatically filtered.

9. The machine vision-based defect detection system of claim 1, wherein, The defect feature learning unit is continuously optimized through a random gradient descent type incremental learning algorithm, and includes the following: The defect gene string, the corresponding interference feature package, the matching result and the fusion effect obtained by each detection are included in a historical database, and the interference coefficient calculation precision of the coupling effect model is continuously updated based on the historical database.

10. The machine vision-based defect detection system of claim 9, wherein, The defect feature learning unit is continuously optimized through a random gradient descent type incremental learning algorithm, and further includes the following: Based on the historical database, the dynamic weight distribution strategy of the dynamic weight matching module is corrected, the matching weight distribution under different interference scenes is optimized, and the judgment threshold of the defect gene similarity algorithm is updated, so that the matching accuracy of the dynamic weight matching module is continuously improved.

Citation Information

Patent Citations

  • A dual-exposure image fusion method based on dynamic scenes

    CN110599433B