Method for detecting poor component of TO tube socket
Through the detection method combined with adaptive threshold algorithm and deep convolutional neural network, the problem of low detection accuracy and efficiency of TO seat components is solved, and high-precision, automation, flexibility and safety detection is achieved, reducing production costs , suitable for large-scale production environments.
Patent Information
- Application Number
- CN202411085201.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-08
- Publication Date
- 2024-11-22
AI Technical Summary
The existing TO tube seat component detection methods have limited accuracy and low efficiency, which cannot meet the needs of large-scale production. The high-precision automated detection system is expensive and complex in operation, so it cannot fully cover all types of adverse phenomena.
The target image is segmented and extracted using an adaptive threshold algorithm, and classified using a deep convolutional neural network, combining continuous operation and shape segmentation to achieve high-precision detection of TO tube components.
Improve inspection accuracy and efficiency, reduce production costs, enhance safety and reliability, adapt to component inspection of different styles and sizes, meet large-scale production needs, reduce the outflow and rework rate of defective products, and improve production efficiency and production capacity. .
Smart Images

Figure CN119006408A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of component detection, and in particular to a method for detecting defective components of a TO tube socket. Background Art
[0002] In the electronics industry, TO sockets are an important form of electronic component packaging and are widely used in various electronic devices and systems. However, due to various factors in the production process, such as material quality, production process, environmental conditions, etc., TO socket components may have undesirable phenomena, such as poor welding, reduced insulation performance, insufficient mechanical strength, etc. The existence of these defective components not only affects the performance and stability of electronic equipment, but also may cause safety hazards and pose potential dangers to users.
[0003] At present, there are various TO socket component inspection methods and systems on the market, but there are some common problems. On the one hand, some inspection methods rely on manual visual inspection or simple electrical testing, which have limited accuracy and low efficiency and cannot meet the needs of large-scale production. On the other hand, although some high-precision automated inspection systems can improve inspection efficiency and accuracy, the equipment cost is high, the operation is complicated, and it may not be able to fully cover all types of adverse phenomena. Summary of the invention
[0004] In view of the shortcomings of the prior art, the object of the present invention is to provide a method for detecting defective components of a TO socket, so as to solve the problems in the background technology.
[0005] The above object of the present invention is achieved through the following technical solutions:
[0006] A method for detecting defective components of a TO socket is characterized by segmenting and extracting a target image by using an adaptive threshold algorithm, classifying it using a classification model, and finally marking it according to the target classification result and position information.
[0007] In a preferred example, the present invention can be further configured as follows: target segmentation extraction includes adaptive threshold binary classification, continuous opening operation, and exclusion of boundaries and non-circles.
[0008] In a preferred example, the present invention can be further configured as follows: using an adaptive threshold algorithm to perform binary classification processing on the input TO socket image;
[0009] The threshold is automatically adjusted according to the pixels in the local area of the image to separate the target area and the background area.
[0010] In a preferred example, the present invention can be further configured as follows: performing continuous opening operations on the binary classified images to eliminate small holes inside the target and bridge portions connecting adjacent targets;
[0011] The continuous opening operation performs dilation and erosion operations by applying the structuring element multiple times.
[0012] In a preferred example, the present invention can be further configured as follows: excluding areas that are too close to the image boundary, then calculating the area and circumscribed rectangle parameters of each candidate area, and excluding range targets that do not meet the preset size by setting appropriate thresholds and shape constraints.
[0013] In a preferred example, the present invention can be further configured as follows: the target segmentation and extraction also includes restoring the position of the filtered target area in the original image, and cutting out a rectangular area containing the target according to the calculated circumscribed rectangle information.
[0014] In a preferred example, the present invention can be further configured as follows: in target classification: the classification model is a deep convolutional neural network, the network structure includes multiple residual blocks and a global average pooling layer, and finally a fully connected layer for classification.
[0015] In a preferred example, the present invention can be further configured as follows: for each detected target, a qualitative analysis is performed based on the classification result, and annotated at the corresponding position.
[0016] In summary, the present invention includes at least one of the following beneficial technical effects:
[0017] This method has significant advantages and positive effects, and is of great value and significance for quality control, production efficiency and safety improvement in the electronics industry, as follows:
[0018] 1. High-precision detection: Through steps such as adaptive threshold binary classification, continuous open operation and shape segmentation, the target area of TO socket components can be accurately segmented, and accurate classification can be performed through the classification model, thereby improving the accuracy and reliability of detection;
[0019] 2. Automated processing: Automatic or semi-automatic image processing and machine learning technology are used to reduce the need for manual intervention and visual inspection, improve detection efficiency and processing capabilities, and are suitable for large-scale production environments;
[0020] 3. Flexibility and versatility: It can adapt to TO socket components of different styles and sizes. By adjusting parameters and training models, it can be extended to other types of electronic component detection, with high flexibility and versatility;
[0021] 4. Reduce production costs: By improving detection accuracy and efficiency, reducing the outflow of defective products and rework rate, and reducing equipment and labor costs, it helps to reduce overall production costs and improve product quality;
[0022] 5. Enhanced safety and reliability: Through comprehensive and accurate testing of TO socket components, potential safety hazards and performance problems can be discovered and eliminated in a timely manner, improving the safety and reliability of electronic equipment and protecting the lives and property of users;
[0023] 6. Improve production efficiency and capacity: The ability to quickly and accurately detect good and bad TO socket components can reduce production line downtime, improve production efficiency and capacity, and thus meet market demand and competitive pressure. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 It is a flow chart of this technical solution. DETAILED DESCRIPTION
[0025] The present invention is further described in detail below in conjunction with the accompanying drawings.
[0026] like Figure 1 As shown, a method for detecting defective components of a TO socket disclosed in the technical solution includes the following steps:
[0027] Target segmentation extraction:
[0028] (1) Adaptive threshold binary classification:
[0029] First, use the image acquisition device to obtain the original color or grayscale image. Use the adaptive threshold algorithm to perform binary classification on the input TO socket image. First, convert the original image into a grayscale image. gray , and then traverse each pixel value, set the pixel threshold to t, if the pixel value is greater than t, set the pixel value to 255, otherwise if the pixel value is less than t, set the pixel value to 0, so that most of the noise background on the image can be filtered out, thereby achieving the purpose of binary classification of pixel values. The adaptive threshold method can automatically adjust the threshold according to the pixel distribution characteristics of the local area of the image, effectively separate the target area and the background area, and cope with complex situations such as illumination changes and noise interference.
[0030] (2) Continuous opening operation:
[0031] The binary images are continuously opened to eliminate small holes inside the object and bridges between adjacent objects. The continuous opening operation maintains the shape characteristics of the original object while removing unstable edges and noise by applying structural elements (such as rectangles or disks of 3x3 or larger sizes) for dilation and erosion operations multiple times.
[0032] (3) Exclude boundaries and non-circular shapes:
[0033] Calculate area and bounding rectangle: In the image after opening operation, further screen out possible target areas. First, exclude areas that are too close to the image boundary to reduce the impact of edge effects. Then, calculate the area and bounding rectangle parameters of each candidate area, and exclude non-circular or non-preset size targets by setting appropriate thresholds and shape constraints (such as circularity).
[0034] (4) Restore the image to its original position and cut out the target area according to the rectangular frame:
[0035] The position of the filtered target area in the original image is restored, and the rectangular area containing the target is cropped according to the calculated bounding rectangle information. These cropped target areas will be used as input for subsequent target classification.
[0036] Target classification:
[0037] The pre-trained seresnet50 classification model is used for target classification. Here, the defect category of the TO tube can be represented as Cn = {C1, C2, C3, …, Ci, …, Cn}. This model is a deep convolutional neural network with powerful feature extraction and classification capabilities. The size of the input image is adjusted to 3*512*512 to meet the input requirements of the model.
[0038] The network structure includes multiple residual blocks and global average pooling layers, and finally a fully connected layer for classification. According to the type N of TO socket styles, we divide the targets into N*2 categories, where each style corresponds to good and bad products.
[0039] Original map annotation:
[0040] According to the results of target classification and the location information of each target in the original image, the original image is annotated. Specifically, for each detected target, it is determined whether it is good or bad according to its classification result, and a rectangular box is drawn or a specific color or label is marked at the corresponding position to facilitate manual review or subsequent analysis and processing. This annotation method can intuitively display the results of detection and classification, which is helpful for evaluating system performance and optimizing parameter settings.
[0041] Example:
[0042] A batch of TO-220 style electronic components needs to be tested for defective components:
[0043] Implementation steps:
[0044] Image acquisition:
[0045] Use a high-resolution camera or image acquisition device to take a picture of each TO-220 component to obtain the original color or grayscale image.
[0046] Target segmentation extraction:
[0047] Each collected image is preprocessed and the target segmentation is extracted.
[0048] Adaptive threshold binary classification: Apply the adaptive threshold algorithm to automatically adjust the threshold according to the local characteristics of the image and divide the image into the target area and the background area.
[0049] Continuous opening operation:
[0050] The binary classified images are continuously opened to eliminate small holes and bridged parts inside the target.
[0051] Exclude boundaries and noncircles:
[0052] Calculate area and bounding rectangle: Calculate the area and bounding rectangle parameters of each candidate region, and exclude objects that are close to the image boundary, non-circular, or do not meet the size range.
[0053] Restore the image to its original position and crop the target area according to the rectangular frame:
[0054] The position of the filtered target area in the original image is restored, and the rectangular area containing the target is cropped out.
[0055] Target classification:
[0056] Use the pre-trained seresnet50 classification model to classify each cropped object region.
[0057] Input resizing:
[0058] The cropped target area is resized to 3*512*512 to meet the input requirements of the model.
[0059] Classification prediction:
[0060] The adjusted image is input into the seresnet50 model to obtain the classification probability of good and bad products.
[0061] Original map annotation:
[0062] According to the classification results and the location information of the target in the original image, mark it on the original image.
[0063] Result judgment:
[0064] For each target, the category with the highest classification probability is selected as the final classification result.
[0065] Image Annotation:
[0066] On the original image, a rectangular box is drawn at the position of each target and marked as green (good product) or red (bad product) according to the classification results.
[0067] The embodiments of this specific implementation method are all preferred embodiments of the present invention, and are not intended to limit the protection scope of the present invention. Therefore, any equivalent changes made based on the structure, shape, and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for detecting defective components of a TO socket, characterized in that: The target image is segmented and extracted by using an adaptive threshold algorithm, classified using a classification model, and finally labeled based on the target classification results and location information.
2. A method for detecting defective components of a TO socket according to claim 1, characterized in that: Target segmentation and extraction include adaptive threshold binary classification, continuous opening operation, and exclusion of boundaries and non-circles.
3. A method for detecting defective components of a TO socket according to claim 2, characterized in that: Use adaptive threshold algorithm to perform binary classification on the input TO socket image; The threshold is automatically adjusted according to the pixels in the local area of the image to separate the target area and the background area.
4. A method for detecting defective components of a TO socket according to claim 3, characterized in that: Perform continuous opening operations on the binary classified images to eliminate small holes inside the target and bridge parts connecting adjacent targets; The continuous opening operation performs dilation and erosion operations by applying the structuring element multiple times.
5. The method for detecting defective components of a TO socket according to claim 2, characterized in that: Areas that are too close to the image boundary are excluded, and then the area and bounding rectangle parameters of each candidate area are calculated. By setting appropriate thresholds and shape constraints, range targets that do not meet the preset size are excluded.
6. A method for detecting defective components of a TO socket according to claim 5, characterized in that: The target segmentation and extraction also includes restoring the position of the filtered target area in the original image, and cutting out the rectangular area containing the target according to the calculated bounding rectangle information.
7. A method for detecting defective components of a TO socket according to claim 1, characterized in that: In target classification: the classification model is a deep convolutional neural network. The network structure includes multiple residual blocks and global average pooling layers, and finally a fully connected layer for classification.
8. The method for detecting defective components of a TO socket according to claim 1, characterized in that: For each detected target, it is qualitatively characterized according to the classification results and annotated at the corresponding position.
