Machine vision-based appearance inspection device and inspection system for color ring component
By dynamically optimizing the wavelength of the detection light source and fusing multimodal features, the problems of static light source parameters and insufficient visibility of defect features in the appearance inspection of color ring components are solved, thus achieving efficient and stable appearance inspection of color ring components.
Patent Information
- Application Number
- PCT/CN2026/094698
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2025-05-07
- Filing Date
- 2026-05-01
- Publication Date
- 2026-11-12
AI Technical Summary
Existing machine vision inspection systems suffer from problems such as the inability to dynamically adjust light source parameters, insufficient explicit expression of defect features, and static inspection strategies in the appearance inspection of color ring components. These issues result in low inspection efficiency and poor stability, making it difficult to meet the needs of high-speed automated production lines.
By integrating the calculation of the primary color wavelength of the color ring element with surface roughness modeling, the wavelength of the detection light source is dynamically optimized. Combined with a dual-branch convolutional neural network for multimodal feature fusion, multi-dimensional adaptive matching of the light source wavelength with element characteristics and defect risk is achieved, thereby improving the contrast and accuracy of defect detection.
It achieves high-precision and high-efficiency appearance inspection of color ring components, significantly reduces the false negative rate, improves the adaptability and accuracy of the inspection system, adapts to batch differences, and optimizes the cost of light sources.
Smart Images

Figure CN2026094698_12112026_PF_FP_ABST
Abstract
Description
Machine vision-based color ring element appearance inspection device and system Technical Field
[0001] This invention relates to the field of color ring component inspection, and more specifically to a color ring component appearance inspection device and inspection system based on machine vision. Background Technology
[0002] With the increasing precision requirements of electronic component manufacturing, the detection of appearance defects in color ring components has gradually become a core part of quality control. Manual visual inspection suffers from low efficiency, strong subjectivity, and insufficient stability, making it difficult to meet the needs of high-speed automated production lines. Although existing machine vision inspection systems have achieved partial automation through image processing technology, they still face many technical bottlenecks, which restrict their large-scale application in industrial scenarios.
[0003] Regarding the optimization of light source parameters, most detection systems use light sources with fixed wavelengths or preset ranges, which cannot be dynamically adjusted according to the batch characteristics of color ring components. Due to differences in raw materials or process fluctuations, the surface color and roughness of color ring components from different batches vary significantly. For example, when the main color wavelength shifts, a fixed light source may lead to a decrease in the contrast between the defect area and the background, especially for scratches or micro-bubbles under light-colored coatings, which significantly increases the false negative rate. Existing technologies ignore the influence of surface roughness on the minimum allowable wavelength and have not established a quantitative model for wavelength adjustment, making it difficult to avoid overexposure or shadow interference in highly reflective areas, thus affecting the consistency of imaging quality.
[0004] The explicit representation of defect features is another key challenge. Different defect types respond significantly to different wavelengths of light. Traditional systems rely on a single light source to acquire images, which results in some defect features not being fully highlighted. Existing methods mostly improve contrast through image enhancement algorithms, but they are not combined with optical wavelength characteristics, which can easily lead to noise amplification or loss of detail. Some studies have attempted to use multispectral imaging, but the equipment is expensive and lacks wavelength optimization mechanisms for specific defects. The complexity of data processing limits real-time performance and makes it difficult to meet the production line cycle time requirements.
[0005] The static nature of detection strategies further restricts system adaptability. Most systems employ preset defect priorities or fixed detection procedures, failing to dynamically assess risks based on historical data. For example, when a certain type of defect appears frequently in consecutive batches, existing technologies cannot automatically adjust light source parameters to prioritize enhancing its visible characteristics, resulting in insufficient sensitivity for detecting critical defects. Traditional defect scoring methods do not incorporate dark current correction and reflectivity standardization, making scoring results significantly affected by environmental noise and equipment differences, and exhibiting poor stability when detecting across batches.
[0006] Therefore, in order to address the above problems, this invention proposes a machine vision-based color ring element appearance inspection device and system to achieve high-precision, high-efficiency and highly adaptable appearance inspection. Summary of the Invention
[0007] This invention achieves dynamic optimization of the detection light source wavelength by integrating the calculation of the primary color wavelength of the color ring element with surface roughness modeling. Simultaneously, a surface roughness evaluation factor is introduced to correct the minimum permissible detection wavelength to avoid high reflectivity interference. This mechanism can dynamically adapt to batch differences, improve the contrast between defects and the background, and significantly reduce the false negative rate. Based on this, the system calculates a risk index and prioritizes the wavelength with the highest sensitivity to high-risk defects. Compared with traditional fixed-wavelength schemes, this invention achieves multi-dimensional adaptive matching of the detection wavelength with element characteristics and defect risk while ensuring controllable light source costs.
[0008] A machine vision-based color ring element appearance inspection device is used to inspect the appearance of color ring elements. The device includes a wavelength range adjustment module, a significant score calculation module, a detection wavelength selection module, and an appearance inspection module.
[0009] The wavelength range adjustment module is used to randomly select several representative samples of color wheel elements from the current batch of color wheel elements, obtain representative sample images of all representative samples of color wheel elements under a white light reference light source; obtain the average primary color H value and average grayscale standard deviation of all representative sample images, and then adjust the preset initial wavelength range to obtain the available wavelength range of the detection light for the current batch of color wheel elements.
[0010] The significant score calculation module is used to calculate the significant score of each defect type under different wavelength detection illumination.
[0011] The detection wavelength selection module includes a defect type confirmation unit and a detection wavelength confirmation unit. The defect type confirmation unit is used to calculate the risk index of each defect type of the color ring element in the current batch and select the defect type with the highest risk index as the key defect type of the current batch. The detection wavelength confirmation unit is used to select the wavelength with the highest significant score in the available wavelength range of the current batch as the optimal detection wavelength based on the key defect type of the current batch and the significant score of the key defect type under different wavelength detection illumination.
[0012] The appearance inspection module is used to acquire, for any color ring element in the current batch, a reference image of the current color ring element under a white light reference light source and a feature-enhanced image under an optimal detection wavelength light source; the reference image and feature-enhanced image of the current color ring element are used as input to the appearance inspection model, and the defect detection results are output as the probability distribution of each defect type.
[0013] Preferably, in the wavelength range adjustment module, the average primary color H value and average grayscale standard deviation of all representative sample images are obtained, and then the preset initial wavelength range is adjusted to obtain the usable wavelength range for the current batch of color ring element detection illumination. The specific operation is as follows:
[0014] Based on the CIE 1931 chromaticity diagram and HSV color wheel model, a mapping table of color-dominant wavelength range-dominant color H value is obtained;
[0015] Set the initial wavelength range of the light detected by the color ring element to be: ;
[0016] For any representative sample image, convert the RGB pixel values of the current representative sample image to HSV, calculate the histogram of H values in the current representative sample image, and select the H value with the highest frequency as the dominant color H value of the current representative sample image; calculate the average dominant color H value of all representative sample images, and use a mapping table to select the dominant wavelength range corresponding to the average dominant color H value as the band to be shielded. ;
[0017] For any representative sample image, convert the current representative sample image into a grayscale image, calculate the standard deviation of the grayscale image, and map the grayscale standard deviation onto... Within the range, obtain the standardized gray standard deviation. The maximum grayscale standard deviation is preset; the average grayscale standard deviation is obtained by calculating the mean of the standardized grayscale standard deviations of all representative sample images. ;
[0018] Using formula Calculate and obtain the minimum allowable wavelength ;in, express Minimum wavelength limit when approaching 0; This is the decay rate coefficient, used to adjust... Follow The changing curve steepness, The value is obtained through particle swarm optimization algorithm; the minimum allowable wavelength and minimum wavelength limit All values are in nm.
[0019] Based on the band to be shielded and minimum permissible wavelength The available wavelength range for obtaining the detection illumination is: .
[0020] Preferably, in the saliency score calculation module, the saliency score of each defect type under different wavelength detection illumination is calculated, and the specific operation is as follows:
[0021] For any type of defect, obtain several color ring element defect samples of the same material that have that defect type. Each color ring element defect sample is marked with the defect area and the normal area.
[0022] For any defective color ring component sample, turn off all light sources and, while maintaining ambient light blocking, capture a dark current image and obtain the average dark current value of the current image. Calculate the average of the dark current values of all defective color ring component samples to obtain the comprehensive average dark current value. ;
[0023] Turn on the light source to wavelength , Located in the initial wavelength range Within, and spaced 10nm apart; at wavelength The white standard plate was photographed to obtain the wavelength. The corresponding whiteboard image is then used to calculate the wavelength. Mean grayscale value of the whiteboard image below ;
[0024] At wavelength The following image is taken of a defect sample of any color ring element, and the wavelength of the current defect sample of the color ring element is obtained. The corresponding defect sample image is then used to calculate the wavelength. The mean gray value of the normal area in the current defect sample image and the average gray level of the defect area Then use the formula Calculate and obtain the reflectance of the normal area in the current defect sample image. Using formulas Calculate and obtain the reflectance of the defect region in the current defect sample image. ;
[0025] For any type of defect, calculate at wavelength The average reflectance of the normal region in all defect sample images corresponding to the current defect type. and the average reflectivity of the defect area Then calculate and absolute difference ,Will As a current defect type, in wavelength The significant score below.
[0026] Preferably, in the detection wavelength selection module, the risk index of each defect type of the current batch of color ring components is calculated, and the specific operation is as follows:
[0027] Based on the material of the current batch of color wheel components, obtain the most recent data for that material. Number of defects in each batch of color ring components , Using formulas Calculate and obtain the average defect rate ,in, This indicates the quantity of color ring components in a batch; using the formula... Calculate and obtain the first score , This refers to the number of defects in the most recent batch of color-coded components; for For any one of the batches, record the number of defects in that batch. The specific number of times each defect type is included. Using formulas Calculation and acquisition The average percentage of each defect type in each batch Using formulas Calculate and obtain the second score for each defect type. ,in, This indicates the specific number of times each defect type occurred in the most recent batch;
[0028] Finally, use the formula Calculate and obtain the risk index for each defect type in the current batch. .
[0029] Preferably, in the appearance detection module, the appearance detection model is based on a CNN model and includes: an input layer, a parallel feature extraction layer, a global feature fusion layer, a fully connected layer, and an output layer;
[0030] The input layer is used to receive the reference image and feature enhancement image of the current color wheel element;
[0031] The parallel feature extraction layer includes a parallel baseline image branch and a feature enhancement image branch. The baseline image branch is used to extract baseline features from the baseline image and output a baseline feature map; the feature enhancement image branch is used to extract defect response features from the feature enhancement image and output a defect response feature map.
[0032] The global feature fusion layer is used to perform global average pooling on the baseline feature map and the defect response feature map, and then concatenate them along the channel dimension to output the fused feature vector.
[0033] Fully connected layers are used to further extract features from the fused feature vectors and output hidden layer features;
[0034] The output layer is used to output the probability distribution of defect types using the Softmax activation function.
[0035] Preferably, in the appearance inspection module, the specific operations for training the appearance inspection model are as follows:
[0036] Obtain several defect detection training samples with labeled defect detection results. Each defect detection training sample contains a base image and a feature enhancement image of a color ring element.
[0037] All defect detection training samples are divided into training set and validation set. The appearance detection model with initialized parameters is trained using the training set, and then the appearance detection model is validated using the validation set to obtain the validation results. Training conditions are set, and it is determined whether the validation results meet the training conditions. If yes, the trained appearance detection model is output; otherwise, the appearance detection model is trained again using the training set.
[0038] A machine vision-based color wheel component appearance inspection system, the inspection system including the aforementioned machine vision-based color wheel component appearance inspection device.
[0039] The present invention has the following advantages:
[0040] 1. This invention achieves dynamic optimization of the detection light source wavelength by integrating the calculation of the primary color wavelength of the color ring element with surface roughness modeling. Simultaneously, a surface roughness evaluation factor is introduced to correct the minimum allowable detection wavelength to avoid high reflectivity interference. This mechanism can dynamically adapt to batch differences, improve the contrast between defects and the background, and significantly reduce the false negative rate. Based on this, the system calculates a risk index and prioritizes the wavelength with the highest sensitivity to high-risk defects. Compared with traditional fixed-wavelength schemes, this invention achieves multi-dimensional adaptive matching of the detection wavelength with element characteristics and defect risk while ensuring controllable light source costs.
[0041] 2. This invention proposes a multimodal feature fusion architecture based on a dual-branch convolutional neural network, which effectively improves the robustness of complex defect detection. The model extracts spatial-spectral features from the white light reference image and the optimal wavelength feature image through parallel branches. This architecture enables the model to simultaneously utilize the stable semantic information of the reference image and the defect-sensitive features of the wavelength-enhanced image, thereby improving the detection accuracy. Attached Figure Description
[0042] Figure 1 is a schematic diagram of the structure of the color ring element appearance inspection device based on machine vision used in an embodiment of the present invention. Detailed Implementation
[0043] To enable those skilled in the art to better understand the technical solutions of this invention, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of this invention.
[0044] Example 1: A machine vision-based color ring element appearance inspection device, as shown in Figure 1, is used to perform appearance inspection on color ring elements. The device includes a wavelength range adjustment module, a significant score calculation module, a detection wavelength selection module, and an appearance inspection module.
[0045] The wavelength range adjustment module is used to randomly select several representative samples of color ring elements from the current batch of color ring elements, obtain representative sample images of all representative samples of color ring elements under a white light reference light source; obtain the average primary color H value and average grayscale standard deviation of all representative sample images, and then adjust the preset initial wavelength range to obtain the usable wavelength range of the detection light for the current batch of color ring elements; the function of this module is to analyze the color characteristics and surface reflectivity of the samples, eliminate wavelengths that are not suitable for detection, optimize the wavelength range of the detection light, and thus improve the accuracy and efficiency of subsequent defect detection;
[0046] The significant score calculation module is used to calculate the significant score of each defect type under different wavelengths of detection light. The function of the significant score calculation module is to quantify the "significance score" of each defect type at a specific wavelength by calculating the difference in reflectivity between the defect area and the normal area under different wavelengths of detection light. The higher the significant score, the more obvious the grayscale difference between the defect area and the normal area is at that wavelength, and the easier it is for the defect to be identified. This module can provide a basis for the selection of subsequent detection wavelengths, ensuring that detection is carried out at the optimal wavelength, thereby improving the accuracy and efficiency of defect detection.
[0047] The detection wavelength selection module includes a defect type confirmation unit and a detection wavelength confirmation unit. The defect type confirmation unit calculates the risk index of each defect type of the color ring components in the current batch and selects the defect type with the highest risk index as the key defect type of the current batch. The detection wavelength confirmation unit selects the wavelength with the highest significant score within the available wavelength range of the current batch as the optimal detection wavelength based on the key defect type of the current batch and the significant score of the key defect type under different wavelength detection illumination. The function of this module is to dynamically optimize the selection of detection wavelengths, ensuring that the detection system can detect the most important defect type in the current batch at the most sensitive wavelength, thereby improving the accuracy and efficiency of detection.
[0048] The appearance inspection module is used to acquire, for any color ring element in the current batch, a reference image of the current color ring element under a white light reference light source and a feature-enhanced image under an optimal detection wavelength light source; the reference image and feature-enhanced image of the current color ring element are used as input to the appearance inspection model, and the defect detection results are output as the probability distribution of each defect type.
[0049] In the wavelength range adjustment module, the average primary color H value and average grayscale standard deviation of all representative sample images are obtained, and then the preset initial wavelength range is adjusted to obtain the available wavelength range for the current batch of color ring element detection illumination. The specific operation is as follows:
[0050] Based on the CIE 1931 chromaticity diagram and the HSV color wheel model, the mapping relationship table between color, dominant wavelength range, and dominant color H value is obtained as follows: This table serves as a practical, empirical reference framework combining the distribution of dominant optical wavelengths with the HSV color model. Currently, there is no universally applicable international standard for the correspondence between color names and parameters. The mapping range between dominant wavelengths and H values primarily stems from statistical analysis of color rendering data for various materials in industrial inspection scenarios and practical engineering summaries, reflecting a phased summary of industry consensus on color classification. For example, the dominant wavelength of red may actually cover 610-750nm (and even as wide as approximately 630-780nm in CIE standard colorimetry), while the definition of H value ranges for the same color differs between Adobe RGB and sRGB color models. Although the parameter range lacks the absolute authority of international standards, it serves as a reliable starting point for developing industrial visual classification algorithms because it adheres to the fundamental theoretical model of color science. In practical applications, a linear offset of ±5% to 10% of the parameters based on variables such as light source color temperature and lens transmittance can adapt to most scenarios.
[0051] Set the initial wavelength range of the light detected by the color ring element to be: ;
[0052] For any representative sample image, convert the RGB pixel values of the current representative sample image to HSV, calculate the histogram of H values in the current representative sample image, and select the H value with the highest frequency as the dominant color H value of the current representative sample image; calculate the average dominant color H value of all representative sample images, and use a mapping table to select the dominant wavelength range corresponding to the average dominant color H value as the band to be shielded. ;
[0053] For any representative sample image, convert the current representative sample image into a grayscale image, calculate the standard deviation of the grayscale image, and map the grayscale standard deviation onto... Within the range, obtain the standardized gray standard deviation. The maximum grayscale standard deviation is preset; the average grayscale standard deviation is obtained by calculating the mean of the standardized grayscale standard deviations of all representative sample images. ;
[0054] Using formula Calculate and obtain the minimum allowable wavelength ;in, express The minimum wavelength limit when it approaches 0 (i.e., the surface roughness of the color ring element is close to that of a mirror) can be set to 620nm; This is the decay rate coefficient, used to adjust... Follow The changing curve steepness, The value is obtained through particle swarm optimization algorithm; the minimum allowable wavelength and minimum wavelength limit All values are in nm.
[0055] Based on the band to be shielded and minimum permissible wavelength The available wavelength range for obtaining the detection illumination is: .
[0056] In the saliency score calculation module, the saliency score of each defect type is calculated under different wavelength detection illumination. The specific operation is as follows:
[0057] For any type of defect, obtain several color ring element defect samples of the same material that have that defect type. Each color ring element defect sample is marked with the defect area and the normal area.
[0058] For any defective color ring component sample, turn off all light sources and, while maintaining ambient light blocking, capture a dark current image and obtain the average dark current value of the current image. Calculate the average of the dark current values of all defective color ring component samples to obtain the comprehensive average dark current value. ;
[0059] Turn on the light source to wavelength , Located in the initial wavelength range Within, and spaced 10nm apart; at wavelength The white standard plate was photographed to obtain the wavelength. The corresponding whiteboard image is then used to calculate the wavelength. Mean grayscale value of the whiteboard image below ;
[0060] At wavelength The following image is taken of a defect sample of any color ring element, and the wavelength of the current defect sample of the color ring element is obtained. The corresponding defect sample image is then used to calculate the wavelength. The mean gray value of the normal area in the current defect sample image and the average gray level of the defect area Then use the formula Calculate and obtain the reflectance of the normal area in the current defect sample image. Using formulas Calculate and obtain the reflectance of the defect region in the current defect sample image. ;
[0061] For any type of defect, calculate at wavelength The average reflectance of the normal region in all defect sample images corresponding to the current defect type. and the average reflectivity of the defect area Then calculate and absolute difference ,Will As a current defect type, in wavelength The significant score below.
[0062] In the detection wavelength selection module, the risk index of each defect type of the current batch of color ring components is calculated. The specific operation is as follows:
[0063] Based on the material of the current batch of color wheel components, obtain the most recent data for that material. Number of defects in each batch of color ring components Using formulas Calculate and obtain the average defect rate ,in, This indicates the quantity of color ring components in a batch; using the formula... Calculate and obtain the first score , The number of defects in the most recent batch of color-coded components; first rating. That is, the defect rate of the most recent batch and Average defect rate per batch The ratio;
[0064] against For any one of the batches, record the number of defects in that batch. The specific number of times each defect type is included. Using formulas Calculation and acquisition The average percentage of each defect type in each batch Using formulas Calculate and obtain the second score for each defect type. ,in, Indicates the specific number of times each defect type occurred in the most recent batch; Second score That is, the proportion of each defect type in the most recent batch and The average percentage of each defect type in each batch The ratio;
[0065] Finally, use the formula Calculate and obtain the risk index for each defect type in the current batch. .
[0066] In the appearance detection module, the appearance detection model is based on a CNN model and includes: an input layer, a parallel feature extraction layer, a global feature fusion layer, a fully connected layer, and an output layer.
[0067] The input layer is used to receive the reference image and feature enhancement image of the current color wheel element;
[0068] The parallel feature extraction layer includes a parallel baseline image branch and a feature enhancement image branch. The baseline image branch is used to extract baseline features from the baseline image and output a baseline feature map; the feature enhancement image branch is used to extract defect response features from the feature enhancement image and output a defect response feature map.
[0069] The global feature fusion layer is used to perform global average pooling on the baseline feature map and the defect response feature map, and then concatenate them along the channel dimension to output the fused feature vector.
[0070] Fully connected layers are used to further extract features from the fused feature vectors and output hidden layer features;
[0071] The output layer is used to output the probability distribution of defect types using the Softmax activation function.
[0072] In the appearance detection module, the specific operations for training the appearance detection model are as follows:
[0073] Obtain several defect detection training samples with labeled defect detection results. Each defect detection training sample contains a base image and a feature enhancement image of a color ring element.
[0074] All defect detection training samples are divided into training set and validation set. The appearance detection model with initialized parameters is trained using the training set, and then the appearance detection model is validated using the validation set to obtain the validation results. Training conditions are set, and it is determined whether the validation results meet the training conditions. If yes, the trained appearance detection model is output; otherwise, the appearance detection model is trained again using the training set.
[0075] Example 2: A machine vision-based color ring component appearance inspection system, wherein the inspection system includes the aforementioned machine vision-based color ring component appearance inspection device.
[0076] It should be understood that those skilled in the art can make improvements or modifications based on the above description, and all such improvements and modifications should fall within the protection scope of the appended claims. Parts not described in detail in this specification are prior art known to those skilled in the art.
Claims
1. A machine vision-based color ring element appearance inspection device, characterized in that, The detection device is used to perform appearance inspection on color ring components. The detection device includes a wavelength range adjustment module, a significant score calculation module, a detection wavelength selection module, and an appearance inspection module. The wavelength range adjustment module is used to randomly select several representative samples of color ring elements from the current batch of color ring elements, and obtain representative sample images of all representative samples of color ring elements under a white light reference source. The average primary color H value and average grayscale standard deviation of all representative sample images are obtained, and then the preset initial wavelength range is adjusted to obtain the available wavelength range of the current batch of color ring element detection illumination. The significant score calculation module is used to calculate the significant score of each defect type under different wavelength detection illumination. The detection wavelength selection module includes a defect type confirmation unit and a detection wavelength confirmation unit; the defect type confirmation unit is used to calculate the risk index of each defect type of the color ring components in the current batch, and select the defect type with the highest risk index as the key defect type of the current batch. The detection wavelength confirmation unit is used to determine the optimal detection wavelength by identifying the key defect types of the current batch and their significant scores under different wavelength detection illuminations. The appearance inspection module is used to acquire, for any color ring element in the current batch, a reference image of the current color ring element under a white light reference light source and a feature-enhanced image under an optimal detection wavelength light source; the reference image and feature-enhanced image of the current color ring element are used as input to the appearance inspection model, and the defect detection results are output as the probability distribution of each defect type.
2. The machine vision-based color ring element appearance inspection device according to claim 1, characterized in that, In the wavelength range adjustment module, the average primary color H value and average grayscale standard deviation of all representative sample images are obtained, and then the preset initial wavelength range is adjusted to obtain the available wavelength range for the current batch of color ring element detection illumination. The specific operation is as follows: Based on the CIE 1931 chromaticity diagram and HSV color wheel model, a mapping table of color-dominant wavelength range-dominant color H value is obtained; Set the initial wavelength range of the light detected by the color ring element to be: ; For any representative sample image, convert the RGB pixel values of the current representative sample image to HSV, calculate the histogram of H values in the current representative sample image, and select the H value with the highest frequency as the main color H value of the current representative sample image. Calculate the average dominant color H value of all representative sample images, and use a mapping table to determine the dominant wavelength range corresponding to the average dominant color H value as the band to be shielded. ; For any representative sample image, convert the current representative sample image into a grayscale image, calculate the standard deviation of the grayscale image, and map the grayscale standard deviation onto... Within the range, obtain the standardized gray standard deviation. The preset maximum grayscale standard deviation; Calculate the average of the standardized grayscale standard deviations of all representative sample images to obtain the average grayscale standard deviation. ; Using formula Calculate and obtain the minimum allowable wavelength ;in, express Minimum wavelength limit when approaching 0; This is the decay rate coefficient, used to adjust... Follow The changing curve steepness, The value is obtained through particle swarm optimization algorithm; the minimum allowable wavelength and minimum wavelength limit All values are in nm. Based on the band to be shielded and minimum permissible wavelength The available wavelength range for obtaining the detection illumination is: 。 3. The machine vision-based color ring element appearance inspection device according to claim 2, characterized in that, In the saliency score calculation module, the saliency score of each defect type is calculated under different wavelength detection illumination. The specific operation is as follows: For any type of defect, obtain several color ring element defect samples of the same material that have that defect type. Each color ring element defect sample is marked with the defect area and the normal area. For any defective color ring component sample, turn off all light sources and, while maintaining ambient light blocking, capture a dark current image and obtain the average dark current value of the current image. Calculate the average of the dark current values of all defective color ring component samples to obtain the comprehensive average dark current value. ; Turn on the light source to wavelength , Located in the initial wavelength range Within, and spaced 10nm apart; at wavelength The white standard plate was photographed to obtain the wavelength. The corresponding whiteboard image is then used to calculate the wavelength. Mean grayscale value of the whiteboard image below ; At wavelength The following image is taken of a defect sample of any color ring element, and the wavelength of the current defect sample of the color ring element is obtained. The corresponding defect sample image is then used to calculate the wavelength. The mean gray value of the normal area in the current defect sample image and the average gray level of the defect area Then use the formula Calculate and obtain the reflectance of the normal area in the current defect sample image. Using formulas Calculate and obtain the reflectance of the defect region in the current defect sample image. ; For any type of defect, calculate at wavelength The average reflectance of the normal region in all defect sample images corresponding to the current defect type. and the average reflectivity of the defect area Then calculate and absolute difference ,Will As a current defect type, in wavelength The significant score below.
4. The machine vision-based color ring element appearance inspection device according to claim 3, characterized in that, In the detection wavelength selection module, the risk index of each defect type of the current batch of color ring components is calculated. The specific operation is as follows: Based on the material of the current batch of color wheel components, obtain the most recent data for that material. Number of defects in each batch of color ring components Using formulas Calculate and obtain the average defect rate ,in, This indicates the quantity of color ring components in a batch; using the formula... Calculate and obtain the first score , This represents the number of defects in the most recent batch of color-coded components. against For any one of the batches, record the number of defects in that batch. The specific number of times each defect type is included. , 2, ..., 5; using the formula Calculation and acquisition The average percentage of each defect type in each batch Using formulas Calculate and obtain the second score for each defect type. ,in, This indicates the specific number of times each defect type occurred in the most recent batch; finally, the formula is used. Calculate and obtain the risk index for each defect type in the current batch. 。 5. The machine vision-based color ring element appearance inspection device according to claim 4, characterized in that, In the appearance detection module, the appearance detection model is based on a CNN model and includes: an input layer, a parallel feature extraction layer, a global feature fusion layer, a fully connected layer, and an output layer. The input layer is used to receive the reference image and feature enhancement image of the current color wheel element; The parallel feature extraction layer includes a parallel baseline image branch and a feature enhancement image branch. The baseline image branch is used to extract baseline features from the baseline image and output a baseline feature map; the feature enhancement image branch is used to extract defect response features from the feature enhancement image and output a defect response feature map. The global feature fusion layer is used to perform global average pooling on the baseline feature map and the defect response feature map, and then concatenate them along the channel dimension to output the fused feature vector. Fully connected layers are used to further extract features from the fused feature vectors and output hidden layer features; The output layer is used to output the probability distribution of defect types using the Softmax activation function.
6. The machine vision-based color ring element appearance inspection device according to claim 5, characterized in that, In the appearance detection module, the specific operations for training the appearance detection model are as follows: Obtain several defect detection training samples with labeled defect detection results. Each defect detection training sample contains a base image and a feature enhancement image of a color ring element. All defect detection training samples are divided into training set and validation set. The appearance detection model with initialized parameters is trained using the training set, and then the appearance detection model is validated using the validation set to obtain the validation results. Set training conditions and determine whether the verification results meet the training conditions. If yes, output the trained appearance detection model; otherwise, continue to train the appearance detection model using the training set.
7. A machine vision-based color ring component appearance inspection system, characterized in that, The detection system includes a machine vision-based color ring element appearance detection device as described in any one of claims 1-6.
