PCB board component model identification method, qualification determination method, terminal and medium

CN122990336APending Publication Date: 2026-10-27ANHUI ZENITH ELECTRICITY & ELECTRONICS
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611254270.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-18
Publication Date
2026-10-27

AI Technical Summary

Technical Problem

为了解决现有PCB板元器件比对检测中,难以排除图像信息不完备或特征表征能力不足对元器件型号识别干扰的技术问题,本发明提供一种PCB板上元器件的型号识别方法、一种PCB板合格判定方法,以及用于该型号识别方法的终端及介质

Benefits of technology

1、本发明通过提取元器件图像集的丝印信息并与样本库匹配,且基于相似度度量提取图像特征,与样本库比对并经阈值筛选,且基于相对距离排序提取图像特征,与样本库比对并经阈值筛选,且对元器件图像集进行分类识别并经阈值筛选,最终得到四类识别结果,各识别结果包括元器件类别与识别置信度,且在四类识别结果融合阶段,充分考虑元器件数据集小样本问题、误判问题以及样本不均衡问题,引入历史准确率、类别混淆惩罚因子以及样本占比补偿因子修正不同识别结果的权重因子,从而进一步提高元器件对比检测的准确性。故,本发明通过融合四类识别结果,确定最后的元器件识别型号,从而解决了现有PCB板元器件比对检测中,难以排除图像信息不完备或特征表征能力不足对元器件型号识别干扰的技术问题。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122990336A_ABST
    Figure CN122990336A_ABST
Patent Text Reader

Abstract

The application relates to a PCB component model recognition method, a qualified judgment method, a terminal and a medium in the technical field of component detection. The steps of the PCB component model recognition method include: outputting recognition results including component categories and corresponding recognition confidence through four types of recognition paths according to a component image set; calculating a basic weight according to the historical accuracy of each recognition result and the current sample confidence; modifying the weight by superimposing a category-adaptive smoothing, penalty and compensation factor; normalizing the modified weight; weighting and fusing the four types of recognition results based on the normalized weight; and outputting the component model. The application further improves the accuracy of component comparison detection by introducing the historical accuracy, category confusion penalty factor and sample proportion compensation factor to modify the weight factor of different recognition results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of component testing technology, and in particular to a method for identifying the model of components on a PCB board, a method for determining the qualification of a PCB board, and a terminal and medium for the model identification method. Background Technology

[0002] As a fundamental measure for electricity metering and settlement, the quality control of electricity meters is crucial. Among these measures, verifying the model and specifications of key components on the electricity meter's PCB, such as those for metering, sampling, and communication, to ensure consistency with the bidding commitments is an important means of guaranteeing the quality of electricity meters.

[0003] Currently, automated methods for verifying the type of components on PCBs typically rely on template matching, OCR character recognition, or a single deep learning model for classification and identification.

[0004] However, existing PCB boards have densely packed and tiny components, making it easy for the same component to be repeatedly detected or missed when photographed in different areas. Furthermore, OCR recognition is susceptible to interference from factors such as conformal coating and silkscreen wear. A single recognition path lacks robustness in complex scenarios, and there is a lack of redundancy verification mechanisms when one method fails. Existing fusion schemes often use fixed weights for each path, failing to consider the varying adaptability of different component types to different recognition methods, thus limiting the accuracy of the fusion results. Summary of the Invention

[0005] (1) Technical problems to be solved To address the technical problem of interference from incomplete image information or insufficient feature representation capabilities in the comparison and inspection of components on PCB boards, this invention provides a method for identifying the model of components on a PCB board, a method for determining the qualification of a PCB board, and a terminal and medium for the model identification method.

[0006] (2) Technical solution The first aspect of this invention provides a method for identifying the model of components on a PCB board, the steps of which include: Extract the silkscreen information of the component image set and match it with the sample library to output the first recognition result; extract image features based on similarity measurement, compare them with the sample library and filter them with a threshold to output the second recognition result; extract image features based on relative distance ranking, compare them with the sample library and filter them with a threshold to output the third recognition result; classify and recognize the component image set and filter it with a threshold to output the fourth recognition result; each recognition result includes the component category and recognition confidence level; The basic weights are calculated based on the historical accuracy and current sample confidence of each recognition result. The weights are then adjusted by adding smoothing, penalty and compensation factors for category adaptation. The adjusted weights are normalized, and the four recognition results are then weighted and fused based on the normalized weights to output the component model.

[0007] As a further improvement to the above solution, the steps for obtaining the component image set include: Feature extraction is performed on each sub-image in the PCB image set to obtain the position coordinates and category matrix of the components in each sub-image; the sub-images are combined into a complete PCB image, and the position coordinates of the components in each sub-image are mapped to the global coordinate system of the complete PCB image to obtain the position coordinates of the components in the whole image; based on the position coordinates of the components in the whole image and the category matrix, the duplicate detection coordinates of the same component are merged to obtain a deduplicated complete component image set.

[0008] As a further improvement to the above scheme, each sub-image is acquired sequentially along the x-axis and y-axis directions according to a preset fixed step size, and overlapping areas are retained between adjacent sub-images to ensure that all positions of the PCB are acquired.

[0009] As a further improvement to the above scheme, the expression for the component position coordinate mapping rule is as follows: ; In the formula, L local,q L represents the coordinates of the q-th component. global,q Let L represent the position coordinates of the q-th element in the full image, L be the step matrix, u represent the relative position offsets of two adjacent sub-images in the horizontal and vertical directions, and v represent the unit row vector, where v∈R. 1×4 Among them, L local =[L local,1 ,L local,2 ,L local,3 ,…,L local,n ] T ∈R Q×4×2 L global =[L global,1 ,L global,2 ,L global,3 ,…,L global,Q ] T ∈R Q×4×2 And Q represents the total number of components in each sub-image; The coordinates of the i-th component are L local,i The expression is: ; In the formula, x i,j Let y represent the x-coordinate of the i-th component on the PCB image set. i,jLet j represent the ordinate of the i-th component on the PCB image set; where j ⊆ [1, 2, 3, 4], and the angular coordinates 1, 2, 3, 4 represent the upper left, upper right, lower right, and lower left positions of the component, respectively. The expression for L is: ; In the formula, x represents the number of steps along the x-axis with a preset fixed step size, y represents the number of steps along the y-axis with a preset fixed step size, and n... y The maximum number of steps that can be taken along the y-axis with a preset fixed step size; The expression for u is: ; In the formula, w and h represent the width and height of the sub-image, respectively. iou and h iou These represent the overlapping areas of the two sub-images in the x and y directions, respectively.

[0010] As a further improvement to the above scheme, the steps for obtaining the component image set based on the full-image component location coordinates and category matrix include: Determine whether the coordinates of the two components in the overall image overlap. The coordinate components of mutually disjoint, maximally overlapping components are obtained by brute-force search; For each set of highly overlapping component coordinate components, the vertex matrix is ​​spliced, and the duplicate detection coordinates belonging to the same component are merged. Based on the complete PCB image and the merged coordinates of the components, component images are extracted to form a component image set.

[0011] As a further improvement to the above scheme, the rule for determining whether the position coordinates of the two components overlap in the overall diagram is as follows: ; In the formula, L global,i L represents the coordinates of the i-th component in the entire image. global,j C represents the coordinates of the j-th component in the entire image. i Let C represent the matrix of the i-th component category. j Let L represent the matrix of the j-th component category, min(L global,i (1) indicates that for matrix L, axis=0) global,i Find the minimum value column by column and return the first column of the resulting vector, max(L) global,j (1) indicates that for matrix L, axis=0) global,j Find the maximum value of each column and return the first column of the resulting vector, min(L global,i (2) indicates that for matrix L, axis=0) global,i Find the minimum value of each column and return the second column of the resulting vector, max(L)global,j (2) indicates that for matrix L, axis=0) global,j Find the maximum value by column and return the second column of the resulting vector.

[0012] As a further improvement to the above scheme, the expression for vertex matrix concatenation is: ; In the formula, K s This represents the set of coordinate components of highly overlapping components.

[0013] As a further improvement to the above scheme, the merged coordinate points are: ; In the formula, I1 and I2 represent index template matrices, J1 and J2 represent projection matrices, s represents the number of coordinate points after merging, and s < Q; I1 and I2 are specifically: ; J1 and J2 are specifically: .

[0014] As a further improvement to the above scheme, the first identification result includes the first component category n. nor ∈[1,N], and the first recognition confidence level Where N is the number of sample categories; The second identification result includes the second component category n. siamses ∈[1,N], and the second recognition confidence level ; The third identification result includes the third component category n triplet ∈[1,N] and the third identification confidence level ; The fourth identification result includes the fourth component category n dino ∈[1,N] and the fourth recognition confidence level .

[0015] As a further improvement to the above scheme, the expression for the basic weights is: ; In the formula, This represents the historical accuracy obtained by the recognition model m. This represents the recognition confidence score of the recognition model m in identifying category n; m∈[ocr,siamese,triplet,dino], n represents the component category, n∈[n ocr ,n siamese ,n triplet ,n dino], and n∈[1,N], where N represents the number of sample categories; in: ; In the formula, This represents the historical accuracy rate of the first identification result. This indicates the historical accuracy of the second identification result. This indicates the historical accuracy of the third identification result. This indicates the historical accuracy of the fourth identification result.

[0016] As a further improvement to the above scheme, the expression for weight correction is: ; In the formula, The Bayesian smoothing class accuracy used to solve the small sample problem is expressed as: ; Where H∈R 1×N H represents the matrix of the number of different categories in the validation set. n This indicates the number of validation set categories n; The category confusion penalty factor, which addresses the problem of misclassification, is expressed as follows: ; In the formula, FP∈R 3×N The class misclassification matrix, FP, represents the class misclassification from other classes to the current class. m,n This represents the total number of times model m mispredicts samples from other classes as belonging to class n; The sample proportion compensation factor for resolving sample imbalance is expressed as: .

[0017] As a further improvement to the above scheme, the expression for the normalized weights is: .

[0018] As a further improvement to the above scheme, the final result recognition result is expressed as follows: .

[0019] The second aspect of this invention provides a method for determining the quality of a PCB board, comprising: Compare the model numbers of the components on the pre-set PCB board with the model numbers of the components on the PCB board to be tested to see if they are the same. If all components are identical, the PCB board under test is considered to be usable; otherwise, it is considered to be unusable. The method for identifying the model of components on the PCB board under test is the same as the method described above.

[0020] A computer terminal provided by a third aspect of the present invention includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the PCB board component comparison and detection method described above.

[0021] The fourth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein when the program is executed by a processor, it implements the steps of the PCB board component comparison and detection method described above.

[0022] (3) Beneficial effects 1. This invention extracts silkscreen information from a set of component images and matches it with a sample library. It then extracts image features based on similarity metrics, compares them with the sample library, and performs threshold filtering. Additionally, it extracts image features based on relative distance ranking, compares them with the sample library, and performs threshold filtering. Finally, it classifies and identifies the component image set, performing threshold filtering again. This results in four categories of identification results, each including the component category and identification confidence level. During the fusion stage of the four categories, the invention fully considers the small sample size, misjudgment, and imbalanced sample problems of the component dataset. It introduces historical accuracy, category confusion penalty factors, and sample proportion compensation factors to correct the weighting factors of different identification results, thereby further improving the accuracy of component comparison and detection. Therefore, this invention, by fusing the four categories of identification results, determines the final component identification model, thus solving the technical problem in existing PCB board component comparison and detection where it is difficult to eliminate interference from incomplete image information or insufficient feature representation capabilities in component model identification.

[0023] 2. The component comparison and detection algorithm and system based on deep learning and image processing of this invention can extract more multi-dimensional features of components: This method efficiently obtains the silk screen information of component images based on image processing technology and OCR recognition, accurately determines similar component images based on Siamese and Triplet two-class contrast learning, extracts component features based on DINOv3 network to determine category information, and automatically adjusts the fusion weight according to the different adaptability of different component types to each recognition path, overcoming the defect of unstable fusion results when facing diverse components in the existing fixed weight scheme. Attached Figure Description

[0024] Figure 1 This is a flowchart of the component model identification method on the PCB board in Embodiment 1 of the present invention; Figure 2 This is a schematic diagram of the component extraction process in Embodiment 1 of the present invention; Figure 3 This is a schematic diagram of the PCB image set in Embodiment 1 of the present invention; Figure 4 This is a flowchart illustrating the Siamese network in Embodiment 1 of the present invention; Figure 5 This is a flowchart illustrating the Triplet network in Embodiment 1 of the present invention; Figure 6 This is a schematic diagram of the DINOv3-SEMLP network in Embodiment 1 of the present invention. Detailed Implementation

[0025] The technical solutions in the embodiments of the present invention will be clearly and completely described below. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0026] It should be noted that when a component is said to be "installed on" another component, it can be directly on the other component or it may be in a component that is centered on it. When a component is said to be "set on" another component, it can be directly set on the other component or it may also be in a component that is centered on it. When a component is said to be "fixed to" another component, it can be directly fixed to the other component or it may also be in a component that is centered on it.

[0027] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used herein in the specification of this invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. The term "or / and" as used herein includes any and all combinations of one or more of the associated listed items.

[0028] Example 1 This embodiment introduces a method for identifying the model of components on a PCB board. This method identifies the silkscreen information of component images, accurately determines similar component images, and identifies the category information of the component images. In the multi-source result fusion stage, it fully considers the problems of small sample sizes, misclassification, and imbalanced sample sizes in the component dataset. It introduces Bayesian smoothing of class accuracy, a class confusion penalty factor, and a sample proportion compensation factor to correct the weight factors of different models, further improving the accuracy of component comparison and detection. Please refer to [link to relevant documentation]. Figure 1 The PCB board component comparison and detection method described in this embodiment has the following specific steps: S1, Obtain the component image set: After obtaining the camera-captured PCB image set M, a clear component image set is obtained through positioning, location filtering, image compositing, and component cropping steps, as detailed below. Figure 2 As shown.

[0029] It should be noted that due to the miniaturization and densification of components, high-definition cameras are often used to capture images of the PCB of an electric meter in order to capture more component features. These cameras have extremely high image resolution, meaning that multiple shots are required to capture the entire PCB. After each shot, images are sequentially acquired along the x and y axes at a preset fixed step size. There will be overlap in the images captured to ensure that all areas of the PCB are included. For a clearer understanding of the formation of the PCB image set M, please refer to [link to relevant documentation]. Figure 3 It shows a schematic diagram of a PCB image set M.

[0030] The specific steps for obtaining the component image set include: S1.1 Considering the miniaturization and densification of components, this embodiment first uses YOLO v11 trained on the component sample set to detect each sub-image of the meter PCB image set M. While locating the component positions, it extracts the features of the corresponding regions of each component to obtain the component position coordinates L in the sub-image. local And the category matrix C. Where, L local =[L local,1 ,L local,2 ,L local,3 ,…,L local,n ] T ∈R Q×4×2 , C∈R Q×1 T represents the matrix transpose identifier, R represents that the matrix elements are real numbers, and Q represents the total number of components in each sub-image.

[0031] For example, the position coordinates L of the i-th component local,i The expression is: ; In the formula, x i,j Let y represent the x-coordinate of the i-th component in the PCB image set M. i,j Let j represent the ordinate of the i-th component in the PCB image set M; where j⊆[1,2,3,4], and the angular coordinates 1,2,3,4 represent the upper left, upper right, lower right, and lower left positions of the component, respectively. Figure 3 As shown.

[0032] S1.2, combine the sub-images into a complete PCB image, and map the component position coordinates of each sub-image to the global coordinate system of the complete PCB image to obtain the component position coordinates of the whole image.

[0033] The expression for the component position coordinate mapping rule is as follows: ; In the formula, L local,q L represents the coordinates of the q-th component. global,q Let L represent the position coordinates of the q-th element in the full image, L be the step matrix, u represent the relative position offsets of two adjacent sub-images in the horizontal and vertical directions, and v represent the unit row vector, where v∈R. 1×4 Among them, L local =[L local,1 ,L local,2 ,L local,3 ,…,L local,n ] T ∈R Q×4×2 L global =[L global,1 ,L global,2 ,L global,3 ,…,L global,Q ] T ∈R Q×4×2 And Q represents the total number of components in each sub-image.

[0034] The expression for L is: ; In the formula, x represents the number of steps along the x-axis with a preset fixed step size, y represents the number of steps along the y-axis with a preset fixed step size, and n... y The maximum number of steps that can be taken along the y-axis with a preset fixed step size; The expression for u is: ; In the formula, w and h represent the width and height of the sub-image, respectively. iou and h iou These represent the overlapping areas of the two sub-images in the x and y directions, respectively.

[0035] S1.3, based on the position coordinates and category matrix of the components in the full image, merge the duplicate detection coordinates of the same component to obtain a complete set of component images after deduplication.

[0036] S1.3.1, determine whether the position coordinates of two components overlap in the overall diagram. The judgment rules are as follows: ; In the formula, L global,i L represents the coordinates of the i-th component in the entire image. global,j C represents the coordinates of the j-th component in the entire image. i Let C represent the matrix of the i-th component category. jLet L represent the matrix of the j-th component category, min(L global,i (1) indicates that for matrix L, axis=0) global,i Find the minimum value column by column and return the first column of the resulting vector, max(L) global,j (1) indicates that for matrix L, axis=0) global,j Find the maximum value of each column and return the first column of the resulting vector, min(L global,i (2) indicates that for matrix L, axis=0) global,i Find the minimum value of each column and return the second column of the resulting vector, max(L) global,j (2) indicates that for matrix L, axis=0) global,j Find the maximum value by column and return the second column of the resulting vector.

[0037] For example, if When, min(L) global,i The axis=0 is [104,256], min(L global,i ,axis=0)(1) and min(L global,i (2) with axis=0 are 104 and 256 respectively. Similarly, max(L global,j The axis=0) is [248, 379], max(L global,j ,axis=0)(1) and max(L global,j (2) ,axis=0)248 and 379 respectively.

[0038] S1.3.2, Based on the above rules, the position coordinates of all components in the image are determined. In this embodiment, brute-force search can be used to obtain the coordinate components K of mutually non-intersecting maximally overlapping components. s =[K 1, K 2, K 3, …,K t ], where K s Used to record overlap L global,i The index number i is used to determine the intersection of the coordinates of all components, and the indexes of components of the same type that intersect are recorded. In different embodiments, the union-intersection algorithm can also be used to obtain the coordinate components of mutually non-intersecting maximally overlapping components.

[0039] S1.3.3, for each set of coordinate components K with maximum overlap s splicing vertex matrix L sp Repeated detection coordinates belonging to the same component are merged. Vertex matrix L sp The concatenated expression is: ; The merged coordinates are: ; In the formula, I1 and I2 represent index template matrices, J1 and J2 represent projection matrices, s represents the number of coordinate points after merging, and s < Q; I1 and I2 are specifically: ; J1 and J2 are specifically: .

[0040] The calculation yielded: .

[0041] S1.3.4, calculated as follows Then, based on the complete PCB image and the merged coordinates of the components, the component images are extracted to form a component image set Y.

[0042] S2, Obtain the component categories and recognition confidence scores output by the four recognition networks: For the obtained component image set, extract various features of the component images, compare them with the component sample library, and obtain the comparison results of various comparison models. Among them, the threshold in various threshold filtering mechanisms is set to 0.85.

[0043] S2.1, Based on image processing and OCR recognition, obtain the silkscreen information of components, and combine it with the silkscreen information of component samples in the sample library to determine the first recognition result, including the specific first component category n. nor ∈[1,N], where N is the number of sample categories and the first recognition confidence level. The image processing workflow includes low-light enhancement of component images, low-resolution enhancement, and rotation angle detection.

[0044] S2.2, as Figure 4 As shown, component image features are extracted based on the Siamese network, compared with images in the sample library to obtain the most similar sample image, and a threshold screening mechanism is used to determine the second recognition result, including the second component category n. siamses ∈[1,N] and the second recognition confidence level .

[0045] It should be noted that the Siamese network uses ResNet50 as the backbone network. To better adapt to the component dataset, the ResNet50 is modified as follows: 1) Remove the average pooling layer and the fully connected layer; 2) Freeze all parameters of the first convolutional layer and the first batch normalization (BN) layer; 3) Freeze the first residual block; 4) Freeze all BN layers.

[0046] Subsequent network layers primarily focus on maximizing the difference in output features between two ResNet50 layers, with the loss function being the binary cross-entropy loss function.

[0047] S2.3, such as Figure 5 As shown, component image features are extracted based on a Triplet network, compared with images in a sample library to obtain the most similar sample image, and a threshold screening mechanism is used to determine the third identification result, including the third component category n. triplet ∈[1,N] and the third identification confidence level .

[0048] It should be noted that the Triplet network also uses ResNet50 as the backbone network, and the processing flow of ResNet50 remains the same. Subsequent network layers mainly aim to minimize similar errors and maximize dissimilar errors, and its error function is the ranking loss function.

[0049] S2.4, such as Figure 6 As shown, component image classification information is obtained based on the DINOv3-SEMLP network. A threshold filtering mechanism and category information are combined to determine the fourth recognition result, including the fourth component category n. dino ∈[1,N] and the fourth recognition confidence level .

[0050] It should be noted that the DINOv3-SEMLP network also uses DINOv3 as the backbone network. To facilitate subsequent task processing, its classification head is removed and all network parameters are frozen. Subsequent networks use attention mechanism modules (SE) and multilayer perceptron network structures (MLP) to ensure classification accuracy. The loss function is the cross-entropy loss function.

[0051] S3, Obtain component identification results: Calculate the basic weights based on the historical accuracy and current sample confidence of each identification result, and then adjust the weights by adding smoothing, penalty and compensation factors for category adaptation. Normalize the adjusted weights, and then perform weighted fusion of the four identification results based on the normalized weights to output the component model.

[0052] S3.1, In steps S2.1 to S2.4, after the training of the four types of models is completed, the model performance is analyzed separately using the validation set to obtain its overall recognition accuracy on the validation set: ; In the formula, This represents the historical accuracy rate of the first identification result. This indicates the historical accuracy of the second identification result. This indicates the historical accuracy of the third identification result. This indicates the historical accuracy of the fourth identification result.

[0053] And the recognition accuracy matrix P∈R under different models and different categories 4×N Simultaneously, determine the class misclassification matrix FP∈R used to identify other classes as this class. N×N , among which, FP n,n |n∈[1,N]=0, the matrix of the number of different categories in the validation set H∈R 1×N .

[0054] S3.2, Calculate the basic weights, the expression of which is: ; In the formula, This represents the historical accuracy obtained using the m-class identification method. This represents the recognition confidence obtained using the m-class recognition method; m∈[ocr,siamese,triplet,dino], where ocr,siamese,triplet, anddino represent the four models in steps S2.1 to S2.4, n represents the component category, n∈[1,N], and N represents the number of sample categories.

[0055] S3.2, based on the basic weights, adds smoothing, penalty, and compensation for class adaptation, taking into account class characteristics to obtain weight correction, the expression of which is: ; In the formula, The Bayesian smoothing class accuracy used to solve the small sample problem is expressed as: ; Where H∈R 1×N H represents the matrix of the number of different categories in the validation set. n This indicates the number of validation set categories n; The category confusion penalty factor, which addresses the problem of misclassification, is expressed as follows: ; In the formula, FP∈R 3×N The class misclassification matrix, FP, represents the class misclassification from other classes to the current class. m,n This represents the total number of times model m incorrectly predicts samples from other categories as category n; Note: During data collection, FP first calculates the N×N confusion matrix (true → predicted) for each category, and then calculates the off-diagonal sum of each column to compress it into N dimensions.

[0056] The sample proportion compensation factor for resolving sample imbalance is expressed as: .

[0057] S3.4 To avoid differences in the magnitude of weight adjustments, the adjusted weights are normalized to obtain normalized weights. The expression for the normalized weights is as follows: .

[0058] S3.5, based on the normalized weights and the identification results of the four types of models, the final identification result is determined. The expression for the final identification result is: ; In the formula, m∈[ocr,siamese,triplet,dino], n∈[n ocr ,n siamese ,n triplet ,n dino ].

[0059] Example 2 This embodiment introduces a PCB board qualification determination method, which applies the PCB board component comparison and detection method based on multi-model fusion provided in Embodiment 1. It is used to detect whether the PCB board under test meets the preset component model and position requirements of the factory-installed PCB board, thereby determining whether the PCB board is qualified and whether it can be used normally. The steps include: According to the PCB board component comparison and detection method based on multi-model fusion provided in Example 1, the model number of the component on the PCB board to be tested is compared with the model number of the component on the preset PCB board, and the model number at the corresponding position is determined based on the output model number.

[0060] If all components are identical, the PCB under test is considered to be usable; otherwise, it is considered to be unusable.

[0061] Example 3 In order to apply the PCB board component comparison and detection method based on multi-model fusion provided in Example 1, Example 3 further provides a computer terminal and storage medium that employ the corresponding detection method.

[0062] Specifically, the computer terminal described in this embodiment 3 includes a memory, a processor, and a computer program stored in the memory and capable of running on the processor. When the processor executes the computer program, it uses the PCB board component comparison and detection method based on multi-model fusion as described in embodiment 1 above to identify the model of the components on the PCB board.

[0063] This embodiment 3 also provides a storage medium storing a computer program; when the computer program is executed by a processor, the PCB board component comparison and detection method based on multi-model fusion as described in embodiment 1 above is used to identify the model of the components on the PCB board.

[0064] The memory (readable storage medium) mentioned in Embodiment 3 includes flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the memory can be an internal storage unit of a computer device, such as the hard disk or RAM of the computer device. In other embodiments, the memory can also be an external storage device of the computer device, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the computer device. Of course, the memory can also include both internal storage units and external storage devices of the computer device. In this embodiment, the memory is typically used to store the operating system and various application software installed on the computer device. In addition, the memory can also be used to temporarily store various types of data that have been output or will be output.

[0065] In some embodiments, a processor may be a central processing unit (CPU), a graphics processing unit (GPU), a controller, a microcontroller, a microprocessor, or other data processing chip. The processor is typically used to control the overall operation of a computer device. In this embodiment, the processor is used to run program code stored in memory or process data.

[0066] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0067] The embodiments described above are merely illustrative of several implementations of the present invention, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these all fall within the protection scope of the present invention. Therefore, the protection scope of this invention patent should be determined by the appended claims.

Claims

1. A method for identifying the model of components on a PCB board, characterized in that, The steps include: Extract the silkscreen information of the component image set and match it with the sample library to output the first recognition result; extract image features based on similarity measurement, compare them with the sample library and filter them with a threshold to output the second recognition result; extract image features based on relative distance ranking, compare them with the sample library and filter them with a threshold to output the third recognition result; classify and recognize the component image set and filter it with a threshold to output the fourth recognition result; each recognition result includes the component category and recognition confidence level; The basic weights are calculated based on the historical accuracy and current sample confidence of each recognition result. The weights are then adjusted by adding smoothing, penalty and compensation factors for category adaptation. The adjusted weights are normalized, and the four recognition results are then weighted and fused based on the normalized weights to output the component model.

2. The method for identifying the model of components on a PCB board according to claim 1, characterized in that, The steps to obtain a set of component images include: Feature extraction is performed on each sub-image in the PCB image set to obtain the position coordinates and category matrix of the components in each sub-image; the sub-images are combined into a complete PCB image, and the position coordinates of the components in each sub-image are mapped to the global coordinate system of the complete PCB image to obtain the position coordinates of the components in the whole image; based on the position coordinates of the components in the whole image and the category matrix, the duplicate detection coordinates of the same component are merged to obtain a deduplicated complete component image set; And / or, each sub-image is acquired sequentially along the x-axis and y-axis directions according to a preset fixed step size, and overlapping areas are retained between adjacent sub-images to ensure that all positions of the PCB are acquired; And / or, the expression for the component position coordinate mapping rule is: ; In the formula, L local,q L represents the coordinates of the q-th component. global,q Let L represent the position coordinates of the q-th element in the full image, L be the step matrix, u represent the relative position offsets of two adjacent sub-images in the horizontal and vertical directions, and v represent the unit row vector, where v∈R. 1×4 Among them, L local =[L local,1 ,L local,2 ,L local,3 ,…,L local,n ] T ∈R Q×4×2 L global =[L global,1 ,L global,2 ,L global,3 ,…,L global,Q ] T ∈R Q×4×2 And Q represents the total number of components in each sub-image; Wherein, the position coordinates L of the i-th component local,i The expression is: ; In the formula, x i,j Let y represent the x-coordinate of the i-th component on the PCB image set. i,j Let j represent the ordinate of the i-th component on the PCB image set; where j ⊆ [1, 2, 3, 4], and the angular coordinates 1, 2, 3, 4 represent the upper left, upper right, lower right, and lower left positions of the component, respectively. The expression for L is: ; In the formula, x represents the number of steps along the x-axis with a preset fixed step size, y represents the number of steps along the y-axis with a preset fixed step size, and n... y The maximum number of steps that can be taken along the y-axis with a preset fixed step size; The expression for u is: ; In the formula, w and h represent the width and height of the sub-image, respectively. iou and h iou These represent the overlapping areas of the two sub-images in the x and y directions, respectively.

3. The method for identifying the model of components on a PCB board according to claim 2, characterized in that, The steps to obtain a component image set based on the component location coordinates and category matrix of the entire image include: Determine whether the coordinates of the two components in the overall image overlap. The coordinate components of mutually disjoint, maximally overlapping components are obtained by brute-force search; For each set of highly overlapping component coordinate components, the vertex matrix is ​​spliced, and the duplicate detection coordinates belonging to the same component are merged. Based on the complete PCB image and the merged coordinates of components, component images are extracted to form a component image set. And / or, the rules for determining whether the position coordinates of two components overlap in the overall diagram are as follows: ; In the formula, L global,i L represents the coordinates of the i-th component in the entire image. global,j C represents the coordinates of the j-th component in the entire image. i Let C represent the matrix of the i-th component category. j Let L represent the matrix of the j-th component category, min(L global,i (1) indicates that for matrix L, axis=0) global,i Find the minimum value column by column and return the first column of the resulting vector, max(L) global,j (1) indicates that for matrix L, axis=0) global,j Find the maximum value of each column and return the first column of the resulting vector, min(L global,i (2) indicates that for matrix L, axis=0) global,i Find the minimum value of each column and return the second column of the resulting vector, max(L) global,j (2) indicates that for matrix L, axis=0) global,j Find the maximum value by column and return the second column of the resulting vector; And / or, the expression for concatenating vertex matrices is: ; In the formula, K s A set representing the coordinate components of highly overlapping components; And / or, the merged coordinates are: ; In the formula, I1 and I2 represent index template matrices, J1 and J2 represent projection matrices, s represents the number of coordinate points after merging, and s < Q; I1 and I2 are specifically: ; J1 and J2 are specifically: 。 4. The method for identifying the model of components on a PCB board according to claim 1, characterized in that, The first identification result includes the first component category n nor ∈[1,N], and the first recognition confidence level Where N is the number of sample categories; The second identification result includes the second component category n. siamses ∈[1,N], and the second recognition confidence level ; The third identification result includes the third component category n triplet ∈[1,N] and the third identification confidence level ; The fourth identification result includes the fourth component category n dino ∈[1,N] and the fourth recognition confidence level .

5. The method for identifying the model of components on a PCB board according to claim 1, characterized in that, The expression for the basic weights is: ; In the formula, This represents the historical accuracy obtained by the recognition model m. This represents the recognition confidence score of the recognition model m in identifying category n; m∈[ocr,siamese,triplet,dino], n represents the component category, n∈[n ocr ,n siamese ,n triplet ,n dino ], and n∈[1,N], where N represents the number of sample categories; in: ; In the formula, This represents the historical accuracy rate of the first identification result. This indicates the historical accuracy of the second identification result. This indicates the historical accuracy of the third identification result. This indicates the historical accuracy of the fourth identification result.

6. The method for identifying the model of components on a PCB board according to claim 1, characterized in that, The expression for weight adjustment is: ; In the formula, The Bayesian smoothing class accuracy used to solve the small sample problem is expressed as: ; Where H∈R 1×N H represents the matrix of the number of different categories in the validation set. n This indicates the number of validation set categories n; The category confusion penalty factor, which addresses the problem of misclassification, is expressed as follows: ; In the formula, FP∈R 3×N The class misclassification matrix, FP, represents the class misclassification from other classes to the current class. m,n This represents the total number of times model m mispredicts samples from other classes as belonging to class n; The sample proportion compensation factor for resolving sample imbalance is expressed as: 。 7. The method for identifying the model of components on a PCB board according to claim 1, characterized in that, The expression for normalized weights is: ; And / or, the final result recognition result expression is: 。 8. A method for determining the quality of a PCB board, comprising: Compare the model numbers of the components on the pre-set PCB board with the model numbers of the components on the PCB board to be tested to see if they are the same. If all components are identical, the PCB board under test is considered to be usable; otherwise, it is considered to be unusable. The characteristic feature is that the method for identifying the model of components on the PCB board under test adopts the method for identifying the model of components on the PCB board as described in any one of claims 1 to 7.

9. A computer terminal, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the PCB board component model identification method as described in any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the steps of the PCB board component model identification method as described in any one of claims 1 to 7.