A machine vision-based electronic component defect detection method and system

By using multimodal data fusion and graph neural network analysis, the modal limitations and insufficient defect identification of electronic component detection in existing technologies have been overcome, achieving high-precision defect detection and identification of unknown defects, and adapting to complex production environments.

CN120807525BActive Publication Date: 2025-12-12SUZHOU XINGKAISHENG INTELLIGENT TECHNOLOGY CO LTD

Patent Information

Application Number
CN202511308487.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-15
Publication Date
2025-12-12
Estimated Expiration
2045-09-15

AI Technical Summary

Technical Problem

Existing deep learning detection solutions for electronic component defect detection suffer from modal limitations, low defect localization accuracy, neglect of spatial topological relationships, and insufficient ability to identify unknown defects.

Method used

A multimodal data fusion method is adopted, which combines visible light, X-ray and three-dimensional structured light images. Feature fusion is performed through cross-modal self-attention mechanism, and graph neural network is used to analyze the spatial topological relationship between defects and key functional units. The prototype network is then used for classification.

Benefits of technology

It enables comprehensive detection of surface, internal, and three-dimensional morphological defects of electronic components, improving the accuracy and comprehensiveness of detection, and has the ability to identify unknown defects, adapting to complex production environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120807525B_ABST
    Figure CN120807525B_ABST
Patent Text Reader

Abstract

The present application belongs to the technical field of image analysis, and particularly relates to a kind of electronic component defect detection method and system based on machine vision, comprising the following steps: S1, the visible light, X-ray and three-dimensional structure light image of the electronic component to be measured are acquired, and respective multi-scale feature pyramids are generated through independent feature extraction network respectively;S2, multi-modal fusion feature pyramid is generated;S3, candidate region generation network is applied to propose candidate defect region;S4, spatial topological relation graph is processed through graph neural network, and spatial context information is embedded into candidate defect region feature;S5, if the minimum distance of candidate region feature and all pre-stored prototypes is greater than the set discrimination threshold, then it is determined that the candidate region is unknown type potential defect.The present application widens the detection range and improves the robustness of feature expression, overcomes the limitation of insufficient information of single data source, and improves the accuracy, comprehensiveness and foresight of detection.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the technical field of image analysis, and particularly relates to a machine vision-based electronic component defect detection method and system. BACKGROUND

[0002] In the field of modern electronic manufacturing, with the increasing integration and complexity of components, the detection requirements for product quality are becoming increasingly stringent. Traditional defect detection mainly relies on manual visual inspection, which is inefficient, costly, and the detection results are easily affected by subjective factors, making it difficult to meet the needs of large-scale, high-precision automated production lines. Therefore, automatic optical inspection (AOI) technology based on machine vision has emerged and been applied. Early automatic optical inspection technology mostly uses traditional image processing algorithms such as template matching, edge detection, and threshold segmentation. Although these methods achieve a certain degree of automation, they have poor robustness to problems such as light changes, background noise, and defect morphology diversity, and require a large number of manual rule settings, with limited generalization ability. In recent years, deep learning technology represented by convolutional neural networks (CNN) has made breakthroughs in image recognition and has been introduced into electronic component defect detection, significantly improving the accuracy and automation level of detection. However, most existing deep learning detection schemes still have limitations. They usually rely only on a single visible light two-dimensional image, and cannot effectively detect internal solder defects (such as BGA virtual soldering, bubbles) or abnormalities on three-dimensional structures (such as component warping, poor coplanarity of pins).

[0003] To overcome the shortcomings of single modal information, some studies have begun to explore multi-modal data fusion detection methods. For example, visible light and X-ray images are combined to cover both surface and internal defects. However, existing fusion strategies are relatively primitive, mostly using simple feature concatenation or pixel-by-pixel addition, which cannot fully exploit and utilize the deep correlations and complementary information between different modal data, resulting in poor fusion results. In addition, in the defect positioning and identification process, existing methods also have some bottlenecks: first, general object detection networks do not optimize for the elongated and irregular shape characteristics of electronic defects when generating candidate boxes, resulting in low positioning accuracy; second, detection models usually analyze each candidate region as an independent individual, ignoring the spatial topological relationship between the defect and the key functional unit (such as chip pins, pads) it is in, which is crucial for judging the actual harmfulness of the defect; third, classifiers are mostly trained to identify a predefined, closed set of defect categories. When new, unknown types of defects appear on the production line, the system often misjudges them as known categories or directly misses them, lacking the ability to discover and warn new patterns, which poses a challenge to ensuring product quality stability throughout the life cycle. SUMMARY

[0004] The application provides a machine vision-based electronic component defect detection method and system to solve the technical problems of modal limitations and defect recognition in the prior art deep learning detection method.

[0005] In a first aspect, the application provides a machine vision-based electronic component defect detection method, comprising the following steps:

[0006] S1, acquiring visible light, X-ray and three-dimensional structured light images of the electronic component to be detected, and generating respective multi-scale feature pyramids through independent feature extraction networks;

[0007] S2, calculating the correlation weights between the features of the visible light, X-ray and three-dimensional structured light images through a cross-modal self-attention module between the corresponding levels of the multi-scale feature pyramids, and weighting and fusing the image features according to the correlation weights to generate a multi-modal fusion feature pyramid;

[0008] S3, applying a candidate region generation network to propose candidate defect regions at each level of the multi-modal fusion feature pyramid, and including a shape prior loss in the loss function of the candidate region generation network to constrain the geometric features of the candidate boxes to preferentially match typical defect shapes;

[0009] S4, constructing a spatial topology relationship graph with all candidate defect regions and preset key functional unit coordinates as nodes and their spatial proximity as edges, and processing the spatial topology relationship graph through a graph neural network to embed spatial context information into the candidate defect region features;

[0010] S5, inputting the candidate region features with embedded spatial context information into a prototype network classifier to complete classification by calculating the distances between the candidate region features and pre-stored known defect class prototypes and normal region prototypes; if the minimum distance between the candidate region features and all pre-stored prototypes is greater than a set discrimination threshold, the candidate region is determined to be a potential defect of an unknown type.

[0011] Further, S1 comprises the following steps:

[0012] For each image type of visible light, X-ray and three-dimensional structured light, an encoder with a ResNet backbone network is independently used for feature extraction, and feature maps are extracted from different stages of the backbone network to construct a multi-scale feature pyramid for each image type.

[0013] Further, S2 comprises the following steps:

[0014] At any corresponding level of the multi-scale feature pyramid, the feature maps of the visible light, X-ray and three-dimensional structured light images are spliced along the channel dimension to form a combined feature map.

[0015] The combined feature map is input into a cross-modal self-attention module, which adaptively calculates attention weights in the spatial dimension and the channel dimension, and recalibrates the combined feature map to enhance key information and suppress redundant information, thereby generating the fusion feature of the level.

[0016] Further, S3 comprises the following steps:

[0017] A set of prior anchor box aspect ratios representing typical defect morphologies is predefined;

[0018] During the training process, for each candidate box output by the candidate region generation network, the generalized intersection over union of the candidate box with all prior anchor boxes is calculated; the maximum generalized intersection over union value is selected, and 1 minus the maximum generalized intersection over union value is taken as the shape prior loss, which is added to the total loss function of the candidate region generation network.

[0019] Further, the total loss function is the sum of the classification loss, the bounding box regression loss, and the shape prior loss.

[0020] Further, S4 comprises the following steps:

[0021] Each candidate defect region and its feature vector are defined as a defect node;

[0022] The position and category information of each preset key functional unit are defined as a key functional unit node;

[0023] When the Euclidean distance between the center points of the entities represented by the defect node and the key functional unit node is less than a preset threshold, an edge is established between the defect node and the key functional unit node to represent their spatial proximity.

[0024] Further, the key functional units include chips and capacitors.

[0025] Further, in S5, when classification is performed by the prototype network classifier, the following steps are included: in the training phase, for each known category, the mean of the feature vectors output by the graph neural network for all training samples of the category are taken as the center prototype of the category;

[0026] In the inference phase, the Euclidean distance between the feature vector of the candidate region and each center prototype is calculated, and the candidate region is classified into the category corresponding to the center prototype with the smallest distance.

[0027] Further, when the candidate region is determined to be an unknown type potential defect, the following steps are included:

[0028] The minimum distance D between the candidate region feature and all pre-stored prototypes is calculated min ;

[0029] D min is compared with a set discriminant threshold T, wherein the discriminant threshold T is determined according to the distance distribution of all correctly classified samples and their corresponding class prototypes on the validation set;

[0030] If D min is greater than T, the candidate region is marked as a "potential defect of unknown type".

[0031] In a second aspect, the present application provides a machine vision-based electronic component defect detection system, comprising a memory and a processor, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the machine vision-based electronic component defect detection method described above is implemented.

[0032] The beneficial effects are: the present application can simultaneously detect the surface, internal and three-dimensional topography defects of electronic components by fusing the data of three modalities of visible light, X-ray and three-dimensional structured light, and using cross-modal self-attention mechanism for feature fusion, which widens the detection range and improves the robustness of feature expression, and overcomes the limitations of insufficient information of a single data source. By introducing shape prior loss in the candidate region generation network, it can more accurately locate defects of special shapes such as elongated and irregular. Using graph neural network to analyze the spatial topological relationship between defects and key functional units, the spatial context information is integrated into the classification decision, reducing the misjudgment caused by isolated analysis. Using the prototype network classifier, not only improves the classification accuracy of known defects, but also gives the system the ability to identify and warn potential defects of unknown types, enhances the ability to find new problems in complex and changing production environments, and improves the accuracy, comprehensiveness and foresight of detection. BRIEF DESCRIPTION OF DRAWINGS

[0033] Figure 1 is a flowchart of the machine vision-based electronic component defect detection method;

[0034] Figure 2 is a schematic diagram of feature extraction;

[0035] Figure 3 is a structural block diagram of the machine vision-based electronic component defect detection system. DETAILED DESCRIPTION

[0036] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application, and those skilled in the art should know that the embodiments described below are part of the embodiments of the present disclosure, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of the present application.

[0037] Embodiments of the machine vision-based electronic component defect detection method provided by the present application include the following steps:

[0038] As shown in Figure 1 and Figure 2 , the machine vision-based electronic component defect detection method includes the following steps:

[0039] S1, acquiring visible light, X-ray and three-dimensional structured light images of the electronic component to be tested, and generating respective multi-scale feature pyramids through independent feature extraction networks.

[0040] In an optional embodiment, S1 includes the following steps: for each image type of visible light, X-ray and three-dimensional structured light, an encoder with a ResNet backbone network is independently used for feature extraction, and feature maps are extracted from different stages of the backbone network to construct a multi-scale feature pyramid under the image type.

[0041] Specifically, taking a printed circuit board assembly to be tested as an example, a visible light color image with a resolution of 1024x1024 pixels is collected, which is used to identify surface color abnormalities (such as blackened solder joints); an X-ray grayscale image with the same resolution is collected, which is used to detect internal structural defects (such as air bubbles); a three-dimensional structured light image with the same resolution generated by structured light scanning is collected, which is used to measure the height or flatness of the component. The three images are respectively input into three independent feature extraction networks based on the ResNet-50 architecture.

[0042] Within each ResNet-50 network, the feature extraction process goes through multiple convolution stages. Feature maps are extracted from the output ends of the second, third, fourth and fifth residual block groups, i.e., C2, C3, C4 and C5 stages. For example, for the visible light color image, the feature map output by the C2 stage has a high resolution and retains fine texture details, which is suitable for detecting small scratches; while the feature map output by the C5 stage has a low resolution but has a larger receptive field and more rich semantic information, which is suitable for identifying the absence of the entire printed circuit board assembly. The four feature maps of different scales together form a feature pyramid under the visible light image, and the same process is applied to the X-ray grayscale image and the three-dimensional structured light image, finally generating three independent multi-scale feature pyramids that can represent information from details to the global.

[0043] S2, through the cross-modal self-attention module, the correlation weights between the features of the visible light, X-ray and three-dimensional structured light images are calculated between the corresponding levels of the multi-scale feature pyramids, and the image features are weighted and fused according to the correlation weights to generate a multi-modal fusion feature pyramid.

[0044] In an optional embodiment, in S2, at any corresponding level of the multi-scale feature pyramid, the feature maps of the visible light, X-ray and three-dimensional structured light images are spliced along the channel dimension to form a combined feature map; the combined feature map is input into the cross-modal self-attention module, the cross-modal self-attention module adaptively calculates the attention weights in the spatial dimension and the channel dimension, and recalibrates the combined feature map to enhance the key information and suppress the redundant information, thereby generating the fusion feature of the level.

[0045] Specifically, assuming that at the third level of the multi-scale feature pyramid, the feature maps of the visible light, X-ray and three-dimensional structured light images are all 64x64 pixels in size and 256 in channel number. The three feature maps are spliced along the channel dimension to form a combined feature map with a size of 64x64 pixels and a channel number of 768. The combined feature map is input into the cross-modal self-attention module, which includes spatial attention and channel attention branches.

[0046] For example, when detecting an internal cavity of a BGA solder joint that is blocked, the channel attention branch learns to give higher weights to the channels corresponding to the X-ray image, i.e., channels 257 to 512, while reducing the weight of the visible light image channel because its surface information is irrelevant. At the same time, the spatial attention branch locates the spatial region where the BGA is located and increases the attention scores of all pixel points in the spatial region. By multiplying the attention weights in the two dimensions with the original combined feature map, the cross-modal self-attention module finally outputs a recalibrated fusion feature map, in which the multi-modal information most relevant to the BGA cavity detection is significantly enhanced, while irrelevant background or noise information is effectively suppressed.

[0047] In S3, at each level of the multi-modal fusion feature pyramid, a candidate region generation network is applied to propose candidate defect regions, and a shape prior loss is included in the loss function of the candidate region generation network to constrain the geometric features of the candidate boxes to preferentially match typical defect shapes.

[0048] In an optional embodiment, in S3, a set of prior anchor box aspect ratios representing typical defect shapes (such as bars, circles, squares) is predefined; during training, for each candidate box output by the candidate region generation network, the generalized intersection over union (GIoU) of the candidate box and all prior anchor boxes is calculated; the maximum GIoU value is selected, and 1 minus the maximum GIoU value is taken as the shape prior loss, which is added to the total loss function of the candidate region generation network, i.e., in addition to the standard classification loss and bounding box regression loss, the shape prior loss is additionally added to the total loss function.

[0049] Specifically, according to the statistical analysis of historical defect data, a set of prior anchor box aspect ratios are predefined, for example, 1:5 and 5:1 represent elongated scratches or tin bridges, 1:1 represents the offset of pinholes or square patch elements, and 2:3 and 3:2 represent common rectangular capacitors or resistors. The aspect ratios of this set of prior anchor boxes are fixed as guidance information.

[0050] During network training, assuming that the candidate region generation network predicts a candidate box with a width of 20 pixels and a height of 25 pixels for a real existing bar scratch defect. The aspect ratio of the candidate box is close to 1:1, and the generalized intersection over union calculated with the 1:5 aspect ratio of the prior anchor box may only be 0.3, while the generalized intersection over union calculated with the 1:1 prior anchor box is 0.8. At this time, the maximum generalized intersection over union value selected is 0.8, and the shape prior loss is 1-0.8=0.2. This loss value will punish the candidate region generation network through back propagation, prompting the candidate region generation network to adjust the parameters in subsequent iterations to generate a candidate box closer to the 1:5 aspect ratio to match the real shape of the bar scratch. By adding the shape prior loss term to the total loss function, the model is guided to generate a prediction box with a geometric shape closer to the actual defect shape.

[0051] S4, a spatial topology relationship graph is constructed with all candidate defect regions and preset key functional unit coordinates, wherein all candidate defect regions and preset key functional unit are nodes, and their spatial proximity relationship is an edge; the spatial context information is embedded into the candidate defect region feature by processing the spatial topology relationship graph through a graph neural network.

[0052] In an optional embodiment, in S4, each candidate defect region and its feature vector are defined as a defect node; the position and category information of each preset key functional unit (such as a chip or a capacitor) are defined as a key functional unit node; when the Euclidean distance between the center points of the defect node and the key functional unit node is less than a preset threshold, an edge is established between the defect node and the key functional unit node to represent their spatial proximity relationship.

[0053] Specifically, assuming that a candidate defect region D1 is detected on a circuit board, with a center coordinate of (150, 200), and a 128-dimensional feature vector is extracted. At the same time, it is known from the design file of the circuit board that the center coordinate of a key chip IC1 is (160, 210) and the center coordinate of a capacitor C1 is (300, 400). D1, IC1 and C1 are all defined as nodes in the spatial topology relationship graph. The preset threshold for judging spatial proximity relationship is 50 pixels.

[0054] The Euclidean distance between the center points of D1 and IC1 is calculated as Pixel. Since 14.14 is less than the threshold 50, an edge is established between the D1 node and the IC1 node. Then the distance between D1 and the center of C1 is calculated, which is much larger than 50 pixels, so no connection is established between D1 and C1. Through this process, the spatial topological graph encodes the important spatial context information that the defect D1 is close to the chip IC1, and is irrelevant to the distant capacitor C1. This graph is then input into the graph neural network to learn the relevance of the defect and its surrounding environment.

[0055] S5, input the candidate region feature embedded with spatial context information into the prototype network classifier, and complete classification by calculating the distance between the candidate region feature and the pre-stored center prototype of each known defect category and the normal region prototype; if the minimum distance between the candidate region feature and all pre-stored prototypes is greater than the set discrimination threshold, it is determined that the candidate region is a potential defect of unknown type.

[0056] In an optional embodiment, in S1, the classification by the prototype network classifier includes the following steps: in the training stage, for each known category (including the normal category and N known defect categories), the mean of the feature vectors output by the graph neural network for all training samples of the category is taken as the center prototype of the category; in the inference stage, the Euclidean distance between the feature vector of the candidate region and each center prototype is calculated, and the candidate region is classified into the category corresponding to the center prototype with the smallest distance.

[0057] Specifically, in the training stage, it is assumed that there are three known categories: normal, tin bead defect, and element offset defect. For the tin bead defect category, 1000 samples of this category are processed, and each sample is processed by the graph neural network to obtain a 256-dimensional feature vector. The 1000 256-dimensional feature vectors are averaged element by element to obtain a single 256-dimensional vector, which becomes the center prototype representing the tin bead defect category. Similarly, the center prototypes of the normal category and the element offset defect category are also calculated. The three prototype vectors belonging to different categories are stored for later use.

[0058] In the inference stage, a candidate region to be tested is processed by the entire network to generate a 256-dimensional feature vector. At this time, the Euclidean distances between the to-be-tested feature vector and the three stored center prototypes need to be calculated. For example, the calculated distances are: the distance to the normal category prototype is 8.2, the distance to the tin bead defect category prototype is 1.5, and the distance to the element offset defect category prototype is 6.7. Since 1.5 is the smallest of the three distances, the candidate region is finally classified as a tin bead defect.

[0059] In an optional embodiment, the steps of determining a candidate region as an unknown type potential defect include: calculating the minimum distance D between the feature of the candidate region and all pre-stored prototypes (including the normal category prototype and the known defect category prototypes) min ; comparing D min with a set of discrimination threshold T, wherein the discrimination threshold T is determined according to the distance distribution of all correctly classified samples and their corresponding category prototypes on the validation set (for example, taking the 95th percentile of the distribution); if D min is greater than T, the candidate region is marked as an “unknown type potential defect”.

[0060] Specifically, the determination process of the discrimination threshold T is as follows: using an independent validation data set (containing samples of all known categories), for each sample correctly classified by the model in the validation set, calculate the Euclidean distance between its feature vector and the prototype of the category it belongs to. For example, a sample correctly identified as a tin bead defect has a distance of 1.3 between its feature vector and the tin bead defect category prototype. Collect the distance values of all these correctly classified samples to form a distance distribution, and take the 95th percentile of the distance distribution as the threshold (assuming that the calculated T is equal to 4.5).

[0061] In actual detection, if a previously unseen defect type (such as circuit board substrate delamination) is encountered, the defect will generate a corresponding feature vector after being processed by the graph neural network. Calculate the Euclidean distance between this feature vector and all known category prototypes (including the normal category prototype, the tin bead defect category prototype, and the component offset defect category prototype). The minimum distance D min =5.8 is calculated, which is the distance between it and the most similar known category, such as the component offset defect type prototype. Because 5.8 is greater than the preset threshold T=4.5, it indicates that the sample is far away from all known category centers in the feature space. Therefore, it will not be misclassified as any known defect, but will be marked as an “unknown type potential defect” and reported to the engineer for manual analysis and confirmation.

[0062] Embodiments of the electronic component defect detection system based on machine vision provided by the present application:

[0063] As shown in Figure 3 , the electronic component defect detection system based on machine vision includes a processor and a memory, the memory stores computer program instructions, when the computer program instructions are executed by the processor, the above-mentioned electronic component defect detection method based on machine vision is realized.

[0064] The electronic component defect detection system based on machine vision also includes a communication interface and other components familiar to those skilled in the art, the settings and functions of which are known in the art, and therefore will not be described here.

[0065] In this invention, the aforementioned memory can be any tangible medium containing or storing a program that can be used or combined with an instruction execution system, apparatus, or device. For example, a computer-readable storage medium can be any suitable magnetic or magneto-optical storage medium, such as Resistive Random Access Memory (RRAM), Dynamic Random Access Memory (DRAM), Static Random Access Memory (SRAM), Enhanced Dynamic Random Access Memory (EDRAM), High-Bandwidth Memory (HBM), Hybrid Memory Cube (HMC), etc., or any other medium that can be used to store desired information and can be accessed by an application, module, or both. Any such computer storage medium can be part of a device or accessible to or connected to a device. Any application or module described in this invention can be implemented using computer-readable / executable instructions stored or otherwise maintained by such a computer-readable medium.

[0066] In addition, in the description of this specification, "multiple" means at least two, such as two, three or more, etc., unless otherwise expressly and specifically defined.

Claims

1. A method for defect detection of electronic components based on machine vision, characterized in that, Includes the following steps: S1: Acquire visible light, X-ray and three-dimensional structured light images of the electronic component under test, and generate their respective multi-scale feature pyramids through independent feature extraction networks; S2, within the corresponding levels of the multi-scale feature pyramid, calculates the correlation weights between the three image features—visible light, X-ray, and 3D structured light—using a cross-modal self-attention module, and then performs weighted fusion of the image features accordingly to generate a multi-modal fused feature pyramid, including: At any corresponding level of the multi-scale feature pyramid, the feature maps of visible light, X-ray, and three-dimensional structured light images are stitched together along the channel dimension to form a combined feature map. The combined feature map is input into the cross-modal self-attention module, which adaptively calculates the attention weights in the spatial and channel dimensions and recalibrates the combined feature map to enhance key information and suppress redundant information, thereby generating the fused features at this level. S3, at each level of the multimodal fusion feature pyramid, a candidate region generation network is applied to propose candidate defect regions. The loss function of the candidate region generation network includes a shape prior loss to constrain the geometric features of the candidate boxes to prioritize matching typical defect shapes, including: A set of prior anchor frame aspect ratios representing typical defect morphologies are predefined; During training, for a real-world strip-shaped scratch defect, the candidate region generation network predicts a candidate box and calculates the generalized intersection-union ratio (GUU) of the candidate box with all prior anchor boxes. The maximum GUU value is selected, and 1 minus the maximum GUU value is used as the shape prior loss. The shape prior loss is added to the total loss function of the candidate region generation network. The shape prior loss penalizes the candidate region generation network through backpropagation, prompting the candidate region generation network to adjust its parameters in subsequent iterations to generate candidate boxes with aspect ratios close to the prior anchor boxes to match the true shape of the strip scratch. This guides the candidate region generation network to predict candidate boxes with geometric shapes that conform to the actual defect morphology. S4. A spatial topology graph is constructed using the coordinates of all candidate defect regions and preset key functional units, where all candidate defect regions and preset key functional units are nodes, and their spatial proximity relationships are edges. The spatial topology graph is processed using a graph neural network to embed spatial context information into the features of the candidate defect regions, including: Each candidate defect region and its feature vector are defined as a defect node. Define the location and category information of each preset key functional unit as a key functional unit node; When the Euclidean distance between the center points of the entities represented by the defective node and the key functional unit node is less than a preset threshold, an edge is established between the defective node and the key functional unit node to represent their spatial proximity relationship. S5. The candidate region features with embedded spatial context information are input into the prototype network classifier. The classification is completed by calculating the distance between the candidate region features and the pre-stored prototypes of each known defect category and normal region. If the minimum distance between the candidate region features and all pre-stored prototypes is greater than the set discrimination threshold, the candidate region will be determined to be a potential defect of unknown type.

2. The method for detecting defects in electronic components based on machine vision according to claim 1, characterized in that, S1 includes the following steps: For each image type—visible light, X-ray, and 3D structured light—an independent encoder with ResNet as the backbone network is used for feature extraction. Feature maps are extracted from the outputs of different stages of the backbone network to construct a multi-scale feature pyramid for each image type.

3. The method for detecting defects in electronic components based on machine vision according to claim 1, characterized in that, The total loss function is the sum of classification loss, bounding box regression loss, and shape prior loss.

4. The method for detecting defects in electronic components based on machine vision according to claim 1, characterized in that, The key functional units include chips and capacitors.

5. The method for detecting defects in electronic components based on machine vision according to claim 1, characterized in that, In S5, classification using a prototype network classifier includes the following steps: During the training phase, for each known category, the mean of the feature vectors output by the graph neural network from all training samples under that category is taken as the central prototype of that category. During the inference phase, the Euclidean distance between the feature vector of the candidate region and each central prototype is calculated, and the candidate region is classified into the category corresponding to the central prototype with the smallest distance.

6. The method for detecting defects in electronic components based on machine vision according to claim 5, characterized in that, The steps involved in identifying a candidate region as a potential defect of an unknown type are as follows: Calculate the minimum distance D between the candidate region features and all pre-stored prototypes. min ; D min The comparison is made with a set discrimination threshold T, which is determined based on the distance distribution between all correctly classified samples on the validation set and their corresponding class prototypes. If D min If the value is greater than T, the candidate region is marked as "potential defect of unknown type".

7. A machine vision-based electronic component defect detection system, characterized in that, It includes a memory and a processor, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the method for detecting electronic component defects based on machine vision as described in any one of claims 1-6 is implemented.

Citation Information

Patent Citations

  • PCBA circuit board welding spot detection method based on multi-modal data fusion

    CN120449113A

  • High-speed rail part crack real-time detection method

    CN120525826A

  • Robot vision detection method and system based on image enhancement

    CN120563475A

Cited By

  • Intelligent identification method for high-value electronic components based on multi-modal information

    CN122492608A