Training method and device for SMT patch detection, equipment and medium

By optimizing the SMT patch detection model through induction, meta-learning, and memory mechanisms, the problems of high data acquisition cost and poor environmental adaptability of deep learning methods in SMT patch detection are solved, and high-precision patch detection is achieved.

CN116246125BActive Publication Date: 2026-04-24深圳市识渊科技有限公司 +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
深圳市识渊科技有限公司
Filing Date
2023-01-19
Publication Date
2026-04-24

Smart Images

  • Figure CN116246125B_ABST
    Figure CN116246125B_ABST
Patent Text Reader

Abstract

The present application belongs to the technical field of image processing, and particularly relates to a training method and device for SMT patch detection, equipment and a medium, wherein the method comprises: inputting a training sample into a to-be-trained detection model, the training sample being images of multiple SMT patches; dividing the images into a first training set and a first verification set according to an induction mechanism; optimizing the first training set based on a meta-learning mechanism to obtain a second training set; and optimizing the first verification set based on the meta-learning mechanism to obtain a second verification set; performing feature reasoning and coding based on an inference mechanism in combination with the second training set and the second verification set to obtain coded features; and training the to-be-trained detection model based on a memory mechanism in combination with the coded features to obtain a detection model. The present application trains the to-be-trained detection model based on the induction, inference and memory mechanisms, so that the model is applicable to the detection of any SMT patch, and the optimization of the SMT patch detection technology is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and in particular to a training method, apparatus, device, and medium for SMT patch detection. Background Technology

[0002] In SMT (Surface Mount Technology) scenarios, it is often necessary to detect surface mount components. This detection is mostly performed using pre-trained detection models. Techniques for training these models include traditional handcrafted feature methods such as SIFT (Scale-invariant feature transform) and HOG (Histogram of Oriented Gradient), as well as deep learning-based methods. Recently, with the widespread application of deep learning, it has also been used to train detection models. However, deep learning methods often encounter the following challenges when training detection models in SMT scenarios: Not only does it require collecting and labeling large amounts of PCB and SMT data, resulting in significant manpower and time costs; Furthermore, due to the distribution of training data, deep learning detection models often overfit to a particular type of data predominantly distributed in the training set, such as data from a specific camera or lighting source, or data from a specific PCB product. This leads to a significant performance drop when facing new products or changes in lighting conditions; Additionally, deep learning models can forget information during training, causing a decrease in accuracy when detecting older products.

[0003] Therefore, optimizing the detection technology for SMT components is a problem that needs to be solved. Summary of the Invention

[0004] This invention provides a training method, apparatus, device, and medium for SMT chip inspection, aiming to optimize SMT chip inspection technology.

[0005] To achieve the aforementioned objectives, the first aspect of this invention proposes a training method for SMT patch detection, the method comprising:

[0006] The training samples are input into the detection model to be trained, and the training samples are multiple images of SMT patches;

[0007] The images are divided into a first training set and a first validation set based on an inductive mechanism;

[0008] The first training set is optimized based on the meta-learning mechanism to obtain the second training set; and the first verification set is optimized based on the meta-learning mechanism to obtain the second verification set.

[0009] Based on the reasoning mechanism, feature reasoning and encoding are performed using the second training set and the second verification set to obtain encoded features;

[0010] The detection model is trained based on the memory mechanism and the encoded features to obtain the detection model.

[0011] Furthermore, before inputting the training samples into the detection model to be trained, wherein the training samples are images of multiple SMT patches, the process further includes:

[0012] Images of SMT components on a PCB board are captured by a camera under different environments, and the images are stored in a pre-set database in a unified format.

[0013] Furthermore, the process of dividing the images into a first training set and a first validation set based on an inductive mechanism includes:

[0014] The images are classified according to the classification rules to obtain a first image set and a second image set;

[0015] The first image set is generalized based on an inductive mechanism to obtain the first training set;

[0016] The second image set is inductively summarized based on the inductive mechanism to obtain the first verification set.

[0017] Further, the optimization of the first training set based on the meta-learning mechanism to obtain the second training set; and the optimization of the first verification set based on the meta-learning mechanism to obtain the second verification set, includes:

[0018] The first training set is internally updated based on the meta-learning mechanism to obtain the second training set; and the first verification set is externally updated based on the meta-learning mechanism to obtain the second verification set.

[0019] Furthermore, the feature inference and feature encoding based on the inference mechanism, combining the second training set and the second verification set, yields encoded features, including:

[0020] Feature data extraction is performed on the second training set to obtain the first feature;

[0021] Feature data extraction is performed on the second verification set to obtain the second feature;

[0022] The first feature and the second feature are mapped together into the same space, and feature reasoning is performed based on the reasoning mechanism to obtain the third feature;

[0023] The third feature is encoded to obtain the encoded feature.

[0024] Furthermore, the step of training the detection model based on the memory mechanism and the encoded features to obtain the detection model includes:

[0025] The encoded features are input into the Transformer network;

[0026] The encoded features are classified according to the prior knowledge in the Transformer network to obtain a first classification and a second classification;

[0027] The first category is frozen based on a memory mechanism, and the second category is adjusted according to the target detection weights corresponding to the first category to obtain posterior knowledge.

[0028] A detection model is generated based on the prior knowledge and the posterior knowledge.

[0029] This application also provides a training device for SMT patch detection, characterized in that the device comprises:

[0030] The input module is used to input training samples into the detection model to be trained, wherein the training samples are images of multiple SMT patches;

[0031] An induction module is used to divide the images into a first training set and a first verification set based on an induction mechanism;

[0032] An optimization module is used to optimize the first training set based on a meta-learning mechanism to obtain a second training set; and to optimize the first verification set based on a meta-learning mechanism to obtain a second verification set.

[0033] The inference module is used to perform feature inference and encoding based on the inference mechanism, combining the second training set and the second verification set, to obtain encoded features.

[0034] The acquisition module is used to train the detection model to be trained based on the memory mechanism and the encoded features to obtain the detection model.

[0035] Furthermore, the reasoning module includes

[0036] The first extraction unit is used to extract feature data from the second training set to obtain the first feature;

[0037] The second extraction unit is used to extract feature data from the second verification set to obtain the second feature;

[0038] The mapping unit is used to map the first feature and the second feature together into the same space, and to perform feature reasoning based on the reasoning mechanism to obtain the third feature;

[0039] The encoding unit is used to encode the third feature to obtain the encoded feature.

[0040] This application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, characterized in that the processor executes the computer program to implement the steps of the training method for SMT patch detection described in any of the above claims.

[0041] This application also provides a computer-readable storage medium storing a computer program thereon, characterized in that, when the computer program is executed by a processor, it implements the steps of the training method for SMT patch detection described in any of the above claims.

[0042] Beneficial effects: In this application, multiple SMT patch images are input into the detection model to be trained. Based on an inductive mechanism, the images are divided into a first training set and a first validation set. The first training set is optimized based on a meta-learning mechanism to obtain a second training set; and the first validation set is optimized based on a meta-learning mechanism to obtain a second validation set. Meta-learning optimizes the effect of multiple components clustered on the same panel in the image. Based on an inference mechanism, feature inference and encoding are performed using the second training set and the second validation set to obtain encoded features. Based on a memory mechanism, the detection model to be trained is trained using the encoded features, so that when the model learns new features, it avoids forgetting the performance of detecting old features, thereby obtaining a detection model applicable to any SMT patch, thus optimizing the SMT patch detection technology. Attached Figure Description

[0043] Figure 1 This is a schematic flowchart of an embodiment of the training method for SMT chip detection in this application;

[0044] Figure 2 This is a schematic flowchart of another embodiment of the training method for SMT patch detection in this application;

[0045] Figure 3 This is a schematic flowchart of another embodiment of the training method for SMT patch detection in this application;

[0046] Figure 4 This is a schematic flowchart of another embodiment of the training method for SMT patch detection in this application;

[0047] Figure 5 This is a schematic diagram of an embodiment of the training device for SMT patch detection in this application;

[0048] Figure 6 This is a schematic block diagram of an embodiment of the computer device of this application.

[0049] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0050] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0051] Those skilled in the art will understand that, unless specifically stated otherwise, the singular forms “a,” “an,” “the,” and “the” used herein may also include the plural forms. It should be further understood that the term “comprising” as used in this specification means the presence of features, integers, steps, operations, elements, modules, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, modules, components, and / or groups thereof. It should be understood that when we say an element is “connected” or “coupled” to another element, it can be directly connected or coupled to the other element, or there may be intermediate elements. Furthermore, “connected” or “coupled” as used herein can include wireless connections or wireless coupling. The term “and / or” as used herein includes all or any modules and all combinations of one or more associated listed items.

[0052] It will be understood by those skilled in the art that, unless otherwise defined, all terms used herein (including technical and scientific terms) have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. It should also be understood that terms such as those defined in general dictionaries should be understood to have the same meaning as in the context of the prior art, and should not be interpreted in an idealized or overly formal sense unless specifically defined as herein.

[0053] Reference Figure 1 This invention provides a training method for SMT patch detection, comprising the following steps S1-S5:

[0054] S1: Input the training samples into the detection model to be trained. The training samples are images of multiple SMT patches.

[0055] Training samples are input into the detection model to be trained. These training samples consist of multiple images of SMT (Surface Mount Technology) components. The images are obtained by capturing images of SMT components on a PCB board under different environments using a camera, and then storing these images in a pre-defined database in a uniform format. Inputting these training samples into the detection model provides a valid basis for subsequent model training.

[0056] S2: Based on the inductive mechanism, the images are divided into a first training set and a first verification set.

[0057] After inputting the training samples into the detection model to be trained, the images are divided into a first training set and a first validation set based on an inductive mechanism. Specifically, the images are first classified according to classification rules to obtain a first image set and a second image set. Then, the first image set is inductively summarized based on the inductive mechanism to obtain the first training set; and the second image set is inductively summarized based on the inductive mechanism to obtain the first validation set. Dividing the images into the first training set and the first validation set based on the inductive mechanism provides a valid basis for subsequent meta-learning training.

[0058] S3: Optimize the first training set based on the meta-learning mechanism to obtain the second training set; and optimize the first verification set based on the meta-learning mechanism to obtain the second verification set.

[0059] After dividing the images into a first training set and a first validation set based on an inductive mechanism, the first training set is optimized using a meta-learning mechanism, allowing its internal structure to be updated to obtain a second training set. Similarly, the first validation set is optimized using the meta-learning mechanism, allowing its external structure to be updated to obtain a second validation set. This meta-learning training process optimizes the effect of multiple components being aggregated onto the same panel in the image, providing a valid basis for subsequently obtaining a detection model with high detection accuracy.

[0060] S4: Based on the reasoning mechanism, combine the second training set and the second verification set to perform feature reasoning and encoding to obtain encoded features.

[0061] Based on a meta-learning mechanism, the first training set is optimized to obtain a second training set; and the first validation set is optimized to obtain a second validation set. Then, based on an inference mechanism, feature inference and encoding are performed on the second training set and the second validation set to obtain encoded features. Specifically, feature data is extracted from the second training set to obtain a first feature; and feature data is extracted from the second validation set to obtain a second feature; the first feature and the second feature are mapped together into the same space, and feature inference is performed based on the inference mechanism to obtain a third feature; the third feature is encoded to obtain encoded features, thus providing a valid basis for subsequently inputting features into the Transformer network.

[0062] S5: The detection model to be trained is trained based on the memory mechanism and the encoded features to obtain the detection model.

[0063] Based on the inference mechanism, feature inference and encoding are performed using the second training set and the second validation set to obtain encoded features. Then, based on the memory mechanism, the detection model to be trained is trained using these encoded features to obtain the detection model. Specifically, the encoded features are input into a Transformer network, and the encoded features are classified according to the prior knowledge in the Transformer network to obtain a first category and a second category. The prior knowledge consists of target detection weights and the performance of identifying and classifying old SMT patch products (old features) obtained by pre-training based on the detection requirements of old SMT patch products. The first category is frozen based on the memory mechanism, and the second category is adjusted using the target detection weights corresponding to the first category to obtain posterior knowledge. The posterior knowledge consists of target detection weights and the performance of identifying and classifying new SMT patch products (new features) obtained by training. A detection model is generated based on the prior knowledge and the posterior knowledge. This detection model is applicable to the detection of any SMT patch and exhibits strong adaptability even under extreme environmental changes (lighting changes, angle changes, etc.).

[0064] This embodiment provides a training method for SMT patch detection. Multiple SMT patch images are input into the detection model to be trained. Based on an inductive mechanism, the images are divided into a first training set and a first validation set. The first training set is optimized using a meta-learning mechanism to obtain a second training set. Similarly, the first validation set is optimized using the same meta-learning mechanism to obtain a second validation set. Meta-learning optimizes the effect of multiple components clustered on the same panel in the image. Based on an inference mechanism, feature inference and encoding are performed using the second training set and the second validation set to obtain encoded features. Based on a memory mechanism, the detection model is trained using the encoded features, ensuring that the model avoids forgetting the performance of detecting old features when learning new features. This results in a detection model applicable to any SMT patch, thus optimizing the SMT patch detection technology.

[0065] In one embodiment, before inputting the training samples into the detection model to be trained, wherein the training samples are images of multiple SMT patches, the method further includes:

[0066] Images of SMT components on a PCB board are captured by a camera under different environments, and the images are stored in a pre-set database in a unified format.

[0067] As mentioned above, PCB (Printed Circuit Board), also known as a printed circuit board, is an important electronic component. It serves as the support for electronic components and the carrier for their electrical interconnection. Because it is manufactured using electronic printing techniques, it is called a "printed" circuit board. SMT is an abbreviation for Surface Mount Technology, the most popular technology and process in the electronics assembly industry. Surface mount technology for electronic circuits is also called surface mounting or surface mount technology. It is a circuit assembly technology that mounts leadless or short-lead surface mount components (SMC / SMD, also known as chip components) onto the surface of a printed circuit board (PCB) or other substrates, and then assembles them by reflow soldering or dip soldering. Multiple images of SMT components are captured by a camera from different angles, positions, and backgrounds. These images include both new and old SMT component images. The captured images are stored in a pre-set database in a uniform format, meaning the images are the same size and orientation. Storing images in a uniform format helps avoid visual illusions caused by different image sizes during image viewing and comparison, thus preventing interference with image analysis.

[0068] Reference Figure 2 In one embodiment, the above-described method of dividing the images into a first training set and a first validation set based on an inductive mechanism includes:

[0069] S21: Classify the images according to the classification rules to obtain a first image set and a second image set.

[0070] The classification rules are used to classify images to obtain classification rules for two image sets: one for training and one for validation. The classification rules specifically include a first filtering rule and a second filtering rule. The first filtering rule is used to filter out training images, and the second filtering rule is used to filter out validation images. The first image set is the training image set, and the second image set is the validation image set.

[0071] S22: Based on the inductive mechanism, the first image set is inductively summarized to obtain the first training set.

[0072] Inductive reasoning refers to the thinking method of generalizing general concepts, principles, or conclusions from many individual things.

[0073] S23: Based on the inductive mechanism, the second image set is inductively summarized to obtain the first verification set.

[0074] As mentioned above, the detection of surface-mount components (SMDs) on a PCB board is essentially the process of various types of SMDs appearing at different angles and positions on backgrounds of different colors. Summarizing this fundamental element, the training samples can be modified for a meta-learning task by classifying the images into a Support Set and a Query Set. The Support Set can be further divided into the component itself, its orientation, and the template. Different tasks contain single components of different categories distributed on templates of different colors according to different orientations. The Query Set can be organized into a jigsaw puzzle of multiple components, serving as the target for optimization in the meta-learning task. This process mimics the inductive process of the human brain. The image classification process involves classifying the images according to classification rules. Specifically, a first image for training is selected based on a first filtering rule, and this first image is recorded to obtain a first image set. A second image for verification is selected based on a second filtering rule, and this second image is recorded to obtain a second image set. The characteristics of the images in the first image set are summarized and generalized using an inductive mechanism to obtain a first training set. The first training set contains training images for multiple different training tasks, where a single type of component is distributed in different directions on templates of different colors. The characteristics of the images in the second image set are summarized and generalized using an inductive mechanism to obtain a first verification set. The first verification set contains verification images for multiple different verification tasks, where the verification tasks correspond to the training tasks. The verification images are jigsaw puzzles composed of various components.

[0075] In one embodiment, the optimization of the first training set based on the meta-learning mechanism to obtain a second training set; and the optimization of the first verification set based on the meta-learning mechanism to obtain a second verification set, include:

[0076] The first training set is internally updated based on the meta-learning mechanism to obtain the second training set; and the first verification set is externally updated based on the meta-learning mechanism to obtain the second verification set.

[0077] As mentioned above, meta-learning, also known as "learning to learn," utilizes past knowledge and experience to guide the learning of new tasks, enabling the network to learn by doing. It is one of the commonly used methods to solve the few-shot learning problem. Optimizing the first training set and the first validation set based on the meta-learning mechanism includes: using the first training set as meta-training, which contains multiple training tasks; using the first validation set as meta-testing, which contains multiple validation tasks corresponding to the meta-training; training the meta-training with random parameters, which are set by technicians according to actual needs and can be any parameters; applying the training parameters obtained from the meta-training to the meta-testing, validating the training parameters through the meta-testing, and recording the training parameters if the test results meet the training expectations. This iterative training process continues until the training task is completed, resulting in an internally updated second training set and an externally updated second validation set. The training process based on meta-learning optimizes the effect of multiple components in an image being aggregated on the same panel, which helps to enhance the generalization ability of the model and provides a valid basis for obtaining a model with high detection accuracy in the future.

[0078] Reference Figure 3 In one embodiment, the above-mentioned feature inference and feature encoding based on the inference mechanism, combining the second training set and the second verification set, yields encoded features, including:

[0079] S41: Extract feature data from the second training set to obtain the first feature.

[0080] Feature data extraction is performed on the second training set to obtain the features of the images in the second training set, namely the first feature.

[0081] S42: Extract feature data from the second verification set to obtain the second feature.

[0082] Feature data extraction is performed on the second verification set to obtain the features of the images in the second verification set, namely the second features.

[0083] S43: Map the first feature and the second feature together into the same space, and perform feature reasoning based on the reasoning mechanism to obtain the third feature.

[0084] The reasoning mechanism is the process of deriving a new judgment (conclusion) from one or more known judgments (premises). The first feature and the second feature are mapped together into the same space, and the first feature and the second feature are permuted and combined based on the reasoning mechanism and spatial weights to obtain a permutation and combination result that can satisfy the input of the transformer network. The permutation and combination result is denoted as the third feature.

[0085] S44: Encode the third feature to obtain the encoded feature.

[0086] As described above, feature data is extracted from the second training set to obtain the features of the images in the second training set, i.e., the first features; feature data is extracted from the second validation set to obtain the features of the images in the second validation set, i.e., the second features; the first features and the second features are mapped together into the same space, and based on the inference mechanism and spatial weights, the first features and the second features are permuted and combined to obtain a permutation and combination result that satisfies the input of the transformer network, and the permutation and combination result is recorded as the third feature; the third feature is encoded so that the third feature is converted into a feature that conforms to the input form of the transformer network, i.e., the encoded feature. Based on the inference mechanism, feature inference and feature encoding are performed using the second training set and the second validation set to obtain the encoded feature, which provides a valid basis for subsequently inputting features into the Transformer network.

[0087] Reference Figure 4 In one embodiment, the above-mentioned training of the detection model based on the memory mechanism combined with the encoded features to obtain the detection model includes:

[0088] S51: Input the encoded features into the Transformer network.

[0089] The Transformer network is a novel neural network architecture based on a self-attention mechanism. It excels at handling language understanding tasks, requires less computing power, and thus increases training speed by an order of magnitude.

[0090] 52: Classify the encoded features based on the prior knowledge in the Transformer network to obtain a first classification and a second classification.

[0091] The prior knowledge is obtained by training the Transformer network in advance based on the detection requirements of old SMT chip products. The prior knowledge includes the target detection weights when detecting old SMT chip products and the performance of identifying and classifying old SMT chip products.

[0092] S53: Freeze the first category based on the memory mechanism, and adjust the second category with the target detection weight corresponding to the first category to obtain posterior knowledge.

[0093] The memory mechanism refers to the process of storing and retrieving acquired information. Posterior knowledge, derived from training on new SMT (Surface Mount Technology) products, includes target detection weights and performance in identifying and classifying these products.

[0094] S54: Generate a detection model based on the prior knowledge and the posterior knowledge.

[0095] As described above, the encoded features are input into a Transformer network. Based on the performance of the Transformer network in identifying and classifying old SMT surface mount products, the encoded features are classified to obtain a first category dominated by old SMT surface mount products and a second category dominated by new SMT surface mount products. The first category is frozen based on a memory mechanism; that is, the target detection weights of old SMT surface mount products are used as adjustment benchmarks, and the second category is adjusted according to the target detection weights corresponding to the first category to obtain posterior knowledge. That is, the knowledge obtained when detecting old SMT surface mount products... The target detection weights are adjusted for new SMT chip products, ensuring that the model maintains performance in detecting older SMT chip products while maintaining accuracy in detecting new ones, thus achieving high-confidence detection results. A detection model is generated based on the prior and posterior knowledge, applicable to the detection of any SMT chip. Even with significant environmental changes (lighting variations, angle variations, etc.), it exhibits strong adaptability, resulting in high accuracy and optimizing SMT chip detection technology.

[0096] Reference Figure 5 This invention also provides a training device for SMT patch detection, comprising:

[0097] Input module 10 is used to input training samples into the detection model to be trained, wherein the training samples are images of multiple SMT patches;

[0098] Induction module 20 is used to divide the images into a first training set and a first verification set according to an induction mechanism;

[0099] The optimization module 30 is used to optimize the first training set based on the meta-learning mechanism to obtain the second training set; and to optimize the first verification set based on the meta-learning mechanism to obtain the second verification set.

[0100] Inference module 40 is used to perform feature inference and encoding based on the inference mechanism, combining the second training set and the second verification set, to obtain encoded features;

[0101] The acquisition module 50 is used to train the detection model to be trained based on the memory mechanism and the encoded features to obtain the detection model.

[0102] As described above, the training device for SMT patch detection can implement the training method for SMT patch detection.

[0103] In one embodiment, the input module 10 further includes:

[0104] The acquisition unit is used to acquire images of SMT components on a PCB board under different environments using a camera, and store the images in a pre-set database in a unified format.

[0105] In one embodiment, the summarizing module 20 further includes:

[0106] The first classification unit is used to classify the images according to classification rules to obtain a first image set and a second image set;

[0107] The first induction unit is used to inductively summarize the first image set based on the induction mechanism to obtain the first training set;

[0108] The second induction unit is used to inductively summarize the second image set based on the induction mechanism to obtain the first verification set.

[0109] In one embodiment, the optimization module 30 further includes:

[0110] The optimization unit is used to internally update the first training set based on the meta-learning mechanism to obtain the second training set; and to externally update the first verification set based on the meta-learning mechanism to obtain the second verification set.

[0111] In one embodiment, the inference module 40 further includes:

[0112] The first extraction unit is used to extract feature data from the second training set to obtain the first feature;

[0113] The second extraction unit is used to extract feature data from the second verification set to obtain the second feature;

[0114] The mapping unit is used to map the first feature and the second feature together into the same space, and to perform feature reasoning based on the reasoning mechanism to obtain the third feature;

[0115] The encoding unit is used to encode the third feature to obtain the encoded feature.

[0116] In one embodiment, the acquisition module 50 further includes;

[0117] Input unit, used to input the encoded features into the Transformer network;

[0118] The second classification unit is used to classify the encoded features based on prior knowledge in the Transformer network to obtain a first classification and a second classification.

[0119] The training unit is used to freeze the first category based on a memory mechanism and adjust the second category with the target detection weights corresponding to the first category to obtain posterior knowledge.

[0120] A generation unit is used to generate a detection model based on the prior knowledge and the posterior knowledge.

[0121] Reference Figure 6 The present invention also provides a computer device, the internal structure of which can be as follows: Figure 6 As shown, the computer device includes a processor, memory, network interface, and database connected via a system bus. The processor is designed to provide computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores operating devices, computer programs, and the database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores relevant data such as training methods for SMT patch detection. The network interface is used for communication with external terminals via a network connection. Furthermore, the computer device may also include input devices and a display screen. The above-mentioned computer program, when executed by a processor, implements a training method for SMT patch detection, comprising the following steps: inputting training samples into the detection model to be trained, wherein the training samples are multiple images of SMT patches; dividing the images into a first training set and a first validation set according to an inductive mechanism; optimizing the first training set based on a meta-learning mechanism to obtain a second training set; optimizing the first validation set based on a meta-learning mechanism to obtain a second validation set; performing feature inference and encoding based on an inference mechanism combining the second training set and the second validation set to obtain encoded features; and training the detection model to be trained based on a memory mechanism combined with the encoded features to obtain a detection model. Those skilled in the art will understand that... Figure 6 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer equipment on which the present application is applied.

[0122] One embodiment of this application also provides a computer-readable storage medium storing a computer program thereon. When the computer program is executed by a processor, it implements a training method for SMT patch detection, comprising the following steps: inputting training samples into a detection model to be trained, wherein the training samples are multiple images of SMT patches; dividing the images into a first training set and a first validation set according to an inductive mechanism; optimizing the first training set based on a meta-learning mechanism to obtain a second training set; optimizing the first validation set based on a meta-learning mechanism to obtain a second validation set; performing feature inference and encoding based on an inference mechanism combining the second training set and the second validation set to obtain encoded features; and training the detection model to be trained based on a memory mechanism combined with the encoded features to obtain a detection model. It is understood that the computer-readable storage medium in this embodiment can be a volatile readable storage medium or a non-volatile readable storage medium.

[0123] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media provided in this application and in the embodiments may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual-speed SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0124] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, apparatus, article, or method. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, apparatus, article, or method that includes that element.

[0125] The above description is merely a preferred embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent structural or procedural transformations made based on the content of the present invention's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of the present invention.

Claims

1. A training method for SMT patch detection, characterized in that, The method includes: The training samples are input into the detection model to be trained, and the training samples are multiple images of SMT patches; The images are divided into a first training set and a first validation set based on an inductive mechanism; The first training set is optimized based on the meta-learning mechanism to obtain the second training set; and the first verification set is optimized based on the meta-learning mechanism to obtain the second verification set. Based on the reasoning mechanism, feature reasoning and encoding are performed using the second training set and the second verification set to obtain encoded features; The encoded features are input into the Transformer network; The encoded features are classified according to the prior knowledge in the Transformer network to obtain a first classification and a second classification. The prior knowledge includes the target detection weight when detecting old SMT patch products and the performance of identifying and classifying old SMT patch products. The first category is frozen based on the memory mechanism, and the second category is adjusted with the target detection weight corresponding to the first category to obtain posterior knowledge. The posterior knowledge is obtained based on training on the new SMT patch product, including the target detection weight when detecting the new SMT patch product and the performance of identifying and classifying the new SMT patch product. A detection model is generated based on the prior knowledge and the posterior knowledge.

2. The training method for SMT patch detection according to claim 1, characterized in that, Before inputting the training samples into the detection model to be trained, wherein the training samples are images of multiple SMT patches, the method further includes: Images of SMT components on a PCB board are captured by a camera under different environments, and the images are stored in a pre-set database in a unified format.

3. The training method for SMT patch detection according to claim 1, characterized in that, The inductive mechanism divides the images into a first training set and a first validation set, including: The images are classified according to the classification rules to obtain a first image set and a second image set; The first image set is generalized based on an inductive mechanism to obtain the first training set; The second image set is inductively summarized based on the inductive mechanism to obtain the first verification set.

4. The training method for SMT patch detection according to claim 1, characterized in that, The first training set is optimized based on the meta-learning mechanism to obtain the second training set; And based on the meta-learning mechanism, the first verification set is optimized to obtain a second verification set, including: The first training set is internally updated based on the meta-learning mechanism to obtain the second training set; And based on the meta-learning mechanism, the first verification set is externally updated to obtain the second verification set.

5. The training method for SMT patch detection according to claim 1, characterized in that, The feature inference and feature encoding based on the inference mechanism, combining the second training set and the second verification set, yields encoded features, including: Feature data extraction is performed on the second training set to obtain the first feature; Feature data extraction is performed on the second verification set to obtain the second feature; The first feature and the second feature are mapped together into the same space, and feature reasoning is performed based on the reasoning mechanism to obtain the third feature; The third feature is encoded to obtain the encoded feature.

6. A training device for SMT patch inspection, characterized in that, The apparatus for implementing the method according to any one of claims 1-5, the apparatus comprising: The input module is used to input training samples into the detection model to be trained, wherein the training samples are images of multiple SMT patches; An induction module is used to divide the images into a first training set and a first verification set based on an induction mechanism; An optimization module is used to optimize the first training set based on a meta-learning mechanism to obtain a second training set; and to optimize the first verification set based on a meta-learning mechanism to obtain a second verification set. The inference module is used to perform feature inference and encoding based on the inference mechanism, combining the second training set and the second verification set, to obtain encoded features. The acquisition module is used to train the detection model to be trained based on the memory mechanism and the encoded features to obtain the detection model.

7. The training apparatus for SMT patch inspection according to claim 6, characterized in that, The reasoning module includes The first extraction unit is used to extract feature data from the second training set to obtain the first feature; The second extraction unit is used to extract feature data from the second verification set to obtain the second feature; The mapping unit is used to map the first feature and the second feature together into the same space, and to perform feature reasoning based on the reasoning mechanism to obtain the third feature; The encoding unit is used to encode the third feature to obtain the encoded feature.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the training method for SMT patch detection as described in any one of claims 1 to 5.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the training method for SMT patch detection as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Multi-patch component detection method

    CN112733924A

  • SMT production line chip mounter fault prediction method based on improved YOLOX and PNN

    CN115082401A