Intelligent Method for Electronic Circuit Board Defect Detection Based on RMT Deep Learning Model
By combining CNN and RMT methods, the problem of noise interference in electronic circuit board defect detection was solved, achieving efficient and accurate defect identification and improving the robustness and production efficiency of the detection system.
Patent Information
- Application Number
- CN202411908106.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-24
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2044-12-24
AI Technical Summary
Existing electronic circuit board defect detection methods based on RMT deep learning models are overly sensitive to abnormal noise, leading to false positives and false negatives, which affect product quality and safety.
Combining convolutional neural networks (CNN) and random matrix theory (RMT), images are acquired through high-resolution cameras, and denoising and feature extraction are performed. The feature decomposition method of RMT is used to distinguish between noise and defects. Multi-task learning (MTL) and adaptive algorithms are combined to optimize the model, thereby improving detection accuracy and robustness.
It effectively suppresses noise interference, improves the accuracy and stability of defect detection, reduces false detections and missed detections, and enhances the automation level and detection efficiency of the production line.
Smart Images

Figure CN119850541B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of electronic circuit board inspection technology, specifically to an intelligent method for detecting defects in electronic circuit boards based on the RMT deep learning model. Background Technology
[0002] Intelligent PCB defect detection based on RMT deep learning models refers to the automated detection and analysis of defects on electronic circuit boards (PCBs) using a combination of stochastic matrix theory (RMT) and deep learning. This method first extracts and learns features from PCB images using a deep learning model to identify and classify various defects (such as cracks, short circuits, and soldering defects). Then, RMT is applied to analyze and process the statistical properties of high-dimensional data in the images, helping to improve the robustness and accuracy of the detection process. RMT, in this way, helps improve the training efficiency of the deep learning model, reduce noise interference, and optimize feature representation, thereby improving the accuracy and real-time performance of PCB defect detection. In summary, this intelligent detection method integrates advanced mathematical theory and artificial intelligence technology, enabling more efficient and accurate quality control in electronic product manufacturing.
[0003] The existing technology has the following shortcomings:
[0004] In the intelligent detection of electronic circuit board defects based on the RMT deep learning model, an oversensitivity to abnormal noise can occur. While deep learning models possess efficient feature extraction capabilities when processing large numbers of PCB images, RMT relies heavily on statistical properties in high-dimensional data analysis. When encountering non-standard noise in the images (e.g., uneven lighting or sensor errors), RMT may fail to effectively distinguish noise from actual defects, leading to errors or missed detections. This is particularly problematic in manufacturing environments where noise generated by equipment aging and ambient light variations can be exceptionally complex and difficult to identify using traditional image processing methods. If this issue is not addressed promptly, it can lead to a significant increase in product defect rates, impacting product quality, increasing rework costs, and even posing unforeseen safety hazards in high-precision electronic products, such as circuit board malfunctions or short-circuit risks, severely affecting end-user safety and product reliability.
[0005] The information disclosed in the background section is only intended to enhance the understanding of the background of this disclosure, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention
[0006] The purpose of this invention is to provide an intelligent method for detecting defects in electronic circuit boards (PCBs) based on the RMT deep learning model. By combining Convolutional Neural Networks (CNNs) and Random Matrix Theory (RMT), this solution effectively improves the accuracy and robustness of PCB defect detection. CNNs automatically extract image features to accurately identify minute or irregular defects, while RMTs, through noise analysis and filtering, suppress the interference of environmental factors on image quality, thus improving the model's stability. Adaptive algorithms and Multi-Task Learning (MTL) optimize the training process, reducing false positives and false negatives and improving detection efficiency. The overall solution reduces noise interference, enhances detection accuracy, and improves the automation level and detection effect of the production line, thereby solving the problems mentioned in the background technology.
[0007] To achieve the above objectives, the present invention provides the following technical solution: an intelligent method for detecting defects in electronic circuit boards based on an RMT deep learning model, comprising the following steps:
[0008] High-resolution cameras are used to acquire images of electronic circuit boards, and the images are denoised to reduce the noise caused by environmental factors and equipment errors, providing clean input images for subsequent analysis.
[0009] Convolutional neural networks are used to extract features from the acquired electronic circuit board images. The convolutional neural network model extracts local and global features from the images through layer convolution and pooling operations, providing rich feature representations for subsequent defect detection.
[0010] The high-dimensional data extracted by the deep learning model is processed using random matrix theory. By constructing a data matrix, the feature decomposition method of random matrix theory is applied to analyze the noise patterns in the image. Statistical analysis methods are then used to distinguish between noise and defects, reducing the interference of noise on defect identification.
[0011] Based on deep learning algorithms, this method combines features processed by random matrix theory to classify and detect defects. By using a multi-task learning approach, the problem of image defect classification and localization is jointly optimized, thereby effectively identifying different types of defects.
[0012] Based on the deep learning model, an adaptive algorithm optimization process is introduced. An improved loss function is used to correct errors. An optimization algorithm based on gradient descent is adopted, combined with high-dimensional features extracted by random matrix theory, to iteratively optimize the model and improve the accuracy and robustness of defect detection.
[0013] Preferably, images of the electronic circuit board are acquired using a high-resolution camera, and the images are denoised to reduce the noise impact caused by environmental factors and equipment errors, providing clean input images for subsequent analysis. The specific steps are as follows:
[0014] First, a high-resolution camera is used to capture images of the electronic circuit board;
[0015] After image acquisition, illumination equalization is performed;
[0016] The image is smoothed to remove interference from non-target signals;
[0017] After image acquisition and denoising, the image is standardized and resized.
[0018] Preferably, a convolutional neural network is used to extract features from the acquired electronic circuit board images. The convolutional neural network model extracts local and global features from the image through layer convolution and pooling operations, providing rich feature representations for subsequent defect detection. The specific steps are as follows:
[0019] After high-resolution image acquisition and denoising, the image will be used as input to the CNN.
[0020] An activation function is added after each convolution operation to introduce a non-linear mapping.
[0021] Pooling is performed after convolution and activation functions;
[0022] After convolution and pooling operations, the deep network of the CNN will begin to extract global features from the image, thereby gaining a higher level of understanding of the image of the entire circuit board.
[0023] Preferably, the high-dimensional data extracted by the deep learning model is processed using random matrix theory. By constructing a data matrix, the interference of noise on defect identification is reduced. The specific steps are as follows:
[0024] After the CNN extracts features, a set of high-dimensional data is obtained, which contains both local and global features of the image;
[0025] The eigenvalue decomposition method of RMT is used to perform spectral analysis on the constructed data matrix;
[0026] The key steps for noise pattern recognition are obtained through eigenvalue decomposition using RMT.
[0027] After feature decomposition and noise removal, the remaining high-dimensional data contains image features that have been filtered out of noise, and the preserved features accurately reflect the defects in the image.
[0028] Preferably, based on deep learning algorithms, and combined with features processed by random matrix theory, defects are classified and detected. A multi-task learning method is used to jointly optimize the image defect classification and localization problems, thereby effectively identifying different types of defects. The specific steps are as follows:
[0029] The features processed by CNN and RMT will be used as input to the multi-task learning model. Let the input features processed by CNN and RMT be represented as follows: Where m is the number of samples and n is the feature dimension of each sample, the multi-task learning model performs joint training of two tasks by sharing some network layers;
[0030] The output of the localization task is the coordinates L = {x, y} of the defect location. The constructed MTL model will share the parameter θ. shared The input features are learned, and the calculation expression is as follows:
[0031]
[0032] In the formula, F shared F represents the shared features output after passing through the shared network layer, where F is the input feature. It is a nonlinear transformation of the shared part;
[0033] In MTL, to jointly optimize classification and localization tasks, the loss function needs to consider the losses of both tasks and perform a weighted average. The cross-entropy loss function is used to calculate the classification loss, and the calculation expression is as follows:
[0034]
[0035] In the formula, L class It is classification loss, y ij It is the one-hot encoded value of the true label, which is the true label of sample i belonging to category j. It is the predicted probability value, the model's predicted probability that sample i belongs to class j, and k is the total number of classes;
[0036] The loss in the localization task is calculated using the mean squared error to determine the coordinate error. The calculation expression is as follows:
[0037]
[0038] In the formula, L loc It's a location loss. and Let x and y represent the x-coordinates and y-coordinates of the defect location predicted by the model for the i-th sample, respectively. i and y i Let x and y represent the actual defect location of the i-th sample, respectively;
[0039] To balance the impact of the two tasks on the model, a weighting coefficient λ is introduced. class and λ loc The two losses are weighted and combined to obtain the final multi-task loss function, which is calculated as follows:
[0040] L MTL =λ class L class +λ loc L loc
[0041] In the formula, L MTL It is the joint loss function, λ class λ is the weight coefficient for the classification task. loc It is the loss function for the classification task;
[0042] The goal of optimization is to minimize this weighted loss function, expressed as follows:
[0043]
[0044] In the formula, The model's parameters θ and L are optimized by minimizing the loss function. MTL (θ) is the total loss function, θ is the model parameter, and L class (θ) is the loss function for the classification task, L loc (θ) is the loss function for the localization task;
[0045] To optimize the loss function L MTL The gradient descent method is used to minimize the loss function. In each round of training, the gradient of each parameter is calculated using the following formula, and the parameters are updated.
[0046]
[0047] In the formula, η is the learning rate. The loss function L MTL (θ) is the gradient of the parameter θ;
[0048] After training, the model outputs classification probabilities. and positioning coordinates and The final classification and location of defects are performed. The classification task determines the type of defect by the maximum probability value output, as shown in the following expression:
[0049]
[0050] In the formula, c pred It is the predicted class label that the model ultimately outputs, based on the model's classification probability. The predicted category is determined by taking the maximum probability value;
[0051] The accuracy of the location is assessed by calculating the error between the predicted coordinates and the actual coordinates. The following metrics are used to evaluate the positioning accuracy.
[0052]
[0053] In the formula, Position Error represents the error between the predicted defect location and the actual location.
[0054] Preferably, based on the deep learning model, the model is iteratively optimized to improve the accuracy and robustness of defect detection. The specific steps are as follows:
[0055] In the optimization process, the parameters of the deep learning model are first initialized, and the high-dimensional features processed by RMT are used as input data for processing. Let the input features of the model be... Where m is the total number of samples, and d is the feature dimension of each sample. After the features are extracted by the deep learning model, the parameters in the model will affect the final prediction result. By optimizing the parameters, the output of the model can be made to fit the real label more closely. The expression is as follows: f(X,W,b)=XW+b, where f(X,W,b) is the predicted output of the model, X is the feature input matrix after RMT processing, and W and b are the weight and bias parameters of the model, respectively.
[0056] To optimize the model parameters, a loss function is defined to measure the difference between the model output and the true label. An improved loss function is adopted, incorporating the characteristics of image defect detection and adding a noise suppression term. The standard loss function is set as mean squared error. To address noise interference, a regularization term λR(W) based on RMT is introduced, where R(W) represents the norm of the feature matrix extracted through RMT analysis. The final loss function formula is as follows:
[0057]
[0058] In the formula, L(W,b) is the sum of the losses over the entire training set, and f(X) is the sum of the losses over the entire training set. p W,b) is the model's predicted output, representing the model's prediction for the p-th sample, X. p Y is the input feature of the p-th sample. p λ is the true label of the p-th sample, and λR(W) is the regularization term used to control the impact of the regularization term on the loss function;
[0059] Next, gradient descent is used to minimize the loss function, and the parameters are updated by calculating the gradient of the loss function with respect to the model parameters W and b. Specifically, the gradients of the weights and biases are obtained by calculating the partial derivatives of the loss function with respect to the parameters, as shown in the following expressions:
[0060]
[0061] The update rules are as follows:
[0062]
[0063] In the formula, λ is the regularization coefficient, Y is the true label matrix with size m·d, d is the feature dimension of each sample, and X... T W is the transpose of matrix X. (t+1) It is the weight at the (t+1)th iteration, b (t+1) It is the bias at the (t+1)th iteration, η is the learning rate, and W (t) b is the weight at the t-th iteration. (t) It is the bias at the t-th iteration;
[0064] To improve the efficiency of the optimization process, the adaptive optimization algorithm Adam optimizer is introduced. Adam optimizer combines the ideas of momentum and adaptive learning rate adjustment. During each update, Adam optimizer adjusts the learning rate of each parameter based on the mean and variance of past gradients, further improving the speed and stability of parameter updates. The update formula of Adam is as follows.
[0065]
[0066]
[0067] In the formula, Let W represent the mean gradient of the weights at the t-th iteration, and β1 be the momentum decay coefficient. This represents the mean gradient of the previous iteration. This represents the gradient of the loss function L(W,b) with respect to the weights W. β² represents the mean squared gradient of the weight W at the t-th iteration, and β² is the gradient squared decay coefficient. This represents the mean squared gradient of the previous iteration. This represents the mean gradient after bias correction following the t-th iteration. Let represent the mean squared gradient after bias correction following the t-th iteration. ∈ is a small constant used to prevent division by zero errors and ensure stability.
[0068] The technical effects and advantages provided by the present invention in the above technical solution are as follows:
[0069] This invention effectively solves the noise interference problem in PCB defect detection by combining Convolutional Neural Networks (CNNs) and Random Matrix Theory (RMT). CNNs can automatically identify local details and global structures of the circuit board from images during image feature extraction, especially complex defect types. Compared with traditional methods, CNNs can more accurately identify small or irregular defects, while RMT effectively suppresses noise influence through feature decomposition of high-dimensional data, enhancing the model's robustness to non-standard noise in images (such as uneven lighting, sensor errors, etc.). Through noise analysis and filtering using RMT, the system can identify and remove noise components in the image, enabling the model to maintain high detection accuracy in various complex environments, thereby significantly improving the accuracy and robustness of the entire detection system.
[0070] Especially in complex production environments, PCB quality inspection is often affected by various factors, such as equipment aging, changes in ambient lighting, and sensor errors, all of which can lead to a decline in image quality. Traditional image processing methods often struggle to handle this complex noise, resulting in false positives or false negatives. However, by combining deep feature extraction from CNNs and noise filtering from RMTs, this solution effectively reduces the impact of these external factors, ensuring high accuracy and stability in defect detection results. The application of this technology significantly improves the automation level and inspection accuracy of the electronic circuit board inspection process, helping to increase production efficiency, reduce costs, and minimize quality problems, particularly in the field of high-precision electronic products where defect requirements are extremely stringent.
[0071] This invention further optimizes the defect detection process through adaptive algorithm optimization and multi-task learning (MTL), not only improving detection efficiency but also significantly reducing false positives and false negatives. The adaptive algorithm dynamically adjusts the learning rate based on changes in the loss function during training, ensuring the deep learning model converges quickly and avoids getting trapped in local optima, thus effectively shortening training time. Simultaneously, the multi-task learning method jointly trains defect classification and localization tasks, enabling the model to complete multiple objectives in a single processing step, improving overall detection efficiency. Through joint optimization, the model can accurately determine the defect type and precisely locate its position in the image, avoiding redundant computation and inconsistencies caused by training multiple models individually.
[0072] Furthermore, RMT effectively removes noise from image features when processing high-dimensional data, retaining only meaningful defect features. This allows the system to extract useful information from a large number of PCB images more quickly in practical applications, significantly improving detection speed. By reducing noise interference, the system also lowers the false positive and false negative rates, especially when dealing with images in complex backgrounds and environments (such as aging equipment or uneven lighting), where detection accuracy is greatly improved. Overall, the combination of adaptive optimization and RMT technology enables this solution to identify defects more efficiently and accurately in industrial production, significantly improving the automation level and detection accuracy of production lines while reducing the cost and error rate of manual inspection. Attached Figure Description
[0073] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this invention. For those skilled in the art, other drawings can be obtained based on these drawings.
[0074] Figure 1 This is a flowchart of the intelligent method for detecting defects in electronic circuit boards based on the RMT deep learning model of the present invention. Detailed Implementation
[0075] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, they are provided so that the description of this disclosure will be more complete and fully convey the concept of the exemplary embodiments to those skilled in the art.
[0076] This invention provides, for example Figure 1 The intelligent method for detecting electronic circuit board defects based on the RMT deep learning model shown includes the following steps:
[0077] High-resolution cameras are used to acquire images of electronic circuit boards (PCBs), and the images are denoised to reduce the noise caused by environmental factors and equipment errors, providing clean input images for subsequent analysis.
[0078] Images of the electronic circuit board are acquired using a high-resolution camera, and the images are then denoised to reduce the noise caused by environmental factors and equipment errors, providing clean input images for subsequent analysis. The specific steps are as follows:
[0079] First, images of the electronic circuit board (PCB) are captured using a high-resolution camera (such as an industrial-grade camera or scanner);
[0080] Choosing the right camera equipment is crucial; it should possess high resolution, high dynamic range, and high spectral response to capture sufficiently fine image details. These images must be sharp enough to accurately reflect every small imperfection on the circuit board. To ensure consistent data acquisition, avoid any misalignment or movement between the camera and the circuit board during image acquisition, ensuring geometric alignment of the images. To minimize interference from equipment or environmental changes, the camera should be mounted on a stable stand, and a suitable light source should be used to ensure uniform illumination of the circuit board surface.
[0081] After image acquisition, illumination equalization is performed;
[0082] Uneven lighting or shadows in the manufacturing environment can directly affect image quality, especially on circuit board surfaces where uneven material reflection can create light spots or shadows, interfering with image analysis. Therefore, illumination equalization is performed first after image acquisition. This step uses image preprocessing algorithms (such as histogram equalization) to adjust the brightness and contrast of the image, making the details on the circuit board surface more prominent. Illumination equalization adjusts the global brightness distribution of the image to ensure that the brightness range is as uniform as possible, eliminating image distortion caused by uneven lighting. This helps improve the stability of subsequent image analysis, ensuring that the model can accurately extract defect features even in low-contrast or high-reflection areas.
[0083] The image is smoothed to remove interference from non-target signals;
[0084] During image acquisition, camera sensors or environmental factors (such as electronic device interference) often cause various types of noise in images, such as salt noise, salt-and-pepper noise, and random noise. To address this issue, noise removal is necessary, which involves smoothing the image to remove interference from non-target signals. Common denoising methods include Gaussian filtering, median filtering, and bilateral filtering. Gaussian filtering smooths the image by calculating a weighted average of the area surrounding each pixel, making it particularly suitable for Gaussian noise. Median filtering effectively removes salt-and-pepper noise by replacing each pixel value with the median of its neighborhood. Bilateral filtering takes into account image edges, preserving edge information while removing noise, which is especially important for preserving details in circuit board images. These denoising methods can help remove noise caused by equipment errors or external factors, ensuring that subsequent image analysis can be based on clear and clean images.
[0085] After image acquisition and denoising, image standardization and resizing are performed.
[0086] This step is crucial for ensuring that subsequent deep learning models can correctly process input images and maintain consistent image sizes. First, images need to be standardized, for example, by scaling them to a fixed resolution (e.g., 256x256 pixels or 512x512 pixels) to ensure consistent input size for each image, facilitating batch processing by the deep learning model. During image resizing, the aspect ratio must be maintained to avoid distortion caused by stretching or scaling. Furthermore, images need color standardization (e.g., RGB channel standardization), normalizing pixel values to a uniform range (e.g., 0-1 or -1 to 1) to eliminate differences in brightness and dynamic range between different images. Standardized images effectively reduce bias caused by data inconsistencies, improving the convergence speed and accuracy of model training.
[0087] Convolutional Neural Networks (CNNs) are used to extract features from the acquired electronic circuit board images. The CNN model extracts local and global features from the images through layer convolution and pooling operations, providing rich feature representations for subsequent defect detection.
[0088] A convolutional neural network (CNN) is used to extract features from the acquired electronic circuit board images. The CNN model extracts local and global features from the images through convolution and pooling operations, providing rich feature representations for subsequent defect detection. The specific steps are as follows:
[0089] After high-resolution image acquisition and denoising, the image will be used as input to the CNN.
[0090] After the image is input into the CNN, it first enters the convolutional layer. The function of the convolutional layer is to perform convolution operations on the image using multiple convolutional kernels (or filters) to extract local features such as edges, textures, and corners. The convolution operation scans the entire image by sliding the convolutional kernel, performing weighted summations in each local region, and generating a feature map. These feature maps reflect basic information in the image, such as lines, boundaries, and color variations, helping the network capture subtle local features on the circuit board. Due to the different sizes of the convolutional kernels, the network can extract features at different scales, providing richer input data for subsequent defect detection.
[0091] An activation function is added after each convolution operation to introduce a non-linear mapping.
[0092] Activation functions convert negative values in the feature map output by convolution operations to zero while retaining positive values, thereby enhancing the model's non-linear expressive power. ReLU helps networks adapt more flexibly to complex image patterns, avoiding the expressive limitations of linear models. Through activation functions, networks can better capture features with irregular or non-linear variations in images, which is particularly important when identifying complex defects on circuit boards (such as micro-cracks or irregular defects). Furthermore, ReLU improves training speed and stability, prevents the vanishing gradient problem, and enables deep networks to be trained and optimized effectively.
[0093] Pooling is performed after convolution and activation functions;
[0094] The primary function of pooling layers is to downsample feature maps, reducing their size while retaining the most important information. Common pooling operations include max pooling and average pooling. Max pooling selects the maximum value in each local region to represent the feature of that region, while average pooling takes the average value of local regions. Pooling operations can reduce the dimensionality of feature maps, thereby reducing computational cost and improving the model's computational efficiency. Furthermore, pooling layers can enhance the model's tolerance to changes in local locations, enabling the network to accurately detect defects in different locations.
[0095] After convolution and pooling operations, the deep network of the CNN will begin to extract global features from the image, thereby gaining a higher level of understanding of the image of the entire circuit board.
[0096] As the number of network layers increases, the network can gradually extract more abstract features from the detailed information of an image, such as different types of defects and defects of different shapes. Deep CNN networks can fuse local and global features to form a complete feature representation. Especially in defect detection, the network can not only identify the local features of a single defect but also understand the relationships between these features, thus making accurate classification and localization. Finally, after convolution and pooling operations, the feature vector output by the CNN will serve as the input to subsequent classifiers or regressors, providing powerful feature support for accurate defect detection and localization.
[0097] The high-dimensional data extracted by the deep learning model is processed using random matrix theory (RMT). By constructing a data matrix, the feature decomposition method of random matrix theory (RMT) is applied to analyze the noise patterns in the image, and statistical analysis methods are used to distinguish between noise and defects, thereby reducing the interference of noise on defect identification.
[0098] The high-dimensional data extracted by the deep learning model is processed using random matrix theory (RMT). By constructing a data matrix, the interference of noise on defect identification is reduced. The specific steps are as follows:
[0099] After the CNN extracts features, a set of high-dimensional data is obtained, which contains both local and global features of the image;
[0100] To apply RMT, these high-dimensional data need to be converted into matrix form for subsequent statistical analysis. Typically, image features are unfolded into a two-dimensional matrix, where each row represents a sample and each column represents a feature. The constructed data matrix can include features from multiple images or features extracted from different convolutional layers of a single image. In this way, RMT can perform statistical analysis on these high-dimensional data, looking for potential noise patterns and anomalies in the data structure. This step is fundamental to applying RMT, providing the mathematical framework for subsequent analysis of noise and defects.
[0101] The eigenvalue decomposition method of RMT is used to perform spectral analysis on the constructed data matrix;
[0102] Image feature matrix mapping (RMT) identifies different statistical properties in data by calculating the eigenvalue distribution of the data matrix. The eigenvalues of the image feature matrix reflect the internal structure of the data, and their distribution can reveal the difference between noise and useful signals (such as defect features). Under normal circumstances, noise in an image typically manifests as small, dispersed eigenvalues; while defect features usually appear as concentrated or anomalous peaks in the eigenvalue distribution. By analyzing the eigenvalues, potential noise patterns can be discovered and distinguished from real defects in the image.
[0103] The key steps for noise pattern recognition are obtained through eigenvalue decomposition using RMT.
[0104] The model separates noise from actual defects based on the magnitude and distribution of feature values. Noise typically manifests as small, widely distributed patterns with small feature values, while true defect features usually exhibit concentrated feature values or specific patterns. Therefore, when using RMT for data denoising, the portion with small feature values (i.e., noise) is usually suppressed, retaining only those feature values relevant to defects. This can be achieved by setting a threshold, removing feature values smaller than that threshold from the data matrix. In this way, noise is effectively filtered, providing cleaner and more stable input data for subsequent defect detection.
[0105] After feature decomposition and noise removal, the remaining high-dimensional data contains image features that have been filtered out of noise, and the retained features accurately reflect the defects in the image.
[0106] Statistical analysis methods are used to further process the denoised data, ensuring that noise and defects are effectively distinguished. Specifically, cluster analysis, correlation analysis, and other methods can be used to classify the remaining features, ensuring that only those features relevant to the actual defects are retained. These effective features are then used as input data to subsequent defect detection models (such as classifiers or regressors) to further optimize the defect detection results. In this way, RMT helps deep learning models improve their robustness to noise, reduce false positives and false negatives, and thus greatly improve the accuracy and stability of defect detection.
[0107] Based on deep learning algorithms, this method combines features processed by random matrix theory (RMT) to classify and detect defects. By using multi-task learning (MTL) method, the image defect classification and localization problems are jointly optimized, thereby effectively identifying different types of defects.
[0108] Based on deep learning algorithms, this method combines features processed by random matrix theory (RMT) for defect classification and detection. Multi-task learning (MTL) is used to jointly optimize the image defect classification and localization problems, thereby effectively identifying different types of defects. The specific steps are as follows:
[0109] The features processed by CNN and RMT will be used as input to a multi-task learning (MTL) model. In the MTL framework, a shared neural network model is typically constructed, with one part of the network structure used for image classification and another part for localization. Let the input features processed by CNN and RMT be represented as... Where m is the number of samples and n is the feature dimension of each sample, the multi-task learning model performs joint training of two tasks by sharing some network layers;
[0110] The output of the localization task is the coordinates L = {x, y} of the defect location. The constructed MTL model will share the parameter θ. shared The input features are learned, and the calculation expression is as follows:
[0111]
[0112] In the formula, F shared F represents the shared features output after passing through the shared network layer, where F is the input feature. It is a nonlinear transformation of the shared part;
[0113] In MTL, to jointly optimize classification and localization tasks, the loss function needs to consider the losses of both tasks and perform a weighted average. The cross-entropy loss function is used to calculate the classification loss, and the calculation expression is as follows:
[0114]
[0115] In the formula, L class It is classification loss, y ij It is the one-hot encoded value of the true label, which is the true label of sample i belonging to category j. It is the predicted probability value, the model's predicted probability that sample i belongs to class j, and k is the total number of classes;
[0116] The loss in the localization task is calculated using the mean squared error (MSE) to determine the coordinate error. The calculation expression is as follows:
[0117]
[0118] In the formula, L loc It is the localization loss, which is the difference between the predicted location and the actual location calculated by the model when making location predictions. and Let x and y represent the x-coordinates and y-coordinates of the defect location predicted by the model for the i-th sample, respectively. i and y i Let x and y represent the actual defect location of the i-th sample, respectively;
[0119] To balance the impact of the two tasks on the model, a weighting coefficient λ is introduced. class and λ loc The two losses are weighted and combined to obtain the final multi-task loss function, which is calculated as follows:
[0120] L MTL =λ class L class +λ loc L loc
[0121] In the formula, L MTL It is the joint loss function, the total loss function in multi-task learning, and it is the loss L for classification tasks. class And the loss of the positioning task L loc The weighted sum, λ class λ is the weight coefficient of the classification task, which determines the importance of the classification task in the total loss function. loc It is the loss function for classification tasks, which measures the difference between the class probabilities predicted by the model and the true labels;
[0122] The goal of optimization is to minimize this weighted loss function, expressed as follows:
[0123]
[0124] In the formula, The model's parameters θ and L are optimized by minimizing the loss function. MTL(θ) is the total loss function, where θ represents the model parameters, which is the set of model parameters, typically including all network weights and biases. class (θ) is the loss function for the classification task, used to measure the difference between the class predicted by the model and the true class. loc (θ) is the loss function for the localization task, which calculates the difference between the predicted defect coordinates and the true coordinates using mean squared error (MSE).
[0125] To optimize the loss function L MTL The gradient descent method (such as the Adam optimizer) is used to minimize the loss function. In each training round, the gradient of each parameter is calculated using the following formula, and the parameters are updated.
[0126]
[0127] In the formula, η is the learning rate. The loss function L MTL (θ) is the gradient of the parameter θ;
[0128] Since the tasks share parts of the network, during backpropagation, the gradients are propagated to the relevant parameters of both the classification and localization tasks, and these parameters are adjusted according to the weighted values of the loss function.
[0129] After training, the model outputs classification probabilities. and positioning coordinates and The final classification and location of defects are performed. The classification task determines the type of defect by the maximum probability value output, as shown in the following expression:
[0130]
[0131] In the formula, c pred It is the predicted class label that the model ultimately outputs, based on the model's classification probability. The predicted category is determined by taking the maximum probability value;
[0132] The accuracy of the location is assessed by calculating the error between the predicted coordinates and the actual coordinates. The following metrics are used to evaluate the positioning accuracy.
[0133]
[0134] In the formula, Position Error represents the error between the predicted defect location and the actual location. This error measures the distance between the predicted and actual locations. The unit is the number of pixels in the image, reflecting the accuracy of the localization task.
[0135] Based on the deep learning model, an adaptive algorithm optimization process is introduced. Error correction is performed through an improved loss function. An optimization algorithm based on gradient descent is adopted, combined with high-dimensional features extracted by random matrix theory (RMT), to iteratively optimize the model and improve the accuracy and robustness of defect detection.
[0136] Based on the deep learning model, the model is iteratively optimized to improve the accuracy and robustness of defect detection. The specific steps are as follows:
[0137] In the optimization process, the parameters of the deep learning model are first initialized, and the high-dimensional features processed by RMT are used as input data for processing. Let the input features of the model be... Where m is the total number of samples, and d is the feature dimension of each sample. After the features are extracted by the deep learning model, the parameters in the model will affect the final prediction result. By optimizing the parameters, the output of the model can be made to fit the real label more closely. The expression is as follows: f(X,W,b)=XW+b, where f(X,W,b) is the predicted output of the model, X is the feature input matrix after RMT processing, and W and b are the weight and bias parameters of the model, respectively.
[0138] To optimize the model parameters, a loss function is defined to measure the difference between the model output and the true label. An improved loss function is adopted, incorporating the characteristics of image defect detection and adding a noise suppression term. The standard loss function is set as mean squared error. To address noise interference, a regularization term λR(W) based on RMT is introduced, where R(W) represents the norm of the feature matrix extracted through RMT analysis. The final loss function formula is as follows:
[0139]
[0140] In the formula, L(W,b) is the sum of the losses over the entire training set, and f(X) is the sum of the losses over the entire training set. p W,b) is the model's predicted output, representing the model's prediction for the p-th sample, X. p Y is the input feature of the p-th sample. p λ is the true label of the p-th sample, and λR(W) is the regularization term used to control the impact of the regularization term on the loss function;
[0141] Next, gradient descent is used to minimize the loss function, and the parameters are updated by calculating the gradient of the loss function with respect to the model parameters W and b. Specifically, the gradients of the weights and biases are obtained by calculating the partial derivatives of the loss function with respect to the parameters, as shown in the following expressions:
[0142]
[0143] The update rules are as follows:
[0144]
[0145] In the formula, λ is the regularization coefficient, used to control the weight of the regularization term, Y is the true label matrix of size m·d, where d is the feature dimension of each sample, and X... T W is the transpose of matrix X. (t+1) It is the weight at the (t+1)th iteration, b (t+1) It is the bias at the (t+1)th iteration, η is the learning rate, and W (t) b is the weight at the t-th iteration. (t) It is the bias at the t-th iteration;
[0146] The purpose of the update rule is to adjust the parameters (weights and biases) of the deep learning model using gradient descent to minimize the loss function, thereby improving the model's performance in defect detection tasks. Specifically, the update rule calculates the direction and magnitude of each parameter adjustment based on the gradient of the loss function with respect to the model parameters. The gradient represents the rate of change of the loss function with respect to the model parameters, indicating the direction in which the loss function increases or decreases most rapidly. Therefore, the parameters are adjusted along the direction of the negative gradient, i.e., optimized "in the direction of minimum loss." By iteratively updating the parameters, the model gradually reduces the difference between predicted and true values, thus achieving more accurate defect detection. In this process, gradient descent continuously optimizes the weights and biases, gradually reducing the model's error on the training data, ultimately achieving superior performance. This update rule effectively guides the model to converge to the optimal solution and improves the model's generalization ability and robustness.
[0147] To improve the efficiency of the optimization process, the adaptive optimization algorithm Adam optimizer is introduced. Adam optimizer combines the ideas of momentum and adaptive learning rate adjustment. During each update, Adam optimizer adjusts the learning rate of each parameter based on the mean and variance of past gradients, further improving the speed and stability of parameter updates. The update formula of Adam is as follows.
[0148]
[0149] In the formula, Let β1 represent the mean gradient of the weight W at the t-th iteration, i.e., the momentum term, used to accelerate the gradient descent process. β1 is the momentum decay coefficient, usually taken as 0.9, which determines the influence of the previous step's mean gradient on the current mean gradient. This represents the mean gradient of the previous iteration. This represents the gradient of the loss function L(W,b) with respect to the weights W, i.e., the derivative of the loss with respect to the weights, indicating how to adjust the weights to minimize the loss function. This represents the mean squared gradient of the weight W at the t-th iteration, i.e., the RMSProp part, which reflects the fluctuation of the gradient. β2 is the gradient squared decay coefficient, usually taken as 0.999. This represents the mean squared gradient of the previous iteration. This represents the mean gradient after bias correction following the t-th iteration, thus avoiding the initial bias towards zero. Let represent the mean squared gradient after bias correction following the t-th iteration. ∈ is a small constant used to prevent division by zero errors and ensure stability.
[0150] Through the derivation of the above formulas, the Adam optimizer effectively combines momentum and adaptive learning rate adjustment. It dynamically adjusts the step size based on the mean and mean squared gradients during each parameter update, accelerating convergence and avoiding overfitting. By adjusting these optimization parameters, Adam can quickly and stably optimize model parameters in complex tasks, such as electronic circuit board defect detection, thereby improving detection accuracy and robustness.
[0151] Specific Implementation Method 1: This implementation method proposes an electronic circuit board (PCB) defect detection system integrating convolutional neural networks (CNN) and random matrix theory (RMT), aiming to improve the accuracy and robustness of defect identification during the manufacturing process of electronic products. This system achieves high-precision defect detection through a series of steps, from image acquisition to denoising, feature extraction, noise filtering, and optimization processing.
[0152] First, the system acquires images of the electronic circuit board using a high-resolution industrial camera. High-resolution images can capture minute defects and detailed structures on the PCB, which is crucial for subsequent defect detection. However, due to factors such as uneven lighting, sensor errors, or environmental interference in practical applications, the images may contain significant noise. Therefore, denoising processing is essential after image acquisition to improve image quality. This denoising process includes illumination equalization, white balance correction, and image size standardization. Illumination equalization ensures uniform brightness distribution across the entire image area, preventing detail loss in some areas due to uneven light sources; white balance correction corrects color distortion and restores the image's natural colors; and image size standardization ensures consistency in subsequent deep learning models, facilitating batch processing. The core objective of this stage is to remove noise caused by equipment and environmental factors, providing stable and clear input data for subsequent feature extraction.
[0153] The denoised image is then fed into a Convolutional Neural Network (CNN) for feature extraction. CNNs are powerful in image processing; through multiple convolutional, activation, and pooling layers, they can extract multi-level feature information from images. In the first convolutional layer, the CNN uses a set of convolutional kernels to perform convolution operations on the image, capturing low-level features such as edges, textures, and shapes. As the number of network layers increases, the CNN gradually shifts from local feature extraction to global feature extraction, identifying more complex structures and patterns in the image (such as connections, solder joints, and potential defect areas on a circuit board). This hierarchical feature extraction approach allows CNNs to automatically extract important, manually designed features from images, laying the foundation for subsequent defect detection.
[0154] After CNN extracts features, a high-dimensional feature representation is obtained. These features may contain noise or irrelevant information, affecting the accurate identification of subsequent defects. To address this issue, the system introduces Random Matrix Theory (RMT). RMT identifies noise patterns in the high-dimensional data by performing eigenvalue decomposition and distinguishes them from true defect features. Specifically, RMT first constructs a data matrix, converting the high-dimensional features extracted by CNN into a mathematical matrix form. Then, RMT performs spectral analysis on this matrix to calculate the distribution of eigenvalues. According to RMT theory, noise typically manifests as smaller eigenvalues, while defect features are characterized by larger eigenvalues or a concentration of specific patterns. Through this analysis, RMT can effectively identify and suppress noise components, removing them from the data matrix and retaining representative defect features. This process improves the model's robustness to noise, making subsequent defect classification and localization more accurate.
[0155] The high-dimensional features optimized by RMT are input into the subsequent classification model for defect classification and localization. Defect detection not only needs to identify the types of defects on the circuit board (such as cracks, poor soldering, short circuits, etc.), but also needs to accurately locate the specific positions of these defects in the image. To achieve this goal, this implementation adopts the multi-task learning (MTL) method, which simultaneously handles defect classification and location regression by jointly training a classifier and a regressor. The classification task is responsible for determining whether each region contains a defect and classifying its type; the regression task is responsible for accurately predicting the location of the defect in the image. Through joint optimization by MTL, the model can handle multiple target tasks simultaneously, avoiding information loss and improving the overall detection performance. After these steps, the final system can efficiently and accurately identify and locate various defects on the electronic circuit board.
[0156] Specific Implementation Method Two: This implementation method proposes an electronic circuit board defect detection method combining adaptive algorithms and RMT optimization. This method uses an adaptive algorithm to optimize the deep learning model and combines it with RMT technology to identify and remove noise, ultimately achieving high-precision defect detection with a low false detection rate. Unlike traditional methods, this system continuously adjusts the parameters during the learning process, enabling the model to adaptively adjust the detection strategy under different environmental conditions.
[0157] The system first uses a high-resolution camera to acquire PCB images and then performs noise reduction processing. During image acquisition, a high-quality industrial camera is used to ensure sufficiently detailed image data, especially for minute circuit defects. The core of the noise reduction process is to eliminate interference introduced by factors such as uneven lighting, sensor errors, and environmental noise. In addition to basic illumination equalization and white balance correction, noise removal algorithms (such as bilateral filtering) are introduced during the noise reduction process. Bilateral filtering can remove noise while preserving edge information in the image, which is crucial for subsequent defect detection, ensuring that subtle defects on the circuit board are not blurred or lost.
[0158] After image denoising, feature extraction is performed using a convolutional neural network (CNN). To improve the stability and accuracy of the training process, this implementation introduces an adaptive optimization algorithm. Traditional gradient descent methods in deep learning sometimes encounter problems such as slow convergence and local optima. Adaptive optimization algorithms (such as the Adam optimizer) dynamically adjust the learning rate based on changes in the loss function during training, thereby accelerating convergence and avoiding getting trapped in local optima. Adaptive optimization algorithms allow the model to adjust parameters more flexibly to adapt to image features of varying complexity, thus improving the accuracy and robustness of defect detection.
[0159] Before training the deep learning model, the system also utilizes Random Matrix Theory (RMT) to analyze and optimize the high-dimensional features extracted by the CNN. RMT, through eigenvalue decomposition of the data matrix, can identify the differences between noise patterns and defect features in the image. Through spectral analysis of the feature matrix, RMT can reveal the differences between noise and defect features, filtering out noise with small eigenvalues and retaining larger eigenvalues that are relevant to actual defects. Thus, the RMT-optimized features significantly reduce noise interference, improving the model's robustness in complex environments. Finally, these optimized features are input into the classifier for defect identification and localization.
[0160] The optimized feature data is fed into a classifier for final defect detection. This stage uses a multi-task learning (MTL) method to simultaneously optimize defect classification and defect localization tasks. In this way, the system can not only accurately identify the types of defects on the circuit board but also precisely locate their positions. Finally, by combining adaptive optimization algorithms and RMT optimization, the system can maintain high-precision defect detection capabilities even in noisy environments, reducing false positives and false negatives and improving detection stability.
[0161] Specific Implementation Method 3: This implementation method proposes an electronic circuit board defect detection system based on random matrix theory (RMT) and multi-task learning (MTL), aiming to solve the problems of large noise interference and low defect recognition accuracy in traditional methods. Through joint optimization of multi-task learning, the system can simultaneously handle defect classification and localization tasks. Combined with the noise filtering capability of RMT, the entire detection process is more efficient and accurate.
[0162] In this embodiment, a high-resolution camera is first used to acquire PCB images to ensure that the image quality meets the requirements of subsequent analysis. The acquired images may be affected by various factors, such as ambient light and device sensor errors, resulting in noise in the images. Therefore, denoising processing must be performed after image acquisition. Denoising is not simply removing random noise from the image; it also includes preprocessing operations such as illumination equalization and white balance correction. These processing steps can reduce the impact of environmental changes, ensure stable image quality, and provide clean input data for subsequent deep learning models.
[0163] The denoised image is fed into a Convolutional Neural Network (CNN) for feature extraction. The CNN extracts local and global features through convolutional and pooling layers, identifying structural information such as circuit board details, solder joints, and connecting lines. In this embodiment, a multi-task learning (MTL) method is employed to jointly optimize defect classification and localization tasks. MTL allows for simultaneous training of multiple tasks within the same model, thereby improving model efficiency and accuracy. Through joint training, the network can simultaneously handle defect classification and localization in images, avoiding information loss or inconsistencies between features, and improving the overall detection performance of the system.
[0164] After CNN feature extraction, the system optimizes the high-dimensional data using Random Matrix Theory (RMT). RMT performs spectral analysis on the feature matrix to identify and remove noise from the data. Noise typically manifests as small eigenvalues; RMT filters these eigenvalues, retaining more valuable defect-related features. This process effectively improves the model's robustness and reduces the impact of noise interference on defect detection. Finally, the RMT-optimized features are passed to the classifier and regressor for defect classification and localization.
[0165] After multi-task learning and RMT optimization, the features are finally fed into the classification module for accurate defect classification and localization. By combining classification and regression tasks, the system can accurately identify various defects in images and locate their specific positions on the circuit board. Thanks to the integration of RMT noise optimization and MTL joint training, the system maintains high accuracy and robustness in defect detection in complex production environments, significantly improving quality control in the electronic circuit board manufacturing process.
[0166] This invention effectively solves the noise interference problem in PCB defect detection by combining Convolutional Neural Networks (CNNs) and Random Matrix Theory (RMT). CNNs can automatically identify local details and global structures of the circuit board from images during image feature extraction, especially complex defect types. Compared with traditional methods, CNNs can more accurately identify small or irregular defects, while RMT effectively suppresses noise influence through feature decomposition of high-dimensional data, enhancing the model's robustness to non-standard noise in images (such as uneven lighting, sensor errors, etc.). Through noise analysis and filtering using RMT, the system can identify and remove noise components in the image, enabling the model to maintain high detection accuracy in various complex environments, thereby significantly improving the accuracy and robustness of the entire detection system.
[0167] Especially in complex production environments, PCB quality inspection is often affected by various factors, such as equipment aging, changes in ambient lighting, and sensor errors, all of which can lead to a decline in image quality. Traditional image processing methods often struggle to handle this complex noise, resulting in false positives or false negatives. However, by combining deep feature extraction from CNNs and noise filtering from RMTs, this solution effectively reduces the impact of these external factors, ensuring high accuracy and stability in defect detection results. The application of this technology significantly improves the automation level and inspection accuracy of the electronic circuit board inspection process, helping to increase production efficiency, reduce costs, and minimize quality problems, particularly in the field of high-precision electronic products where defect requirements are extremely stringent.
[0168] This invention further optimizes the defect detection process through adaptive algorithm optimization and multi-task learning (MTL), not only improving detection efficiency but also significantly reducing false positives and false negatives. The adaptive algorithm dynamically adjusts the learning rate based on changes in the loss function during training, ensuring the deep learning model converges quickly and avoids getting trapped in local optima, thus effectively shortening training time. Simultaneously, the multi-task learning method jointly trains defect classification and localization tasks, enabling the model to complete multiple objectives in a single processing step, improving overall detection efficiency. Through joint optimization, the model can accurately determine the defect type and precisely locate its position in the image, avoiding redundant computation and inconsistencies caused by training multiple models individually.
[0169] Furthermore, RMT effectively removes noise from image features when processing high-dimensional data, retaining only meaningful defect features. This allows the system to extract useful information from a large number of PCB images more quickly in practical applications, significantly improving detection speed. By reducing noise interference, the system also lowers the false positive and false negative rates, especially when dealing with images in complex backgrounds and environments (such as aging equipment or uneven lighting), where detection accuracy is greatly improved. Overall, the combination of adaptive optimization and RMT technology enables this solution to identify defects more efficiently and accurately in industrial production, significantly improving the automation level and detection accuracy of production lines while reducing the cost and error rate of manual inspection.
[0170] The foregoing has only described certain exemplary embodiments of the present invention by way of illustration. Undoubtedly, those skilled in the art can modify the described embodiments in various ways without departing from the spirit and scope of the present invention. Therefore, the foregoing drawings and descriptions are illustrative in nature and should not be construed as limiting the scope of protection of the claims of the present invention.
Claims
1. An intelligent method for detecting defects in electronic circuit boards based on an RMT deep learning model, characterized in that, Includes the following steps: Images of electronic circuit boards are acquired using a high-resolution camera, and the images are then denoised. Convolutional neural networks are used to extract features from the acquired electronic circuit board images. The convolutional neural network model extracts local and global features from the images through layer convolution and pooling operations. The high-dimensional data extracted by the deep learning model is processed using random matrix theory. By constructing a data matrix, the feature decomposition method of random matrix theory is applied to analyze the noise patterns in the image, and statistical analysis methods are used to distinguish between noise and defects. The specific steps are as follows: After the CNN extracts features, a set of high-dimensional data is obtained, which contains both local and global features of the image; The eigenvalue decomposition method of RMT is used to perform spectral analysis on the constructed data matrix; After performing eigenvalue decomposition in RMT, when using RMT for data denoising, the part with smaller eigenvalues, i.e., noise, is usually suppressed, and only those eigenvalues related to defects are retained. By setting a threshold, the part corresponding to eigenvalues smaller than the threshold is removed from the data matrix. After feature decomposition and noise removal, the remaining high-dimensional data contains image features that have been filtered out of noise. Based on deep learning algorithms, this method combines features processed by random matrix theory to classify and detect defects. It also utilizes a multi-task learning approach to jointly optimize the problem of image defect classification and localization. Based on the deep learning model, an adaptive algorithm optimization process is introduced. An improved loss function is used to correct errors. An optimization algorithm based on gradient descent is adopted, combined with high-dimensional features extracted by random matrix theory, to iteratively optimize the model.
2. The intelligent method for detecting electronic circuit board defects based on the RMT deep learning model according to claim 1, characterized in that, The following are the specific steps for acquiring images of electronic circuit boards using a high-resolution camera and then denoising the images to reduce the noise impact caused by environmental factors and equipment errors: First, a high-resolution camera is used to capture images of the electronic circuit board; After image acquisition, illumination equalization is performed; The image is smoothed to remove interference from non-target signals; After image acquisition and denoising, the image is standardized and resized.
3. The intelligent method for detecting electronic circuit board defects based on the RMT deep learning model according to claim 1, characterized in that, A convolutional neural network (CNN) is used to extract features from the acquired electronic circuit board images. The CNN model extracts local and global features from the images through convolution and pooling operations. The specific steps are as follows: After high-resolution image acquisition and denoising, the image will be used as input to the CNN. An activation function is added after each convolution operation to introduce a non-linear mapping. Pooling is performed after convolution and activation functions; After convolution and pooling operations, the deep network of the CNN will begin to extract global features from the image, thereby gaining a higher level of understanding of the image of the entire circuit board.
4. The intelligent method for detecting electronic circuit board defects based on the RMT deep learning model according to claim 1, characterized in that, Based on deep learning algorithms, and combined with features processed by random matrix theory, defects are classified and detected. A multi-task learning method is used to jointly optimize the image defect classification and localization problem. The specific steps are as follows: The features processed by CNN and RMT will be used as input to the multi-task learning model. Let the input features processed by CNN and RMT be represented as follows: ,in It is the sample size. It is the feature dimension of each sample. The multi-task learning model performs joint training of two tasks by sharing some network layers. The output of the localization task is the coordinates of the defect location. The constructed MTL model will share parameters. The input features are learned, and the calculation expression is as follows: In the formula, It is the shared feature output after passing through the shared network layer. These are input features. It is a nonlinear transformation of the shared part; In MTL, to jointly optimize classification and localization tasks, the loss function needs to consider the losses of both tasks and perform a weighted average. The cross-entropy loss function is used to calculate the classification loss, and the calculation expression is as follows: In the formula, It is classification loss. It is the one-hot encoded value of the real label, and it is the sample Category The true label, It is the predicted probability value; the model predicts the probability of a sample. Category The predicted probability, It is the total number of categories; The loss in the localization task is calculated using the mean squared error to determine the coordinate error. The calculation expression is as follows: In the formula, It's a location loss. and These represent the model's predicted first and second halves of the series. Location of defects in each sample coordinates and coordinate, and They represent the first The actual location of defects in each sample. coordinates and coordinate; To balance the impact of the two tasks on the model, weighting coefficients are introduced. and The two losses are weighted and combined to obtain the final multi-task loss function, which is calculated as follows: In the formula, It is a joint loss function. These are the weighting coefficients for the classification task. It is the loss function for the classification task; The goal of optimization is to minimize this weighted loss function, expressed as follows: In the formula, It optimizes the model parameters by minimizing the loss function. , It is the total loss function. These are model parameters. It is the loss function for the classification task. It is the loss function for the localization task; To optimize the loss function The gradient descent method is used to minimize the loss function. In each round of training, the gradient of each parameter is calculated using the following formula, and the parameters are updated. In the formula, It's the learning rate. It is a loss function For parameters The gradient; After training, the model outputs classification probabilities. and positioning coordinates and The final classification and location of defects are performed. The classification task determines the type of defect by the maximum probability value output, as shown in the following expression: In the formula, It is the predicted class label that the model ultimately outputs, based on the model's classification probability. The predicted category is determined by taking the maximum probability value; The accuracy of the location is assessed by calculating the error between the predicted coordinates and the actual coordinates. The following metrics are used to evaluate the positioning accuracy. In the formula, This indicates the error between the predicted defect location and the actual defect location.
5. The intelligent method for detecting electronic circuit board defects based on the RMT deep learning model according to claim 1, characterized in that, The specific steps for iterative optimization of a deep learning model are as follows: In the optimization process, the parameters of the deep learning model are first initialized, and the high-dimensional features processed by RMT are used as input data for processing. Let the input features of the model be... ,in, This is the total number of samples. For each sample's feature dimension, after the deep learning model extracts the features, the parameters in the model will affect the final prediction result. By optimizing the parameters, the model's output can be made to better match the true label, as shown in the following expression: In the formula, It is the model's predicted output. It is the feature input matrix after RMT processing. and These are the model's weights and bias parameters, respectively. To optimize the model parameters, a loss function is defined to measure the difference between the model output and the true label. An improved loss function is adopted, incorporating the characteristics of image defect detection by adding a noise suppression term. The standard loss function is set as mean squared error, and to address noise interference, a regularization term based on RMT is introduced. ,in, The norm of the feature matrix extracted through RMT analysis is represented by the following formula for the final loss function: In the formula, It is the sum of the losses across the entire training set. It is the model's predicted output, representing the model's prediction for the th... Prediction for each sample It is the first Input features of each sample It is the first The true label of each sample This is a regularization term used to control the impact of the regularization term on the loss function; Next, gradient descent is used to minimize the loss function, and the model parameters are calculated by evaluating the loss function. and The gradients are used to update these parameters. Specifically, the gradients of the weights and biases are obtained by calculating the partial derivatives of the loss function with respect to the parameters. The calculation expression is as follows: The update rules are as follows: In the formula, It is the regularization coefficient. It is the real label matrix, with a size of , It is the feature dimension of each sample. It is a matrix transpose, It is the first The weights at the next iteration It is the first Bias at the next iteration It's the learning rate. It is the first The weights at the next iteration It is the first Bias at the next iteration; To improve the efficiency of the optimization process, the adaptive optimization algorithm Adam optimizer is introduced. Adam optimizer combines the ideas of momentum and adaptive learning rate adjustment. During each update, Adam optimizer adjusts the learning rate of each parameter based on the mean and variance of past gradients, further improving the speed and stability of parameter updates. The update formula of Adam is as follows. In the formula, Indicates weight In the The mean gradient at the nth iteration It is the momentum decay coefficient. This represents the mean gradient of the previous iteration. Represents the loss function Weights gradient, Indicates weight In the The mean squared gradient at the next iteration. It is the gradient squared decay coefficient. This represents the mean squared gradient of the previous iteration. Indicates the first After the nth iteration, the mean gradient after bias correction Indicates the first After the nth iteration, the mean squared gradient after bias correction. It is a small constant used to prevent division by zero errors and ensure stability.
Citation Information
Patent Citations
Float glass defect detection system and detection method based on machine learning
CN116542963A
Structure defect detection using machine learning algorithms
US20200175352A1