SMT defect diagnosis and improvement method and system based on image analysis
Through technologies such as image analysis and generative adversarial networks, the problems of sample diversity and insufficient model adaptability in SMT defect detection are solved, automated defect detection and equipment parameter adjustment are realized, and production efficiency and product quality are improved.
Patent Information
- Application Number
- CN202411027674.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-30
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2044-07-30
AI Technical Summary
Existing SMT defect detection methods rely on the traditional gradient descent method and fixed rules to generate samples, resulting in a lack of diversity in samples, vulnerability to abnormal data, model overfitting, lack of flexibility and adaptability, and difficulty in being accurate in complex data environments. Check welding quality.
Using a method based on image analysis, by acquiring surface mount images, using generative adversarial networks for sample expansion, feature extraction models and feature dimensionality reduction models for feature extraction and dimensionality reduction, combined with classifier models to identify defect types, and automatically adjust production equipment Parameters to achieve defect detection and improvement.
It improves the accuracy and generalization ability of the model, reduces the dependence on the experience of engineers, improves the overall quality and production efficiency of the production line, and realizes automated equipment parameter adjustment and product quality control.
Smart Images

Figure CN118552546B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a method and system for diagnosing and improving SMT defects based on image analysis. Background Art
[0002] SMT is the surface mount technology, which is the most mainstream technology and process in the electronic assembly industry. It uses various equipment to detect product production quality. Specifically, the solder paste thickness tester can be used to detect the printing quality, the optical detector can be used to detect the effect of reflow soldering, and the X-ray test can be used to assist in the detection of some hidden welding parts. The engineers of related technologies adjust the parameters of the production equipment according to the results of the above tests.
[0003] In the related technology, defects in solder joints on the surface of integrated circuit boards are usually detected. Specifically, fixed rules can be used to generate samples, and the traditional gradient descent method can be used to extract features to train the model, and the model can be reduced in feature dimension and the data set can be classified. This method is prone to lack of sample diversity and is easily affected by abnormal data, resulting in overfitting of the model, and has great limitations in terms of diversity, flexibility, operability and adaptability.
[0004] In view of this, a more convenient method of SMT defect diagnosis and improvement based on image analysis is currently needed. Summary of the invention
[0005] One or more embodiments of the present disclosure provide an SMT defect diagnosis and improvement method and system based on image analysis, which can easily and accurately determine the defect type of the target product and make adjustments.
[0006] In order to achieve the above objectives, the main technical solutions adopted in this application include:
[0007] In the first aspect, one or more embodiments of the present disclosure provide a method for SMT defect diagnosis and improvement. The method includes: obtaining a surface mounting image of a target product; extracting the initial image features of the surface mounting image through a feature extraction model; performing dimensionality reduction processing on the initial image features based on a feature dimensionality reduction model to obtain dimensionality reduction image features; using a classifier model to identify the target classification to which the dimensionality reduction image features belong, so as to determine the defect type represented by the target classification; obtaining the production equipment parameters corresponding to the defect type, and re-surface mounting the target product after adjusting the production equipment parameters.
[0008] In a second aspect, one or more embodiments of the present disclosure provide an SMT defect diagnosis and improvement system. The system includes: an image acquisition unit for acquiring a surface mounting image of a target product; a feature extraction unit for extracting the initial image features of the surface mounting image through a feature extraction model; a dimension reduction unit for performing dimension reduction processing on the initial image features based on a feature dimension reduction model to obtain dimension reduction image features; a classification unit for identifying the target classification to which the dimension reduction image features belong using a classifier model to determine the defect type represented by the target classification; and a re-mounting unit for acquiring the production equipment parameters corresponding to the defect type and re-mounting the target product on the surface after adjusting the production equipment parameters.
[0009] On the other hand, the present disclosure further provides an electronic device, which includes a memory and a processor, wherein the memory is used to store a computer program, and when the computer program is executed by the processor, the above-mentioned SMT defect diagnosis and improvement method is implemented.
[0010] On the other hand, the present disclosure further provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program, and when the computer program is executed by a processor, the above-mentioned SMT defect diagnosis and improvement method is implemented.
[0011] The technical solution provided by one or more embodiments of the present disclosure can determine whether the target product has defects based on the surface mounting image of the target product and make corresponding defect adjustments. Specifically, first obtain the surface mounting image of the target product, perform feature extraction and feature dimension reduction on the initial image features of the surface mounting image, and obtain the reduced dimension image features. Use a classifier model to classify the reduced dimension image features and determine the defect type. Adjust the production equipment parameters according to the determined defect type and re-mount and inspect the target product.
[0012] It can be seen that the technical solution provided by the present disclosure can detect whether there are defects and make corresponding defect adjustments based only on the surface mounting image of the target product. Not only does it not rely on manual inspection and repair by relevant technical engineers, but it also does not need to be equipped with a variety of inspection equipment and devices, which greatly improves convenience. At the same time, when the system finds quality abnormalities, the equipment parameters are automatically adjusted and repeatedly verified until the product quality is qualified, greatly improving the overall quality and production efficiency of the production line. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] In order to more clearly illustrate the specific implementation methods of the present application or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0014] Figure 1 A schematic diagram of the steps of a method for diagnosing and improving SMT defects in one embodiment of the present disclosure is shown;
[0015] Figure 2 A flow chart of training steps for sample expansion in one embodiment of the present disclosure is shown;
[0016] Figure 3 A schematic diagram showing the steps of optimizing the first network parameters of a generator in one embodiment of the present disclosure is shown;
[0017] Figure 4 A flowchart of the steps of a method for training a feature extraction model in one embodiment of the present disclosure is shown;
[0018] Figure 5 A schematic diagram of the steps of determining whether a splitting condition is met in one embodiment of the present disclosure is shown;
[0019] Figure 6 A schematic diagram showing the training steps of a feature dimensionality reduction model in one embodiment of the present disclosure is shown;
[0020] Figure 7 A schematic diagram of functional modules of an SMT defect diagnosis and improvement system in one embodiment of the present disclosure is shown;
[0021] Figure 8 A schematic structural diagram of an electronic device in one embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0022] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present disclosure.
[0023] With the continuous development of the field of artificial intelligence, related technologies can detect the quality of circuit board welding based on the feature processing of solder joint detection images. In view of this, an embodiment of the present disclosure can detect whether there are defects and make corresponding defect adjustments based only on the surface mounting image of the target product. In this way, on the one hand, the accuracy and generalization ability of the model can be improved, and the limitations of detection in complex data environments can be eliminated; on the other hand, the dependence on engineer experience can be effectively reduced, and the overall quality and production efficiency of the production line can be improved.
[0024] Based on the above ideas, if conventional data augmentation methods rely on fixed rules to generate samples, the generated sample types usually lack diversity. In addition, the reliance on global gradient information and minimization of reconstruction errors during feature extraction and dimensionality reduction affects the flexibility and adaptability of the model. At the same time, traditional classification algorithms are prone to fall into local optimal solutions when dealing with complex and numerous data sets, affecting classification accuracy and efficiency. How to solve these difficulties is also a current technical problem.
[0025] In view of this, an embodiment of the present disclosure provides a SMT defect diagnosis and improvement method, which analyzes qualified and defective images to find the corresponding production parameters and generates relevant learning models through training. Subsequently, by analyzing and comparing the detection images, process requirements and models of the detection equipment, the equipment parameters can be automatically adjusted and re-mounted when quality abnormalities are found until the product quality meets the requirements.
[0026] See also Figure 1 An embodiment of the present disclosure provides a method for diagnosing and improving SMT defects, which may include the following steps:
[0027] S1: Acquire a surface mount image of a target product.
[0028] In this embodiment, the surface mount image is an image collected from the solder joint of the circuit board, and the image data is derived from a high-resolution machine vision system. The system is installed on an industrial production line and can capture the image of the solder joint in real time during the circuit board welding process. The present disclosure does not limit the specific machine vision system. For example, in order to capture the solder joint image in real time, a camera such as k210 or OpenMV can be used and installed on the production line, and the collected image data is stored in png (Portable Network Graphics) format. Specifically, the collected data is annotated, and the existing target objects can be pre-annotated in the training sample. The specific annotation method is not limited. For example, in order to accurately annotate the target object in the training image, a manual annotation method can be used. The annotation categories include: reverse welding, false welding, curled feet, short circuit, tombstone, bubble, leak welding, and wrong welding, a total of eight categories.
[0029] In this embodiment, the training samples are obtained by a sample expansion model, and the sample expansion model adopts a generative adversarial network algorithm. Figure 2 Specifically, the generative adversarial network consists of a generator and a discriminator. The generator is responsible for creating circuit board solder joint image data that is close to the real thing, while the discriminator is responsible for evaluating the authenticity of these images, enabling the computer to generate extremely realistic data. Figure 3 , the first network parameters of the generator are optimized in the following manner:
[0030] S11: Acquire an initial sample set, wherein the initial sample set includes original image samples.
[0031] In this embodiment, the original image sample is the manually annotated image. In order to expand the sample types, a generative adversarial network is used to generate circuit board solder joint image samples. According to the collected image information, the generator performs sample expansion.
[0032] S13: In the current training cycle, obtain the discrimination result of the discriminator on the original image sample in the previous training cycle, and adjust the sparse connection ratio applicable to the generator in the current training cycle based on the discrimination result, wherein the generator generates an expanded image sample corresponding to the original image sample based on the sparse connection ratio and the first network parameter in the current training cycle.
[0033] In this embodiment, before the current training cycle starts, the adaptive adjustment module evaluates the discrimination result of the discriminator on the image generated by the generator in the previous cycle, based on the feedback of the discriminator D, that is, the loss of the discriminator , adjust the sparse connection ratio of generator G It should be noted that if the current training cycle is the first training cycle, the network parameters of the generator G and the discriminator D need to be initialized, and the adaptive sparse rate , expressed as:
[0034]
[0035]
[0036] in, represents the parameters of the generator, represents the parameters of the discriminator, represents the initial sparse connection ratio, is the preset initial sparseness rate.
[0037] In this embodiment, adjusting the sparse connection ratio applicable to the generator in the current training cycle based on the discrimination result includes: identifying partial derivative information of the loss data of the discriminator with respect to the sparse connection ratio in the discrimination result, and generating a sparse adjustment value according to the learning rate of the discriminator and the partial derivative information, expressed as:
[0038]
[0039]
[0040] in, represents the generated image, Represents a real image, is the partial derivative of the discriminator loss with respect to the proportion of sparse connections. The calculation method can be expressed as:
[0041]
[0042] in, The historical sparse connection ratio of the generator in the previous training cycle is obtained, and the sparse connection ratio applicable to the generator in the current training cycle is generated according to the historical sparse connection ratio and the sparse adjustment value, which is expressed as:
[0043]
[0044] in, Indicates the sparse connection ratio of the current training cycle, Indicates the proportion of sparse connections in the previous training cycle, Represents the learning rate.
[0045] S15: Obtain a result of the authenticity identification of the extended image sample by the discriminator, and optimize the first network parameters according to the identification result to obtain second network parameters suitable for the next training cycle.
[0046] In this embodiment, the generator uses the adjusted network parameters and sparse connection ratio to generate a new image, and the discriminator evaluates the authenticity of the new image and feeds back the evaluation result to the generator to adjust the first network parameters. Optimize and improve image quality. Optimized parameters That is, the second network parameter. Specifically, the discriminator's process of judging the authenticity of a new image is expressed as:
[0047]
[0048]
[0049] in, represents the generated image, is the input random noise vector, represents the weight matrix of the generator, is the loss of the discriminator, is the discriminator for the real image The output, is the discriminator for generating images Output.
[0050] In this embodiment, optimizing the first network parameter according to the identification result to obtain the second network parameter suitable for the next training cycle includes: obtaining the learning rate of the generator and identifying the generator loss gradient from the identification result; calculating the network parameter adjustment amount according to the learning rate of the generator and the generator loss gradient; optimizing the first network parameter in the current training cycle according to the network parameter adjustment amount to obtain the second network parameter suitable for the next training cycle. Specifically, the generator loss gradient is expressed as:
[0051]
[0052]
[0053] in, is the generator loss gradient, represents the gradient of the discriminator output to the generated image, represents the gradient of the generated image with respect to the generator parameters.
[0054] In view of this, by continuously iterating in accordance with steps S11 to S15, a more realistic image training sample can be obtained, the circuit board solder joint data can be expanded, the generalization ability of the model can be improved, and the accuracy of the model can be improved. In addition, the sparse connection ratio of the generator is dynamically adjusted according to the feedback of the discriminator, so that the generator can focus more on the key features in the data, thereby generating more representative and diverse images.
[0055] S3: extracting initial image features of the surface mount image through a feature extraction model, wherein the feature extraction model has initial network parameters during the training process, and the initial weights and initial biases in the initial network parameters are adjusted by gradient descent. If the splitting condition is met, the weights and biases after gradient descent adjustment are incrementally adjusted under the constraint of a preset weight pruning function, and after the incremental adjustment, the learning rate of the feature extraction model is adjusted decreasingly.
[0056] In this embodiment, the image data of the target product is input into the feature extraction model for feature extraction to obtain the initial image features of the image data. Figure 4 Taking the periodic metabolic process of biological cells as an example, different mechanisms are used at different stages to optimize the parameters of the neural network, adjust the weights and biases of the neural network, and enable the algorithm to adapt to data changes more flexibly.
[0057] See also Figure 5 In this embodiment, after the above network parameters are adjusted by gradient descent, it is necessary to determine whether they meet the splitting condition, and steps S31 to S35 can be performed:
[0058] S31: For the current iteration cycle, obtain the first weight and the first bias of the previous iteration cycle, and perform gradient descent adjustment on the first weight and the first bias respectively to obtain the second weight and the second bias in the current iteration cycle.
[0059] In this application scenario, the weight parameters and bias parameters in the previous training cycle are obtained, and the weight parameters and bias parameters in the current training cycle are generated according to the gradient descent iteration of the loss function. For example: the learning rate in the growth phase Set to 0.01. The initial network parameters are adjusted and updated by the gradient descent algorithm, and the update method is expressed as:
[0060]
[0061]
[0062] In the formula, is the loss function of neural network training, is the gradient of the loss function with respect to the weight parameter, is the gradient of the loss function with respect to the bias parameter, is the acceleration factor. The acquisition of is determined by the descent speed and curvature of the loss function, and its calculation method is:
[0063]
[0064] In the formula, is the preset maximum acceleration factor, is the minimum value function.
[0065] It should be noted that if the previous iteration cycle is the first cycle, the initial network parameters should be established first, including the initial weights. and initial bias , the variance of the initial distribution It is set to 0.01, and its setting method obeys the normal distribution, which is expressed as:
[0066]
[0067]
[0068] In this embodiment, is the first weight of the previous iteration cycle, is the first bias of the previous iteration cycle; is the second weight in the current iteration cycle, It is the second bias of the current iteration cycle. The above algorithm is used to accelerate the fine-tuning of weights and update the neural network parameters.
[0069] S33: Determine the importance coefficient of each sub-weight in the second weight, and use the importance coefficient to perform weight synthesis on each sub-weight to obtain a synthetic weight corresponding to the second weight. The importance coefficient is calculated based on the gradient size of the first weight in the previous iteration cycle.
[0070] In this application scenario, the second weight and the second bias obtained in S31 are weighted in this stage, and multiple weight parameters are synthesized into new parameters to improve the generalization ability of the network. We define this new parameter as the synthetic weight. Define the synthesis function The calculation method is:
[0071]
[0072] In this embodiment, nr is the number of weight parameters, is the importance coefficient of the weight parameter, which is dynamically calculated based on the gradient size of the first weight in the previous iteration cycle. For the i-th weight parameter, the calculation method of its importance coefficient is expressed as:
[0073]
[0074] It should be noted that is the attenuation speed parameter, and its calculation method is expressed as:
[0075]
[0076] S35: Generate decision information of the feature extraction model under the synthetic weight and the second bias, and determine whether the splitting condition is met based on the decision value of the decision information.
[0077] In this application scenario, the algorithm evaluates the current network performance and decides whether to adjust the periodic optimization strategy. Specifically, the performance evaluation function is set , outputs whether to enter the next cycle in the form of a decision function, and the decision method is expressed as:
[0078]
[0079] In this embodiment, the performance threshold Set to 0.5. If the calculation is 1, the split condition is met and the next cycle is entered, that is, returning to the growth period; if If the calculation is not 1, it enters the early stage of splitting. Based on the above description, iterate continuously according to S31 to S35 to adjust the weights and biases of the neural network until the evaluation conditions are met and enter the next adjustment stage.
[0080] In this embodiment, during the incremental adjustment process, the first adjustment increment of the weight and the second adjustment increment of the bias are determined according to the following formula:
[0081]
[0082]
[0083] in, is the first adjustment increment of the weight, is the second adjustment increment for the offset, and are the fine-tuning parameters for amplitude and frequency, is the gradient of the loss function with respect to the weight, is the gradient of the loss function with respect to the bias.
[0084] Specifically, and The setting method is expressed as:
[0085]
[0086]
[0087] in, is a scaling factor for the perturbation amplitude. In this embodiment, It should be noted that, in this embodiment, the incremental adjustment should be performed under the constraint of preset weight pruning, using weight pruning method to constrain the weight. The weight pruning function The calculation method is expressed as:
[0088]
[0089] In this embodiment, after the incremental adjustment, the learning rate of the feature extraction model is adjusted downward according to the following formula:
[0090]
[0091] Among them, the adjusted learning rate is , the learning rate before adjustment is , is the attenuation coefficient, is the number of completed training epochs.
[0092] Based on the above description, the image data is input into the feature extraction model to extract the initial image features, and the parameters of the neural network are continuously optimized using a circular iteration method. The neural network can dynamically adjust the network parameters through real-time learning and feedback mechanisms, so that the algorithm can more flexibly adapt to changes in training data, reduce the risk of overfitting, and effectively jump out of the local optimal solution.
[0093] S5: Performing dimension reduction processing on the initial image features based on a feature dimension reduction model to obtain reduced dimension image features.
[0094] In this embodiment, the data of the initial image features obtained by the feature extraction model in S3 is input into the feature dimensionality reduction model for training to obtain the reduced dimensionality image features. Feature dimensionality reduction is an important preprocessing technology in machine learning and data analysis. Its purpose is to reduce the number of features while retaining as much effective information as possible. This can reduce the computational complexity of the model, and can also help improve the performance of the model and reduce overfitting. Specifically, the feature extraction model extracts a large number of initial image features of the surface mount image. These features are processed by the feature dimensionality reduction model to extract only effective reduced dimensionality image features that can be distinguished from different defect types.
[0095] In this embodiment, the present disclosure adopts an autoencoder algorithm to perform feature dimensionality reduction. The feature dimensionality reduction model includes an encoder and a decoder. The encoder maps the input sample to the encoded representation, and the decoder maps the encoded representation back to the reconstructed sample. The training goal is to make the reconstructed sample as close to the original sample as possible, that is, to minimize the difference between the output sample and the reconstructed sample, and to reveal more information in the feature representation. Specifically, please refer to Figure 6 , the feature dimensionality reduction model is trained according to the following steps S51 to S59:
[0096] S51: In the current training cycle, the encoding parameters of the encoder and the decoding parameters of the decoder are obtained.
[0097] In one embodiment, for encoder E and decoder D, the encoder parameters in the current training cycle are obtained. and decoder parameters It should be noted that if the current training cycle is the first training cycle, the network parameters should be initialized first, and the weights and biases of the encoder and decoder should be initialized randomly.
[0098] S53: performing dimensionality reduction processing on the input training feature vector through the encoder to obtain a reduced-dimensionality feature vector, and reconstructing the reduced-dimensionality feature vector through the decoder to obtain a reconstructed feature vector.
[0099] In one embodiment, the input feature vector The encoder transforms it into a low-dimensional representation z, i.e., a reduced-dimensional feature vector, and then the decoder reconstructs z into the output of the original dimension. , expressed as:
[0100]
[0101]
[0102] in, is the input feature vector, is the encoded low-dimensional representation, is the reconstructed output.
[0103] S55: Calculate the dual loss in the current training cycle, the dual loss includes a reconstruction error and a sparse self-expression error, the reconstruction error is used to characterize the error between the reconstructed feature vector and the training feature vector, and the sparse self-expression error is used to characterize the error between the reduced-dimensionality feature vector and the sparse linear combination of the reduced-dimensionality feature vector.
[0104] In this embodiment, the dual loss is , the reconstruction error is , the sparse self-expression error is , expressed as:
[0105]
[0106] In this implementation, the reconstruction error and the sparse self-expression error are respectively expressed according to the following formulas:
[0107]
[0108]
[0109] in, is the number of samples for training feature vectors, and is the regularization parameter, is the self-expression matrix, is one of the training feature vectors, is the reconstructed feature vector corresponding to the training feature vector, is the reduced dimension feature vector output by the encoder.
[0110] It should be noted that the self-expression matrix The construction method is expressed as:
[0111]
[0112]
[0113] in, Contains all sample codes The matrix of is a hyperparameter that controls the density of the matrix, represents the Euclidean distance calculation, is the Softmax function.
[0114] S57: Calculate the encoding gradient of the dual loss with respect to the encoding parameter, and calculate the decoding gradient of the dual loss with respect to the decoding parameter.
[0115] In this embodiment, the loss is calculated using the chain rule based on the dual loss about and The gradient of , and update the parameters. The update formulas of encoding parameters and decoding parameters are as follows:
[0116]
[0117]
[0118] in, is the encoding parameter, To decode the parameters, is the learning rate, The dual loss about The encoded gradient of The dual loss about The decoding gradient of .
[0119] S59: updating the encoding parameters in the current training cycle according to the encoding gradient, and updating the decoding parameters in the current training cycle according to the decoding gradient.
[0120] In view of this, by continuously iterating in accordance with steps S51 to S59, the error between the low-dimensional representation after calculation and encoding and the original dimensional output is gradually reduced, and finally the feature dimensionality reduction model is determined, so that the initial image features can be extracted as reduced-dimensional image features. The sparse self-expression layer is used to force more structural information to be revealed in the encoded feature representation, thereby deeply mining the intrinsic structural characteristics of the data, making the data features corresponding to different defect types more complete and accurate.
[0121] S7: Using a classifier model to identify the target classification to which the reduced-dimensionality image features belong, so as to determine the defect type represented by the target classification, wherein the classifier model has a plurality of parameter configuration individuals during the training process, and the parameter configuration individuals continuously update their positions in the search space to screen out the optimal parameter configuration individuals; the classifier model processes the input reduced-dimensionality image features based on the optimal parameter configuration individuals.
[0122] In this embodiment, the data after the feature dimension reduction obtained in S5 is input into the classifier to train the classifier model. Common classifier models, such as naive Bayes classifiers, support vector machines (SVM), etc., often lack sufficient adaptability and exploratory power when processing complex or noisy data sets. Therefore, the present disclosure uses the whale algorithm to optimize the support vector machine algorithm, which can effectively avoid falling into the local optimal solution. Specifically, the global search capability of the whale algorithm and the classification optimization capability of the SVM algorithm are combined, and the improved whale algorithm is used to update the position of each parameter individual, and a global search is performed to find the optimal SVM parameter configuration individual, thereby improving the accuracy and generalization ability of classification.
[0123] It should be noted that before training begins, the input feature vector is decomposed into projection vectors to reduce the feature dimension and extract the most critical information. The decomposition method is expressed as:
[0124]
[0125] in, is the feature vector after dimensionality reduction, is the projection matrix, is the feature vector input to the classifier.
[0126] In this implementation, the position update of the parameter configuration individual includes encirclement update, spiral update and random search update, and the formula for the position update is expressed as:
[0127]
[0128]
[0129]
[0130] in, is the position of the next time step after the bracket update, is the position of the next time step after the spiral is updated, is the position of the next time step after random search update, is the position of the current time step before the bracket update, is the position of the current time step before the spiral is updated, is the position of the current time step before the random search update, is the best position in the current group, is a randomly selected position in the population, , and To control the search coefficient, is the random number for spiral update. , and The calculation method is expressed as:
[0131]
[0132]
[0133]
[0134]
[0135] in, is a coefficient that decreases linearly from 2 to 0, is a random number in the range [0,1], is a random number in the range [0,1].
[0136] In this embodiment, for each whale individual, i.e., support vector machine configuration, the classification accuracy on the training set is calculated as the fitness function value, and the fitness evaluation is performed. Then, the fitness function The calculation method is:
[0137]
[0138]
[0139] in, is the fitness function value; Based on The error rate of the support vector machine with the parameter configuration on the training set. The lower the error rate, the higher the fitness value that can be generated. It is determined by the parameters The support vector machine model defined is The prediction of samples.
[0140] In this embodiment, the optimal parameter configuration individuals are screened in the following manner: in the current screening round, for any parameter configuration individual, the first fitness function value before the position update and the second fitness function value after the position update are calculated respectively. Specifically, the selection and update method according to the fitness function value is expressed as:
[0141]
[0142] in, represents the second fitness function value after the position is updated, Represents the first fitness function value before the position is updated. Indicates the current configuration parameter individual, Indicates the last round of parameter configuration individuals, Indicates a new parameter configuration individual. If the second fitness function value is better than the first fitness function value, the parameter configuration individual with the updated position enters the next screening round; if the first fitness function value is better than the second fitness function value, the parameter configuration individual is eliminated.
[0143] Based on the above update iteration, until the preset stop iteration condition is met, the model training is completed. At this time, the final SVM parameter configuration individual is the optimal model, which can better adapt to different problems and scenarios and achieve better recognition effect.
[0144] See also Figure 7 , an embodiment of the present disclosure further provides a SMT defect diagnosis and improvement system, the system comprising:
[0145] The image acquisition unit 100 is used to acquire a surface mounting image of a target product.
[0146] The feature extraction unit 200 extracts the initial image features of the surface mount image through the feature extraction model, wherein the feature extraction model has initial network parameters during the training process, and the initial weights and initial biases in the initial network parameters are adjusted by gradient descent. If the splitting condition is met, the weights and biases after the gradient descent adjustment are incrementally adjusted under the constraint of a preset weight pruning function, and after the incremental adjustment, the learning rate of the feature extraction model is adjusted decreasingly.
[0147] The dimension reduction unit 300 is used to perform dimension reduction processing on the initial image features based on a feature dimension reduction model to obtain reduced dimension image features.
[0148] The classification unit 400 is used to use a classifier model to identify the target classification to which the reduced-dimensionality image feature belongs, so as to determine the defect type represented by the target classification, wherein the classifier model has a plurality of parameter configuration individuals during the training process, and the parameter configuration individuals continuously update their positions in the search space to screen out the optimal parameter configuration individuals; the classifier model processes the input reduced-dimensionality image features based on the optimal parameter configuration individuals.
[0149] The re-mounting unit 500 is used to obtain the production equipment parameters corresponding to the defect type, and re-surface mount the target product after adjusting the production equipment parameters.
[0150] In this embodiment, the input data is a newly collected circuit board solder joint image. The new image data is first subjected to feature extraction by a trained feature extraction model. Further, the extracted features are then input into a data dimension reduction model to obtain reduced-dimensional features. Further, the reduced-dimensional features are input into a trained classifier model to determine whether there are defects in the solder joint and the type of defects.
[0151] In this embodiment, the output categories of the classifier include: reverse solder joint, cold solder joint, lifted pin, short circuit, tombstone, bubble, missed solder joint, and wrong solder joint, a total of 8 categories.
[0152] In this embodiment, the production equipment parameters corresponding to the defect type are obtained, and the target product is surface mounted again after adjusting the production equipment parameters. According to the analysis results of the model, the relevant production equipment parameters are automatically adjusted through the MES system (manufacturing execution system). In one embodiment, the adjusted parameters may include but are not limited to printer parameters, placement machine parameters, reflow soldering parameters, etc.
[0153] In this embodiment, after the target product is re-surface mounted, the equipment is checked again to see if it is qualified. Use equipment such as SPI (Solder Paste Inspection) solder paste thickness tester, AOI (Automated Optical Inspection) and XRAY to check the adjusted product. Verify whether the adjustment is successful to ensure that the product quality meets the standards. If it meets the standards, the process ends, otherwise readjust the parameters. Use SPI to detect the printing quality, use AOI to detect the results of reflow soldering, and use Xray testing to assist in the detection of some concealed soldering parts (such as BGA, QFN and other packages).
[0154] See also Figure 8 , Figure 8 is a schematic diagram of the structure of a computer device provided in an embodiment of the present application, such as Figure 8As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 8 A processor 10 is taken as an example.
[0155] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0156] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0157] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0158] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0159] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.
[0160] The embodiment of the present application also provides a computer-readable storage medium. The above method according to the embodiment of the present application can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0161] The embodiment of the present application provides a computer program product, which includes computer instructions, which are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method of any embodiment of the present application.
[0162] Although the embodiments of the present application are described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present application, and such modifications and variations are all within the scope defined by the appended claims.
[0163] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0164] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to the computer device, application, server, storage medium or other software or hardware that performs the operation of the technical solution of the present disclosure according to the prompt message.
[0165] As an optional but non-limiting implementation, in response to receiving an active request from the user, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the computer device.
[0166] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet the relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0167] It is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions.
[0168] It is understandable that in the specific implementation of the present application, related data such as user information, location information, navigation data, etc. are involved. When the above embodiments of the present application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.
[0169] The systems or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0170] For the convenience of description, the above system is described by dividing it into various units according to its functions. Of course, when implementing the present application, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0171] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0172] The present application is described with reference to the flowcharts and / or block diagrams of the methods, systems, and computer program products according to the embodiments of the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A system that specifies the functions of a box or multiple boxes.
[0173] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a product including an instruction system, which is implemented in the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0174] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0175] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0176] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0177] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
[0178] Although the embodiments of the present application have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present application, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A SMT defect diagnosis and improvement method based on image analysis, characterized in that: The method comprises: Acquire a surface mount image of a target product; Extracting initial image features of the surface mount image through a feature extraction model, wherein the feature extraction model has initial network parameters during training, and initial weights and initial biases in the initial network parameters are adjusted by gradient descent, and if a splitting condition is satisfied, the weights and biases adjusted by gradient descent are incrementally adjusted under the constraint of a preset weight pruning function, and after the incremental adjustment, the learning rate of the feature extraction model is adjusted in a decreasing manner; Performing dimensionality reduction processing on the initial image features based on a feature dimensionality reduction model to obtain dimensionality reduced image features; A classifier model is used to identify the target classification to which the reduced-dimensionality image features belong, so as to determine the defect type represented by the target classification, wherein the classifier model has a plurality of parameter configuration individuals during the training process, and the parameter configuration individuals are continuously updated in the search space to screen out the optimal parameter configuration individuals; the classifier model processes the input reduced-dimensionality image features based on the optimal parameter configuration individuals; Acquiring production equipment parameters corresponding to the defect type, and re-surface mounting the target product after adjusting the production equipment parameters; The training samples used by the feature extraction model in the training process are obtained by expanding the sample expansion model, the sample expansion model includes a generator and a discriminator, and the first network parameter of the generator is optimized in the following manner: Acquire an initial sample set, wherein the initial sample set includes original image samples; In a current training cycle, obtaining a discrimination result of the discriminator on the original image sample in a previous training cycle, and adjusting a sparse connection ratio applicable to the generator in the current training cycle based on the discrimination result, wherein the generator generates an expanded image sample corresponding to the original image sample based on the sparse connection ratio and a first network parameter in the current training cycle; Obtaining a result of authenticity identification performed by the discriminator on the expanded image sample, and optimizing the first network parameters according to the identification result to obtain second network parameters suitable for the next training cycle; Wherein, adjusting the sparse connection ratio applicable to the generator in the current training cycle based on the discrimination result includes: Identifying partial derivative information of the loss data of the discriminator with respect to the sparse connection ratio in the discrimination result, and generating a sparse adjustment value according to the learning rate of the discriminator and the partial derivative information; Obtaining a historical sparse connection ratio of the generator in the previous training cycle, and generating a sparse connection ratio applicable to the generator in the current training cycle according to the historical sparse connection ratio and the sparse adjustment value; The first network parameter is optimized according to the identification result to obtain the second network parameter suitable for the next training cycle, which includes: Obtaining a learning rate of the generator, and identifying a generator loss gradient from the identification result; Calculate the network parameter adjustment amount according to the learning rate of the generator and the generator loss gradient; According to the network parameter adjustment amount, the first network parameter in the current training cycle is optimized to obtain the second network parameter suitable for the next training cycle.
2. The method according to claim 1, characterized in that The splitting condition is determined to be satisfied in the following manner: For the current iteration cycle, obtain the first weight and the first bias of the previous iteration cycle, and perform gradient descent adjustment on the first weight and the first bias respectively to obtain the second weight and the second bias in the current iteration cycle; Determine the importance coefficient of each sub-weight in the second weight, and use the importance coefficient to perform weight synthesis on each of the sub-weights to obtain a synthetic weight corresponding to the second weight; wherein the importance coefficient is calculated based on the gradient size of the first weight in the previous iteration cycle; Generate decision information of the feature extraction model under the synthetic weight and the second bias, and judge whether the splitting condition is met based on the decision value of the decision information.
3. The method according to claim 1, characterized in that During the incremental adjustment process, the first adjustment increment of the weight and the second adjustment increment of the bias are determined according to the following formula: in, is the first adjustment increment of the weight, is the second adjustment increment for the offset, and are the fine-tuning parameters for amplitude and frequency, is the gradient of the loss function with respect to the weight, is the gradient of the loss function with respect to the bias.
4. The method according to claim 1, characterized in that: The learning rate is adjusted downward according to the following formula: Among them, the adjusted learning rate is , the learning rate before adjustment is , is the attenuation coefficient, is the number of completed training epochs.
5. The method according to claim 1, characterized in that The feature dimensionality reduction model includes an encoder and a decoder, and the feature dimensionality reduction model is trained in the following manner: In a current training cycle, obtaining encoding parameters of the encoder and decoding parameters of the decoder; Performing dimensionality reduction processing on the input training feature vector by the encoder to obtain a reduced-dimensional feature vector, and reconstructing the reduced-dimensional feature vector by the decoder to obtain a reconstructed feature vector; Calculating the dual loss in the current training cycle, the dual loss includes a reconstruction error and a sparse self-expression error, the reconstruction error is used to characterize the error between the reconstructed feature vector and the training feature vector, and the sparse self-expression error is used to characterize the error between the reduced-dimensionality feature vector and the sparse linear combination of the reduced-dimensionality feature vector; Calculating an encoding gradient of the dual loss with respect to the encoding parameter, and calculating a decoding gradient of the dual loss with respect to the decoding parameter; According to the encoding gradient, the encoding parameters in the current training cycle are updated, and according to the decoding gradient, the decoding parameters in the current training cycle are updated.
6. The method according to claim 5, characterized in that The reconstruction error and the sparse self-expression error are respectively expressed according to the following formulas: The reconstruction error is , the sparse self-expression error is , is the number of samples for training feature vectors, and is the regularization parameter, is the self-expression matrix, is one of the training feature vectors, is the reconstructed feature vector corresponding to the training feature vector, is the reduced dimension feature vector output by the encoder.
7. The method according to claim 5 or 6, characterized in that: The updating formulas of encoding parameters and decoding parameters are as follows: in, is the encoding parameter, To decode the parameters, is the learning rate, The dual loss about The encoded gradient of The dual loss about The decoding gradient of .
8. The method according to claim 1, characterized in that The position update of the parameter configuration individual includes encirclement update, spiral update and random search update, and the formula of the position update is expressed as: in, is the position of the next time step after the bracket update, is the position of the next time step after the spiral is updated, is the position of the next time step after random search update, is the position of the current time step before the bracket update, is the position of the current time step before the spiral is updated, is the position of the current time step before the random search update, is the best position in the current group, is a randomly selected position in the population, , and To control the search coefficient, A random number to update the spiral.
9. The method according to claim 1 or 8, characterized in that: The optimal parameter configuration individuals are screened in the following manner: In the current screening round, for any parameter configuration individual, the first fitness function value before the position update and the second fitness function value after the position update are calculated respectively; if the second fitness function value is better than the first fitness function value, the parameter configuration individual after the position update enters the next screening round; if the first fitness function value is better than the second fitness function value, the parameter configuration individual is eliminated.
10. An SMT defect diagnosis and improvement system based on image analysis, characterized in that: The system comprises: An image acquisition unit, used for acquiring a surface mounting image of a target product; A feature extraction unit, extracting initial image features of the surface mount image through a feature extraction model, wherein the feature extraction model has initial network parameters during training, and the initial weights and initial biases in the initial network parameters are adjusted by gradient descent. If the splitting condition is satisfied, the weights and biases adjusted by gradient descent are incrementally adjusted under the constraint of a preset weight pruning function, and after the incremental adjustment, the learning rate of the feature extraction model is adjusted decreasingly, wherein the training samples used by the feature extraction model during training are expanded by a sample expansion model, and the sample expansion model includes a generator and a discriminator, and the first network parameters of the generator are optimized in the following manner: obtaining an initial sample set, wherein the initial sample set includes original image samples; in a current training cycle, obtaining a discrimination result of the discriminator on the original image samples in a previous training cycle, and adjusting the sparse connection ratio applicable to the generator in the current training cycle based on the discrimination result, wherein the generator generates an expanded image sample corresponding to the original image sample based on the sparse connection ratio and the first network parameters in the current training cycle; obtaining the discriminator on The recognition result of authenticity recognition of the augmented image sample is obtained, and the first network parameter is optimized according to the recognition result to obtain the second network parameter suitable for the next training cycle; wherein, adjusting the sparse connection ratio suitable for the generator in the current training cycle based on the recognition result includes: identifying the partial derivative information of the loss data of the discriminator with respect to the sparse connection ratio in the recognition result, and generating a sparse adjustment value according to the learning rate of the discriminator and the partial derivative information; obtaining the historical sparse connection ratio of the generator in the previous training cycle, and generating the sparse connection ratio suitable for the generator in the current training cycle according to the historical sparse connection ratio and the sparse adjustment value; wherein, optimizing the first network parameter according to the recognition result to obtain the second network parameter suitable for the next training cycle includes: obtaining the learning rate of the generator, and identifying the generator loss gradient from the recognition result; calculating the network parameter adjustment amount according to the learning rate of the generator and the generator loss gradient; optimizing the first network parameter in the current training cycle according to the network parameter adjustment amount to obtain the second network parameter suitable for the next training cycle; A dimension reduction unit, used for performing dimension reduction processing on the initial image features based on a feature dimension reduction model to obtain reduced dimension image features; A classification unit, used for identifying the target classification to which the reduced-dimensionality image features belong using a classifier model, so as to determine the defect type represented by the target classification, wherein the classifier model has a plurality of parameter configuration individuals during the training process, and the parameter configuration individuals are continuously updated in the search space to screen out the optimal parameter configuration individuals; the classifier model processes the input reduced-dimensionality image features based on the optimal parameter configuration individuals; The re-mounting unit is used to obtain the production equipment parameters corresponding to the defect type, and re-surface mount the target product after adjusting the production equipment parameters.
11. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the SMT defect diagnosis and improvement method according to any one of claims 1 to 9 by executing the computer instructions.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the SMT defect diagnosis and improvement method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Steel plate surface defect classification method and device based on deep convolutional neural network
CN110490849A
Product defect detection method and device, electronic equipment and storage medium
CN116958041A
Insulator quality detection method
CN118154997A
Detection and identification of defects using artificial intelligence analysis of multi-dimensional information data
WO2023096908A1
