Industrial defect detection method based on abnormal prompt learning and storage medium
Through the exception prompt learning method, CLIP network and semantic connection are used to achieve high-precision abnormality detection in industrial defect detection, solving the problem of requiring a large number of abnormal samples in traditional methods.
Patent Information
- Application Number
- CN202411782293.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-05
- Publication Date
- 2025-03-28
AI Technical Summary
Existing industrial defect detection methods require a large number of abnormal samples, making it difficult to achieve high-precision defect detection in the absence of sufficient abnormal samples.
Through the method based on exception prompt learning, the global and local features of normal PCB images are extracted using the CLIP network, and abnormal prompts are designed in combination with semantic connections, and prompt learning is performed through explicit exception boundaries to obtain accurate defect exception prompts.
With only a small amount of normal samples and description text provided, high-precision abnormality detection of PCB surface mount defects is achieved, overcoming the limitation of the need for a large number of abnormal samples in traditional methods.
Smart Images

Figure CN119722611A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of deep learning technology, and in particular to an industrial defect detection method and storage medium for abnormal prompt learning. Background Art
[0002] With the continuous development of computer and electronic technology, various electronic products emerge in an endless stream. Whether it is the newly launched Shenzhou XII manned spacecraft or personal mobile phones, headphones and other electronic devices, they are inseparable from an important component, namely the Printed Circuit Board (PCB). The growing development of electronic products has led to an increasing demand for PCBs in society. The emergence of surface mounting technology has replaced manual work and greatly improved production efficiency, but errors cannot be completely avoided, which will lead to various defects and abnormalities in PCBs.
[0003] Printed circuit board (PCB) defect detection has become a difficult problem that needs to be solved urgently in enterprise production. The initial manual detection efficiency was very low and the robustness was poor, which could not meet the needs of low cost and high precision. So people began to seek automatic detection methods and use deep learning technology to perform defect detection on images of industrial PCBs. General defect detection networks usually require a large number of abnormal samples to achieve good detection accuracy. However, it is difficult to obtain enough defect abnormal samples in actual production scenarios. On the contrary, many PCB normal samples and prompt texts related to normal samples can be obtained. Therefore, it is necessary to invent a method that can perform surface mount defect abnormality detection in PCB (Surface Mount Technology, SMT) using only normal samples and prompt texts. Summary of the invention
[0004] The present invention provides an industrial defect detection method and storage medium based on abnormal prompt learning, which can solve the problem that the existing method requires a large number of abnormal samples. On the premise of providing a small number of normal samples and description texts of normal samples, accurate abnormal prompts can be obtained, thereby realizing abnormality detection according to the abnormal prompt features. This method is called SMT-AD in the present invention.
[0005] To achieve the above object, the present invention provides the following technical solutions:
[0006] In the first aspect, an industrial defect detection method based on abnormal prompt learning is provided, which obtains abnormal prompts on the premise of providing a normal PCB image and a normal PCB image description text, thereby realizing abnormal detection of surface mounting defects of PCB according to the abnormal prompts, comprising the following steps:
[0007] Step S1: Using the CLIP network, extract the global features and local features of the normal PCB image;
[0008] Step S2: Based on the global features and local features of the normal PCB image, using semantic connections, design a number of abnormal prompts about surface mount defects;
[0009] Step S3: Based on the abnormal prompt, the normal PCB image is prompted and learned by using the explicit abnormal boundary to obtain a set amount of defect abnormal prompts;
[0010] Step S4: According to the defect abnormality prompt obtained in step S3, abnormal detection of surface mounting defects is performed.
[0011] As a further solution of the present invention: the step S1 specifically includes the following steps:
[0012] Step S11: Take K normal PCB images and pass them through the hth layer of the image encoder of the frozen CLIP network in turn to obtain the global features of the normal PCB images
[0013] Step S12: Pass the K normal PCB images through the hth layer of the attention network in sequence to obtain the local features X of the normal PCB images h ;
[0014] Step S13: Take the features of the normal PCB image output by each layer and store them as the visual memory B of the normal PCB image.
[0015] As a further solution of the present invention: the step S12 specifically includes the following steps:
[0016] Step S121: The hth Transformer attention layer uses the global and local sample features output by the image encoder layer and the attention layer of the h-1th layer Get Q h , K h , V h , the formula is as follows:
[0017]
[0018] Where Q h , K h , V h It indicates that the hth Transformer attention layer calculates the attention weight of the input data. QKV(.) is a linear projection layer of Transformer, which generates Q, V and K from the input features.
[0019] Step S122: Calculate the local features X of the normal PCB image according to the self-attention mechanism h , the formula is as follows:
[0020] X h =Proj(Self(V h ,V h ,V h ))+X h-1 ,
[0021] Where Proj represents the linear projection layer, which is used to remap the output of the self-attention layer back to the same feature space as the input; Self represents the operation function of the self-attention mechanism, X h-1 Represents the global and local sample features of the h-1th layer.
[0022] As a further solution of the present invention: the step S2 specifically includes the following steps:
[0023] Step S21: prepare N normal PCB prompt prefixes NP, recorded as [NP1], [NP2], ..., [NPn];
[0024] Step S22: prepare M abnormal PCB prompt suffixes AP, recorded as [AP1], [AP2], ..., [APm];
[0025] Step S23: prepare L learnable abnormal PCB prompt suffixes LAP, recorded as [LAP1], [LAP2], ..., [LAP1];
[0026] Step S24: connect N learnable normal PCB prompt prefixes with the PCB type name [PCB Type] to generate N normal PCB sample prompts, namely [NP1][PCB Type], [NP2][PCB Type], ..., [NPn][PCBType];
[0027] Step S25: connect the above N normal PCB sample prompts with the M manually set abnormal PCB prompt suffixes to generate a total of N×M abnormal PCB sample prompts, which are called manual defect abnormal prompts, namely [NP1][PCB Type][with][AP1], [NP1][PCB Type][with][AP2], …, [NPn][PCB Type][with][APm], where [with] is used to semantically connect the following abnormal prompt suffix [APm];
[0028] Step S26: connect the N normal PCB sample prompts with the L learnable abnormal PCB prompt suffixes to generate a total of N×L abnormal PCB sample prompts, which are called learnable abnormal prompts, namely [NP1][PCB Type][with][LAP1], [NP1][PCB Type][with][LAP2], …, [NPn][PCB Type][with][LAPl];
[0029] Step S27: According to the contrastive learning loss function, the normal PCB sample prompts, the manual defect abnormal prompts and the learnable defect abnormal prompts are trained so that the normal PCB sample prompts are close to the normal PCB image visual features, while the manual defect abnormal prompts and the learnable defect abnormal prompts are far away from the normal PCB image visual features.
[0030] As a further solution of the present invention: the step S3, based on the abnormal prompt of step S2, uses the explicit abnormal boundary to perform prompt learning on the normal PCB image to obtain a set amount of defect abnormal prompts, specifically includes the following steps:
[0031] Step S31: Use regularization loss to control the distance between normal PCB sample prompts and abnormal PCB sample prompts. The formula is as follows:
[0032]
[0033] Among them, L regu represents the loss function between the normal PCB sample prompt features and the abnormal PCB sample prompt features during training, which is used to maximize the Euclidean distance between the normal PCB sample prompt features and the abnormal PCB sample prompt features. x is the visual feature of the normal PCB image. It is a normal PCB sample prompt feature prototype, CLIP text (.) is the text encoder of the frozen CLIP, t n This is a normal PCB sample prompt. is the defect anomaly prompt feature prototype, d(.,.) is the Euclidean distance;
[0034] Step S32: Using the L2 norm square function, the distribution of the learnable defect anomaly prompt is aligned with the distribution of the manual defect anomaly prompt. The formula is as follows:
[0035]
[0036] Among them, L distri It represents the loss function between the learnable anomaly prompt and the manual anomaly prompt during training. Its mathematical meaning is the square of the Euclidean distance between the learnable anomaly prompt feature and the manual anomaly prompt feature. It is used to minimize the Euclidean distance between the learnable anomaly prompt feature and the manual anomaly prompt feature. is the feature mean of manual defect anomaly prompt, is the feature mean of the learnable defect anomaly prompt, and α is a hyperparameter;
[0037] Step S33: Combining the L regu and L distriThe two losses are jointly trained to show abnormal boundaries.
[0038] As a further solution of the present invention: the step S4 performs abnormal detection of surface mount defects according to the abnormal defect prompt obtained in step S3, specifically comprising the following steps:
[0039] Step S41: Calculate the pixel-level visual guidance score map S according to the memory B obtained in step S13 v , the formula is as follows:
[0041]
[0042] Where, b is the feature of the normal PCB image stored in step S13, F v It is the visual feature of the query PCB image;
[0043] Step S42: Prompt feature prototypes based on normal PCB samples obtained in the training phase And defect anomaly prompt feature prototype Calculate pixel-level cue-guided score map S o ∈[0,1], the formula is as follows:
[0044]
[0045] Among them, ε is a hyperparameter, x is the feature of the detected image, S o is the probability that the detected image is a normal image;
[0046] Step S43: Fusion of PCB visual features and S o , using the harmonic mean, we get the pixel-level defect anomaly score map S p ∈[0,1], the formula is as follows:
[0047]
[0048] Among them, S v is the pixel-level guided visual score, S o is the pixel-level cue guidance score, S p is the harmonic mean of the two, S p The higher the value, the closer it is to the normal PCB image. p The lower the value is, the closer it is to the abnormal PCB image, that is, there is a defect.
[0049] In a second aspect, the present invention also includes a readable storage medium storing a computer program, and when the computer program is executed by a processor, the processor executes the industrial defect detection method based on abnormal prompt learning.
[0050] Compared with the prior art, the beneficial effects of the present invention are: overcoming the problem of requiring a large number of abnormal samples in traditional methods, and being mainly used in small sample abnormality detection of surface mount defects. The present invention proposes semantic connection, transposing the prompts of normal PCB samples into defect abnormality prompts that are difficult to obtain industrially, and also proposes displaying abnormal boundaries to obtain sufficiently accurate defect abnormality prompts, and increasing the distance between defect abnormality prompt features and normal sample prompts and normal visual features, which is conducive to abnormality detection when abnormal sample images cannot be provided. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] Figure 1 It is a processing flow chart of the industrial defect detection method of the present invention. DETAILED DESCRIPTION
[0052] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0053] like Figure 1 As shown, in an embodiment of the present invention, an industrial defect detection method (SMT-AD) based on abnormal prompt learning includes step S1: using the CLIP network to extract global features and local features of a normal PCB image; step S2: using semantic connections to design a number of abnormal prompts about surface mount (SMT) defects based on normal PCB samples; step S3: using explicit abnormal boundaries to perform prompt learning to obtain sufficient defect abnormal prompts; step S4: performing surface mount (SMT) defect abnormality detection according to the defect abnormal prompts obtained in S3.
[0054] Step S1, using the CLIP network to extract the global features and local features of the normal PCB image. First, through step S11, take K normal PCB images and pass them through the hth layer of the frozen CLIP image encoder in turn to obtain the original features of the PCB sample. Then, in step S12, the K normal PCB images are sequentially passed through the hth layer of the attention network to obtain the local features of the PCB samples to X h .
[0055] Step S12 also involves steps S121 and S122. Specifically, step S121 is the hth Transformer attention layer, which uses the global and local sample features output by the image encoder layer and the attention layer of the h-1th layer. Get Q h , K h, V h , the formula is as follows:
[0056]
[0057] Where Q h , K h , V h Indicates that the hth Transformer attention layer calculates the attention weight of the input data. QKV(.) is a linear projection layer of a Transformer, which generates Q, V and K from the input features. Step S122: According to the self-attention mechanism, calculate the local feature X of the normal PCB image h , the formula is as follows:
[0058] X h =Proj(Self(V h ,V h ,V h ))+X h-1 ,
[0059] Where Proj represents the linear projection layer, which is used to remap the output of the self-attention layer back to the same feature space as the input; Self represents the operation function of the self-attention mechanism, X h-1 Represents the global and local sample features of the h-1th layer.
[0060] Finally, through step S13, the features of the normal PCB image output by each layer are taken and stored as the visual memory B of the normal PCB image.
[0061] In the present invention, step S2 specifically includes the following steps: step S21: prepare N normal PCB prompt prefixes NP, recorded as [NP1], [NP2], ..., [NPn]; step S22: prepare M abnormal PCB prompt suffixes AP, recorded as [AP1], [AP2], ..., [APm]; step S23: prepare L learnable abnormal PCB prompt suffixes LAP, recorded as [LAP1], [LAP2], ..., [LAPl]; step S24: connect the N learnable normal PCB prompt prefixes with the PCB type name [PCB Type] to generate N normal PCB sample prompts, namely [NP1][PCB Type], [NP2][PCB Type], ..., [NPn][PCB Type]; step S25: connect the above N normal PCB sample prompts with M manually set abnormal PCB prompt suffixes to generate a total of N×M abnormal PCB sample prompts, which are called manual defect abnormal prompts, namely [NP1][PCB Type][with][AP1], [NP1][PCBType][with][AP2], …, [NPn][PCB Type][with][APm], where [with] is used for semantic connection with the following abnormal prompt suffix [APm]; Step S26: Connect the above-mentioned N normal PCB sample prompts with the L learnable abnormal PCB prompt suffixes to generate a total of N×L abnormal PCB sample prompts, called learnable abnormal prompts, namely [NP1][PCB Type][with][LAP1], [NP1][PCB Type][with][LAP2], …, [NPn][PCB Type][with][LAPl]; Step S27: According to the contrastive learning loss function, train the normal PCB sample prompts, the manual defect abnormal prompts and the learnable defect abnormal prompts, so that the normal PCB sample prompts are close to the normal PCB image visual features, while the manual defect abnormal prompts and the learnable defect abnormal prompts are far away from the normal PCB image visual features.
[0062] In the present invention, step S3 is based on the abnormal prompt of step S2, and uses the explicit abnormal boundary to perform prompt learning on the normal PCB image to obtain a set amount of defect abnormal prompts, which specifically includes the following steps:
[0063] Step S31: Use regularization loss to control the distance between normal PCB sample prompts and abnormal PCB sample prompts. The formula is as follows:
[0064]
[0065] Among them, L regurepresents the loss function between the normal PCB sample prompt features and the abnormal PCB sample prompt features during training, which is used to maximize the Euclidean distance between the normal PCB sample prompt features and the abnormal PCB sample prompt features. x is the visual feature of the normal PCB image. It is a normal PCB sample prompt feature prototype, CLIP text (.) is the text encoder of the frozen CLIP, t n This is a normal PCB sample prompt. is the defect anomaly prompt feature prototype, d(.,.) is the Euclidean distance;
[0066] Step S32: Using the L2 norm square function, the distribution of the learnable defect anomaly prompt is aligned with the distribution of the manual defect anomaly prompt. The formula is as follows:
[0067]
[0068] Among them, L distri It represents the loss function between the learnable anomaly prompt and the manual anomaly prompt during training. Its mathematical meaning is the square of the Euclidean distance between the learnable anomaly prompt feature and the manual anomaly prompt feature. It is used to minimize the Euclidean distance between the learnable anomaly prompt feature and the manual anomaly prompt feature. is the feature mean of manual defect anomaly prompt, is the feature mean of the learnable defect anomaly prompt, and α is a hyperparameter;
[0069] Step S33: Combining the L regu and L distri The two losses are jointly trained to show abnormal boundaries.
[0070] In the present invention, step S4 performs abnormal detection of surface mount defects according to the abnormal defect prompt obtained in step S3, and specifically includes the following steps:
[0071] Step S41: Calculate the pixel-level visual guidance score map S according to the memory B obtained in step S13 v , the formula is as follows:
[0072]
[0073] Where, b is the feature of the normal PCB image stored in step S13, F v It is the visual feature of the query PCB image;
[0074] Step S42: Prompt feature prototypes based on normal PCB samples obtained in the training phase And defect anomaly prompt feature prototype Calculate pixel-level cue-guided score map S o∈[0,1], the formula is as follows:
[0075]
[0076] Among them, ε is a hyperparameter, x is the feature of the detected image, S o is the probability that the detected image is a normal image;
[0077] Step S43: Fusion of PCB visual features and S o , using the harmonic mean, we get the pixel-level defect anomaly score map S p ∈[0,1], the formula is as follows:
[0078]
[0079] Among them, S v is the pixel-level guided visual score, S o is the pixel-level cue guidance score, S p is the harmonic mean of the two. Compared with the arithmetic mean, the harmonic mean can better highlight the impact of the lower score of the two. p The higher the value, the closer it is to the normal PCB image. p The lower the value is, the closer it is to the abnormal PCB image, that is, there is a defect.
[0080] In this embodiment of the present invention, some PCB images generated on a factory production line are made into a data set, which are divided into a training set and a test set in a ratio of 8:2. The training set only contains normal PCB samples, and the test set contains normal samples and defective abnormal samples. AUROC (Area Under the Receiver Operating Characteristic Curve) is used as an evaluation indicator. The experimental results are shown in the following table, where K represents the number of normal samples available for learning in few-sample learning.
[0081]
[0082] It can be seen from the above table that the SMT-AD method of the present invention can maintain the highest defect location accuracy in all cases when facing the problem of small sample anomaly detection compared with other anomaly detection networks. This shows that the present invention is a relatively accurate small sample anomaly detection network suitable for industrial quality inspection.
[0083] In addition, the present invention also discloses a readable storage medium storing a computer program. When the computer program is executed by a processor, the processor executes the industrial defect detection method SMT-AD based on abnormal prompt learning of the present invention.
[0084] It will be apparent to those skilled in the art that the invention is not limited to the details of the exemplary embodiments described above and that the invention can be implemented in other specific forms without departing from the spirit or essential features of the invention. Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description, and it is intended that all variations falling within the meaning and scope of the equivalent elements of the claims be included in the invention. Any reference numeral in a claim should not be considered as limiting the claim to which it relates.
[0085] In addition, it should be understood that although the present specification is described according to implementation modes, not every implementation mode contains only one independent technical solution. This description of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each embodiment may also be appropriately combined to form other implementation modes that can be understood by those skilled in the art.
Claims
1. An industrial defect detection method based on abnormal prompt learning, characterized in that: Under the premise of providing a normal PCB image and a normal PCB image description text, an abnormal prompt is obtained, so as to realize abnormal detection of surface mounting defects of the PCB according to the abnormal prompt, including the following steps: Step S1: Using the CLIP network, extract the global features and local features of the normal PCB image; Step S2: Based on the global features and local features of the normal PCB image, using semantic connections, design a number of abnormal prompts about surface mount defects; Step S3: Based on the abnormal prompt, the normal PCB image is prompted and learned by using the explicit abnormal boundary to obtain a set amount of defect abnormal prompts; Step S4: According to the defect abnormality prompt obtained in step S3, abnormal detection of surface mounting defects is performed.
2. The industrial defect detection method based on abnormal prompt learning according to claim 1 is characterized in that: The step S1 specifically includes the following steps: Step S11: Take K normal PCB images and pass them through the hth layer of the image encoder of the frozen CLIP network in turn to obtain the global features of the normal PCB images Step S12: Pass the K normal PCB images through the hth layer of the attention network in sequence to obtain the local features X of the normal PCB images h ; Step S13: Take the features of the normal PCB image output by each layer and store them as the visual memory B of the normal PCB image.
3. The industrial defect detection method based on abnormal prompt learning according to claim 2 is characterized in that: The step S12 specifically includes the following steps: Step S121: The hth Transformer attention layer uses the global and local sample features output by the image encoder layer and the attention layer of the h-1th layer Get Q h , K h , V h , the formula is as follows: Where Q h , K h , V h It indicates that the hth Transformer attention layer calculates the attention weight of the input data. QKV(-) is a linear projection layer of Transformer, which generates Q, V and K from the input features. Step S122: Calculate the local features X of the normal PCB image according to the self-attention mechanism h , the formula is as follows: X h =Proj(Self(V h ,V h ,V h ))+X h-1 , Where Proj represents the linear projection layer, which is used to remap the output of the self-attention layer back to the same feature space as the input; Self represents the operation function of the self-attention mechanism, X h-1 Represents the global and local sample features of the h-1th layer.
4. The industrial defect detection method based on abnormal prompt learning according to claim 1 is characterized in that: The step S2 specifically includes the following steps: Step S21: prepare N normal PCB prompt prefixes NP, recorded as [NP1], [NP2], ..., [NPn]; Step S22: prepare M abnormal PCB prompt suffixes AP, recorded as [AP1], [AP2], ..., [APm]; Step S23: prepare L learnable abnormal PCB prompt suffixes LAP, recorded as [LAP1], [LAP2], ..., [LAP1]; Step S24: connect N learnable normal PCB prompt prefixes with the PCB type name [PCB Type] to generate N normal PCB sample prompts, namely [NP1][PCB Type], [NP2][PCB Type], ..., [NPn][PCBType]; Step S25: connect the N normal PCB sample prompts and the M manually set abnormal PCB prompt suffixes to generate a total of N×M abnormal PCB sample prompts, which are called manual defect abnormal prompts, namely [NP1][PCBType][with][AP1], [NP1][PCB Type][with][AP2], …, [NPn][PCB Type][with][APm], where [with] is used to semantically connect the following abnormal prompt suffix [APm]; Step S26: connect the N normal PCB sample prompts with the L learnable abnormal PCB prompt suffixes to generate a total of N×L abnormal PCB sample prompts, which are called learnable abnormal prompts, namely [NP1][PCB Type][with][LAP1], [NP1][PCB Type][with][LAP2], …, [NPn][PCB Type][with][LAPl]; Step S27: According to the contrastive learning loss function, the normal PCB sample prompts, the manual defect abnormal prompts and the learnable defect abnormal prompts are trained so that the normal PCB sample prompts are close to the normal PCB image visual features, while the manual defect abnormal prompts and the learnable defect abnormal prompts are far away from the normal PCB image visual features.
5. The industrial defect detection method based on abnormal prompt learning according to claim 4 is characterized in that: The step S3, based on the abnormal prompt of step S2, uses the explicit abnormal boundary to perform prompt learning on the normal PCB image to obtain a set amount of defect abnormal prompts, specifically includes the following steps: Step S31: Use regularization loss to control the distance between normal PCB sample prompts and abnormal PCB sample prompts. The formula is as follows: Among them, L regu represents the loss function between the normal PCB sample prompt features and the abnormal PCB sample prompt features during training, which is used to maximize the Euclidean distance between the normal PCB sample prompt features and the abnormal PCB sample prompt features. x is the visual feature of the normal PCB image. It is a normal PCB sample prompt feature prototype, CLIP text (.) is the text encoder of the frozen CLIP, t n This is a normal PCB sample prompt. is the defect anomaly prompt feature prototype, d(.,.) is the Euclidean distance; Step S32: Using the L2 norm square function, the distribution of the learnable defect anomaly prompt is aligned with the distribution of the manual defect anomaly prompt. The formula is as follows: Among them, L distri It represents the loss function between the learnable anomaly prompt and the manual anomaly prompt during training. Its mathematical meaning is the square of the Euclidean distance between the learnable anomaly prompt feature and the manual anomaly prompt feature. It is used to minimize the Euclidean distance between the learnable anomaly prompt feature and the manual anomaly prompt feature. is the feature mean of manual defect anomaly prompt, is the feature mean of the learnable defect anomaly prompt, and α is a hyperparameter; Step S33: Combining the L regu and L distri The two losses are jointly trained to show abnormal boundaries.
6. The industrial defect detection method based on abnormal prompt learning according to claim 2 is characterized in that: The step S4, according to the defect abnormality prompt obtained in step S3, performs abnormal detection of surface mount defects, specifically comprises the following steps: Step S41: Calculate the pixel-level visual guidance score map S according to the memory B obtained in step S13 v , the formula is as follows: Where, b is the feature of the normal PCB image stored in step S13, F v It is the visual feature of the query PCB image; Step S42: Prompt feature prototypes based on normal PCB samples obtained in the training phase And defect anomaly prompt feature prototype Calculate pixel-level cue-guided score map S o ∈[0, 1], the formula is as follows: Among them, ε is a hyperparameter, x is the feature of the detected image, S o is the probability that the detected image is a normal image; Step S43: Fusion of PCB visual features and S o , using the harmonic mean, we get the pixel-level defect anomaly score map S p ∈[0, 1], the formula is as follows: Among them, S v is the pixel-level guided visual score, S o is the pixel-level cue guidance score, S p is the harmonic mean of the two, S p The higher the value, the closer it is to the normal PCB image. p The lower the value is, the closer it is to the abnormal PCB image, that is, there is a defect.
7. A readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the processor executes the industrial defect detection method based on abnormal prompt learning as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Printed circuit board defect detection method based on small sample learning, medium and equipment
CN116579980A
Small sample anomaly detection method based on single-class prompt learning
CN118038188A
Transformer defect detection method based on pixel-text matching of CLIP model
CN118918095A
Rapid anomaly detection method and system based on contrastive representation distillation
WO2023097638A1
Cited By
Printed circuit board defect detection method and system based on cross-modal prompt learning and visual guidance
CN120471929A
Electronic component defect detection and segmentation method based on normal sample prompt
CN121810590A
PCB welding spot defect detection method and system
CN122265282A
A method and system for detecting PCB solder joint defects
CN122265282B