A PCB board defect detection method, device, medium and electronic equipment

The feature of the historical defect image features of PCB boards is extracted through the feature pyramid network, and the training set is processed by combining the particle swarm algorithm and Pearson correlation coefficient metric method to build a visual defect recognition model, which solves the problems of low efficiency and multi-scale data interference of existing PCB board detection methods, and realizes high-precision defect recognition and optimized model training.

CN119006437BActive Publication Date: 2025-04-11SHENZHEN ZHENHUAXING INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411208488.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-30
Publication Date
2025-04-11
Estimated Expiration
2044-08-30

AI Technical Summary

Technical Problem

The existing PCB board detection methods are inefficient and have multi-scale data interference, which reduces the accuracy of defect recognition.

Method used

The historical defect image features are extracted through the feature pyramid network, and the training set is processed by combining the particle swarm algorithm and the Pearson correlation coefficient metric method to build a visual defect recognition model, and the Markov chain model is used to monitor the prediction accuracy.

Benefits of technology

The interference of multi-scale data on model training is suppressed, the defect prediction accuracy is improved, and the model training process is optimized.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119006437B_ABST
    Figure CN119006437B_ABST
Patent Text Reader

Abstract

The present invention relates to a defect detection method, device, medium and electronic equipment for a PCB board, and belongs to the technical field of PCB board detection. The present invention inputs a processed training set into a visual defect recognition model separately, monitors the prediction accuracy of each visual defect recognition model, obtains several trained visual defect recognition models, and finally obtains real-time image data of PCB boards in a production line, and recognizes the real-time image data of PCB boards in the production line through the visual defect recognition model, generates relevant abnormal analysis results according to the recognition results, and processes the training set by fusing a particle swarm algorithm and a Pearson correlation coefficient measurement method, which can suppress the interference of multi-scale data on model training and improve the accuracy of the model in predicting defects. By fusing a Markov model, an evaluation can be performed according to the actual prediction accuracy, and the training of the model can be further optimized to improve the rationality of the model training.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of PCB board detection, and in particular to a PCB board defect detection method, device, medium and electronic equipment. Background Art

[0002] Traditional PCB inspection methods are generally divided into three categories: manual visual inspection, flying probe inspection, and AOI inspection. Manual visual inspection mainly inspects PCB boards by direct visual inspection. As PCB boards become more and more sophisticated, the time for manual inspection of a single PCB board gradually increases, and the inspection efficiency cannot meet the production speed of the product. The second is flying probe inspection, which uses a probe to inspect the PCB board point by point. Flying probe inspection has the characteristics of fast speed and low cost, but the probe will contact the via holes and solder joints on the PCB board, causing them to deform, which will cause defects in some normal products. The third is AOI inspection, which mainly uses image processing and machine vision technology to identify defects on PCB boards. First, an industrial camera is used to capture an image of the PCB board to be inspected, and then the image information of the PCB board is obtained through image processing technology. The image information is analyzed and processed by the machine vision algorithm to finally obtain the inspection result. However, during the training process of the AOI inspection method, since there may be multiple defect data in the PCB defect image data in the training set, the model training will be interfered by multi-scale data, which reduces the defect recognition accuracy of the PCB board. Summary of the invention

[0003] The present invention overcomes the deficiencies of the prior art and provides a PCB defect detection method, device, medium and electronic equipment.

[0004] To achieve the above object, the technical solution adopted by the present invention is:

[0005] A first aspect of the present invention provides a method for detecting defects in a PCB board, comprising the following steps:

[0006] Obtain historical defect image information of PCB boards, extract features of historical defect image information of each PCB board through feature pyramid network, classify according to defect features, and obtain image information of each defect type;

[0007] Building several training sets of defect types based on the image information of each defect type, and processing the training set of each defect type using a particle swarm algorithm and a Pearson correlation coefficient measurement method to obtain several processed training sets;

[0008] Constructing a visual defect recognition model, inputting the processed training set into the visual defect recognition model separately, and monitoring the prediction accuracy of each visual defect recognition model to obtain a number of visual defect recognition models that have been trained;

[0009] Real-time image data of PCB boards in the production line are acquired, and the real-time image data of PCB boards in the production line are identified by the visual defect recognition model, and relevant abnormality analysis results are generated according to the identification results.

[0010] Furthermore, in this method, feature pyramid network is used to extract features from the historical defect image information of each PCB board, and the defect features are classified to obtain image information of each defect type, specifically:

[0011] A feature pyramid network is introduced, and feature extraction is performed on the historical defect image information of each PCB board through the feature pyramid network to obtain image features corresponding to the historical defect image of each PCB board;

[0012] Setting a number of defect classification feature standards, and classifying image features corresponding to historical defect images appearing on the PCB board according to the defect classification feature standards, to obtain a number of data sample sets;

[0013] Image information of each defect type is acquired based on the plurality of data sample sets, and the image information of each defect type is output.

[0014] Furthermore, in this method, several training sets of defect types are constructed based on the image information of each defect type, and the particle swarm algorithm and the Pearson correlation coefficient measurement method are used to process the training set of each defect type to obtain several processed training sets, specifically:

[0015] Constructing training sets of several defect types, setting the number of training items in the training sets, introducing a particle swarm algorithm, randomly selecting training items in the training set of each defect type from the image information of each defect type, and setting the number of iterations based on the particle swarm algorithm;

[0016] By calculating the Pearson correlation coefficient between each defect type training set, and determining whether there is a situation where the Pearson correlation coefficient is greater than a preset Pearson correlation coefficient threshold;

[0017] When there is a situation where the Pearson correlation coefficient is greater than the preset Pearson correlation coefficient threshold, iterate based on the number of iterations and reselect training items in the defect type training set until there is no situation where the Pearson correlation coefficient is greater than the preset Pearson correlation coefficient threshold;

[0018] When there is no situation where the Pearson correlation coefficient is greater than the preset Pearson correlation coefficient threshold, each defect type training set is output, and a plurality of processed training sets are generated.

[0019] Furthermore, in this method, a visual defect recognition model is constructed, the processed training set is input into the visual defect recognition model separately, and the prediction accuracy of each visual defect recognition model is monitored to obtain several visual defect recognition models that have been trained, specifically:

[0020] Building a visual defect recognition model based on a deep neural network, setting the number of visual defect recognition models according to the number of training sets, and inputting one of the processed training sets into one of the visual defect recognition models for training;

[0021] Calculating the prediction accuracy of the visual defect recognition model, obtaining the prediction accuracy of the visual defect recognition model at each timestamp, and using the prediction accuracy of the visual defect recognition model at each timestamp as a state value, and introducing it into the Markov chain model;

[0022] Calculate the transition probability value of the state value to another state value through the Markov chain model, and when the transition probability value is greater than a preset transition probability value, update the state value to another state value as the current state value, and determine whether the current state value is greater than a preset state threshold;

[0023] When the current state value is greater than the preset state threshold, the visual defect recognition model training is completed, and the remaining training sets are input into the remaining visual defect recognition models in sequence, one training set corresponds to one visual defect recognition model, until all visual defect recognition models are trained, and several visual defect recognition models that have been trained are obtained.

[0024] Furthermore, in this method, real-time image data of PCB boards in the production line is obtained, and the real-time image data of PCB boards in the production line is identified by the visual defect recognition model, specifically:

[0025] Acquire real-time image data of PCB boards in the production line, and sequentially input the real-time image data of PCB boards in the production line into each of the visual defect recognition models for recognition and analysis;

[0026] Through recognition and analysis, the recognition result of the real-time image data recognition of the PCB board in the production line is obtained, and the recognition result is output.

[0027] Furthermore, in this method, relevant abnormal analysis results are generated according to the recognition results, specifically:

[0028] Obtaining the production process corresponding to each defect type, and constructing a knowledge database, inputting the production process corresponding to each defect type into the knowledge database for storage;

[0029] When the identification result has defects, the current defect type is obtained, the number of PCB boards with the current defect type within a preset time is counted, and it is determined whether the number of PCB boards with the current defect type within the preset time is greater than a preset number threshold;

[0030] When the number of PCB boards with the current defect type within a preset time is greater than a preset number threshold, the current defect type is input into the knowledge database for data query to obtain the production process corresponding to the current defect type;

[0031] Generate relevant abnormality analysis results based on the production process corresponding to the current defect type, and output the relevant abnormality analysis results as output results.

[0032] A second aspect of the present invention provides a defect detection device for a PCB board, the defect detection device for a PCB board comprising a memory and a processor, the memory comprising a method program, and when the method program is executed by the processor, the steps of any one of the defect detection methods for a PCB board are implemented.

[0033] A third aspect of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium includes a method program, and when the method program is executed by the processor, the steps of any one of the PCB board defect detection methods are implemented.

[0034] A fourth aspect of the present invention provides an electronic device, comprising:

[0035] The classification module obtains the historical defect image information of the PCB board, extracts the features of the historical defect image information of each PCB board through the feature pyramid network, classifies them according to the defect features, and obtains the image information of each defect type;

[0036] A training set processing module, which constructs a plurality of training sets of defect types based on the image information of each defect type, and processes the training set of each defect type using a particle swarm algorithm and a Pearson correlation coefficient measurement method to obtain a plurality of processed training sets;

[0037] A model training module, which constructs a visual defect recognition model, inputs the processed training set into the visual defect recognition model separately, monitors the prediction accuracy of each visual defect recognition model, and obtains a number of visual defect recognition models that have been trained;

[0038] The abnormality analysis module obtains the real-time image data of the PCB board in the production line, and recognizes the real-time image data of the PCB board in the production line through the visual defect recognition model, and generates relevant abnormality analysis results according to the recognition results.

[0039] The present invention solves the defects existing in the background technology and has the following beneficial effects:

[0040] The present invention obtains the historical defect image information of the PCB board, extracts the feature of the historical defect image information of each PCB board through the feature pyramid network, classifies according to the defect features, obtains the image information of each defect type, and then constructs a training set of several defect types based on the image information of each defect type, and uses the particle swarm algorithm and the Pearson correlation coefficient measurement method to process the training set of each defect type, obtains several processed training sets, thereby constructing a visual defect recognition model, inputs the processed training set into the visual defect recognition model separately, and monitors the prediction accuracy of each visual defect recognition model, obtains several trained visual defect recognition models, and finally obtains the real-time image data of the PCB board in the production line, and recognizes the real-time image data of the PCB board in the production line through the visual defect recognition model, and generates relevant abnormal analysis results according to the recognition results. The present invention processes the training set by fusing the particle swarm algorithm and the Pearson correlation coefficient measurement method, which can suppress the interference of multi-scale data on model training and improve the accuracy of the model in predicting defects. Secondly, by fusing the Markov model, it can be evaluated according to the actual prediction accuracy, further optimize the training of the model, and improve the rationality of the model training. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0042] Figure 1 The overall flow chart of the defect detection method of the PCB board is shown;

[0043] Figure 2 A device block diagram of a defect detection device for a PCB board is shown;

[0044] Figure 3 A device schematic diagram of an electronic device is shown. DETAILED DESCRIPTION

[0045] In order to more clearly understand the above-mentioned purpose, features and advantages of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.

[0046] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways different from those described herein. Therefore, the protection scope of the present invention is not limited to the specific embodiments disclosed below.

[0047] like Figure 1 As shown, the first aspect of the present invention provides a defect detection method for a PCB board, comprising the following steps:

[0048] S102: Obtain historical defect image information of PCB boards, extract features of the historical defect image information of each PCB board through a feature pyramid network, classify according to defect features, and obtain image information of each defect type;

[0049] It is worth mentioning that in step S102, specifically:

[0050] A feature pyramid network is introduced, and feature extraction is performed on the historical defect image information of each PCB board through the feature pyramid network to obtain the image features corresponding to the historical defect image of each PCB board;

[0051] Setting a number of defect classification feature standards, and classifying image features corresponding to historical defect images of PCB boards according to the defect classification feature standards, to obtain a number of data sample sets;

[0052] Image information of each defect type is acquired based on a plurality of data sample sets, and the image information of each defect type is output.

[0053] It is worth mentioning that the Feature Pyramid Network (FPN) is a feature extractor designed based on the concept of feature pyramid, with the purpose of improving accuracy and speed. It replaces the feature extractor in Faster R-CNN and generates a higher quality feature map pyramid. The feature pyramid network extracts the feature data of historical defect image information (such as white spots, microcracks, blistering, delamination, wet fabric, exposed fabric, halo and solder mask defect images, etc.), so as to classify the image features corresponding to the historical defect images of PCB boards according to the defect classification feature standards.

[0054] S104: constructing several training sets of defect types based on the image information of each defect type, and processing the training set of each defect type using a particle swarm algorithm and a Pearson correlation coefficient measurement method to obtain several processed training sets;

[0055] It is worth mentioning that in step S104, the following specifically includes: since the sample data in the sample data set may contain multiple defect types, such as white spots, microcracks and other defect features in a defect image, this will lead to multi-scale feature interference during model training, which is not conducive to model training and reduces the prediction accuracy of the model. In this process, we use the particle swarm algorithm to optimize the training set by adaptive iteration and the Pearson correlation coefficient, which specifically includes the following steps:

[0056] Construct several training sets of defect types, and set the number of training items in the training set to 2000. Introduce the particle swarm algorithm, randomly select the training items in each defect type training set from the image information of each defect type, and set the number of iterations to 1000 based on the particle swarm algorithm.

[0057] By calculating the Pearson correlation coefficient between each defect type training set, and determining whether there is a situation where the Pearson correlation coefficient is greater than a preset Pearson correlation coefficient threshold;

[0058] When there is a situation where the Pearson correlation coefficient is greater than the preset Pearson correlation coefficient threshold, iteration is performed based on the number of iterations, and training items in the defect type training set are reselected until there is no situation where the Pearson correlation coefficient is greater than the preset Pearson correlation coefficient threshold;

[0059] When there is no situation where the Pearson correlation coefficient is greater than the preset Pearson correlation coefficient threshold, each defect type training set is output, and a plurality of processed training sets are generated.

[0060] It is worth mentioning that by calculating the Pearson correlation coefficient between the training sets of each defect type, when the Pearson correlation coefficient is greater than the preset Pearson correlation coefficient threshold, it means that there are similarities between the two training sets, that is, there are samples that have the characteristics of at least two defect types at the same time. At this time, the particle swarm algorithm is used to optimize the training items in the training set, thereby suppressing the interference of multi-scale data on model training and improving the prediction accuracy of the model.

[0061] S106: constructing a visual defect recognition model, inputting the processed training set into the visual defect recognition model separately, and monitoring the prediction accuracy of each visual defect recognition model to obtain a number of visual defect recognition models that have been trained;

[0062] It is worth mentioning that in step S106, since the actual prediction accuracy needs to be monitored during the model training process, the present invention integrates the Markov model to analyze the prediction accuracy state during the training process, so as to timely understand the training status of the model training process and improve the rationality of the model training, specifically:

[0063] Building a visual defect recognition model based on a deep neural network, setting the number of visual defect recognition models according to the number of training sets, and inputting one of the processed training sets into one of the visual defect recognition models for training;

[0064] Calculate the prediction accuracy of the visual defect recognition model, obtain the prediction accuracy of the visual defect recognition model at each timestamp, and use the prediction accuracy of the visual defect recognition model at each timestamp as a state value and introduce it into the Markov chain model;

[0065] The transition probability value of the state value transferring to another state value is calculated by the Markov chain model. When the transition probability value is greater than the preset transition probability value, the state value is updated to another state value as the current state value, and it is determined whether the current state value is greater than the preset state threshold;

[0066] When the current state value is greater than the preset state threshold, the training of the visual defect recognition model is completed, and the remaining training sets are input into the remaining visual defect recognition models in turn, one training set corresponds to one visual defect recognition model, until all visual defect recognition models are trained, and several trained visual defect recognition models are obtained.

[0067] It should be noted that deep neural networks include deep convolutional neural networks, recursive neural networks, BP neural networks, etc. After training to a certain number of sample items, the statistical model has a high prediction accuracy in defect prediction, and the Markov chain can take the prediction accuracy of each timestamp as a state value, and calculate the transition probability value of the state value transferring to another state value, such as the transition probability value from the prediction accuracy of 50% to the prediction accuracy of 60%. If the transition probability value is greater than the preset transition probability threshold, it means that the transfer has occurred, and the prediction accuracy of the current timestamp is updated to 60%. This method can update the prediction accuracy of model training, so that when the prediction accuracy is higher than the preset prediction accuracy threshold, the model stops training, improving the rationality of model training.

[0068] S108: Acquire real-time image data of PCB boards in the production line, and identify the real-time image data of PCB boards in the production line through a visual defect recognition model, and generate relevant abnormality analysis results based on the recognition results.

[0069] Furthermore, in this method, real-time image data of PCB boards in the production line is obtained, and the real-time image data of PCB boards in the production line is identified by a visual defect recognition model, specifically:

[0070] Real-time image data of PCB boards in the production line are obtained, and the real-time image data of PCB boards in the production line are input into each visual defect recognition model in turn for recognition and analysis; through recognition and analysis, the recognition results of the real-time image data of PCB boards in the production line are obtained, and the recognition results are output.

[0071] Furthermore, in the present method, a relevant abnormality analysis result is generated according to the recognition result, specifically: the production process corresponding to each defect type is obtained, and a knowledge database is constructed, and the production process corresponding to each defect type is input into the knowledge database for storage;

[0072] When there is a defect in the identification result, the current defect type is obtained, the number of PCB boards with the current defect type within a preset time is counted, and it is determined whether the number of PCB boards with the current defect type within the preset time is greater than a preset number threshold;

[0073] When the number of PCB boards with the current defect type within a preset time is greater than a preset number threshold, the current defect type is input into the knowledge database for data query to obtain the production process corresponding to the current defect type;

[0074] Generate relevant abnormal analysis results based on the production process corresponding to the current defect type, and output the relevant abnormal analysis results as output results.

[0075] It should be noted that the production process of PCB boards may include cutting and grinding, drilling, outer layer graphics, full board gold plating, etching, inspection, silk screen solder mask, hot air leveling, silk screen characters, appearance processing, testing, and inspection. This method can trace abnormal production processes, detect abnormal production processes, and stop losses in time.

[0076] It should be noted that the present invention processes the training set by fusing the particle swarm algorithm and the Pearson correlation coefficient measurement method, which can suppress the interference of multi-scale data on model training and improve the accuracy of the model in predicting defects. Secondly, by fusing the Markov model, it can be evaluated according to the actual prediction accuracy, further optimize the model training, and improve the rationality of model training.

[0077] In addition, obtaining real-time image data of PCB boards in the production line may include the following steps: constructing a visual monitoring network, obtaining historical service data information of each PCB production process equipment, constructing a Bayesian network, inputting the historical service data information of the PCB production process equipment into the Bayesian network for training, and obtaining a trained Bayesian network; predicting the performance membership of each PCB production process equipment through the Bayesian network, and presetting a performance membership threshold, judging whether the performance membership is greater than the performance membership threshold, and obtaining the maximum information collection amount of the visual monitoring network per unit time; when the performance membership is greater than the preset performance membership threshold, the corresponding PCB production process equipment is used as the PCB production process equipment for priority monitoring. CB production process equipment, and configure a first data acquisition frequency. When the performance membership is not greater than a preset performance membership threshold, the corresponding PCB production process equipment is used as a PCB production process equipment for non-priority monitoring, and a second data acquisition frequency is configured. The first data acquisition frequency and the second data acquisition frequency are counted to obtain a total data acquisition frequency. When the total data acquisition frequency is greater than the maximum amount of information collected by the visual monitoring network per unit time, the second data acquisition frequency is optimized by a particle swarm algorithm until the total data acquisition frequency is no greater than the maximum amount of information collected by the visual monitoring network per unit time, and real-time image data of PCB boards in the production line are obtained through the visual monitoring network based on the data acquisition frequency.

[0078] It should be noted that the maximum amount of information collected by the visual surveillance network within a certain period of time is fixed. When the total data collection frequency exceeds the maximum amount of information collected by the visual surveillance network within a unit time, serious delays in data transmission may occur. This method can improve the rationality of data collection. The performance membership includes data such as no performance membership, low performance membership, and high performance degradation membership.

[0079] A second aspect of the present invention provides a PCB board defect detection device 4, the PCB board defect detection device includes a memory 41 and a processor 42, the memory 41 includes a method program, and when the method program is executed by the processor 42, any step of the PCB board defect detection method is implemented.

[0080] A third aspect of the present invention provides a computer-readable storage medium, the computer-readable storage medium comprising a method program, and when the method program is executed by a processor, the method program implements any step of the PCB board defect detection method.

[0081] A fourth aspect of the present invention provides an electronic device, comprising:

[0082] The classification module 10 obtains the historical defect image information of the PCB board, extracts the features of the historical defect image information of each PCB board through the feature pyramid network, classifies according to the defect features, and obtains the image information of each defect type;

[0083] The training set processing module 20 constructs a plurality of training sets of defect types based on the image information of each defect type, and processes the training set of each defect type using a particle swarm algorithm and a Pearson correlation coefficient measurement method to obtain a plurality of processed training sets;

[0084] The model training module 30 constructs a visual defect recognition model, inputs the processed training set into the visual defect recognition model separately, monitors the prediction accuracy of each visual defect recognition model, and obtains a number of visual defect recognition models that have been trained;

[0085] The abnormality analysis module 40 obtains real-time image data of the PCB boards in the production line, and recognizes the real-time image data of the PCB boards in the production line through a visual defect recognition model, and generates relevant abnormality analysis results according to the recognition results.

[0086] Furthermore, feature pyramid network is used to extract features of the historical defect image information of each PCB board, and the defect features are classified to obtain image information of each defect type, specifically:

[0087] A feature pyramid network is introduced, and feature extraction is performed on the historical defect image information of each PCB board through the feature pyramid network to obtain the image features corresponding to the historical defect image of each PCB board;

[0088] Setting a number of defect classification feature standards, and classifying image features corresponding to historical defect images of PCB boards according to the defect classification feature standards, to obtain a number of data sample sets;

[0089] Image information of each defect type is acquired based on a plurality of data sample sets, and the image information of each defect type is output.

[0090] Furthermore, several training sets of defect types are constructed based on the image information of each defect type, and the training set of each defect type is processed using the particle swarm algorithm and the Pearson correlation coefficient measurement method to obtain several processed training sets, specifically:

[0091] Construct several training sets of defect types, set the number of training items in the training set, introduce the particle swarm algorithm, randomly select the training items in the training set of each defect type from the image information of each defect type, and set the number of iterations based on the particle swarm algorithm;

[0092] By calculating the Pearson correlation coefficient between each defect type training set, and determining whether there is a situation where the Pearson correlation coefficient is greater than a preset Pearson correlation coefficient threshold;

[0093] When there is a situation where the Pearson correlation coefficient is greater than the preset Pearson correlation coefficient threshold, the training items in the defect type training set are reselected based on the number of iterations until there is no situation where the Pearson correlation coefficient is greater than the preset Pearson correlation coefficient threshold;

[0094] When there is no situation where the Pearson correlation coefficient is greater than the preset Pearson correlation coefficient threshold, each defect type training set is output, and a plurality of processed training sets are generated.

[0095] Furthermore, a visual defect recognition model is constructed, the processed training set is input into the visual defect recognition model separately, and the prediction accuracy of each visual defect recognition model is monitored to obtain several visual defect recognition models that have been trained, specifically:

[0096] Building a visual defect recognition model based on a deep neural network, setting the number of visual defect recognition models according to the number of training sets, and inputting one of the processed training sets into one of the visual defect recognition models for training;

[0097] Calculate the prediction accuracy of the visual defect recognition model, obtain the prediction accuracy of the visual defect recognition model at each timestamp, and use the prediction accuracy of the visual defect recognition model at each timestamp as a state value and introduce it into the Markov chain model;

[0098] The transition probability value of the state value transferring to another state value is calculated by the Markov chain model. When the transition probability value is greater than the preset transition probability value, the state value is updated to another state value as the current state value, and it is determined whether the current state value is greater than the preset state threshold;

[0099] When the current state value is greater than the preset state threshold, the training of the visual defect recognition model is completed, and the remaining training sets are input into the remaining visual defect recognition models in turn, one training set corresponds to one visual defect recognition model, until all visual defect recognition models are trained, and several trained visual defect recognition models are obtained.

[0100] Furthermore, in this method, real-time image data of PCB boards in the production line is obtained, and the real-time image data of PCB boards in the production line is identified by a visual defect recognition model, specifically:

[0101] Acquire real-time image data of PCB boards in the production line, and input the real-time image data of PCB boards in the production line into each visual defect recognition model in turn for recognition and analysis;

[0102] Through recognition and analysis, the recognition results of real-time image data recognition of PCB boards in the production line are obtained and output.

[0103] Furthermore, relevant abnormal analysis results are generated based on the recognition results, specifically:

[0104] Obtain the production process corresponding to each defect type, build a knowledge database, and input the production process corresponding to each defect type into the knowledge database for storage;

[0105] When there is a defect in the identification result, the current defect type is obtained, the number of PCB boards with the current defect type within a preset time is counted, and it is determined whether the number of PCB boards with the current defect type within the preset time is greater than a preset number threshold;

[0106] When the number of PCB boards with the current defect type within a preset time is greater than a preset number threshold, the current defect type is input into the knowledge database for data query to obtain the production process corresponding to the current defect type;

[0107] Generate relevant abnormal analysis results based on the production process corresponding to the current defect type, and output the relevant abnormal analysis results as output results.

[0108] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.

[0109] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units; they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0110] In addition, all functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may be separately used as a unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0111] A person of ordinary skill in the art can understand that: all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiment; and the aforementioned storage medium includes: a mobile storage device, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.

[0112] Alternatively, if the above-mentioned integrated unit of the present invention is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present invention can be essentially or partly reflected in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the methods of each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, RAM, magnetic disks or optical disks.

[0113] The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims

1. A defect detection method for a PCB board, characterized in that: The following steps are involved: Obtain historical defect image information of PCB boards, extract features of historical defect image information of each PCB board through feature pyramid network, classify according to defect features, and obtain image information of each defect type; Building several training sets of defect types based on the image information of each defect type, and processing the training set of each defect type using a particle swarm algorithm and a Pearson correlation coefficient measurement method to obtain several processed training sets; Constructing a visual defect recognition model, inputting the processed training set into the visual defect recognition model separately, and monitoring the prediction accuracy of each visual defect recognition model to obtain a number of visual defect recognition models that have been trained; Acquire real-time image data of PCB boards in the production line, and identify the real-time image data of PCB boards in the production line through the visual defect recognition model, and generate relevant abnormality analysis results according to the recognition results; Construct a visual defect recognition model, input the processed training set into the visual defect recognition model separately, monitor the prediction accuracy of each visual defect recognition model, and obtain several visual defect recognition models that have been trained, specifically: Building a visual defect recognition model based on a deep neural network, setting the number of visual defect recognition models according to the number of training sets, and inputting one of the processed training sets into one of the visual defect recognition models for training; Calculating the prediction accuracy of the visual defect recognition model, obtaining the prediction accuracy of the visual defect recognition model at each timestamp, and using the prediction accuracy of the visual defect recognition model at each timestamp as a state value, and introducing it into the Markov chain model; Calculate the transition probability value of the state value to another state value through the Markov chain model, and when the transition probability value is greater than a preset transition probability value, update the state value to another state value as the current state value, and determine whether the current state value is greater than a preset state threshold; When the current state value is greater than the preset state threshold, the training of the visual defect recognition model is completed, and the remaining training sets are input into the remaining visual defect recognition models in turn, one training set corresponds to one visual defect recognition model, until all visual defect recognition models are trained, and several trained visual defect recognition models are obtained.

2. A PCB defect detection method according to claim 1, characterized in that: The feature pyramid network is used to extract the features of the historical defect image information of each PCB board, classify them according to the defect features, and obtain the image information of each defect type, specifically: A feature pyramid network is introduced, and feature extraction is performed on the historical defect image information of each PCB board through the feature pyramid network to obtain image features corresponding to the historical defect image of each PCB board; Setting a number of defect classification feature standards, and classifying image features corresponding to historical defect images appearing on the PCB board according to the defect classification feature standards, to obtain a number of data sample sets; Image information of each defect type is acquired based on the plurality of data sample sets, and the image information of each defect type is output.

3. A PCB defect detection method according to claim 1, characterized in that: Based on the image information of each defect type, several training sets of defect types are constructed, and the training sets of each defect type are processed using the particle swarm algorithm and the Pearson correlation coefficient measurement method to obtain several processed training sets, specifically: Constructing training sets of several defect types, setting the number of training items in the training sets, introducing a particle swarm algorithm, randomly selecting training items in the training set of each defect type from the image information of each defect type, and setting the number of iterations based on the particle swarm algorithm; By calculating the Pearson correlation coefficient between each defect type training set, and determining whether there is a situation where the Pearson correlation coefficient is greater than a preset Pearson correlation coefficient threshold; When there is a situation where the Pearson correlation coefficient is greater than the preset Pearson correlation coefficient threshold, iterate based on the number of iterations and reselect training items in the defect type training set until there is no situation where the Pearson correlation coefficient is greater than the preset Pearson correlation coefficient threshold; When there is no situation where the Pearson correlation coefficient is greater than the preset Pearson correlation coefficient threshold, each defect type training set is output, and a plurality of processed training sets are generated.

4. A PCB defect detection method according to claim 1, characterized in that: Acquire real-time image data of PCB boards in the production line, and identify the real-time image data of PCB boards in the production line through the visual defect recognition model, specifically: Acquire real-time image data of PCB boards in the production line, and sequentially input the real-time image data of PCB boards in the production line into each of the visual defect recognition models for recognition and analysis; Through recognition and analysis, the recognition result of the real-time image data recognition of the PCB board in the production line is obtained, and the recognition result is output.

5. A PCB defect detection method according to claim 1, characterized in that: Generate relevant abnormal analysis results based on the recognition results, specifically: Obtaining the production process corresponding to each defect type, and constructing a knowledge database, inputting the production process corresponding to each defect type into the knowledge database for storage; When the identification result has defects, the current defect type is obtained, the number of PCB boards with the current defect type within a preset time is counted, and it is determined whether the number of PCB boards with the current defect type within the preset time is greater than a preset number threshold; When the number of PCB boards with the current defect type within a preset time is greater than a preset number threshold, the current defect type is input into the knowledge database for data query to obtain the production process corresponding to the current defect type; Generate relevant abnormality analysis results based on the production process corresponding to the current defect type, and output the relevant abnormality analysis results as output results.

6. A defect detection device for a PCB board, characterized in that: The PCB board defect detection device includes a memory and a processor, the memory includes a method program, and when the method program is executed by the processor, the steps of the PCB board defect detection method according to any one of claims 1 to 5 are implemented.

7. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a method program, and when the method program is executed by a processor, the steps of the PCB board defect detection method according to any one of claims 1 to 5 are implemented.

8. An electronic device, characterized in that: include: The classification module obtains the historical defect image information of the PCB board, extracts the features of the historical defect image information of each PCB board through the feature pyramid network, classifies them according to the defect features, and obtains the image information of each defect type; A training set processing module, which constructs a plurality of training sets of defect types based on the image information of each defect type, and processes the training set of each defect type using a particle swarm algorithm and a Pearson correlation coefficient measurement method to obtain a plurality of processed training sets; A model training module, which constructs a visual defect recognition model, inputs the processed training set into the visual defect recognition model separately, monitors the prediction accuracy of each visual defect recognition model, and obtains a number of visual defect recognition models that have been trained; An abnormality analysis module acquires real-time image data of PCB boards in the production line, and identifies the real-time image data of PCB boards in the production line through the visual defect recognition model, and generates relevant abnormality analysis results according to the recognition results; Construct a visual defect recognition model, input the processed training set into the visual defect recognition model separately, monitor the prediction accuracy of each visual defect recognition model, and obtain several visual defect recognition models that have been trained, specifically: Building a visual defect recognition model based on a deep neural network, setting the number of visual defect recognition models according to the number of training sets, and inputting one of the processed training sets into one of the visual defect recognition models for training; Calculating the prediction accuracy of the visual defect recognition model, obtaining the prediction accuracy of the visual defect recognition model at each timestamp, and using the prediction accuracy of the visual defect recognition model at each timestamp as a state value, and introducing it into the Markov chain model; Calculate the transition probability value of the state value to another state value through the Markov chain model, and when the transition probability value is greater than a preset transition probability value, update the state value to another state value as the current state value, and determine whether the current state value is greater than a preset state threshold; When the current state value is greater than the preset state threshold, the training of the visual defect recognition model is completed, and the remaining training sets are input into the remaining visual defect recognition models in turn, one training set corresponds to one visual defect recognition model, until all visual defect recognition models are trained, and several trained visual defect recognition models are obtained.

Citation Information

Patent Citations

  • Intelligent detection device and method for LED lamp

    CN118052813A

  • Operation management method and system of e-commerce platform, and storage medium

    CN118551327A