Training method, detection method, device, equipment, storage medium and program product

By training a general defect detection model of multi-stage joint training, the problem that the defect detection model in the prior art cannot meet the requirements of multiple varieties and short-cycle detection in production lines is solved, and efficient and accurate defect detection results are achieved.

CN119671968APending Publication Date: 2025-03-21GOERTEK INC
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411730240.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-28
Publication Date
2025-03-21

AI Technical Summary

Technical Problem

The existing defect detection model cannot meet the testing requirements of multiple varieties and short-cycle production lines, resulting in inaccurate inspection and low detection efficiency.

Method used

A training method for defect detection is proposed. By obtaining the annotated surface-mount defect sample image as the training set, the general model for defect detection to be trained is obtained to obtain the general model for defect detection for surface-mount defect detection. The model can detect multiple defect items through multi-stage joint training, including component detection, defect detection, classification and comparison learning tasks.

Benefits of technology

It realizes the detection capability of iterative products, has general detection capability, can shorten the production line model development cycle, reduce sample dependence, and meet the testing requirements of multiple varieties and short cycles of production line.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119671968A_ABST
    Figure CN119671968A_ABST
Patent Text Reader

Abstract

The invention discloses a defect detection general model training method, a surface mounting defect detection method, a surface mounting defect detection device, processing equipment, a storage medium and a computer program product, and relates to the technical field of defect detection. In the application, a training method of a defect detection general model is proposed, and a to-be-trained defect detection general model is trained by taking labeled surface-mounted defect sample images as a training set, so that the defect detection general model for surface-mounted defect detection is obtained. Compared with the prior art, the method and the device have the advantages that each surface mounting defect does not need to be independently trained to establish a targeted detection model, the universal model is established by uniformly training on the basis of the obtained data of all production line products, such as the first to fourth types of defect items, and the universal model has the capability of detecting iterative products.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of defect detection, and in particular to a training method for a general defect detection model, a surface mount defect detection method, a surface mount defect detection device, a processing device, a storage medium and a computer program product. Background Art

[0002] At present, defect detection systems based on automatic optical inspection (AOI) are widely used in surface mount (SMT) production lines, which can effectively detect defects such as printing, mounting and solder joints. Compared with manual visual inspection, AOI inspection has achieved higher automation and detection accuracy, but it still has certain limitations in the application process, such as changes in incoming materials (color difference of incoming components and changes in pin length, etc.), white silk screen interference, and various complex situations such as similar images of good and bad products, which make the AOI false alarm rate high. The high false alarm rate of AOI forces the production line to use manual secondary inspection, resulting in a decrease in detection efficiency and an increase in labor costs.

[0003] Furthermore, artificial intelligence (AI) is used to assist AOI inspection. For example, AOI inspection based on deep learning can extract features of various fault states and information, while suppressing noise, which is conducive to the collection of fault information.

[0004] At present, it is not complicated to train a high-precision defect detection model for a single production line product. However, for similar products, it is necessary to collect sample data of similar products and retrain the model. The defect detection model trained in this way cannot be universal. In other words, a defect detection model needs to be trained for the products of a certain production line. When changing production lines, it is also necessary to collect training sets, train and switch new defect detection models. The defect detection model established in this way does not have the ability to detect iterative products.

[0005] In summary, the current deep learning-based product appearance defect detection model has a long production line model development cycle and high sample dependence, which cannot meet the requirements of multi-variety and short-cycle detection of production lines. It is urgent to develop a general model for surface mount SMT.

[0006] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention

[0007] The main purpose of this application is to provide a training method for a general defect detection model, a surface mount defect detection method, a surface mount defect detection device, a processing device, a storage medium and a computer program product, aiming to solve the technical problem that the current defect detection model cannot meet the multi-variety and short-cycle detection requirements of the production line.

[0008] To achieve the above objectives, the present application proposes a method for training a general defect detection model, the method comprising:

[0009] Obtain defect sample images of surface mount products, and annotate the defect sample images to obtain a training set of a general defect detection model to be trained; wherein the training set includes first-category defect items, components without silk-screen printing, and components with silk-screen printing, and / or second-category defect items and third-category defect items without silk-screen printing components on surface mount products to be inspected, and / or fourth-category defect items of silk-screen printing components on surface mount products to be inspected;

[0010] The defect detection general model to be trained is trained by using the training set to obtain a defect detection general model for surface mount defect detection.

[0011] In one embodiment, the step of training the defect detection general model to be trained by using the training set to obtain the defect detection general model for surface mount defect detection includes:

[0012] In the first stage of training the general defect detection model to be trained using the training set, the component detection head and the first type of defect item detection head are involved in the training;

[0013] After the training of the first stage converges, in the second stage of training the general defect detection model to be trained by using the training set, the second type defect item detection head, the third type defect item detection head and the fourth type defect item detection head are involved in the training;

[0014] After the training of the second stage converges, a general defect detection model for surface mount defect detection is obtained.

[0015] In addition, to achieve the above purpose, the present application also proposes a surface mount defect detection method, the surface mount defect detection method uses a defect detection general model trained by any of the above defect detection general model training methods, and the surface mount defect detection method includes:

[0016] Acquire a surface mounted image to be inspected, extract image features of the image to be inspected, and input the image features into a general defect detection model;

[0017] Through the general defect detection model, the first type of defect items, non-silk-screen components and silk-screen components on the surface mount products to be inspected are detected, and / or the second type of defect items and the third type of defect items without silk-screen components on the surface mount products to be inspected, and / or the fourth type of defect items of silk-screen components on the surface mount products to be inspected are detected.

[0018] In one embodiment, the general defect detection model is used to detect the first type of defect items, silk-screen printed components and non-silk-screen printed components through target detection tasks.

[0019] In one embodiment, the general defect detection model is used to detect the second type of defect items and the third type of defect items without silk-screen printed components on the surface mounted products to be inspected through classification tasks and comparative learning tasks.

[0020] In one embodiment, the general defect detection model is used to detect the fourth type of defect items of silk-screen printed components on the surface mounted product to be inspected through an optical character recognition task.

[0021] In addition, to achieve the above purpose, the present application also proposes a surface mount defect detection device, wherein the surface mount defect detection method uses a defect detection general model trained by any of the above defect detection general model training methods, and the surface mount defect detection device includes:

[0022] A preparation module, used for acquiring a surface mounted image to be inspected, extracting image features of the image to be inspected and inputting the image features into a general defect detection model;

[0023] A detection module is used to detect, through the general defect detection model, first-category defect items of surface mount products to be inspected, components without silk screen printing, and silk screen printed components, and / or second-category defect items and third-category defect items of components without silk screen printing on surface mount products to be inspected, and / or fourth-category defect items of silk screen printed components on surface mount products to be inspected.

[0024] In addition, to achieve the above-mentioned objectives, the present application also proposes a processing device, which includes: a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the computer program is configured to implement the steps of the method for training a general defect detection model as described in any of the above items, and / or the steps of the method for detecting surface mount defects as described in any of the above items.

[0025] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the training method of the general defect detection model as described in any of the above items and / or the steps of the surface mount defect detection method as described in any of the above items are implemented.

[0026] In addition, to achieve the above-mentioned objectives, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements the steps of the training method of the general defect detection model as described in any of the above items, and / or the steps of the surface mount defect detection method as described in any of the above items.

[0027] One or more technical solutions proposed in this application have at least the following technical effects:

[0028] In this application, a method for training a general defect detection model is proposed. By taking labeled surface mount defect sample images as a training set, a general defect detection model to be trained is trained to obtain a general defect detection model for surface mount defect detection.

[0029] Compared with the prior art, the present application does not need to conduct separate training for each surface mount defect to establish a targeted detection model. Instead, it conducts unified training based on the data of all available production line products, such as the first to fourth category defect items, to establish a general model. The general model has the ability to detect iterative products, that is, it has a general detection capability. Based on the general model, surface mount defect detection can be performed on each production line product, which can be applied to similar defect detection of different products of the same type. It can shorten the production line model development cycle, reduce sample dependence, and meet the production line's multi-variety and short-cycle detection requirements. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0031] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0032] Figure 1 A flowchart diagram of the first embodiment of the method for training a general defect detection model of the present application;

[0033] Figure 2 A schematic diagram of a flow chart provided for the second embodiment of the surface mount defect detection method of the present application;

[0034] Figure 3 A schematic diagram of an application scenario provided for the second embodiment of the surface mount defect detection method of the present application;

[0035] Figure 4This is a schematic diagram of the module structure of a surface mount defect detection device according to an embodiment of the present application;

[0036] Figure 5 A schematic diagram of the processing device structure of the hardware operating environment involved in the embodiments of the present application.

[0037] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0038] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.

[0039] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0040] The present application embodiment provides a method for training a general defect detection model, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the method for training a general defect detection model of the present application.

[0041] In this embodiment, the training method of the general defect detection model includes steps S10 to S20:

[0042] Step S10, obtaining defect sample images of surface mount, and annotating the defect sample images to obtain a training set of the general defect detection model to be trained; wherein the training set includes first-category defect items, components without silk screen printing, and components with silk screen printing, and / or second-category defect items and third-category defect items without silk screen printing components on surface mount products to be inspected, and / or fourth-category defect items of silk screen printing components on surface mount products to be inspected;

[0043] In one embodiment, the categories and annotation types of the SMT-AOI defect dataset are shown in Table 1:

[0044]

[0045]

[0046] Table 1

[0047] The acquired surface mount defect sample images can be annotated based on Table 1. Furthermore, for the second type of defect items, the classification annotation needs to screen the three types of defects, namely bad boards, wrong parts, and empty texts, and select representative defect image samples to ensure that the number of each category is relatively even and the image features are obvious, so as to facilitate model learning and generalization; for the 12 types of defect items (missing parts, flipped parts, stacked materials, bridging, less tin, tin connection, cold soldering, impurities, tin beads, sideways, shielding shell abnormalities, and repaired parts) that need to be quantified in terms of area size, count, and semantic information, that is, the first type of defect items, ensure that the bounding box of the target detection annotation is consistent with the actual position of the defect, so that the training model can accurately identify and locate the defect; for the third type of defect items, namely, polar reversal, offset, damaged parts, and sideways, it is necessary to construct a comparative learning of the image to be inspected and the template image, and perform comparative learning annotation; for components that need to identify silk screen content, the silk screen area is annotated and content aligned at the pixel level in the image to ensure the accuracy and quality of the annotation. Among them, substitute materials are the fourth type of defect item for silk-screen components on surface mount products to be inspected.

[0048] In addition, the accuracy and consistency of the labeled data can be ensured by establishing a quality control mechanism, including training and review of labelers, regular sampling and checking of labeling results, etc. The data distribution can also be monitored to ensure that the number of categories is relatively balanced. If necessary, data enhancement techniques can be used to expand the data set to increase the diversity and quantity of data to improve the generalization ability and robustness of the model, such as commonly used data enhancement techniques such as rotation, flipping, scaling, translation, brightness adjustment, etc.

[0049] The above effectively labels the data for SMT-AOI defect detection and provides a reliable data foundation for training high-quality detection models.

[0050] In addition, in order to achieve a higher accuracy rate, the existing model needs to collect thousands of pictures of a certain NG item. In this embodiment, compared with the existing model, the data set and the backbone network only need to be trained on sample sets with different defects and multiple defects, which is equivalent to training on data sets of different projects. It can reduce the amount of sample data and sample pictures. In the new production line project, only a small number of samples need to be collected to fine-tune the large model that has learned the common features, so that the new model obtained after fine-tuning can achieve higher detection accuracy on the new production line project, thereby reducing the dependence of the new production line project on samples when training the model.

[0051] Step S20, training the general defect detection model to be trained by using the training set to obtain the general defect detection model for surface mount defect detection.

[0052] The annotated dataset images are input into the proposed general defect detection model to be trained. A backbone network plus a multi-task head (component detection head, defect detection head, classification head, comparative learning head, OCR head) is used to perform multi-stage joint training to obtain a general defect detection model for surface mount defect detection.

[0053] Among them, the classification head is composed of multiple fully connected layers, and the ReLU activation function is used between the fully connected layers. Finally, the softmax activation function is used to output the output space of the number of classes to obtain the prediction result; the target detection head structure is designed with reference to the Faster R-CNN network structure; the instance segmentation head structure is designed with reference to the Mask R-CNN network structure. The basic structure of Mask R-CNN is basically the same as that of Faster R-CNN, except that ROI Pooling is replaced by ROI Align, and a fully connected layer is added for the segmentation task.

[0054] The main requirements of SMT-AOI defect detection are multi-label classification, target detection, contrastive learning and OCR recognition. In order to reduce the development workload and model reusability, Swin-Transformer is designed as the backbone of the model network. Swin-Transformer adopts a structure connected by sliding window and attention mechanism. The V2 version with up to 3 billion parameters solves the shortcomings of excessive feature variance and low model migration accuracy during training, and has excellent performance in tasks such as multi-label classification and target detection.

[0055] In a feasible implementation manner, the step S20 includes:

[0056] In the first stage of training the general defect detection model to be trained using the training set, the component detection head and the first type of defect detection head are involved in the training;

[0057] After the training of the first stage converges, in the second stage of training the general defect detection model to be trained using the training set, the second type defect item detection head, the third type defect item detection head and the fourth type defect item detection head are involved in the training;

[0058] After the second stage of training converges, a general defect detection model for surface mount defect detection is obtained.

[0059] The first stage is a process in which the backbone network extracts general features, the component detection head and the defect detection head participate in training, and the detection head loss participates in the model weight update process; after the first stage training converges, the central component Bbox (Bounding Box, a rectangular box used to represent the position and size of an object in the target detection task) detected by the component detection head is used to cut out the component to be tested, and the image to be tested and the template image are spliced ​​left and right as the input of the second stage task head. The classification head of the second defect item and the comparative learning head loss of the third defect item participate in the second stage model weight update process.

[0060] During the model training phase, appropriate training parameters, including learning rate, batch size, number of iterations, etc., are selected to ensure that the model can fully learn the features and patterns in the data set during the training process. Through repeated experiments and adjustments, the model performs well on the training set and avoids overfitting. In addition, by focusing on the performance of the model on the validation set and optimizing and improving the model based on the validation results, the model architecture, training parameters, or regularization techniques are adjusted to improve the generalization ability and accuracy of the model.

[0061] As mentioned above, multi-task heads can be added and expanded in the model, making the model more flexible, adaptable and extensible.

[0062] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction, and no further description will be given later. On this basis, the embodiment of the present application provides a method for detecting surface mount defects, please refer to Figure 2 , Figure 2 This is a flow chart of the second embodiment of the surface mount defect detection method of the present application.

[0063] In this embodiment, the surface mount defect detection method includes steps T10 to T20:

[0064] Step T10: obtaining the image to be inspected of the surface mount, extracting the image features of the image to be inspected and inputting the image features into the general defect detection model;

[0065] Step T20: Through the general defect detection model, the first type of defect items, non-silk-screen components and silk-screen components of the surface mount products to be inspected are detected, and / or the second type of defect items and the third type of defect items of non-silk-screen components on the surface mount products to be inspected, and / or the fourth type of defect items of silk-screen components on the surface mount products to be inspected are detected.

[0066] In this embodiment, a defect detection method based on automatic optical inspection (AOI) in surface mount (SMT) is proposed, by inputting image features extracted from the surface mount image to be inspected into a general defect detection model, and the general defect detection model respectively detects the first type of defect items, non-screen printed components and screen printed components on the surface mount product to be inspected, and / or, the second type of defect items and the third type of defect items of the non-screen printed components on the surface mount product to be inspected, and / or, the fourth type of defect items of the screen printed components on the surface mount product to be inspected.

[0067] Considering that there are many defect categories in SMT-AOI data, the characteristics of multiple defects are relatively small, the defect situation is complicated, and the supervised method cannot solve the problem of new defect detection (especially damaged parts defects that affect product performance), therefore, a customized detection solution is designed according to the characteristics of each defect.

[0068] Among them, the classification model with attention mechanism as the backbone has the ability of context understanding, can effectively capture global information, and classify various defects through multi-scale fusion capabilities. It has high classification accuracy and strong migration ability, but its ability to detect defects with a large proportion of semantic information is slightly poor.

[0069] In a feasible implementation, the general defect detection model is used to detect the first type of defect items, silk-screen printed components, and non-silk-screen printed components through target detection tasks.

[0070] Therefore, for the 12 types of defect items (missing parts, flipped parts, stacked materials, bridging, insufficient tin, tin connection, cold solder joints, impurities, tin beads, sideways, shielding shell abnormalities, and repaired parts) that need to be quantified in terms of area size, count, and semantic information, the target detection task is performed to detect the first type of defect items, silk-screen components, and components without silk-screen printing. Furthermore, through the target detection task, the bounding box of each defect can be obtained, so as to accurately locate their position in the image. Subsequently, quantitative analysis can be performed based on the size of the target box and the number of items that meet the size.

[0071] In a feasible implementation, the general defect detection model is used to detect the second type of defect items and the third type of defect items without silk-screen printed components on the surface mounted products to be inspected through classification tasks and comparative learning tasks, respectively.

[0072] The second type of defect items, bad boards, wrong parts, and empty text, are classified. For the third type of defect items (extreme reversal, offset, damaged parts, and sideways), which have less defect data and will cause poor performance, a comparative learning task is performed.

[0073] In a feasible implementation, the general defect detection model is used to detect the fourth type of defect items of silk-screen printed components on the surface mount products to be inspected through an optical character recognition task.

[0074] As for the replacement materials with silk-screen components, it is necessary to judge according to the specific silk-screen content. Therefore, it is suitable to use target detection + OCR for judgment. Through the optical character recognition task, the fourth category of defects of silk-screen components on the surface mount products to be inspected are detected.

[0075] Therefore, the general defect detection model based on classification accompanied by target detection, contrast learning and OCR can fully utilize and extract image data features to achieve efficient and accurate defect detection results. In other words, for components with silk screen printing, it is necessary to identify such components and then perform secondary OCR recognition to compare the silk screen content of the image to be inspected with the template image to determine whether it is a wrong part or a substitute material.

[0076] The above-mentioned surface mount defect detection method can solve the problem of inaccurate defect detection and low detection efficiency caused by the current defect detection model being unable to meet the multi-variety and short-cycle detection requirements of the production line. Based on the general defect detection model, accurate and efficient defect detection of production line products can be performed.

[0077] In the first application scenario of the surface mount defect detection method of the present application, refer to Figure 3 First, the image to be inspected at the point to be inspected is sent to the backbone network for feature extraction, and then two detection heads are added. The first detection head is the defect detection head, which is responsible for the target detection of 12 types of defect items that need to be quantified in terms of area size, count, and semantic information. After the defect items are detected, they directly enter the post-processing link; the second detection head is the qualified detection head, which is responsible for the detection of components (silk-screen printed components and non-silk-screen printed components). After the components are detected, the Bbox of the central component is output. The non-silk-screen printed components enter the classification module and the comparative learning module for discrimination. Among them, the silk-screen printed components enter the OCR module for discrimination of substitute materials.

[0078] It should be noted that the above examples are only used to understand the present application, and do not constitute a limitation on the training method of the general defect detection model of the present application, and / or the surface mount defect detection method. More simple transformations based on this technical concept are all within the scope of protection of the present application.

[0079] The present application also provides a surface mount defect detection device, wherein the surface mount defect detection method uses a defect detection general model trained by any of the above defect detection general model training methods, please refer to Figure 4 , the surface mount defect detection device comprises:

[0080] A preparation module 10 is used to obtain a surface mounted image to be inspected, extract image features of the image to be inspected, and input the image features into a general defect detection model;

[0081] The detection module 20 is used to detect the first type of defect items, non-silk-screen components and silk-screen components on the surface mount products to be inspected through a general defect detection model, and / or the second type of defect items and the third type of defect items without silk-screen components on the surface mount products to be inspected, and / or the fourth type of defect items of silk-screen components on the surface mount products to be inspected.

[0082] In one embodiment, the general defect detection model is used to detect the first type of defect items, silk-screen printed components, and non-silk-screen printed components through target detection tasks.

[0083] In one embodiment, the general defect detection model is used to detect the second type of defect items and the third type of defect items without silk-screen printed components on the surface mounted products to be inspected through classification tasks and comparative learning tasks.

[0084] In one embodiment, the general defect detection model is used to detect the fourth type of defect items of silk-screen printed components on the surface mount products to be inspected through an optical character recognition task.

[0085] The surface mount defect detection device provided by the present application adopts the surface mount defect detection method in the above embodiment, which can solve the technical problems of inaccurate defect detection and low detection efficiency. Compared with the prior art, the beneficial effects of the surface mount defect detection device provided by the present application are the same as the beneficial effects of the surface mount defect detection method provided by the above embodiment, and other technical features in the surface mount defect detection device are the same as the features disclosed in the above embodiment method, which will not be repeated here.

[0086] The present application provides a processing device, which includes: at least one processor; and a memory that is communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the training method of the general defect detection model in the above-mentioned embodiment, and / or the surface mount defect detection method.

[0087] Reference below Figure 5, which shows a schematic diagram of the structure of a processing device suitable for implementing an embodiment of the present application. The processing device in the embodiment of the present application may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5 The processing device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0088] like Figure 5 As shown, the processing device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the processing device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the processing device to communicate with other devices wirelessly or by wire to exchange data. Although the processing device with various systems is shown in the figure, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.

[0089] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0090] The processing equipment provided by the present application adopts the training method of the general defect detection model in the above-mentioned embodiments, and / or the surface mount defect detection method, which can solve the technical problems that the current defect detection model cannot meet the multi-variety and short-cycle detection requirements of the production line, and / or the defect detection is not accurate enough and the detection efficiency is low. Compared with the prior art, the beneficial effects of the processing equipment provided by the present application are the same as the beneficial effects of the training method of the general defect detection model provided in the above-mentioned embodiments, and / or the surface mount defect detection method, and the other technical features in the processing equipment are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0091] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0092] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0093] The present application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, the computer-readable program instructions being used to execute the training method of the general defect detection model in the above-mentioned embodiments, and / or the surface mount defect detection method.

[0094] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM: Random Access Memory), a read-only memory (ROM: Read Only Memory), an erasable programmable read-only memory (EPROM: Erasable Programmable Read Only Memory or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM: CD-Read Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency: Radio Frequency), etc., or any suitable combination of the above.

[0095] The computer-readable storage medium may be included in the processing device; or may exist independently without being assembled into the processing device.

[0096] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by the processing device, the processing device implements the training method of the general defect detection model in the above-mentioned embodiment, and / or the steps of the surface mount defect detection method.

[0097] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0098] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0099] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0100] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the training method of the above-mentioned general defect detection model, and / or the surface mount defect detection method, which can solve the technical problems that the current defect detection model cannot meet the production line's multi-variety and short-cycle detection requirements, and / or the defect detection is not accurate enough and the detection efficiency is low. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the training method of the general defect detection model provided by the above-mentioned embodiments, and / or the surface mount defect detection method, and will not be repeated here.

[0101] The present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the training method of the general defect detection model as described above, and / or the steps of the surface mount defect detection method.

[0102] The computer program product provided by the present application can solve the technical problems that the current defect detection model cannot meet the requirements of multi-variety and short-cycle detection of production lines, and / or the defect detection is not accurate enough and the detection efficiency is low. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as the beneficial effects of the training method of the general defect detection model provided in the above embodiments, and / or the method for detecting surface mount defects, which will not be elaborated here.

[0103] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.

Claims

1. A method for training a general defect detection model, characterized in that: The training method of the general defect detection model includes: Obtain defect sample images of surface mount products, and annotate the defect sample images to obtain a training set of a general defect detection model to be trained; wherein the training set includes first-category defect items, components without silk-screen printing, and components with silk-screen printing, and / or second-category defect items and third-category defect items without silk-screen printing components on surface mount products to be inspected, and / or fourth-category defect items of silk-screen printing components on surface mount products to be inspected; The defect detection general model to be trained is trained by using the training set to obtain a defect detection general model for surface mount defect detection.

2. The method for training a general defect detection model according to claim 1, characterized in that: The step of training the defect detection general model to be trained by using the training set to obtain the defect detection general model for surface mount defect detection comprises: In the first stage of training the general defect detection model to be trained using the training set, the component detection head and the first type of defect item detection head are involved in the training; After the training of the first stage converges, in the second stage of training the general defect detection model to be trained by using the training set, the second type defect item detection head, the third type defect item detection head and the fourth type defect item detection head are involved in the training; After the training of the second stage converges, a general defect detection model for surface mount defect detection is obtained.

3. A method for detecting surface mount defects, characterized in that: The surface mount defect detection method uses a defect detection general model trained by the defect detection general model training method according to any one of claims 1 to 2, and the surface mount defect detection method includes: Acquire a surface mounted image to be inspected, extract image features of the image to be inspected, and input the image features into a general defect detection model; Through the general defect detection model, the first type of defect items, non-silk-screen components and silk-screen components on the surface mount products to be inspected are detected, and / or the second type of defect items and the third type of defect items without silk-screen components on the surface mount products to be inspected, and / or the fourth type of defect items of silk-screen components on the surface mount products to be inspected are detected.

4. The method for detecting surface mount defects according to claim 3, characterized in that: The general defect detection model is used to detect the first type of defect items, silk-screen components and non-silk-screen components through target detection tasks.

5. The method for detecting surface mount defects according to claim 3, characterized in that: The general defect detection model is used to detect the second type of defect items and the third type of defect items without silk-screen printed components on the surface mounted products to be inspected through classification tasks and comparative learning tasks.

6. The method for detecting surface mount defects according to claim 3, characterized in that: The general defect detection model is used to detect the fourth type of defect items of silk-screen printed components on surface mounted products to be inspected through optical character recognition tasks.

7. A surface mount defect detection device, characterized in that: The surface mount defect detection method uses a defect detection general model trained by the defect detection general model training method according to any one of claims 1 to 2, and the surface mount defect detection device comprises: A preparation module, used for acquiring a surface mounted image to be inspected, extracting image features of the image to be inspected and inputting the image features into a general defect detection model; A detection module is used to detect, through the general defect detection model, first-category defect items of surface mount products to be inspected, components without silk screen printing, and silk screen printed components, and / or second-category defect items and third-category defect items of components without silk screen printing on surface mount products to be inspected, and / or fourth-category defect items of silk screen printed components on surface mount products to be inspected.

8. A processing device, characterized in that: The device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the method for training a general defect detection model as described in any one of claims 1 to 2, and / or the steps of the method for detecting surface mount defects as described in any one of claims 3 to 6.

9. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by the processor, the steps of the training method of the general defect detection model as described in any one of claims 1 to 2 and / or the steps of the surface mount defect detection method as described in any one of claims 3 to 6 are implemented.

10. A computer program product, characterized in that The computer program product comprises a computer program, which, when executed by a processor, implements the steps of the method for training a general defect detection model as described in any one of claims 1 to 2, and / or the steps of the method for detecting surface mount defects as described in any one of claims 3 to 6.

Citation Information

Cited By

  • Machine vision general detection algorithm, device and equipment

    CN119919743A