PCB printing and welding quality detection method and system based on semi-supervised hybrid algorithm

The PCB board printing and soldering quality inspection method based on a semi-supervised hybrid algorithm combines supervised and unsupervised learning, solving the problems of high false alarm rate, strong data dependence and long development cycle in existing technologies. It achieves efficient and reliable inspection results and is applicable to solder paste printing and soldering quality inspection in the PCB manufacturing process.

CN121837147APending Publication Date: 2026-04-10LUXISTECHNOLOGY (KUNSHAN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-07
Publication Date
2026-04-10

Smart Images

  • Figure CN121837147A_ABST
    Figure CN121837147A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of industrial visual inspection, in particular to a PCB printing and welding quality detection method and system based on a semi-supervised hybrid algorithm, and the system comprises a supervised learning sub-module and an unsupervised learning sub-module which are parallel, and the output of the two sub-modules is integrated through a decision module. According to the method, a small amount of labeled data and a large amount of unlabeled data are utilized, and accurate recognition of known defects and wide perception of unknown anomalies are achieved in SPI, SMT and AOI links. According to the method, the false alarm rate and the missing report rate can be remarkably reduced, the manual recheck cost is reduced, the model development period is shortened, and the generalization ability and the automation level of the system are improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of industrial vision, and particularly relates to a PCB printing and welding quality detection method and system based on a semi-supervised hybrid algorithm. BACKGROUND

[0002] In the surface mount technology (SMT) manufacturing process of printed circuit boards (PCB), the detection of solder paste printing, component mounting and welding quality is a key link to ensure the reliability of the final electronic product. At present, the industry generally uses automatic detection equipment based on optical imaging, such as solder paste inspection (SPI) and automatic optical inspection (AOI) systems, to identify and classify defects in the production process. Although such equipment has achieved preliminary automation, it still faces many technical bottlenecks in practical application.

[0003] Firstly, due to the influence of material differences, process fluctuations and environmental factors (such as changes in light and mechanical vibration), the false positive rate of existing visual detection systems is usually as high as 2% to 10%, resulting in a large number of products that should be qualified being incorrectly marked as defective, which in turn causes a heavy burden of manual re-inspection, reduces production line efficiency, and increases labor costs.

[0004] Secondly, although the artificial intelligence re-inspection method based on supervised learning introduced in recent years has improved detection accuracy in specific scenarios, it highly depends on a large number of accurately labeled defect samples. However, PCB manufacturing is a high-precision and high-consistency process, and real defect samples are scarce and the labeling cost is extremely high, which makes the model development period often last for 6 to 12 months, and in the early stage, it is prone to overfitting due to insufficient data, resulting in a high misjudgment rate.

[0005] In addition, whether it is a traditional rule algorithm or a single AI model, its generalization ability is generally weak, and it is difficult to adapt to common production changes such as new product introduction, component type change or process parameter fine-tuning, and often needs to be frequently retrained or even reconstructed, which seriously affects deployment efficiency and system stability.

[0006] More importantly, the existing technical path is difficult to balance between cost and performance: pure manual inspection is inefficient and has different standards, which does not meet the requirements of intelligentization and lean production of Industry 4.0; the pure supervised learning scheme has a long development period and high data threshold; while the pure unsupervised anomaly detection method does not require labeled data, but it is too sensitive to normal process fluctuations, and is prone to misjudging reasonable variations as defects, and has limited recognition ability for known defect patterns, which has the risk of missing detection.

[0007] Therefore, there is an urgent need for a new type of automated re-inspection technology that can significantly reduce dependence on labeled data and balance detection accuracy and generalization ability, in order to break through the efficiency, cost and reliability bottlenecks in current PCB manufacturing quality detection. SUMMARY

[0008] The present application aims at the technical problems of high false positive rate, strong dependence on a large number of labeled data, long model development period and weak generalization ability of optical visual inspection technology in the process of tin paste printing, surface mounting and post-welding link of existing printed circuit board manufacturing, and provides a PCB board printing and welding quality detection method and system based on a semi-supervised hybrid algorithm. The method fuses the advantages of supervised learning and unsupervised learning by constructing a semi-supervised hybrid model architecture, realizes accurate identification of known defects and extensive perception of unknown abnormalities under the premise of only a small amount of labeled samples, thereby significantly reducing the cost of manual review, and improving the accuracy, efficiency and robustness of the detection system.

[0009] The present application provides a PCB board printing and welding quality detection method based on a semi-supervised hybrid algorithm, comprising the following steps: Data acquisition: obtaining the whole board image of the PCB to be detected, and receiving the element coordinate file output from the SPI / AOI device through the communication interface; Image preprocessing: parsing the coordinate information in the element coordinate file, cropping and scaling the whole board image to a uniform size to generate a single element ROI image; performing invalid image filtering processing and differential data enhancement processing on the ROI image to obtain an enhanced ROI image; inputting the enhanced ROI image into a semi-supervised hybrid model, the semi-supervised hybrid model comprising two parallel supervised learning sub-modules and unsupervised learning sub-modules, the enhanced ROI image outputting a defect probability value p after passing through the supervised learning sub-module, and the enhanced ROI image outputting an anomaly score s after passing through the unsupervised learning sub-module; According to the defect probability value p and the anomaly score s, one of the fusion strategies of weighted average, logistic regression or confidence gating strategy is selected to obtain the final score Calculate and compare the final score with the set threshold value, if the final score is greater than the set threshold value, the PCB to be detected is determined as NG, otherwise the PCB to be detected is determined as OK.

[0010] Further, in the data acquisition step, the element coordinate file includes the unique identifier, center coordinates (x, y), width w and height h of all pads on the PCB to be detected; based on (x, y, w, h), the ROI image is obtained by cropping and scaling to 224x224 pixels after expanding the boundary by 10% around.

[0011] Further, in the image preprocessing step, the invalid image filtering processing includes calculating the Laplacian variance of each ROI image, if the value is lower than the set threshold value, it is determined as an out-of-focus or blurred image and is rejected; if it is equal to or higher than the set threshold value, it is retained.

[0012] Furthermore, in step S2, the differentiated data enhancement includes employing a weak enhancement strategy for the labeled data used in the supervised learning sub-module and a strong enhancement strategy for the unlabeled data used in the unsupervised learning sub-module.

[0013] Furthermore, the weak enhancement strategy involves performing random horizontal flips or rotation transformations within ±5° with a set probability.

[0014] Furthermore, the strong enhancement strategy includes one or more combinations of random brightness and contrast adjustment, Gaussian noise injection, CutOut random occlusion processing, or Gaussian blur processing.

[0015] Furthermore, the construction of the supervised learning submodule includes: Initialize the network and data: Use ResNet-34 as the backbone network, remove the top fully connected layers, and retain the convolutional parts as the feature encoder. (x, W), where W is the trainable weights of the network, and the encoder output is a feature vector; obtain a dataset D containing only ROI images labeled with defect information. normal ={x1,x2,...,x N}, where N is the number of samples; Based on the initial network computation and with the center of the sphere fixed at C: Before training begins, the dataset D is... normal The feature representations are obtained from an encoder in which all sample inputs are in a randomly initialized state. (x i W init ); Calculate the mean of the feature vectors of all normal samples, define it as the center C of the hypersphere, and keep it constant throughout the training process. The formula for calculating the center C is: ; Train the network to shrink the features of normal samples towards the center C of the sphere: Objective: To optimize the loss function Update the encoder parameters W to drive the feature vectors of all normal samples. (x i (W) converges towards the center C of the sphere; The loss function consists of a distance contraction term and a weight regularization term, and its calculation formula is as follows: ; in: Represents the squared Euclidean distance between vectors; The regularization coefficient is used. Based on the shrunk feature distribution, determine the radius R of the decision boundary range: using the encoder after training. For training set D normal Perform forward propagation again, calculate the squared distance from each sample to the center C of the sphere, and obtain the distance set: ; The 95th quantile of the distance set S is chosen as the radius R of the hypersphere. This radius defines the boundary of the normal sample distribution, and its calculation formula is as follows: ; Calculate the anomaly score: For a new sample x to be detected test Using a trained encoder Extract its features Calculate the squared distance from the feature to the center C of the sphere; compare the squared distance with the squared radius to obtain the anomaly score. .

[0016] Furthermore, the training dataset of the supervised learning submodule consists entirely of ROI images labeled with defect information; the training dataset of the unsupervised learning submodule consists of ROI images without labeled defect information; in the training dataset of the supervised learning submodule, the defect information includes four types of defects: insufficient solder, solder bridging, offset, and poor shape, and the proportion of each type of defect sample is not less than 15% of the total NG samples.

[0017] Furthermore, it also includes calculating the overall confidence level, which is calculated as follows: | -0.5|×2; When the overall confidence level is lower than the set value, a manual re-inspection request is triggered.

[0018] Another object of the present invention is to provide a PCB board printing and soldering quality inspection system that implements the method described above, comprising: Image acquisition unit, equipped with a high-resolution industrial camera and LED light source; The metadata parsing unit, connected to the SPI / AOI device communication interface, is used to parse the component coordinate file; The ROI cropping and preprocessing unit is used to perform intelligent cropping, size normalization, invalid image filtering, and differential data augmentation. A semi-supervised hybrid model, comprising a supervised learning sub-model, an unsupervised learning sub-model, and a decision module.

[0019] Compared with existing technologies, the technical advantages of the PCB board printing and soldering quality inspection method and system based on a semi-supervised hybrid algorithm of the present invention are as follows: (1) The semi-supervised hybrid model proposed in this invention achieves a qualitative leap in detection performance by deeply integrating the accurate classification capability based on supervised learning with the ability to detect unknown anomalies based on unsupervised learning. Specifically, the supervised learning submodule uses a small amount of expert-annotated data to accurately identify known typical defects such as "insufficient solder, solder bridging, misalignment, and poor shape"; while the unsupervised learning submodule learns the inherent distribution of "normal" through a large number of unannotated normal samples, and can effectively detect unknown or rare defects that exceed known types. The two complement each other, achieving a high accuracy rate of over 99.6% in the test, while controlling the false negative rate below 0.08% and the false positive rate (false normality) below 0.3%. The overall performance far exceeds that of a single pure supervised or pure unsupervised scheme, significantly improving the robustness and reliability of the detection system in complex and ever-changing industrial environments.

[0020] (2) This method greatly reduces the reliance on expensive and scarce defective samples and expert annotations. The unsupervised learning pathway can be trained directly using massive amounts of readily available normal production images, requiring only about 10% of the labeled data to drive the entire high-performance system. Combined with highly automated ROI cropping, intelligent preprocessing (such as invalid image filtering and differential data augmentation) and efficient training strategies (pre-trained weights and early stopping mechanisms), the complete development cycle from data preparation to model deployment is shortened to about 10 weeks, far less than the 6 to 12 months required by traditional methods. This significantly reduces the implementation threshold and overall cost of AI quality inspection, enabling rapid deployment and iteration.

[0021] (3) The system is designed with a flexible, confidence-based decision fusion module and a manual review triggering mechanism, ensuring the reliability of the final decision while pursuing full automation. Through strategies such as weighted averaging, logistic regression, or confidence gating, the system can intelligently fuse dual-path judgments and output stable and reliable final results. More importantly, by calculating the comprehensive confidence level, the system can automatically identify and mark boundary cases where the model judgment is "not very confident" and trigger manual review requests. This mechanism allows human effort to focus on the few most difficult and critical cases (which can reduce the workload of manual review by more than 85% in practical applications), achieving the optimal configuration of human-machine collaboration while ensuring the goal of "zero defects" in factory quality, and greatly improving the overall efficiency and practicality of the quality inspection process. Attached Figure Description

[0022] Figure 1 This is a system block diagram of the detection system in this invention; Figure 2 This is a flowchart of the detection method in this invention; Figure 3 These are NG and OK sample images that have undergone differential enhancement processing in this invention. Detailed Implementation

[0023] The present invention will be further described in detail below with reference to the accompanying drawings. Figure 1 As shown, the PCB board printing and soldering quality inspection system of the present invention includes an image acquisition unit, a metadata parsing unit, a ROI cropping and preprocessing unit, and a semi-supervised hybrid model. The image acquisition unit is equipped with a high-resolution industrial camera 1 and an LED light source 2, and is installed in an independent inspection station downstream of SPI or AOI equipment to acquire PCB board images.

[0024] Please refer to Figures 2-3 This embodiment also provides a method for inspecting the printing and soldering quality of PCB boards, which includes the following steps: S1. Data Acquisition: Acquire an image of the entire PCB board to be inspected; simultaneously, receive component coordinate files output from the SPI / AOI device via the communication interface. The file is in XML or JSON format and contains a unique identifier, center coordinates (x, y), width w, and height h for each pad or component to be inspected.

[0025] After the image acquisition unit acquires the image, the whole board image and the component coordinate file are synchronously transmitted to the ROI cropping and preprocessing unit.

[0026] S2. Image preprocessing: S21. ROI Image Generation, Cropping, and Uniform Size Scaling: For the whole board image and the component coordinate file, parse the coordinate information in the component coordinate file, draw a coordinate rectangle on the original whole board image, and crop it by extending the boundary by 10% around it. Then, uniformly scale it to 224×224 pixels to generate a single component ROI image.

[0027] The cropping operation uses the solder paste coordinates output by the AOI device to locate the ROI region of the component and crop it to obtain a solder paste image. This allows the neural network to focus more on learning the features of the target object, while reducing interference from irrelevant information, thus improving training efficiency and generalization ability. The scaling operation scales or crops the solder paste image, changing its size and viewpoint. This helps the model learn features at different scales and locations, improving the model's generalization ability.

[0028] S22. Invalid Image Filtering: Calculate the Laplacian variance of each ROI image. If the value is lower than the set threshold, it is determined to be an out-of-focus or blurry image and is removed. If it is equal to or higher than the set threshold, it is retained. The goal of this step is to remove invalid ROI images caused by focus failure or motion blur to ensure the quality of input data.

[0029] S23. Differentiated Data Augmentation: Differentiated augmentation processing is implemented according to the intended use of the data, resulting in strongly augmented and weakly augmented datasets. A weak augmentation strategy is used for the labeled data used in the supervised learning sub-module, while a strong augmentation strategy is used for the unlabeled data used in the unsupervised learning sub-module.

[0030] The weak enhancement strategy involves randomly flipping the solder paste image horizontally and rotating it within ±5° with a set probability (e.g., 0.5). The flipping and rotation in this strategy involve horizontally or vertically flipping the solder paste image, or rotating the image within a certain angle range. This increases data diversity, makes the solder paste model more robust, and reduces the risk of overfitting.

[0031] The strong enhancement strategy significantly alters the appearance of an image by combining multiple drastic color, noise, and structure transformations. It aims to simulate complex process variations, imaging environmental interference, and extreme conditions, thereby forcing the model to learn more robust feature representations rather than relying on appearance details. Specifically, it includes: (1) Random brightness and contrast adjustment: The brightness factor β is uniformly and randomly sampled within the interval [0.8, 1.2]. The brightness adjustment formula is as follows: I bright =I×β, Among them, I bright I represents the image after brightness adjustment, and I represents the original ROI image. The contrast factor α is uniformly and randomly sampled within the interval [0.8, 1.2]. The contrast adjustment formula is as follows: I contrast =α×I bright +(1-α)×μ, Among them, I contrast The image is after contrast adjustment, and μ is the image I. bright The average pixel value.

[0032] Adjusting the brightness and contrast parameters of the solder paste image can simulate different lighting and environmental conditions, making the model more adaptable.

[0033] (2) Gaussian noise injection: A variance value σ is uniformly and randomly sampled from the variance range [10, 50]. noise 2 Generate a noise matrix N of the same size as the image, where each pixel value independently follows a Gaussian distribution N(0, σ). noise 2 Noise superposition: I noisy =I contrast +N, Among them, I noisy The image after adding noise.

[0034] (3) CutOut random occlusion processing: randomly generate n occlusion regions, where n is a random integer in [1,8]; each occlusion region is an 8×8 pixel rectangular block, and its position is randomly and uniformly sampled within the original ROI image; set the pixel values ​​in these rectangular blocks to zero or set them to the mean value.

[0035] (4) Gaussian blur processing: Randomly select a value from the set {3,5,7} as the size k of the Gaussian kernel, and use a k×k Gaussian kernel with a standard deviation of σ (usually related to k) to perform convolution blur processing on the image.

[0036] The original ROI image is enhanced in the above way to generate a variety of enhanced ROI images, which significantly improves the model's robustness to process fluctuations and environmental disturbances. After preprocessing, the data is fed into a semi-supervised hybrid model.

[0037] S3. Construct a semi-supervised hybrid model, which includes two parallel supervised learning sub-modules and an unsupervised learning sub-module. After the preprocessed ROI image passes through the supervised learning sub-module, it outputs a defect probability value as the supervised anomaly confidence. After the preprocessed ROI image passes through the unsupervised learning sub-module, it outputs an original anomaly score with an unbounded value range, which needs to be transformed before it can be fused with the output of the supervised path.

[0038] The supervised learning submodule uses DenseNet-121 as the base network, initialized with ImageNet pre-trained weights, and fine-tuned on a small amount of expert-annotated ROI data. In the annotated data, the "Defect NG" class covers four typical defects: insufficient solder, solder bridging, misalignment, and poor shape, with each class accounting for at least 15%. During training, a binary cross-entropy loss function is used, and the optimizer is AdamW (learning rate 1e). -4 The supervised learning submodule is constructed by enabling an early stopping mechanism—training is terminated if the validation set loss does not decrease for five consecutive epochs. S301. Initialize the network and data: Use ResNet-34 as the backbone network, remove the top fully connected layers, and retain the convolutional parts as the feature encoder. (x, W), where W are the trainable weights of the network. The encoder output is a feature vector. Obtain a dataset D containing only normal (defect-free) ROI images. normal ={x1,x2,...,x N}, where N is the number of samples.

[0039] S302, Calculate and fix the sphere center C based on the initial network: Before training begins, dataset D normalThe feature representations are obtained from an encoder in which all sample inputs are in a randomly initialized state. (x i W init Calculate the mean of the feature vectors of all normal samples, define it as the center C of the hypersphere, and keep it constant throughout the training process. The formula for calculating the center C is: .

[0040] S303. Train the network to shrink the features of normal samples toward the center C of the sphere.

[0041] Objective: To optimize the loss function Update the encoder parameters W to drive the feature vectors of all normal samples. (x i ,W) gathers towards the center C of the sphere.

[0042] The loss function consists of a distance contraction term and a weight regularization term, and its calculation formula is as follows: ; in: Represents the squared Euclidean distance between vectors; This is the regularization coefficient.

[0043] S304. Based on the shrinking characteristic distribution, determine the radius R of the decision boundary range.

[0044] Using the encoder after training For training set D normal Perform forward propagation again, calculate the squared distance from each sample to the center C of the sphere, and obtain the distance set: ; The 95th quantile of the distance set S is chosen as the radius R of the hypersphere. This radius defines the boundary of the normal sample distribution, and its calculation formula is as follows: .

[0045] S305. By comparing the relationship between the sample to be tested and the normal space defined by "center of the sphere + radius", the anomaly score is output.

[0046] For a new sample x to be detected test Using a trained encoder Extract its features Calculate the squared distance from the feature to the center C of the sphere; compare the squared distance with the squared radius to obtain the anomaly score. : , like If ≤0, the sample is considered normal; if A score greater than 0 indicates the sample is an anomaly. The higher the score, the greater the degree of anomaly.

[0047] The construction method of the unsupervised learning submodule is basically the same as that of the supervised learning submodule. The main difference is that the unsupervised learning submodule is based on the Deep SVDD architecture, and its encoder part is composed of ResNet-34 with the fully connected layers removed. Before training, all normal samples are input into the encoder, and the mean value of the output features is calculated to obtain the fixed center C. The training objective is to minimize the sum of squared distances from the normal sample features to the fixed center C, and an L2 regularization term is added. =1e -6 After training, the 95th percentile of the normal sample feature distance distribution is taken as the hypersphere radius R, so that 95% of the normal sample points fall into the hypersphere with the center C as the center and R as the radius, while the abnormal sample points fall outside the hypersphere.

[0048] The anomaly score output by the supervised learning submodule is denoted as the defect probability value p. The anomaly score output by the unsupervised learning submodule is used as the original anomaly score s.

[0049] During the inference phase of the semi-supervised hybrid model, the same ROI image to be inspected is input in parallel into the CNN classifier of the supervised learning submodule and the Deep SVDD encoder of the unsupervised learning submodule. The supervised learning submodule outputs the defect probability value p, and the unsupervised learning submodule outputs the original anomaly score s. The defect probability value p and the original anomaly score s are both sent to the decision module for decision fusion.

[0050] The workflow of the decision-making module is as follows: input standardization, then select a fusion strategy to calculate the final score. Based on the set threshold, an OK / NG judgment is made, and finally the overall confidence level is calculated to determine whether manual re-inspection is needed.

[0051] The fusion strategies include: weighted average, logistic regression, or confidence gating.

[0052] In the weighted average scheme, the final outlier score is calculated using the following formula: , in, The weighting coefficient is determined through performance tuning on the validation set, and is typically set to 0.6-0.8. The unsupervised anomaly confidence score is the original anomaly score *s* mapped to the [0, 1] interval using the sigmoid function. The closer it is to 1, the higher the probability that the unsupervised learning submodule considers the sample to be abnormal.

[0053] The logistic regression approach uses the defect probability value p and the anomaly score s as features to train a binary classifier on the validation set. The probability value output by this classifier is the final score. .

[0054] The confidence level is set as follows: τ = 0.9. When the confidence level of the supervised learning submodule is ≥ τ, its result is directly adopted; otherwise, the score output by the unsupervised learning submodule is used for judgment.

[0055] Ultimately, if If a threshold is set (e.g., 0.5), it is considered NG; otherwise, it is considered OK. Furthermore, the system calculates the overall confidence level as | - Set a threshold |×2. If the threshold is lower than the set value (e.g., 0.3), a manual re-inspection request will be automatically triggered.

[0056] Taking the solder paste printing inspection of a mobile phone motherboard PCBA as an example, the system collects 500 images of the entire board and generates approximately 2000 pad ROI images through the ROI cropping module. Of these, 200 (10%) are labeled by experts, including 180 OK and 20 NG samples. The supervised learning submodule uses 200 labeled data to train DenseNet-121, while the unsupervised learning submodule uses 2000 pad ROI images (unlabeled data) to train Deep SVDD. A logistic regression strategy is used for fusion. On the independent test set, the semi-supervised hybrid model of this invention achieves 99.6% accuracy, 0.3% false positive rate, and 0.08% false negative rate, significantly improving upon purely supervised or purely unsupervised solutions, reducing manual re-inspection workload by more than 85%. The entire development cycle takes only 10 weeks, far lower than the traditional industry average of 6-12 months.

[0057] The above descriptions are merely some embodiments of the present invention. Those skilled in the art can make various modifications and improvements without departing from the inventive concept of the present invention, and these all fall within the scope of protection of the present invention.

Claims

1. A method for inspecting the printing and soldering quality of PCB boards based on a semi-supervised hybrid algorithm, characterized in that, Includes the following steps: Data acquisition: Acquire a full-board image of the PCB to be inspected, and simultaneously receive component coordinate files output from SPI / AOI devices via the communication interface; Image preprocessing: Parse the coordinate information in the component coordinate file, crop and scale the whole board image to a uniform size, and generate a single component ROI image; The ROI image is subjected to invalid image filtering and differential data augmentation to obtain an enhanced ROI image; The enhanced ROI image is input into a semi-supervised hybrid model, which includes two parallel supervised learning sub-modules and an unsupervised learning sub-module. After passing through the supervised learning sub-module, the enhanced ROI image outputs a defect probability value p, and after passing through the unsupervised learning sub-module, the enhanced ROI image outputs an anomaly score s. Based on the defect probability value p and the anomaly score s, a fusion strategy is selected from weighted average, logistic regression, or confidence gating to obtain the final score. The system calculates and compares the final score with a set threshold. If the final score is greater than the set threshold, the PCB to be tested is determined to be NG; otherwise, the PCB to be tested is determined to be OK.

2. The PCB board printing and soldering quality inspection method as described in claim 1, characterized in that, In the data acquisition step, the component coordinate file includes the unique identifier of all pads on the PCB to be detected, the center coordinates (x,y), the width w, and the height h; on the whole board image, based on (x,y,w,h), the boundary is expanded by 10% in all directions and then cropped, and then scaled to 224×224 pixels to obtain the ROI image.

3. The PCB board printing and soldering quality inspection method as described in claim 1, characterized in that, In step S2, the invalid image filtering process includes calculating the Laplacian variance of each ROI image. If the value is lower than a set threshold, it is determined to be an out-of-focus or blurry image and is removed; if it is equal to or higher than the set threshold, it is retained.

4. The PCB board printing and soldering quality inspection method as described in claim 1, characterized in that, In the image preprocessing step, the differential data augmentation includes using a weak augmentation strategy for the labeled data used in the supervised learning submodule and a strong augmentation strategy for the unlabeled data used in the unsupervised learning submodule.

5. The PCB board printing and soldering quality inspection method as described in claim 4, characterized in that, The weak enhancement strategy involves randomly flipping horizontally or rotating within ±5° with a set probability.

6. The PCB board printing and soldering quality inspection method as described in claim 4, characterized in that, The enhanced strategy includes one or more of the following: random brightness and contrast adjustment, Gaussian noise injection, Cutout random occlusion processing, or Gaussian blur processing.

7. The PCB board printing and soldering quality inspection method as described in claim 1, characterized in that, The construction of the supervised learning submodule includes: Initialize the network and data: Use ResNet-34 as the backbone network, remove the top fully connected layers, and retain the convolutional parts as the feature encoder. (x, W), where W is the trainable weights of the network, and the encoder output is a feature vector; obtain a dataset D containing only ROI images labeled with defect information. normal ={x1,x2,...,x N }, where N is the number of samples; Based on the initial network computation and with the center of the sphere fixed at C: Before training begins, the dataset D is... normal The feature representations are obtained from an encoder in which all sample inputs are in a randomly initialized state. (x i W init ); Calculate the mean of the feature vectors of all normal samples, define it as the center C of the hypersphere, and keep it constant throughout the training process. The formula for calculating the center C is: ; Train the network to shrink the features of normal samples towards the center C of the sphere: Objective: To optimize the loss function Update the encoder parameters W to drive the feature vectors of all normal samples. (x i (W) converges towards the center C of the sphere; The loss function consists of a distance contraction term and a weight regularization term, and its calculation formula is as follows: ; in: Represents the squared Euclidean distance between vectors; The regularization coefficient is used. Based on the shrunk feature distribution, determine the radius R of the decision boundary range: using the encoder after training. For training set D normal Perform forward propagation again, calculate the squared distance from each sample to the center C of the sphere, and obtain the distance set: ; The 95th quantile of the distance set S is chosen as the radius R of the hypersphere. This radius defines the boundary of the normal sample distribution, and its calculation formula is as follows: ; Calculate the anomaly score: For a new sample x to be detected test Using a trained encoder Extract its features Calculate the squared distance from the feature to the center C of the sphere; compare the squared distance with the squared radius to obtain the anomaly score. .

8. The PCB board printing and soldering quality inspection method as described in claim 7, characterized in that, The training dataset of the supervised learning submodule consists entirely of ROI images labeled with defect information; the training dataset of the unsupervised learning submodule consists of ROI images without labeled defect information; in the training dataset of the supervised learning submodule, the defect information includes four types of defects: insufficient solder, solder bridging, misalignment, and poor shape, and the proportion of each type of defect sample is not less than 15% of the total NG samples.

9. The PCB board printing and soldering quality inspection method as described in claim 1, characterized in that, It also includes calculating the overall confidence level, which is calculated as follows: | -0.5|×2; When the overall confidence level is lower than the set value, a manual re-inspection request is triggered.

10. A PCB board printing and soldering quality inspection system for implementing the method as described in any one of claims 1 to 9, characterized in that, include: Image acquisition unit, equipped with a high-resolution industrial camera and LED light source; The metadata parsing unit, connected to the SPI / AOI device communication interface, is used to parse the component coordinate file; The ROI cropping and preprocessing unit is used to perform intelligent cropping, size normalization, invalid image filtering, and differential data augmentation. A semi-supervised hybrid model, comprising a supervised learning sub-model, an unsupervised learning sub-model, and a decision module.