CN112801998A - Printed circuit board detection method and device, computer equipment and storage medium - Google Patents

Printed circuit board detection method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN112801998A
CN112801998A CN202110164030.6A CN202110164030A CN112801998A CN 112801998 A CN112801998 A CN 112801998A CN 202110164030 A CN202110164030 A CN 202110164030A CN 112801998 A CN112801998 A CN 112801998A
Authority
CN
China
Prior art keywords
printed circuit
circuit board
local information
image
generating
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110164030.6A
Other languages
Chinese (zh)
Other versions
CN112801998B (en
Inventor
张�杰
朱海峰
朱洁
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Spreadtrum Communications Shanghai Co Ltd
Original Assignee
Spreadtrum Communications Shanghai Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Spreadtrum Communications Shanghai Co Ltd filed Critical Spreadtrum Communications Shanghai Co Ltd
Priority to CN202110164030.6A priority Critical patent/CN112801998B/en
Publication of CN112801998A publication Critical patent/CN112801998A/en
Application granted granted Critical
Publication of CN112801998B publication Critical patent/CN112801998B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/84Systems specially adapted for particular applications
    • G01N21/88Investigating the presence of flaws or contamination
    • G01N21/8851Scan or image signal processing specially adapted therefor, e.g. for scan signal adjustment, for detecting different kinds of defects, for compensating for structures, markings, edges
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/84Systems specially adapted for particular applications
    • G01N21/88Investigating the presence of flaws or contamination
    • G01N21/95Investigating the presence of flaws or contamination characterised by the material or shape of the object to be examined
    • G01N21/956Inspecting patterns on the surface of objects
    • G01N21/95607Inspecting patterns on the surface of objects using a comparative method
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • G06F18/2415Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on parametric or probabilistic models, e.g. based on likelihood ratio or false acceptance rate versus a false rejection rate
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/84Systems specially adapted for particular applications
    • G01N21/88Investigating the presence of flaws or contamination
    • G01N21/8851Scan or image signal processing specially adapted therefor, e.g. for scan signal adjustment, for detecting different kinds of defects, for compensating for structures, markings, edges
    • G01N2021/8854Grading and classifying of flaws
    • G01N2021/888Marking defects
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/84Systems specially adapted for particular applications
    • G01N21/88Investigating the presence of flaws or contamination
    • G01N21/8851Scan or image signal processing specially adapted therefor, e.g. for scan signal adjustment, for detecting different kinds of defects, for compensating for structures, markings, edges
    • G01N2021/8887Scan or image signal processing specially adapted therefor, e.g. for scan signal adjustment, for detecting different kinds of defects, for compensating for structures, markings, edges based on image processing techniques
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/84Systems specially adapted for particular applications
    • G01N21/88Investigating the presence of flaws or contamination
    • G01N21/95Investigating the presence of flaws or contamination characterised by the material or shape of the object to be examined
    • G01N21/956Inspecting patterns on the surface of objects
    • G01N2021/95638Inspecting patterns on the surface of objects for PCB's
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20081Training; Learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20084Artificial neural networks [ANN]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30108Industrial image inspection
    • G06T2207/30141Printed circuit board [PCB]

Abstract

The embodiment of the invention provides a printed circuit board detection method, a printed circuit board detection device, computer equipment and a storage medium. In the technical scheme provided by the embodiment of the invention, random noise, local information and a printed circuit board image are obtained; generating a confrontation network model through the constructed conditions, and generating the authenticity probability of the printed circuit board according to the random noise, the local information and the printed circuit board image; according to the authenticity probability and the set probability threshold, the detection result of the printed circuit board is generated, the labor cost can be reduced, the detection accuracy is improved, and therefore the detection efficiency of the printed circuit board is improved.

Description

Printed circuit board detection method and device, computer equipment and storage medium
[ technical field ] A method for producing a semiconductor device
The present invention relates to the field of communications technologies, and in particular, to a method and an apparatus for detecting a printed circuit board, a computer device, and a storage medium.
[ background of the invention ]
At present, electronic products are widely applied to production and life of people, complex environments put higher requirements on the working stability of the electronic products, and a printed circuit board is used as a carrier of electronic components and is in a crucial position in the whole electronic products. With the precision of electronic products, the detection requirements for printed circuit boards are also increasing. In the prior art, a Printed Circuit Board (PCB for short) is usually detected by adopting a manual detection mode, so that the problems of manual touch damage, increased labor cost and low detection efficiency are caused; or partial positions of the PCB are detected by adopting the line images and the drilling information, the detection process is complex, the detection range is not comprehensive, and the detection accuracy is low.
[ summary of the invention ]
In view of this, embodiments of the present invention provide a method and an apparatus for detecting a printed circuit board, a computer device, and a storage medium, which can reduce labor cost and improve detection accuracy, thereby improving detection efficiency of the printed circuit board.
In one aspect, an embodiment of the present invention provides a method for detecting a printed circuit board, where the method includes:
acquiring random noise, local information and a printed circuit board image;
generating a confrontation network model through the constructed conditions, and generating the authenticity probability of the printed circuit board according to the random noise, the local information and the printed circuit board image;
and generating a detection result of the printed circuit board according to the authenticity probability and the set probability threshold.
Optionally, the condition generating confrontation network model comprises a generator and a discriminator;
before generating a countermeasure network model through the constructed conditions and generating the authenticity probability of the printed circuit board according to the random noise, the local information and the printed circuit board image, the method further comprises the following steps:
collecting first training data;
inputting first training data into a generator to generate a first image;
randomly acquiring second training data from the real picture distribution;
and training the discriminator according to the second training data and the first image to construct the discriminator.
Optionally, after training the discriminator according to the second training data and the first image, and constructing the discriminator, the method further includes:
and training the generator according to the first training data to construct the generator.
Optionally, before acquiring the random noise, the local information and the printed circuit board image, the method further comprises:
collecting an initial image of the printed circuit board;
and preprocessing the initial image to generate a printed circuit board image.
Optionally, the condition generating confrontation network model comprises a generator and a discriminator;
generating a countermeasure network model through the constructed conditions, and generating the authenticity probability of the printed circuit board according to the random noise, the local information and the printed circuit board image, wherein the authenticity probability comprises the following steps:
inputting random noise and local information into a generator to generate a second image;
and inputting the second image, the printed circuit board image and the local information into a discriminator to generate the authenticity probability of the printed circuit board.
Optionally, the local information comprises a first level, a second level or a third level;
generating a detection result of the printed circuit board according to the authenticity probability and the set probability threshold, wherein the detection result comprises the following steps:
if the authenticity probability is larger than or equal to the probability threshold, adding 1 to the level of the local information;
judging whether the local information subjected to the 1 adding processing is larger than the specified level number;
and if the local information processed by adding 1 is judged to be larger than the specified level number, determining the detection result as that the printed circuit board is in a normal state.
Optionally, the method further comprises:
and if the partial information subjected to the 1 adding processing is judged to be less than or equal to the designated level number, continuing to execute the step of generating a countermeasure network model through the constructed conditions and generating the authenticity probability of the printed circuit board according to the random noise, the partial information and the printed circuit board image.
Optionally, the method further comprises:
if the authenticity probability is smaller than the probability threshold, carrying out defect marking on the local information;
and determining the detection result as that the printed circuit board is in a defect state.
Optionally, if the local information includes the first level, the probability threshold includes a first threshold; if the local information comprises a second level, the probability threshold comprises a second threshold; if the local information includes a third level, the probability threshold includes a third threshold.
In another aspect, an embodiment of the present invention provides a printed circuit board detection apparatus, including:
the acquisition unit is used for acquiring random noise, local information and a printed circuit board image;
the first generation unit is used for generating a confrontation network model through the constructed conditions and generating the authenticity probability of the printed circuit board according to the random noise, the local information and the printed circuit board image;
and the second generation unit is used for generating a detection result of the printed circuit board according to the authenticity probability and the set probability threshold.
On the other hand, the embodiment of the invention provides a storage medium, which includes a stored program, wherein when the program runs, the device where the storage medium is located is controlled to execute the printed circuit board detection method.
In another aspect, an embodiment of the present invention provides a computer device, including a memory and a processor, where the memory is used to store information including program instructions, and the processor is used to control execution of the program instructions, where the program instructions are loaded and executed by the processor to implement the printed circuit board detection method.
In the scheme of the embodiment of the invention, random noise, local information and a printed circuit board image are obtained; generating a confrontation network model through the constructed conditions, and generating the authenticity probability of the printed circuit board according to the random noise, the local information and the printed circuit board image; according to the authenticity probability and the set probability threshold, the detection result of the printed circuit board is generated, the labor cost can be reduced, the detection accuracy is improved, and therefore the detection efficiency of the printed circuit board is improved.
[ description of the drawings ]
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a flowchart of a printed circuit board inspection method according to an embodiment of the present invention;
FIG. 2 is a flow chart of another method for inspecting a printed circuit board according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a printed circuit board detection apparatus according to an embodiment of the present invention;
fig. 4 is a schematic diagram of a computer device according to an embodiment of the present invention.
[ detailed description ] embodiments
For better understanding of the technical solutions of the present invention, the following detailed descriptions of the embodiments of the present invention are provided with reference to the accompanying drawings.
It should be understood that the described embodiments are only some embodiments of the invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The terminology used in the embodiments of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in the examples of the present invention and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be understood that the term "and/or" as used herein is merely one type of association that describes an associated object, meaning that three relationships may exist, e.g., a and/or B may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship.
It should be understood that although the terms first, second, etc. may be used to describe the set thresholds in the embodiments of the present invention, the set thresholds should not be limited to these terms. These terms are used only to distinguish the set thresholds from each other. For example, the first set threshold may also be referred to as the second set threshold, and similarly, the second set threshold may also be referred to as the first set threshold, without departing from the scope of embodiments of the present invention.
Printed Circuit Boards (PCBs) are often subject to various problems during manufacturing and transportation, such as: the problems of scratches, cracks, stains, gaps and the like on the board surface, the problems of oxidation, blackening, redness, speckles, size deviation, opposite sex and the like on the bonding pad, and the problems of wrinkling and dislocation of covering oil, missing and error of silk screen printing, deviation of hole positions, solder resistance and hole plugging, burrs and the like. Because the problem is complex, testing the PCB often takes a significant amount of time and cost. With the increase of the number of PCB detections, the detection efficiency is often reduced, and the detection accuracy is low. The condition of missing detection is easy to occur. In order to improve the detection efficiency of the PCB and avoid the condition of missing detection, a more efficient detection method needs to be adopted to detect the appearance of the PCB.
The embodiment of the invention adopts a Conditional generation countermeasure Network (CGAN) model to detect different defects on the surface of the PCB. The CGAN model consists of two submodels, generator G (Generator) and discriminator D (discriminator). The generator G can output a virtual image with the same dimension as the PCB real image, and the aim of the generator G is to enable the generated virtual image to be infinitely close to the PCB real image; the discriminator D outputs the probability that the virtual image is a real image, the target of the discriminator D is to distinguish the truth of the virtual image as far as possible, the optimization targets of the generator G and the discriminator D are mutually opposite, and the optimization process of the CGAN model is the process that the generator G and the discriminator D are mutually confronted. The target optimization problem of the CGAN model can be expressed as:
minG maxDV(D,G)=Ex~pdata[logD(x,c)]+Ez~pz(z)[log(1-D(G(z,c)))]
=∫x Pdata(x)log(D(x,c))dx+∫x Pz(z)log(1-D(g(z,c)))dz
=∫x[Pdata(x)log(D(x,c))+Pg(x)log(1-D(x,c))]dx
wherein E isx~pdata[logD(x,c)]Expectation of the probability distribution of the real image, Ez~pz(z)[ log (1-D (G (z, c))) is the expectation of the probability distribution of the virtual image, Pdata(x) For the probability distribution of the real image, Pg(x) Is the probability distribution of the virtual image. In the embodiment of the invention, D (x, c) is regarded as an unknown quantity, so that
Figure BDA0002936856050000061
Namely:
Figure BDA0002936856050000062
can obtain
Figure BDA0002936856050000063
Is the optimal solution of D (x, c). When D (x, c) ═ D (x, c), the target optimization problem of the CGAN model can be further expressed as:
Figure BDA0002936856050000064
wherein the content of the first and second substances,
Figure BDA0002936856050000065
representing a probability distribution PdataAnd
Figure BDA0002936856050000066
the KL divergence in between is greater than the KL divergence,
Figure BDA0002936856050000067
representing a probability distribution PgAnd
Figure BDA0002936856050000068
KL divergence between, JS (P)data||Pg) Representing a probability distribution PdataAnd PgJS divergence in between. The KL divergence and the JS divergence are both used for describing the difference between the two probability distributions, when the two probability distributions are the same, the KL divergence and the JS divergence are both 0, and at the moment, the target function V (D, G) obtains the minimum value. Therefore, when the probability distribution of the virtual image generated by the generator is the same as that of the real image, the objective function reaches the minimum value, and the model parameters at this time are the optimal parameters.
Fig. 1 is a flowchart of a printed circuit board inspection method according to an embodiment of the present invention, as shown in fig. 1, the method includes:
step 101, acquiring random noise, local information and a printed circuit board image.
And 102, generating a countermeasure network model according to the constructed conditions, and generating the authenticity probability of the printed circuit board according to the random noise, the local information and the printed circuit board image.
And 103, generating a detection result of the printed circuit board according to the authenticity probability and the set probability threshold.
In the technical scheme provided by the embodiment of the invention, random noise, local information and a printed circuit board image are obtained; generating a confrontation network model through the constructed conditions, and generating the authenticity probability of the printed circuit board according to the random noise, the local information and the printed circuit board image; according to the authenticity probability and the set probability threshold, the detection result of the printed circuit board is generated, the labor cost can be reduced, the detection accuracy is improved, and therefore the detection efficiency of the printed circuit board is improved.
Fig. 2 is a flowchart of another printed circuit board inspection method according to an embodiment of the present invention, as shown in fig. 2, the method includes:
step 201, collecting an initial image of the PCB.
In the embodiment of the invention, each step is executed by the server.
In the embodiment of the present invention, an electronic device with a camera function may be used to capture an initial image of a PCB, for example: and acquiring an initial image of the PCB by a high-definition camera. The initial image of the PCB includes an appearance image of the PCB.
Step 202, preprocessing the initial image to generate a PCB image.
As an alternative scheme, image preprocessing operations such as graying processing, median filtering and the like are carried out on an initial image, the problems of blurring, light reflection and the like generated in the shooting process are solved, misjudgment caused by environmental interference is reduced, image pixels are smoother, and the PCB image quality is improved while noise is reduced.
It should be noted that other preprocessing operations may also be performed on the initial image, which is only exemplary and not limited in the embodiment of the present invention.
Step 203, collecting first training data.
In an embodiment of the present invention, the first training data includes noise data and local information. In particular, p can be distributed from the noise input vectorzRandomly acquiring m noise data in (z) { z(1),...,z(m)}. Wherein, the value of m can be set according to actual conditions.
In the embodiment of the invention, in view of the complex diversity of the appearance defects of the PCB, the local information is divided into three categories, namely a board surface, a drilling hole and a bonding pad, the detection is carried out in the order from large to small, firstly, scratches, cracks, gaps and the like on the board surface are detected, secondly, the defect information such as hole position deviation, solder mask hole plugging, burrs and the like is detected, and finally, the defects such as oxidation, oil covering, size deviation, opposite sex and the like of the bonding pad are detected. Namely: the local information comprises a first level, a second level or a third level, as an alternative, the first level being a board level, the second level being a drill level and the third level being a pad level.
Step 204, inputting the first training data into the generator to generate a first image.
In an embodiment of the present invention, the first image is a virtual image generated by the generator.
And step 205, randomly acquiring second training data from the real picture distribution.
In the embodiment of the present invention, the second training data includes real picture information and local information. In particular, P can be distributed from the real picturedata(x) Randomly acquiring m second training data { (x)(1),c(1)),(x(2),c(2)),...,(x(m),c(m)) And x is real picture information, and c is local information. Wherein, the value of m can be set according to actual conditions.
And step 206, training the discriminator according to the second training data and the first image to construct the discriminator.
In the embodiment of the invention, second training data and a first image are input into a discriminator, and training probability is output; by the formula
Figure BDA0002936856050000081
Calculating an average of the discriminant loss function over the current training data, wherein LDAs an average, m is the number of samples of training data, log (1-D (G (z)(i),c(i)) ))) a first image generated for the ith training data, D (x)(i),c(i)) Probabilities are trained for the ith training data.
Further, the discriminator includes a parameter θdSolving for LDFor discriminator parameter thetadIs determined by a gradient descent algorithm on thetadAnd updating, so that gradient descending can be more uniform and stable, the problems of too fast gradient descending and the like can not occur, and the CGAN model is kept in an optimal solution state as far as possible.
In the embodiment of the invention, the arbiter is subjected to iterative training for k times, and the value of k can be set according to the actual situation.
And step 207, training the generator according to the first training data to construct the generator.
In an embodiment of the invention, the first training data comprises a noise input vectorQuantity distribution pzRandomly acquiring m noise data in (z) { z(1),...,z(m)And local information. The generator establishes a distribution p of the input vectors from the noisez(z) mapping function G (z, theta) to data spaceg) By the formula
Figure BDA0002936856050000082
Calculating an average of the discriminant loss function over the current training data, wherein LGAs an average, m is the number of samples of training data, log (1-D (G (z)(i),c(i)) ) for the ith training data.
Further, the mapping function established by the generator includes a parameter θgSolving for LGTo generator parameter thetagIs determined by a gradient descent algorithm on thetagAnd updating, so that gradient descending can be more uniform and stable, the problems of too fast gradient descending and the like can not occur, and the CGAN model is kept in an optimal solution state as far as possible.
In the embodiment of the invention, each pair of discriminators performs k times of iterative training, and then performs 1 time of iterative training on the generator, wherein the total number of iterations is N times. Wherein, the value of N can be set according to actual conditions.
Step 208, acquiring random noise, local information and PCB images.
In the embodiment of the present invention, the local information includes a first level, a second level, or a third level, and as an alternative, the first level is a board level, the second level is a drilling level, and the third level is a pad level.
In the embodiment of the invention, the PCB image is a real image.
Step 209 inputs the random noise and the local information into the generator to generate a second image.
In the embodiment of the invention, random noise and local information are input into a trained generator, and a second image is output and is a virtual image.
And step 210, inputting the second image, the PCB image and the local information into a discriminator to generate the authenticity probability of the PCB.
In the embodiment of the invention, the second image, the PCB image and the local information are input into the trained discriminator, and the authenticity probability of the PCB is output. The authenticity probability is within a specified output interval, which corresponds to the local information, for example: if the local information comprises a first level, and the first level is a board level, the specified output interval of the authenticity probability is [0,1 ]; if the local information comprises a second level, and the second level is a drilling level, the specified output interval of the authenticity probability is [0,0.9 ]; if the local information includes a third level, which is a pad level, the specified output interval of the authenticity probability is [0,0.8 ].
In the embodiment of the invention, the closer the second image, the PCB image and the local information are to the real data, the closer the authenticity probability is to the right value of the specified output interval; the closer the authenticity probability is to the right value of the specified output interval, the closer the second image is to the real image.
Step 211, determining whether the authenticity probability is greater than or equal to a set probability threshold, if so, executing step 212; if not, go to step 215.
In the embodiment of the present invention, if the local information includes the first level, the probability threshold includes a first threshold; if the local information comprises a second level, the probability threshold comprises a second threshold; if the local information includes a third level, the probability threshold includes a third threshold. The first threshold, the second threshold and the third threshold may be set according to actual conditions. As an alternative, if the local information includes a first level, the first level being a board level, the first threshold is 0.95; if the local information comprises a second level, the second level being a borehole level, the second threshold is 0.85; if the local information includes a third level, which is a pad level, the third threshold is 0.75.
It should be noted that the first threshold, the second threshold, and the third threshold may also be set to other values, which is not limited in this embodiment of the present invention.
In the embodiment of the present invention, if it is determined that the authenticity probability is greater than or equal to the probability threshold, it indicates that the generated second image is determined to be true by the discriminator, and step 212 is continuously executed; if the authenticity probability is less than the probability threshold, indicating that the second image is determined to be false by the discriminator, the process continues to step 215.
Step 212, add 1 to the level of the local information.
For example: the current local information is a first level, and the level of the local information is subjected to plus 1 processing; and adding 1 to the processed local information to obtain a second level.
Step 213, judging whether the local information processed by adding 1 is greater than the specified level number, if so, executing step 214; if not, go to step 209.
In the embodiment of the present invention, the number of designated levels may be set according to actual conditions, and the board surface, the drilled hole, and the pad of the PCB are detected in the embodiment of the present invention, that is: three levels, and therefore, the number of designated levels is set to 3.
In the embodiment of the invention, if the local information processed by adding 1 is judged to be more than the specified level number, which indicates that the board surface, the drill hole and the bonding pad of the PCB are all detected, the generated second image is true, and the step 214 is continuously executed; if the local information processed by adding 1 is judged to be less than or equal to the designated level number, indicating that the PCB has undetected levels, continuing to detect, and executing step 209.
And step 214, determining the detection result as that the PCB is in a normal state, and ending the process.
In the embodiment of the invention, if the board surface, the drilling hole and the bonding pad of the PCB are all detected and the generated second image is true, the PCB is a normal PCB, the detection result is determined to be that the PCB is in a normal state, and the process is ended.
Step 215, marking the local information with defects.
In the embodiment of the invention, because the PCBs have different sizes and shapes, the types of the bonding pads of the device are various, the hole positions have different sizes, and the defects of the board have difference, in order to mark the defects of different positions, the local information is subjected to defect marking through a multi-example multi-label image automatic marking algorithm. Specifically, the PCB image corresponding to the second image of the defect is input into a multi-example multi-label image automatic labeling algorithm, and a digital identifier is output. Different numerical designations represent different levels, for example: numeral 1 indicates that the first level is in a defective state; numeral 2 indicates that the second level is in a defective state; the numerical identifier 3 identifies the third level as being in a defective state.
It should be noted that the defect labeling may also be performed on the local information in other manners, which is not limited in the embodiment of the present invention.
And step 216, determining the detection result as that the printed circuit board is in a defect state, and ending the process.
In the embodiment of the invention, if the generated second image is false, the detection result is determined that the PCB is in a defect state, and the process is ended.
In the technical scheme of the printed circuit board detection method provided by the embodiment of the invention, random noise, local information and a printed circuit board image are obtained; generating a confrontation network model through the constructed conditions, and generating the authenticity probability of the printed circuit board according to the random noise, the local information and the printed circuit board image; according to the authenticity probability and the set probability threshold, the detection result of the printed circuit board is generated, the labor cost can be reduced, the detection accuracy is improved, and therefore the detection efficiency of the printed circuit board is improved.
Fig. 3 is a schematic structural diagram of a printed circuit board inspection apparatus according to an embodiment of the present invention, the apparatus is configured to perform the above printed circuit board inspection method, and as shown in fig. 3, the apparatus includes: an acquisition unit 11, a first generation unit 12, and a second generation unit 13.
The acquisition unit 11 is used to acquire random noise, local information, and printed circuit board images. The acquisition unit 11 may be: a chip, a chip module, or a portion of a chip module.
The first generating unit 12 is configured to generate a countermeasure network model according to the constructed conditions, and generate an authenticity probability of the printed circuit board according to the random noise, the local information, and the printed circuit board image. The first generating unit 12 may be: a chip, a chip module, or a portion of a chip module.
The second generating unit 13 is configured to generate a detection result of the printed circuit board according to the authenticity probability and the set probability threshold. The second generating unit 13 may be: a chip, a chip module, or a portion of a chip module.
In the embodiment of the present invention, the apparatus further includes: a first acquisition unit 14, a third generation unit 15, a second acquisition unit 16 and a first construction unit 17.
The first acquisition unit 14 is configured to acquire first training data. The first acquisition unit 14 may be: a chip, a chip module, or a portion of a chip module.
The third generating unit 15 is configured to input the first training data into the generator to generate the first image. The third generating unit 15 may be: a chip, a chip module, or a portion of a chip module.
The second acquisition unit 16 is adapted to randomly acquire second training data from the real picture distribution. The second acquisition unit 16 may be: a chip, a chip module, or a portion of a chip module.
The first construction unit 17 is configured to train the discriminator according to the second training data and the first image, and construct the discriminator. The first building element 17 may be: a chip, a chip module, or a portion of a chip module.
In the embodiment of the present invention, the apparatus further includes: a second building element 18.
The second constructing unit 18 is configured to train the generator according to the first training data to construct the generator. The second building element 18 may be: a chip, a chip module, or a portion of a chip module.
In the embodiment of the present invention, the apparatus further includes: a third acquisition unit 19 and a fourth generation unit 20.
The third capturing unit 19 is used for capturing an initial image of the printed circuit board. The third acquisition unit 19 may be: a chip, a chip module, or a portion of a chip module.
The fourth generating unit 20 is used for preprocessing the initial image and generating a printed circuit board image. The fourth generating unit 20 may be: a chip, a chip module, or a portion of a chip module.
In the embodiment of the present invention, the first generating unit 12 is specifically configured to input random noise and local information into the generator, and generate a second image; and inputting the second image, the printed circuit board image and the local information into a discriminator to generate the authenticity probability of the printed circuit board.
In the embodiment of the present invention, the second generating unit 13 is specifically configured to, if the authenticity probability is greater than or equal to the probability threshold, add 1 to the level of the local information; judging whether the local information subjected to the 1 adding processing is larger than the specified level number; and if the local information processed by adding 1 is judged to be larger than the specified level number, determining the detection result as that the printed circuit board is in a normal state.
In this embodiment of the present invention, the second generating unit 13 is further specifically configured to trigger the first generating unit 12 to continue to execute the step of generating the countermeasure network model according to the constructed condition and generating the authenticity probability of the printed circuit board according to the random noise, the local information, and the printed circuit board image if it is determined that the local information subjected to the processing of adding 1 is less than or equal to the specified level number.
In the embodiment of the present invention, the second generating unit 13 is further specifically configured to perform defect labeling on the local information if the authenticity probability is smaller than the probability threshold; and determining the detection result as that the printed circuit board is in a defect state.
In the scheme of the embodiment of the invention, random noise, local information and a printed circuit board image are obtained; generating a confrontation network model through the constructed conditions, and generating the authenticity probability of the printed circuit board according to the random noise, the local information and the printed circuit board image; according to the authenticity probability and the set probability threshold, the detection result of the printed circuit board is generated, the labor cost can be reduced, the detection accuracy is improved, and therefore the detection efficiency of the printed circuit board is improved.
An embodiment of the present invention provides a storage medium, where the storage medium includes a stored program, where, when the program runs, a device in which the storage medium is located is controlled to execute each step of the above-mentioned embodiment of the printed circuit board detection method, and for specific description, reference may be made to the above-mentioned embodiment of the printed circuit board detection method.
Embodiments of the present invention provide a computer device, including a memory and a processor, where the memory is configured to store information including program instructions, and the processor is configured to control execution of the program instructions, and the program instructions are loaded and executed by the processor to implement the steps of the embodiments of the printed circuit board detection method.
Fig. 4 is a schematic diagram of a computer device according to an embodiment of the present invention. As shown in fig. 4, the computer device 30 of this embodiment includes: the processor 31, the memory 32, and the computer program 33 stored in the memory 32 and capable of running on the processor 31, wherein the computer program 33, when executed by the processor 31, implements the method applied to detecting the printed circuit board in the embodiment, and for avoiding repetition, it is not described herein repeatedly. Alternatively, the computer program is executed by the processor 31 to implement the functions of the models/units applied to the printed circuit board inspection apparatus in the embodiments, which are not repeated herein to avoid repetition.
The computer device 30 includes, but is not limited to, a processor 31, a memory 32. Those skilled in the art will appreciate that fig. 4 is merely an example of a computer device 30 and is not intended to limit the computer device 30 and that it may include more or fewer components than shown, or some components may be combined, or different components, e.g., the computer device may also include input output devices, network access devices, buses, etc.
The Processor 31 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The storage 32 may be an internal storage unit of the computer device 30, such as a hard disk or a memory of the computer device 30. The memory 32 may also be an external storage device of the computer device 30, such as a plug-in hard disk provided on the computer device 30, a Smart Media (SM) Card, a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like. Further, the memory 32 may also include both internal and external storage units of the computer device 30. The memory 32 is used for storing computer programs and other programs and data required by the computer device. The memory 32 may also be used to temporarily store data that has been output or is to be output.
Each device and product described in the above embodiments includes modules/units, which may be software modules/units, or hardware modules/units, or may be partly software modules/units and partly hardware modules/units. For example, for each device or product of an application or integrated chip, each module/unit included in the device or product may be implemented by hardware such as a circuit, or at least a part of the modules/units may be implemented by a software program, which runs on an integrated processor inside the chip, and the remaining (if any) part of the modules/units may be implemented by hardware such as a circuit; for each device and product corresponding to or integrating a chip module, each module/unit included in the device and product may be implemented by hardware such as a circuit, different modules/units may be located in the same piece (e.g., a chip, a circuit module, etc.) or different components of the chip module, and at least part of/unit may be implemented by a software program, where the software program runs on the rest (if any) of the modules/units of the integrated processor inside the chip module and may be implemented by hardware such as a circuit; for each device or product applied to or integrated in the terminal, the modules/units included in the device or product may all be implemented by using hardware such as a circuit, different modules/units may be located in the same component (e.g., a chip, a circuit module, etc.) or different components in the terminal, or at least part of the modules/units may be implemented by using a software program running on a processor integrated in the terminal, and the rest (if any) part of the modules/units may be implemented by using hardware such as a circuit.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.

Claims (12)

1. A printed circuit board inspection method, comprising:
acquiring random noise, local information and a printed circuit board image;
generating a countermeasure network model according to the constructed conditions, and generating the authenticity probability of the printed circuit board according to the random noise, the local information and the printed circuit board image;
and generating a detection result of the printed circuit board according to the authenticity probability and a set probability threshold.
2. The method of claim 1, wherein the conditionally generating the antagonistic network model comprises a generator and an arbiter;
before generating a countermeasure network model through the constructed conditions and generating the authenticity probability of the printed circuit board according to the random noise, the local information and the printed circuit board image, the method further comprises the following steps:
collecting first training data;
inputting the first training data into the generator to generate a first image;
randomly acquiring second training data from the real picture distribution;
and training the discriminator according to the second training data and the first image to construct the discriminator.
3. The method of claim 2, wherein after the training the discriminator based on the second training data and the first image to construct the discriminator, further comprising:
and training the generator according to the first training data to construct the generator.
4. The method of claim 1, further comprising, prior to said acquiring random noise, local information, and printed circuit board images:
collecting an initial image of the printed circuit board;
and preprocessing the initial image to generate the printed circuit board image.
5. The method of claim 1, wherein the conditionally generating the antagonistic network model comprises a generator and an arbiter;
generating a countermeasure network model through the constructed conditions, and generating the authenticity probability of the printed circuit board according to the random noise, the local information and the printed circuit board image, wherein the generating comprises the following steps:
inputting the random noise and the local information into the generator to generate a second image;
and inputting the second image, the printed circuit board image and the local information into the discriminator to generate the authenticity probability of the printed circuit board.
6. The method of claim 1, wherein the local information comprises a first level, a second level, or a third level;
generating a detection result of the printed circuit board according to the authenticity probability and a set probability threshold, wherein the detection result comprises the following steps:
if the authenticity probability is larger than or equal to the probability threshold, adding 1 to the level of the local information;
judging whether the local information subjected to the 1 adding processing is larger than the specified level number;
and if the local information subjected to the processing of 1 is judged to be larger than the designated level number, determining the detection result as that the printed circuit board is in a normal state.
7. The method of claim 6, further comprising:
and if the local information subjected to the 1 adding processing is judged to be less than or equal to the designated level number, continuing to execute the step of generating a confrontation network model through the constructed conditions, and generating the authenticity probability of the printed circuit board according to the random noise, the local information and the printed circuit board image.
8. The method of claim 6, further comprising:
if the authenticity probability is smaller than the probability threshold, carrying out defect marking on the local information;
and determining the detection result as that the printed circuit board is in a defect state.
9. The method of claim 6, wherein if the local information comprises the first level, the probability threshold comprises a first threshold; if the local information includes the second level, the probability threshold includes a second threshold; if the local information includes the third level, the probability threshold includes a third threshold.
10. A printed circuit board inspection device, the device comprising:
the acquisition unit is used for acquiring random noise, local information and a printed circuit board image;
the first generation unit is used for generating a countermeasure network model according to the constructed conditions and generating the authenticity probability of the printed circuit board according to the random noise, the local information and the printed circuit board image;
and the second generating unit is used for generating the detection result of the printed circuit board according to the authenticity probability and the set probability threshold.
11. A storage medium, characterized in that the storage medium comprises a stored program, wherein when the program runs, the storage medium is controlled to execute the printed circuit board detection method according to any one of claims 1 to 9.
12. A computer device comprising a memory for storing information including program instructions and a processor for controlling the execution of the program instructions, wherein the program instructions are loaded and executed by the processor to implement the printed circuit board inspection method of any one of claims 1 to 9.
CN202110164030.6A 2021-02-05 2021-02-05 Printed circuit board detection method and device, computer equipment and storage medium Active CN112801998B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110164030.6A CN112801998B (en) 2021-02-05 2021-02-05 Printed circuit board detection method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110164030.6A CN112801998B (en) 2021-02-05 2021-02-05 Printed circuit board detection method and device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112801998A true CN112801998A (en) 2021-05-14
CN112801998B CN112801998B (en) 2022-09-23

Family

ID=75814633

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110164030.6A Active CN112801998B (en) 2021-02-05 2021-02-05 Printed circuit board detection method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112801998B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109190524A (en) * 2018-08-17 2019-01-11 南通大学 A kind of human motion recognition method based on generation confrontation network
CN109345469A (en) * 2018-09-07 2019-02-15 苏州大学 It is a kind of that speckle denoising method in the OCT image of confrontation network is generated based on condition
CN109840467A (en) * 2018-12-13 2019-06-04 北京飞搜科技有限公司 A kind of in-vivo detection method and system
CN110222774A (en) * 2019-06-10 2019-09-10 百度在线网络技术(北京)有限公司 Illegal image discrimination method, device, content safety firewall and storage medium
CN111881884A (en) * 2020-08-11 2020-11-03 中国科学院自动化研究所 Cross-modal transformation assistance-based face anti-counterfeiting detection method, system and device
WO2020258668A1 (en) * 2019-06-26 2020-12-30 平安科技(深圳)有限公司 Facial image generation method and apparatus based on adversarial network model, and nonvolatile readable storage medium and computer device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109190524A (en) * 2018-08-17 2019-01-11 南通大学 A kind of human motion recognition method based on generation confrontation network
CN109345469A (en) * 2018-09-07 2019-02-15 苏州大学 It is a kind of that speckle denoising method in the OCT image of confrontation network is generated based on condition
CN109840467A (en) * 2018-12-13 2019-06-04 北京飞搜科技有限公司 A kind of in-vivo detection method and system
CN110222774A (en) * 2019-06-10 2019-09-10 百度在线网络技术(北京)有限公司 Illegal image discrimination method, device, content safety firewall and storage medium
WO2020258668A1 (en) * 2019-06-26 2020-12-30 平安科技(深圳)有限公司 Facial image generation method and apparatus based on adversarial network model, and nonvolatile readable storage medium and computer device
CN111881884A (en) * 2020-08-11 2020-11-03 中国科学院自动化研究所 Cross-modal transformation assistance-based face anti-counterfeiting detection method, system and device

Also Published As

Publication number Publication date
CN112801998B (en) 2022-09-23

Similar Documents

Publication Publication Date Title
US10674651B2 (en) Printed circuit board inspecting apparatus, method for determining fault type of screen printer and computer readable recording medium
WO2017088553A1 (en) Method and system for rapidly identifying and marking electronic component polarity direction
CN110909712B (en) Moving object detection method and device, electronic equipment and storage medium
WO2022151658A1 (en) Defect detection method and apparatus, and computer device and computer-readable storage medium
TWI744999B (en) Method for training solder joint detecting model, method for detecting solder joint, and solder joint detecting device
CN110880175B (en) Welding spot defect detection method, system and equipment
US10684321B2 (en) Printed circuit board inspecting apparatus, method for detecting anomaly in solder paste and computer readable recording medium
CN110967350B (en) Chip testing method and device based on image recognition and electronic equipment
TWI765442B (en) Method for defect level determination and computer readable storage medium thereof
CN113628179B (en) PCB surface defect real-time detection method, device and readable medium
CN113344931A (en) Plug-in visual detection and identification method, readable storage medium and device
CN111681235B (en) IC welding spot defect detection method based on learning mechanism
CN111126165A (en) Black smoke vehicle detection method and device and electronic equipment
CN107909554B (en) Image noise reduction method and device, terminal equipment and medium
Szymanski et al. Automated PCB inspection in small series production based on SIFT algorithm
CN113920096A (en) Method for detecting metal packaging defects of integrated circuit
CN115471476A (en) Method, device, equipment and medium for detecting component defects
CN112465871A (en) Method and system for evaluating accuracy of visual tracking algorithm
Kulkarni et al. A deep learning approach in optical inspection to detect hidden hardware trojans and secure cybersecurity in electronics manufacturing supply chains
CN112801998B (en) Printed circuit board detection method and device, computer equipment and storage medium
KR20220026439A (en) Apparatus and method for checking whether a part is inserted in PCB
CN111882547A (en) PCB missing part detection method based on neural network
CN114627113B (en) Method, system, device and medium for detecting defects of printed circuit board
CN116993654A (en) Camera module defect detection method, device, equipment, storage medium and product
CN111476056A (en) Target object identification method and device, terminal equipment and computer storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant