Electronic circuit board defect detection method based on RMT model optimization YOLOv8 algorithm

By combining RMT and YOLOv8 algorithms, the feature analysis of electronic circuit board image data is optimized, and the data distortion problem of YOLOv8 when identifying small defects is solved, achieving higher detection accuracy and robustness.

CN119810047APending Publication Date: 2025-04-11CHINA THREE GORGES UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411860665.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-17
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

During the electronic circuit board defect detection process based on the RMT model optimization YOLOv8 algorithm, training data distortion may occur due to mismatch between the RMT model and the YOLOv8 characteristics, resulting in the model being unable to accurately identify the small defects on the electronic circuit board.

Method used

By combining the random matrix theory (RMT) and YOLOv8 object detection algorithm, high-dimensional feature analysis of image data is optimized, redundant information is removed and small defect features and edge information is retained, ensuring that defect features are not lost. At the same time, multi-scale feature fusion and loss function optimization are adopted to make YOLOv8 more sensitive to defects of different sizes.

Benefits of technology

It significantly improves the detection accuracy of tiny defects of electronic circuit boards (such as cracks, virtual welding joints, etc.), reduces the occurrence of false detection and missed detection, improves the accuracy and robustness of detection, and enables the model to maintain high accuracy in complex environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119810047A_ABST
    Figure CN119810047A_ABST
Patent Text Reader

Abstract

The invention discloses an electronic circuit board defect detection method based on an RMT model optimization YOLOv8 algorithm, and relates to the technical field of electronic circuit board defect detection, and the method comprises the following steps: obtaining high-resolution image data of an electronic circuit board, carrying out the preprocessing of the image data, and improving the image quality and the model robustness. According to the method, the random matrix theory and the YOLOv8 target detection algorithm are combined, so that the detection precision of the tiny flaws of the electronic circuit board is remarkably improved. RMT removes redundant information and retains details, and high-quality data is provided for YOLOv8. Multi-scale feature fusion and loss function optimization enhance the sensitivity of YOLOv8 to flaws of different sizes, and the robustness and generalization ability of the YOLOv8 are improved through data enhancement and structure optimization, so that efficient and stable detection performance is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of electronic circuit board defect detection, and in particular to an electronic circuit board defect detection method based on an RMT model to optimize an OLOv8 algorithm. Background Art

[0002] Optimizing the YOLOv8 algorithm for electronic circuit board defect detection based on the RMT (Random Matrix Theory) model refers to applying the idea of ​​random matrix theory to the optimization process of the YOLOv8 algorithm to improve its accuracy and efficiency in the task of electronic circuit board (PCB) defect detection. YOLOv8 is an advanced target detection algorithm based on convolutional neural network (CNN) and is widely used in real-time object detection tasks. Electronic circuit board defect detection usually requires high-precision and high-speed identification and classification of various defects on the circuit board (such as cracks, welding defects, etc.). By analyzing the characteristics of high-dimensional data, the RMT model can reveal the inherent structure and noise characteristics in the data, optimize the feature extraction and classification capabilities of YOLOv8, and thus improve the robustness and accuracy of defect detection in complex backgrounds. Specifically, RMT can help YOLOv8 more effectively process redundant information and noise in the input data, so that the model can reduce false detection and missed detection when identifying small or imperceptible defects, and improve the accuracy of detection.

[0003] The prior art has the following deficiencies:

[0004] In the process of defect detection of electronic circuit boards based on the RMT model to optimize the YOLOv8 algorithm, training data distortion may occur due to feature mismatch between the RMT model and the YOLOv8. Specifically, during the optimization process, the RMT model attempts to reduce noise and reconstruct the high-dimensional feature space of the data, which may excessively remove certain tiny defect features or edge information, resulting in YOLOv8 being unable to capture these weak defect features during training, thereby affecting the model's recognition of subtle defects in electronic circuit boards. This problem is particularly serious because defects on electronic circuit boards often appear as tiny cracks, cold solder joints, or tiny foreign objects on the surface, which themselves may be very difficult to detect. If the RMT model over-compresses or adjusts these key features, the YOLOv8 algorithm may not be able to accurately identify these defects, resulting in serious missed detection problems. Missed detection may directly affect the production quality of the product, cause potential safety hazards, and even cause batches of substandard products to enter the market, bringing great economic losses and brand reputation risks.

[0005] The above information disclosed in this Background section is only for enhancement of understanding of the background of the present disclosure and therefore it may contain information that does not constitute the prior art that is already known to one of ordinary skill in the art. Summary of the invention

[0006] The purpose of the present invention is to provide an electronic circuit board defect detection method based on the RMT model to optimize the YOLOv8 algorithm. By combining the random matrix theory (RMT) and the YOLOv8 target detection algorithm, this scheme significantly improves the detection accuracy of small defects (such as cracks, cold solder joints, etc.) of electronic circuit boards. RMT removes redundant information through high-dimensional feature analysis, retains key details, and provides high-quality training data for YOLOv8. Multi-scale feature fusion and loss function optimization make YOLOv8 more sensitive to defects of different sizes and maintain high accuracy in complex environments. Data enhancement and network structure optimization further enhance the robustness and generalization ability of YOLOv8, ensuring its efficient and stable operation in actual industrial environments to solve the problems in the above-mentioned background technology.

[0007] In order to achieve the above object, the present invention provides the following technical solution: an electronic circuit board defect detection method based on RMT model optimization YOLOv8 algorithm, comprising the following steps:

[0008] Obtain high-resolution image data of electronic circuit boards and preprocess the image data to improve image quality and model robustness;

[0009] Based on random matrix theory, the preprocessed image data is subjected to noise reduction and high-dimensional feature reconstruction to remove redundant information in the data while retaining tiny defect features and edge information to ensure that defect features are not lost;

[0010] The image data after RMT optimization is input into the YOLOv8 target detection algorithm for training, and the characteristics of various defects in electronic circuit boards are learned. During the training process, the network structure is optimized to improve the detection accuracy.

[0011] Use the trained YOLOv8 model to detect defects on electronic circuit boards, identify and calibrate defective areas in images, and output detection results;

[0012] Based on the detection results of the YOLOv8 algorithm, the accuracy and recall rate of minor defect detection are further improved through algorithm optimization, ensuring the accuracy of identifying small defects such as cracks, cold solder joints and surface foreign matter.

[0013] Preferably, the high-resolution image data of the electronic circuit board is obtained, and the image data is preprocessed to improve the image quality and the robustness of the model. The specific steps are as follows:

[0014] Firstly, high-quality image data is obtained from the scanning device;

[0015] After obtaining the high-resolution image, image denoising is performed;

[0016] After the denoising process is completed, the image is normalized and enhanced;

[0017] In order to better extract the tiny defects on the electronic circuit board, the image is processed with edge enhancement and detail highlighting.

[0018] Preferably, redundant information in the data is removed while retaining minor defect features and edge information to ensure that defect features are not lost. The specific steps are as follows:

[0019] After denoising, normalizing and enhancing the electronic circuit board image, the next step is to construct the high-dimensional feature space of the image, which is the basis of denoising based on random matrix theory;

[0020] After the high-dimensional feature space is constructed, the next step is to use random matrix theory to perform noise reduction;

[0021] Enhance important information in the image through feature reconstruction through RMT;

[0022] In the process of high-dimensional feature reconstruction, ensure that tiny defect features and edge information in the image are not lost.

[0023] Preferably, the image data after RMT optimization is input into the YOLOv8 target detection algorithm for training, the characteristics of various defects in the electronic circuit board are learned, and the network structure is optimized during the training process to improve the detection accuracy. The specific steps are as follows;

[0024] After the image data is optimized by RMT, the optimized image data is input into the YOLOv8 target detection model for training;

[0025] After completing image denoising and high-dimensional feature reconstruction based on random matrix theory, the optimized image data is then input into the YOLOv8 target detection algorithm for training;

[0026] In the YOLOv8 model, the convolutional layer is responsible for extracting multi-level features from the image. The model automatically learns the characteristics of various defects in the image during the training process.

[0027] In order to improve the accuracy of the model in electronic circuit board defect detection, the network structure of YOLOv8 will be optimized during the training process;

[0028] During the YOLOv8 training process, the training parameters are dynamically adjusted according to the training progress to further improve the detection accuracy.

[0029] Preferably, the trained YOLOv8 model is used to detect defects on electronic circuit boards, identify and calibrate defect areas in images, and output the detection results in the following specific steps:

[0030] The trained YOLOv8 model receives the RMT-optimized electronic circuit board image as input. The input image will first be extracted through the convolution layer of the network to generate multiple feature maps. Each feature map represents a different level of abstract information in the image. In YOLOv8, feature extraction is performed through multiple convolution layers. The model learns different features of the image in each layer. This process uses convolution operations, which can be expressed as:

[0031] F l =σ(W l ·F l-1 +b l ), where F l is the feature map of layer l, W l is the convolution kernel, F l-1 is the feature map of the previous layer, b l is the bias term, σ is the activation function;

[0032] After feature extraction, YOLOv8 predicts the bounding box of each target through regression. The YOLOv8 model predicts the position and confidence of the target box in the output layer. In each predicted box, the model calculates four parameters of a bounding box: center point coordinates x, y, width w and height h, and the confidence C of each bounding box. The regression formula calculation expression is as follows:

[0033] (x,y,w,h)=sigmoid(F l ),

[0034] C = sigmoid(F l ), where sigmoid(F l ) is the feature map F output by the sigmoid function applied to the convolutional layer l , C = sigmoid(F l ) is the confidence prediction in YOLOv8. For each predicted box, the model outputs a C value, which indicates the confidence that there is an object in the bounding box;

[0035] Each bounding box also needs to be classified and predicted. YOLOv8 will output a category probability vector for each predicted box, indicating the probability that each bounding box contains a certain type of defect. The category prediction process is also performed through the convolution layer, and the Softmax activation function is used to calculate the probability distribution of each category. The calculation expression of this process is as follows:

[0036] P class =Softmax(F l ),

[0037] , where P classis the predicted probability of each category, F i is the prediction score of category i, e is the natural base, F j is the prediction score of category j, P(class i ) is the probability that the prediction box belongs to category i;

[0038] Finally, after completing the target detection frame and classification prediction, YOLOv8 will use the non-maximum suppression algorithm to filter the predicted frame to remove redundant frames and retain the most accurate bounding box. The core idea of ​​the NMS algorithm is that if the overlap between two predicted frames exceeds the set threshold, the overlapping frame will be removed and only the frame with high confidence will be retained. The formula of NMS is as follows:

[0039]

[0040] B final = argmax B (IoU(B,B threshold )), where IoU(B1,B2) is the intersection-over-union ratio of the two predicted boxes, Area(B1∩B2) and Area(B1∪B2) represent the areas of the intersection and union of the two boxes, respectively. final is the final bounding box after NMS filtering, IoU(B,B threshold ) is the front frame B and the threshold B threshold The IoU value between the reference boxes given in .

[0041] Preferably, the specific steps of further improving the accuracy and recall rate of micro-defect detection through algorithm optimization and ensuring the accuracy of recognition of micro-defects such as cracks, cold solder joints and surface foreign matter are as follows:

[0042] In the preliminary stage of the target detection algorithm, we need to evaluate the accuracy and recall of the YOLOv8 model to provide a basis for further optimization. Accuracy and recall are important indicators for evaluating the detection effect of the model. They are defined as follows:

[0043] Precision indicates the proportion of samples correctly predicted as positive to all samples predicted as positive:

[0044] , where precision is the accuracy, TP is the true positive, indicating the defects that are correctly detected, and FP is the false positive, indicating the area that is incorrectly detected as a defect;

[0045] The recall rate indicates the proportion of samples correctly predicted as positive to all samples that are actually positive:

[0046] , where Recall is the recall rate, and FN is the false negative, indicating the missed defect area;

[0047] In order to further balance precision and recall and improve the model's recognition accuracy for small defects, F1-score is used as the optimization target. F1-score is the harmonic mean of precision and recall, and is used to comprehensively evaluate the performance of the model when dealing with imbalanced categories. The formula for F1-score is as follows:

[0048] , where F1-score is the blended average of precision and recall, which combines precision and recall to balance the impact between the two;

[0049] Next, the detection accuracy of small defects can be further improved by optimizing the IoU value. IoU measures the overlap between the predicted bounding box and the true bounding box. The calculation formula is:

[0050] , where IoU is a commonly used evaluation criterion in target detection, which measures the degree of overlap between the detection box predicted by the model and the real annotation box, Area of ​​Overlap represents the intersection area of ​​the predicted box and the real box, Area of ​​Union represents the union area of ​​the predicted box and the real box, A represents the bounding box predicted by the model, that is, the area containing defects predicted by the model in the image, B represents the real annotated bounding box, that is, the real area manually annotated and containing defects, A∩B is the intersection area of ​​the predicted box and the real box, and A∪B is the union area of ​​the predicted box and the real box;

[0051] In order to improve the recall rate of small defects and further reduce false negatives, the non-maximum suppression algorithm is used to optimize the merging and deduplication of detection frames. In YOLOv8, multiple detection frames will detect the same defect, so it is necessary to remove redundant frames through NMS and retain the optimal frame; the calculation process of NMS is as follows:

[0052] Sort all prediction boxes by confidence;

[0053] Select the box with the highest confidence and use it as the reference box;

[0054] For all boxes, calculate the IoU value with the reference box. If the IoU is greater than the set threshold, remove the box.

[0055] Repeat this process until all boxes have been processed;

[0056] The formula for NMS is as follows:

[0057] , IoU max is the maximum intersection-over-union ratio, and max is the box that most overlaps with the real box selected from multiple predicted boxes.

[0058] In the above technical solution, the technical effects and advantages provided by the present invention are:

[0059] The present invention optimizes image data based on random matrix theory and combines the training of the YOLOv8 target detection algorithm. This solution can significantly improve the detection accuracy of small defects (such as cracks, cold solder joints, etc.) in electronic circuit boards. RMT removes redundant information and retains key small defect features and edge information through high-dimensional feature analysis of image data, avoiding the problem of detail loss that may be caused by traditional denoising methods. The image data optimized by RMT can provide YOLOv8 with more refined and high-quality input, so that YOLOv8 can accurately identify small defects that are difficult to detect during the training process. This optimization method is particularly suitable for defect detection of electronic circuit boards, and can effectively deal with the problem of missed detection of traditional detection methods in small defect detection, thereby improving the accuracy of overall detection and reducing the occurrence of false detection and missed detection.

[0060] In addition, through multi-scale feature fusion and loss function optimization, YOLOv8 can extract features of images at different scales, making it more sensitive to tiny defects. Multi-scale feature fusion enables the model to handle defects of different sizes and enhances the ability to detect tiny details. During model training, by adjusting the loss function weights, the network is particularly strengthened in learning tiny defects, thereby further improving the accuracy of the model in detecting small defects. Ultimately, the optimized YOLOv8 can not only accurately identify small defects, but also maintain high-precision detection effects under various lighting and noise conditions, greatly improving the reliability and practicality of the detection task.

[0061] The present invention significantly improves the robustness and generalization ability of the YOLOv8 model through data enhancement, optimization of network structure and training strategy, so that it can still maintain efficient detection performance under different environmental conditions. First, the normalization and enhancement technology in image preprocessing is used, combined with high-quality training data, to ensure that YOLOv8 can process input images well under different brightness, contrast and noise conditions. Data enhancement technology (such as rotation, scaling, brightness adjustment, etc.) can expand the diversity of the training set, help the model adapt to different types of electronic circuit boards and complex backgrounds, and improve the generalization ability of the model on unknown data. This allows the trained YOLOv8 to not only achieve good results under laboratory conditions, but also to cope with various real-world challenges in actual industrial applications.

[0062] In addition, the optimization of network structure and the adjustment of learning rate during training further enhance the stability and robustness of the YOLOv8 model. Through multi-scale feature fusion and adaptive loss function design, the model can better adapt to the complex morphology and minor defects of electronic circuit boards, especially in images with partial missing or damaged parts, the model can still effectively identify defects. Further optimization, such as the use of dynamic learning rate, early stopping and transfer learning strategies, enables the model to maintain efficient learning ability with limited training data. In summary, through these technical optimizations, the robustness and generalization ability of YOLOv8 have been significantly improved, and it can maintain excellent performance in a changing actual production environment. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0064] Figure 1 This is a method flow chart of the electronic circuit board defect detection method based on the RMT model optimization YOLOv8 algorithm of the present invention. DETAILED DESCRIPTION

[0065] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these example embodiments are provided so that the description of the present disclosure will be more comprehensive and complete, and the concept of the example embodiments will be fully conveyed to those skilled in the art.

[0066] The present invention provides Figure 1 The electronic circuit board defect detection method based on RMT model optimization YOLOv8 algorithm shown includes the following steps:

[0067] Obtain high-resolution image data of electronic circuit boards and preprocess the image data to improve image quality and model robustness;

[0068] Obtain high-resolution image data of electronic circuit boards and preprocess the image data to improve image quality and model robustness. The specific steps are as follows:

[0069] Firstly, high-quality image data is obtained from the scanning device;

[0070] Scanning equipment usually has sensors with millions of pixels, which can capture tiny defects on the circuit board, such as micro cracks, cold solder joints, etc. To ensure the accuracy and completeness of the data, special attention should be paid to the control of lighting conditions during the acquisition process to avoid uneven image exposure due to too dark or too bright environments, which will affect subsequent processing. In addition, when acquiring images, it is necessary to ensure that the distance between the camera and the circuit board is stable to avoid distortion caused by position changes. The acquired images should have sufficient resolution, usually above 300dpi, so that small circuit board defects can be clearly displayed.

[0071] After obtaining the high-resolution image, image denoising is performed;

[0072] Image data will inevitably be interfered by noise during the acquisition process, which may come from the noise of the camera sensor, environmental interference (such as electromagnetic noise), etc. The denoising operation is to remove these interference signals by applying some algorithms, so that the key information of the image is more prominent and convenient for subsequent feature extraction. Common denoising algorithms include Gaussian filtering, median filtering, and bilateral filtering. Gaussian filtering removes noise by weighted averaging the surrounding pixels of each pixel; median filtering eliminates noise by taking the median value in the pixel neighborhood, which is particularly suitable for salt and pepper noise; bilateral filtering not only considers the spatial position of the pixel neighborhood, but also the color similarity of the pixels, which can remove noise while retaining edge details. After denoising, the noise of the image is reduced and the defect features are more prominent, laying the foundation for subsequent processing.

[0073] After the denoising process is completed, the image is normalized and enhanced;

[0074] Image normalization is to adjust the pixel values ​​of an image to a standard range, usually between 0 and 1 or -1 and 1, which can prevent the brightness difference of different images from affecting model training. The normalization operation is completed by subtracting the mean of each pixel value and dividing it by the standard deviation, so that each image has a similar dynamic range during the training process, thereby improving the stability and convergence speed of the model. In addition, image enhancement is to generate different versions of images by rotating, scaling, translating, or changing visual features such as brightness, contrast, and color to enhance the diversity of training data. Image enhancement can not only prevent the model from overfitting, but also improve the model's ability to adapt to images under various environmental conditions. In particular, when processing images with complex details such as electronic circuit boards, it can improve the accuracy and robustness of defect detection.

[0075] In order to better extract the tiny defects on the electronic circuit board, the image is processed with edge enhancement and detail highlighting;

[0076] Defects on circuit boards often appear as tiny cracks, cold solder joints, etc., and their edges and details are usually weak, so the edges and details of the image need to be particularly prominent. A commonly used enhancement method is gradient-based edge detection, such as the Sobel operator or the Canny edge detection. Through these algorithms, edge information in the image can be extracted and more prominent structural features in the image can be enhanced. In addition, methods such as Laplace filtering can be used to further enhance the details of the image, so that the model can accurately capture the edges of tiny defects. The enhanced image appears visually clearer and more detailed, providing high-quality data support for subsequent feature extraction and target detection.

[0077] Based on random matrix theory (RMT), the preprocessed image data is subjected to noise reduction and high-dimensional feature reconstruction to remove redundant information in the data while retaining tiny defect features and edge information to ensure that defect features are not lost.

[0078] Remove redundant information from the data while retaining tiny defect features and edge information to ensure that defect features are not lost. The specific steps are as follows:

[0079] After denoising, normalizing and enhancing the electronic circuit board image, the next step is to construct the high-dimensional feature space of the image, which is the basis of denoising based on random matrix theory (RMT);

[0080] In this process, it is first necessary to extract features from the pixels of the image. Usually, the image is segmented in a local or global manner to capture the high-dimensional features of each local area. In actual operation, high-dimensional vectors can be generated through convolution operations or other feature extraction methods (such as principal component analysis, SIFT, etc.). These feature vectors not only contain the overall structural information of the image, but also contain details and texture features, which are especially important for the extraction of tiny defects and edge information. By constructing such a high-dimensional feature space, a comprehensive and rich representation can be provided for subsequent denoising and reconstruction.

[0081] After the high-dimensional feature space is constructed, the next step is to use random matrix theory (RMT) for noise reduction;

[0082] The core idea of ​​RMT is to identify and remove noise by analyzing the statistical characteristics of data. In the high-dimensional feature space of an image, noise usually appears as random, irregular changes. RMT simulates noise by constructing a random matrix and determines which components are noise based on the distribution of the eigenvalues ​​of the matrix. According to RMT theory, noise components usually appear at the tail of the eigenvalue spectrum, while useful information of the image (such as defect features and edge information) is located in the main part of the spectrum. Therefore, by removing the noise components at the tail, the redundant information in the image can be effectively reduced, and the key information in the image, including subtle defect features and edges, can be retained. This denoising method of RMT can avoid the excessive suppression of image details by traditional denoising methods (such as Gaussian filtering), ensuring that defect features are well preserved.

[0083] Enhance important information in the image through feature reconstruction through RMT;

[0084] Feature reconstruction refers to the process of reconstructing image data to enhance the valuable information in the image and further highlight the characteristics of tiny defects. After denoising, the RMT algorithm will reconstruct the image based on the effective feature information retained in the image using a specific mathematical model (such as sparse representation, low-rank approximation, etc.) to reconstruct an image without redundancy but containing tiny defect features and detail information. This process retains the key details of the image by extracting the most representative features from the high-dimensional space of the data, making tiny defects (such as microcracks, cold solder joints, etc.) more obvious in the image while reducing interference caused by noise. In this process, RMT can not only remove data redundancy, but also improve the detectability of tiny defects by effectively reconstructing local information in the image.

[0085] In the process of high-dimensional feature reconstruction, ensure that tiny defect features and edge information in the image are not lost;

[0086] Since defects on electronic circuit boards often appear as small cracks, cold solder joints or foreign matter on the surface, these details may be very subtle, so special attention should be paid to retaining these features during reconstruction. Through the RMT reconstruction method, each detail is finely optimized to enhance the edge information of tiny defects. This process can be achieved through adaptive filtering, local contrast enhancement and other technologies to ensure that every detail in the image is fully highlighted without loss. In the final image, defect features and edge information will be more prominent, providing clearer and more accurate input data for the YOLOv8 target detection algorithm, thereby greatly improving the model's ability to recognize tiny defects. Through this series of operations, not only the image quality is optimized, but also a solid foundation is laid for subsequent target detection.

[0087] The image data after RMT optimization is input into the YOLOv8 target detection algorithm for training, and the characteristics of various defects in electronic circuit boards are learned. During the training process, the network structure is optimized to improve the detection accuracy.

[0088] Learn the characteristics of various defects in electronic circuit boards and optimize the network structure during training to improve detection accuracy. The specific steps are as follows:

[0089] After the image data is optimized by RMT, the optimized image data is input into the YOLOv8 target detection model for training;

[0090] After completing image denoising and high-dimensional feature reconstruction based on random matrix theory (RMT), the optimized image data is then input into the YOLOv8 target detection algorithm for training;

[0091] YOLOv8 (You Only Look Once v8) is an advanced convolutional neural network (CNN) architecture designed for target detection tasks, capable of simultaneously locating and classifying objects. In this step, the input image data has been denoised to remove redundant information, and the characteristics of small defects and edge information have been retained. Therefore, YOLOv8 can more effectively capture small defects in the image during training, such as cracks, cold solder joints, etc. The quality of the input data directly affects the training effect. Therefore, in this step, the optimized image data provides a clear and precise input for the YOLOv8 model, which can help the model learn the characteristics of each defect more accurately during training.

[0092] In the YOLOv8 model, the convolutional layer is responsible for extracting multi-level features from the image. The model automatically learns the characteristics of various defects in the image during the training process.

[0093] Because the input data is optimized by RMT, the tiny defect features and details are preserved, which enables YOLOv8 to better focus on these tiny defects. In this process, YOLOv8 continuously optimizes its convolution kernels and network weights through forward propagation and back propagation to minimize the loss function. The loss function usually consists of two parts: positioning loss and classification loss. The positioning loss measures the difference between the predicted bounding box and the true bounding box, and the classification loss measures the gap between the defect category of each predicted box and the actual category. During training, YOLOv8 will increase its sensitivity to tiny defects by continuously adjusting the network structure to ensure that the model can accurately identify and classify tiny defects.

[0094] In order to improve the accuracy of the model in electronic circuit board defect detection, the network structure of YOLOv8 will be optimized during the training process;

[0095] Especially when detecting tiny defects, the infrastructure of YOLOv8 may need to be adjusted to enhance the ability to capture detailed features. Common optimization methods include increasing the depth of the convolution layer, using smaller convolution kernels (such as 3x3 convolution) to capture more detailed information, or using different activation functions (such as ReLU, Leaky ReLU, etc.) to enhance the nonlinear expression ability of the network. In addition, batch normalization can be used during training to accelerate the convergence of the network and reduce the risk of gradient disappearance. The optimized network structure can improve the accuracy of YOLOv8 in electronic circuit board defect detection tasks, especially for tiny and complex defects, ensuring that these details are not missed during target detection.

[0096] During the YOLOv8 training process, the training parameters are dynamically adjusted according to the training progress to further improve the detection accuracy;

[0097] First, adjusting the learning rate is the key. Too high a learning rate may cause oscillations during training, while too low a learning rate may cause the training speed to be too slow. During the training process, a learning rate scheduler can be used to gradually reduce the learning rate according to the number of training iterations, helping the model to perform detailed optimization when it is close to the optimal solution. Secondly, data enhancement techniques (such as random rotation, scaling, flipping, etc.) can be used to increase the diversity of training samples and improve the generalization ability of the model. In addition, optimization algorithms (such as Adam, RMSProp, etc.) are used to dynamically adjust the gradient update to make the training process more stable, especially when facing the characteristics of tiny defects in electronic circuit boards. The optimization algorithm can accelerate the convergence of the network and improve the accuracy. Through these adjustments, YOLOv8 can more accurately learn the detailed characteristics of various defects in the circuit board and improve the overall detection effect.

[0098] Use the trained YOLOv8 model to detect defects on electronic circuit boards, identify and calibrate defective areas in images, and output detection results;

[0099] The specific steps of using the trained YOLOv8 model to detect defects on electronic circuit boards, identify and calibrate defective areas in images, and output the detection results are as follows:

[0100] The trained YOLOv8 model receives the RMT-optimized electronic circuit board image as input. The input image will first be extracted through the convolution layer of the network to generate multiple feature maps. Each feature map represents a different level of abstract information in the image. In YOLOv8, feature extraction is performed through multiple convolution layers. The model learns different features of the image in each layer. This process uses convolution operations, which can be expressed as:

[0101] F l=σ(W l ·F l-1 +b l ), where F l is the feature map of layer l, W l is the convolution kernel, F l-1 is the feature map of the previous layer, b l is the bias term, σ is the activation function;

[0102] In the initial stage, the feature map contains the basic information in the electronic circuit board image, such as color, edge, texture, etc. Then the model will gradually extract higher-level features.

[0103] Convolutional Kernel, also known as filter, is a core element used in convolutional neural network (CNN) to process images or other data. It is a small matrix or array, usually smaller than the input data (such as an image), with a fixed size and parameters. The convolution kernel slides on the input data (i.e., performs a convolution operation), weights and sums the data, and extracts features from the image, such as edges, textures, or colors. During the sliding process, each convolution kernel performs a dot multiplication operation with the local area of ​​the input image to obtain a new value, thereby generating a feature map of the output image. Multiple convolution kernels can capture feature information at different levels. By continuously using different convolution kernels, convolutional neural networks can automatically learn and extract hierarchical features from simple to complex, thereby achieving tasks such as image classification and target detection.

[0104] After feature extraction, YOLOv8 predicts the bounding box of each target through regression method. The YOLOv8 model predicts the position and confidence of the target box in the output layer. In each predicted box, the model calculates four parameters of a bounding box: center point coordinates x, y, width w and height h, and the confidence C of each bounding box (indicating the probability of the existence of the target). The regression formula calculation expression is as follows:

[0105] (x,y,w,h)=sigmoid(F l ),

[0106] C = sigmoid(F l ), where sigmoid(F l ) is the feature map F output by the sigmoid function applied to the convolutional layer l , C = sigmoid(F l ) is the confidence prediction in YOLOv8. For each predicted box, the model outputs a C value, which indicates the confidence that there is an object in the bounding box;

[0107] In YOLOv8, the target detection network generates multiple prediction boxes, each of which needs to predict 5 values: x, y, w, h and confidence C. These values ​​are calculated by passing the output of the convolutional layer (feature map) into the sigmoid activation function, mapping the result to a probability range of [0, 1]. In this way, the network can predict the relative position and size of the target box, and provide a confidence value for each box to evaluate whether the box contains the target.

[0108] Each bounding box also needs to be classified and predicted. YOLOv8 will output a category probability vector for each predicted box, indicating the probability that each bounding box contains a certain type of defect (such as cracks, cold solder joints, etc.). The category prediction process is also performed through the convolution layer, and the Softmax activation function is used to calculate the probability distribution of each category. The calculation expression of this process is as follows:

[0109] P class =Softmax(F l ),

[0110] , where P class is the predicted probability of each category, F i is the prediction score of category i, e is the natural base, F j is the prediction score of category j, P(class i ) is the probability that the prediction box belongs to category i. The output of Softmax ensures that the probability of each category is between 0 and 1, and the sum of the probabilities of all categories is 1;

[0111] Through this step, YOLOv8 can not only predict the location of the bounding boxes, but also predict whether these boxes contain a specific electronic circuit board defect.

[0112] Finally, after completing the target detection frame and classification prediction, YOLOv8 will use the non-maximum suppression (NMS) algorithm to filter the predicted frame to remove redundant frames and retain the most accurate bounding box. The core idea of ​​the NMS algorithm is that if the overlap degree (IoU, intersection over union) of two predicted frames exceeds the set threshold, the frame with large overlap will be removed and only the frame with high confidence will be retained. The formula of NMS is as follows:

[0113]

[0114] B final = argmax B (IoU(B,B threshold )), where IoU(B1,B2 is the intersection-over-union ratio of the two prediction boxes, Area(B1∩B2) and Area(B1∪B2) represent the area of ​​the intersection and union of the two boxes, respectively.final It is the final bounding box after NMS screening. The purpose of NMS is to select the best box from multiple prediction boxes and remove redundant boxes with large overlap. The final retained box is B final , which is selected from the candidate boxes to meet the conditions of IoU and confidence, IoU(B,B threshold ) is the front frame B and the threshold B threshold The IoU value between the reference boxes given in;

[0115] Through the non-maximum suppression algorithm NMS, YOLOv8 will filter out the optimal bounding box and finally calibrate the defect area in the electronic circuit board. Finally, the model will output information including the coordinates, category, and confidence level of each detected defect area.

[0116] Based on the detection results of the YOLOv8 algorithm, the accuracy and recall rate of minor defect detection are further improved through algorithm optimization to ensure the accuracy of identifying minor defects such as cracks, cold solder joints and surface foreign matter.

[0117] The specific steps to further improve the accuracy and recall rate of small defect detection through algorithm optimization and ensure the accuracy of recognition of small defects such as cracks, cold solder joints and surface foreign matter are as follows:

[0118] In the preliminary stage of the target detection algorithm, we need to evaluate the accuracy (Precision) and recall (Recall) of the YOLOv8 model to provide a basis for further optimization. Precision and recall are important indicators for evaluating the detection effect of the model, and are defined as follows:

[0119] Precision represents the proportion of samples correctly predicted as positive (defects detected) to all samples predicted as positive:

[0120] , where precision is the accuracy, TP is the true positive, indicating the defects that are correctly detected, and FP is the false positive, indicating the area that is incorrectly detected as a defect;

[0121] Recall represents the proportion of samples correctly predicted as positive (defects detected) to all samples that are actually positive:

[0122] , where Recall is the recall rate, and FN is the false negative, indicating the missed defect area;

[0123] By calculating the precision and recall, we can get a preliminary understanding of the model performance, especially the ability to identify minor defects. On this basis, we further improve these indicators, especially the recall rate, by optimizing the algorithm to ensure that missed detection (FN) can be minimized.

[0124] In order to further balance precision and recall and improve the model's recognition accuracy for small defects, F1-score is used as the optimization target. F1-score is the harmonic mean of precision and recall, and is used to comprehensively evaluate the performance of the model when dealing with imbalanced categories. The formula for F1-score is as follows:

[0125] , where F1-score is the blended average of precision and recall, which combines precision and recall to balance the impact between the two;

[0126] In this formula, the weights of precision and recall are equal. The higher the F1-score value, the better the overall performance of the model in detecting small defects. By adjusting the parameters of the model (such as threshold, learning rate, etc.), we can maximize the value of F1-score to ensure that the recall rate does not decrease while improving the precision. In particular, in the detection of small defects (such as cracks, cold solder joints, and surface foreign matter), by adjusting the parameters of the model, the phenomenon of false detection FP and missed detection FN can be reduced.

[0127] For example, during the training process, by dynamically adjusting the detection threshold of YOLOv8, if the threshold is too high, it may lead to low recall rate, while if it is too low, it may increase the probability of false positives. At this time, we calculate the F1-score and select the best detection threshold so that the precision and recall rate are balanced within a reasonable range.

[0128] Next, the detection accuracy of small defects can be further improved by optimizing the IoU (Intersection over Union) value. IoU measures the overlap between the predicted bounding box and the true bounding box. The calculation formula is:

[0129] , where IoU is a commonly used evaluation criterion in target detection, which measures the degree of overlap between the detection box predicted by the model and the real annotation box. Area of ​​Overlap represents the intersection area of ​​the predicted box and the real box, Area of ​​Union represents the union area of ​​the predicted box and the real box, A represents the bounding box predicted by the model, that is, the area containing defects predicted by the model in the image, B represents the real annotated bounding box, that is, the real area manually annotated and containing defects, |A∩B| is the intersection area of ​​the predicted box and the real box, |A∪B| is the union area of ​​the predicted box and the real box;

[0130] During the optimization process, the improvement of IoU will directly affect the calculation of precision and recall, and further optimize the overall model performance through F1-score. After adjusting the IoU threshold, new TP, FP, and FN values ​​will be obtained, so as to recalculate the precision, recall, and F1-score to ensure the balance between precision and recall in the detection of minor defects.

[0131] In order to improve the recall rate of small defects and further reduce false negatives (FN), the non-maximum suppression (NMS) algorithm is used to optimize the merging and deduplication of detection frames. In YOLOv8, multiple detection frames will detect the same defect, so it is necessary to remove redundant frames through NMS and retain the optimal frame; the calculation process of NMS is as follows:

[0132] 1. Sort all prediction boxes by confidence;

[0133] 2. Select the box with the highest confidence and use it as the reference box;

[0134] 3. For all boxes, calculate the IoU value with the reference box. If the IoU is greater than the set threshold, remove the box;

[0135] 4. Repeat this process until all boxes have been processed;

[0136] The formula for NMS is as follows:

[0137] , IoU max It is the maximum intersection over union ratio, which indicates the IoU value of the box that most overlaps with the real box among multiple predicted boxes. Max is the box that most overlaps with the real box selected from multiple predicted boxes.

[0138] Through NMS, the quality of the detection frame can be maximized, the frame that is most likely to contain defects can be retained, and redundant frames can be removed, thereby improving the recall rate and ensuring that minor defects are not missed. This process further optimizes the precision and recall rate, allowing the model to capture all possible defects as much as possible with high accuracy, especially those minor defects that are difficult to identify.

[0139] After the above steps, the model will significantly improve the effect of minor defect detection under the comprehensive optimization of precision, recall rate, F1-score, IoU and NMS, ensuring efficient and accurate identification of defects such as cracks, poor solder joints, and surface foreign matter on electronic circuit boards.

[0140] Implementation 1: This implementation aims to improve the accuracy and robustness of electronic circuit board defect detection by combining random matrix theory (RMT) with the YOLOv8 object detection algorithm. We first capture images of electronic circuit boards using a high-resolution camera and preprocess these raw images to ensure the efficiency and accuracy of subsequent analysis. Image preprocessing includes steps such as denoising, normalization, and enhancement, with the aim of improving image quality and providing clear input for the YOLOv8 model.

[0141] First of all, image denoising is a key step to solve the common noise problem in electronic circuit board images. For the interference components that may appear in the image, such as Gaussian noise and salt and pepper noise, which affect the image quality, we use a combination of median filtering and Gaussian filtering to denoise. Gaussian filtering can effectively remove high-frequency noise, while median filtering can well eliminate salt and pepper noise. This hybrid method can retain the edge information and details of the image to the greatest extent, avoiding the edge blurring problem that may be caused by traditional denoising methods when removing noise. Then, the image normalization operation adjusts each pixel value to a unified standard range (such as 0 to 1) to eliminate the differences in brightness and contrast between different images, providing a stable input for subsequent processing. Image enhancement techniques such as random rotation, cropping, brightness adjustment, etc., further enrich the training set and enhance the robustness of the model.

[0142] After the preprocessing steps are completed, the image will be further processed through the RMT-based denoising and feature reconstruction process. RMT removes redundant information and noise components in the image by analyzing the high-dimensional feature space, while retaining the tiny defects and edge information in the image. The core idea of ​​RMT is to construct the feature matrix of the image through a random matrix, analyze and identify the noise components with statistical characteristics in the image. In the high-dimensional feature space of the image, noise and redundant information are usually located at the tail of the eigenvalue spectrum, while useful defect features are in the main part. Therefore, by removing the noise at the tail of the eigenvalue spectrum through the RMT denoising algorithm, the key defect information in the image, such as microcracks, cold solder joints, etc., can be effectively retained. This process ensures that even tiny defect features can be clearly retained, laying the foundation for the subsequent training of the YOLOv8 model.

[0143] Next, the optimized image data is input into the YOLOv8 target detection model for training. YOLOv8 is one of the most advanced target detection networks. Its core feature is that it can simultaneously complete target location and classification tasks in one forward propagation. During the training process, the convolutional neural network (CNN) of YOLOv8 will gradually learn the characteristics of various defects in the image based on the input optimized image. In order to improve the accuracy of YOLOv8 in detecting small defects, we enhance the network's attention to small defects by improving the loss function. The traditional YOLO model loss function is generally optimized by calculating position loss, confidence loss and classification loss, but for tasks with high precision requirements such as electronic circuit boards, conventional loss functions may not effectively improve the model's ability to recognize small defects. To this end, we added a weighted factor for the small defect area in the loss function, so that the network's sensitivity to small defects can be improved during training.

[0144] In order to further optimize the detection capability of YOLOv8, dynamic learning rate adjustment and data enhancement techniques are also used during training. Dynamic learning rate adjustment can avoid the problem of training instability caused by excessive learning rate during training, and can also accelerate the convergence of the training process. Data enhancement technology generates diversified training samples by randomly rotating, scaling, flipping and other operations on training images, thereby enhancing the generalization ability of the model and avoiding overfitting. After multiple iterations of training, the YOLOv8 model can learn various defect features on electronic circuit boards, including small cracks, cold solder joints, etc., and can detect them efficiently and accurately.

[0145] In the final model evaluation stage, the performance of YOLOv8 in the electronic circuit board defect detection task is verified through the test set. Through evaluation indicators such as precision, recall, and F1-score, it is verified whether the optimized YOLOv8 model can effectively identify various defects and compare it with other detection methods. Finally, the YOLOv8 target detection network optimized by RMT can greatly improve the accuracy of electronic circuit board defect detection, especially in the detection of minor defects, which has significant advantages over traditional methods.

[0146] Implementation 2: The core idea of ​​this implementation is to efficiently detect tiny defects on electronic circuit boards through adaptive noise reduction and reinforcement learning technology combined with the YOLOv8 target detection network. In the early stage of the processing, we first obtain high-resolution image data of the electronic circuit board and perform necessary preprocessing on it, including denoising, enhancement and normalization. These operations can improve the quality of the image and the adaptability to the model, ensuring that YOLOv8 can effectively extract key information from the image.

[0147] In the image denoising stage, we first use a combination of Gaussian filtering and bilateral filtering to perform preliminary image denoising. Gaussian filtering can smooth images and remove high-frequency noise, while bilateral filtering can retain the edge information of the image while removing noise. For defects in complex backgrounds, bilateral filtering can better retain detail information, while Gaussian filtering is suitable for large-area noise removal. After the image normalization operation, the brightness and contrast of the image are standardized, which makes subsequent image analysis and feature extraction more efficient. In the image enhancement process, random rotation, cropping, brightness adjustment and other operations are used to further improve the diversity of training samples, helping YOLOv8 maintain high detection accuracy under different image conditions.

[0148] Next, the image is further optimized using random matrix theory (RMT). RMT's denoising and feature reconstruction capabilities help us remove redundant information from the image and eliminate excess noise components while retaining image details. The RMT model analyzes the high-dimensional features of the image and can identify and remove noise from the data, thereby ensuring that tiny defects and edge information are effectively retained. Especially in the task of defect detection on electronic circuit boards, small cracks or cold solder joints are often difficult to capture. RMT can clearly extract these tiny features from the image through its unique denoising mechanism.

[0149] The preprocessed and optimized image data is input into YOLOv8 for target detection training. In order to improve the performance of YOLOv8 in detecting subtle defects, we adopted an adaptive reinforcement learning strategy. By dynamically adjusting the random transformation (such as rotation, scaling, etc.) and noise perturbation of the image during training, we can simulate various real-life detection environments, so that the model has better adaptability to images of different qualities and types. At the same time, we also added a weighted penalty term for minor defects to the loss function of YOLOv8 to strengthen the model's attention to these minor defects. This weighted term helps the model capture these subtle defects more accurately during training by applying greater learning pressure to difficult-to-detect areas.

[0150] Through these training strategies, YOLOv8 can automatically extract key defect features from images when processing electronic circuit board images, and perform effective classification and positioning. In the testing phase, real electronic circuit board images were used to verify the trained model and evaluate its performance in terms of accuracy and recall. The test results show that YOLOv8, which has been optimized through adaptive denoising and reinforcement learning, can accurately and efficiently identify various minor defects, especially in images with high noise and unclear details. The detection effect has been significantly improved compared with traditional methods.

[0151] Implementation 3: This implementation aims to improve the accuracy of small defect detection through multi-scale feature fusion and YOLOv8 network optimization, especially in the task of electronic circuit board defect detection, for defects of different sizes and shapes, more accurate detection can be achieved. In the preprocessing stage, the electronic circuit board image is firstly collected with high quality and denoised.

[0152] Processing ensures the quality of input data. The denoised image is optimized through RMT to remove redundant information and retain small defect features. Especially in complex backgrounds, the details and edge information of the defects are clearly retained, providing high-quality input for subsequent processing.

[0153] After the image data is preprocessed, we enter the training phase of the YOLOv8 network. In order to enable YOLOv8 to better identify defects of different sizes, this implementation introduces a multi-scale feature fusion mechanism. The original network structure of YOLOv8 usually extracts image features through convolution layers of different scales, but when dealing with subtle defects, traditional single-scale convolution may not be able to effectively capture small-sized defects. To this end, we introduce a multi-scale convolution layer to divide the image into multiple scales for processing, ensuring that the model can capture defect information from different scales. After the feature maps processed by each scale convolution layer are fused, they enter the subsequent detection layer as input, which significantly improves the model's ability to recognize tiny defects.

[0154] In addition, during the training process, we optimized the network structure of YOLOv8. By increasing the depth and width of the convolution layer, the model can extract more levels of image features. At the same time, in order to enhance the sensitivity of YOLOv8 to small defects, we introduced more convolution kernels with different receptive fields, which enables the model to perform accurate feature learning in a smaller local area, which is particularly suitable for the detection of small cracks and solder joint defects. In terms of loss function, the weighted cross entropy loss function is used to additionally weight the small defect area to enhance the detection of these defects.

[0155] Finally, through the strategy of multi-scale feature fusion and network optimization, YOLOv8 can accurately detect various defects in electronic circuit boards. During the testing phase, the model showed higher precision and recall than traditional methods, especially when detecting tiny defects.

[0156] The present invention optimizes image data based on random matrix theory and combines the training of the YOLOv8 target detection algorithm. This solution can significantly improve the detection accuracy of small defects (such as cracks, cold solder joints, etc.) in electronic circuit boards. RMT removes redundant information and retains key small defect features and edge information through high-dimensional feature analysis of image data, avoiding the problem of detail loss that may be caused by traditional denoising methods. The image data optimized by RMT can provide YOLOv8 with more refined and high-quality input, so that YOLOv8 can accurately identify small defects that are difficult to detect during the training process. This optimization method is particularly suitable for defect detection of electronic circuit boards, and can effectively deal with the problem of missed detection of traditional detection methods in small defect detection, thereby improving the accuracy of overall detection and reducing the occurrence of false detection and missed detection.

[0157] In addition, through multi-scale feature fusion and loss function optimization, YOLOv8 can extract features of images at different scales, making it more sensitive to tiny defects. Multi-scale feature fusion enables the model to handle defects of different sizes and enhances the ability to detect tiny details. During model training, by adjusting the loss function weights, the network is particularly strengthened in learning tiny defects, thereby further improving the accuracy of the model in detecting small defects. Ultimately, the optimized YOLOv8 can not only accurately identify small defects, but also maintain high-precision detection effects under various lighting and noise conditions, greatly improving the reliability and practicality of the detection task.

[0158] The present invention significantly improves the robustness and generalization ability of the YOLOv8 model through data enhancement, optimization of network structure and training strategy, so that it can still maintain efficient detection performance under different environmental conditions. First, the normalization and enhancement technology in image preprocessing is used, combined with high-quality training data, to ensure that YOLOv8 can process input images well under different brightness, contrast and noise conditions. Data enhancement technology (such as rotation, scaling, brightness adjustment, etc.) can expand the diversity of the training set, help the model adapt to different types of electronic circuit boards and complex backgrounds, and improve the generalization ability of the model on unknown data. This allows the trained YOLOv8 to not only achieve good results under laboratory conditions, but also to cope with various real-world challenges in actual industrial applications.

[0159] In addition, the optimization of network structure and the adjustment of learning rate during training further enhance the stability and robustness of the YOLOv8 model. Through multi-scale feature fusion and adaptive loss function design, the model can better adapt to the complex morphology and minor defects of electronic circuit boards, especially in images with partial missing or damaged parts, the model can still effectively identify defects. Further optimization, such as the use of dynamic learning rate, early stopping and transfer learning strategies, enables the model to maintain efficient learning ability with limited training data. In summary, through these technical optimizations, the robustness and generalization ability of YOLOv8 have been significantly improved, and it can maintain excellent performance in a changing actual production environment.

[0160] The above description is only by way of illustration of certain exemplary embodiments of the present invention. It is undoubted that 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 above 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 electronic circuit board defect detection method based on RMT model optimization YOLOv8 algorithm, characterized in that: The following steps are involved: Obtain high-resolution image data of electronic circuit boards and preprocess the image data to improve image quality and model robustness; Based on random matrix theory, the preprocessed image data is subjected to noise reduction and high-dimensional feature reconstruction to remove redundant information in the data while retaining tiny defect features and edge information to ensure that defect features are not lost; The image data after RMT optimization is input into the YOLOv8 target detection algorithm for training, and the characteristics of various defects in electronic circuit boards are learned. During the training process, the network structure is optimized to improve the detection accuracy. Use the trained YOLOv8 model to detect defects on electronic circuit boards, identify and calibrate defective areas in images, and output detection results; Based on the detection results of the YOLOv8 algorithm, the accuracy and recall rate of minor defect detection are further improved through algorithm optimization, ensuring the accuracy of identifying small defects such as cracks, cold solder joints and surface foreign matter.

2. The electronic circuit board defect detection method based on RMT model optimization YOLOv8 algorithm according to claim 1 is characterized in that: Obtain high-resolution image data of electronic circuit boards and preprocess the image data to improve image quality and model robustness. The specific steps are as follows: Firstly, high-quality image data is obtained from the scanning device; After obtaining the high-resolution image, image denoising is performed; After the denoising process is completed, the image is normalized and enhanced; In order to better extract the tiny defects on the electronic circuit board, the image is processed with edge enhancement and detail highlighting.

3. The electronic circuit board defect detection method based on RMT model optimization YOLOv8 algorithm according to claim 1 is characterized in that: Remove redundant information from the data while retaining tiny defect features and edge information to ensure that defect features are not lost. The specific steps are as follows: After denoising, normalizing and enhancing the electronic circuit board image, the next step is to construct a high-dimensional feature space of the image; After the high-dimensional feature space is constructed, the next step is to use random matrix theory to perform noise reduction; Enhance important information in the image through feature reconstruction through RMT; In the process of high-dimensional feature reconstruction, ensure that tiny defect features and edge information in the image are not lost.

4. The electronic circuit board defect detection method based on RMT model optimization YOLOv8 algorithm according to claim 1 is characterized in that: The image data after RMT optimization is input into the YOLOv8 target detection algorithm for training, and the characteristics of various defects in the electronic circuit board are learned. During the training process, the network structure is optimized to improve the detection accuracy. The specific steps are as follows; After the image data is optimized by RMT, the optimized image data is input into the YOLOv8 target detection model for training; After completing image denoising and high-dimensional feature reconstruction based on random matrix theory, the optimized image data is then input into the YOLOv8 target detection algorithm for training; In the YOLOv8 model, the convolutional layer is responsible for extracting multi-level features from the image. The model automatically learns the characteristics of various defects in the image during the training process. In order to improve the accuracy of the model in electronic circuit board defect detection, the network structure of YOLOv8 will be optimized during the training process; During the YOLOv8 training process, the training parameters are dynamically adjusted according to the training progress to further improve the detection accuracy.

5. The electronic circuit board defect detection method based on RMT model optimization YOLOv8 algorithm according to claim 1 is characterized in that: The specific steps of using the trained YOLOv8 model to detect defects on electronic circuit boards, identify and calibrate defective areas in images, and output the detection results are as follows: The trained YOLOv8 model receives the RMT-optimized electronic circuit board image as input. The input image will first be extracted through the convolution layer of the network to generate multiple feature maps. Each feature map represents a different level of abstract information in the image. In YOLOv8, feature extraction is performed through multiple convolution layers. The model learns different features of the image in each layer. This process uses convolution operations, which can be expressed as: F l =σ(W l ·F l-1 +b l ), where F l is the feature map of layer l, W l is the convolution kernel, F l-1 is the feature map of the previous layer, b l is the bias term, σ is the activation function; After feature extraction, YOLOv8 predicts the bounding box of each target through regression. The YOLOv8 model predicts the position and confidence of the target box in the output layer. In each predicted box, the model calculates four parameters of a bounding box: center point coordinates x, y, width w and height h, and the confidence C of each bounding box. The regression formula calculation expression is as follows: (x,y,w,h)=sigmoid(F l ), C = sigmoid(F l ), where sigmoid(F l ) is the feature map F output by the sigmoid function applied to the convolutional layer l , C = sigmoid(F l ) is the confidence prediction in YOLOv8. For each predicted box, the model outputs a C value, which indicates the confidence that there is an object in the bounding box; Each bounding box also needs to be classified and predicted. YOLOv8 will output a category probability vector for each predicted box, indicating the probability that each bounding box contains a certain type of defect. The category prediction process is also performed through the convolution layer, and the Softmax activation function is used to calculate the probability distribution of each category. The calculation expression of this process is as follows: P class =Softmax(F l ), Where P class is the predicted probability of each category, F i is the prediction score of category i, e is the natural base, F j is the prediction score of category j, P(class i ) is the probability that the prediction box belongs to category i; Finally, after completing the target detection frame and classification prediction, YOLOv8 will use the non-maximum suppression algorithm to filter the predicted frame to remove redundant frames and retain the most accurate bounding box. The core idea of ​​the NMS algorithm is that if the overlap between two predicted frames exceeds the set threshold, the overlapping frame will be removed and only the frame with high confidence will be retained. The formula of NMS is as follows: B final = argmax B (IoU(B,B threshold )), where IoU(B1,B2) is the intersection-over-union ratio of the two predicted boxes, Area(B1∩B2) and Area(B1∪B2) represent the areas of the intersection and union of the two boxes, respectively. final is the final bounding box after NMS filtering, IoU(B,B threshold ) is the front frame B and the threshold B threshold The IoU value between the reference boxes given in .

6. The electronic circuit board defect detection method based on RMT model optimization YOLOv8 algorithm according to claim 1 is characterized in that: The specific steps to further improve the accuracy and recall rate of small defect detection through algorithm optimization and ensure the accuracy of recognition of small defects such as cracks, cold solder joints and surface foreign matter are as follows: In the preliminary stage of the target detection algorithm, we need to evaluate the accuracy and recall of the YOLOv8 model to provide a basis for further optimization. Accuracy and recall are important indicators for evaluating the detection effect of the model. They are defined as follows: Precision indicates the proportion of samples correctly predicted as positive to all samples predicted as positive: Where precision is accuracy, TP is true positive, indicating the defects detected correctly, and FP is false positive, indicating the area that is wrongly detected as a defect; The recall rate indicates the proportion of samples correctly predicted as positive to all samples that are actually positive: In the formula, Recall is the recall rate, and FN is the false negative, which indicates the missed defect area; In order to further balance precision and recall and improve the model's recognition accuracy for small defects, F1-score is used as the optimization target. F1-score is the harmonic mean of precision and recall, and is used to comprehensively evaluate the performance of the model when dealing with imbalanced categories. The formula for F1-score is as follows: In the formula, F1-score is the blended average of precision and recall, which combines precision and recall to balance the impact between the two. Next, the detection accuracy of small defects can be further improved by optimizing the IoU value. IoU measures the overlap between the predicted bounding box and the true bounding box. The calculation formula is: Where, IoU is a commonly used evaluation criterion in target detection, which measures the degree of overlap between the detection box predicted by the model and the real annotation box. Area of ​​Overlap represents the intersection area of ​​the predicted box and the real box, Area of ​​Union represents the union area of ​​the predicted box and the real box, A represents the bounding box predicted by the model, that is, the area containing defects predicted by the model in the image, B represents the real annotated bounding box, that is, the real area manually annotated and containing defects, |A∩B| is the intersection area of ​​the predicted box and the real box, |A∪B| is the union area of ​​the predicted box and the real box; In order to improve the recall rate of small defects and further reduce false negatives, the non-maximum suppression algorithm is used to optimize the merging and deduplication of detection frames. In YOLOv8, multiple detection frames will detect the same defect, so it is necessary to remove redundant frames through NMS and retain the optimal frame; the calculation process of NMS is as follows: Sort all prediction boxes by confidence; Select the box with the highest confidence and use it as the reference box; For all boxes, calculate the IoU value with the reference box. If the IoU is greater than the set threshold, remove the box. Repeat this process until all boxes have been processed; The formula for NMS is as follows: IoU max is the maximum intersection-over-union ratio, and max is the box that most overlaps with the real box selected from multiple predicted boxes.