Circuit board image cross-domain registration model and method based on semantic feature guidance

Through the cross-domain registration model of circuit board images based on semantic features, combining deep learning technology and loss functions, semantic information is fused to enhance robustness and matching, the robustness of circuit board image registration methods in the prior art is solved. The problem of insufficient and domain difference matching achieves more efficient image feature matching.

CN119006548APending Publication Date: 2024-11-22苏州深视信息科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411231681.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-04
Publication Date
2024-11-22

AI Technical Summary

Technical Problem

The existing circuit board image registration method is not robust enough when facing factors such as image resolution, rotation angle and noise, and it is difficult to achieve an ideal matching effect in the case of domain differences.

Method used

Using a cross-domain registration model for circuit board images based on semantic feature guidance, the image feature extraction module, semantic feature extraction module, semantic implantation module and feature matching module are combined with the position encoding layer, self-attention layer, cross-attention layer and Multi-layer perceptron module uses semantic triplet loss, control matching loss and fine matching loss functions, and fuses semantic information to enhance robustness and matching.

Benefits of technology

It improves the robustness and matching effect of circuit board image registration, can effectively deal with image registration problems with large domain differences and style differences, and solves the problem of circuit board image comparison collected by different photosensitive devices in different environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119006548A_ABST
    Figure CN119006548A_ABST
Patent Text Reader

Abstract

The invention relates to a circuit board image cross-domain registration model and method based on semantic feature guidance in the field of circuit board image registration, and the model comprises a feature extraction module, a semantic feature extraction module, a semantic implantation module and a feature matching module. The semantic features are fused into the image features, and the image features and the semantic information are kept consistent, so that the registration problem between the circuit board image with large style difference and the reference image is solved, the recognition challenge caused by the domain difference problem in the industrial defect recognition field is solved, and the recognition accuracy is improved. The problem of comparison of circuit board images acquired by different photosensitive devices in different shooting environments is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of circuit board image registration, and in particular to a circuit board image cross-domain registration model and method based on semantic feature guidance. Background Art

[0002] Circuit board image registration is a key technology in the industrial field, which is often used to solve the problem of comparing sample images collected by different photosensitive devices in different environments.

[0003] The current mainstream circuit board image registration methods are as follows:

[0004] 1. Image registration methods based on traditional machine vision features: including image registration methods based on grayscale information, features and transform domains. These methods achieve image registration by finding significant features in the image and using these features for matching and transformation.

[0005] 2. Image feature point registration method based on neural network features: This method follows the idea of ​​image registration based on traditional machine vision features, such as point features and texture features, but it extracts features through a neural network model and optimizes feature expression.

[0006] However, the above two mainstream circuit board image registration methods also have some defects, as follows:

[0007] 1. The image registration method based on traditional machine vision features mainly relies on manually defined feature patterns to extract image features. This method is easily affected by factors such as image resolution, rotation angle and image noise, resulting in insufficient robustness.

[0008] 2. The image registration method based on neural network features mainly relies on data learning feature patterns and adapts to various complex feature matching scenarios. However, when there is a large domain difference between the circuit board image and the reference circuit board image, this method is difficult to achieve an ideal matching effect. Summary of the invention

[0009] In order to solve the defects and shortcomings of the current mainstream circuit board image registration methods, the present invention discloses a circuit board image cross-domain registration model and method based on semantic feature guidance to enhance robustness and improve image feature matching. The technical solution of the present invention is implemented as follows:

[0010] The first aspect of the present invention discloses a cross-domain registration model of circuit board images based on semantic feature guidance, wherein the model includes an image feature extraction module, a semantic feature extraction module, a semantic implantation module, and a feature matching module.

[0011] The image feature extraction module is used to extract image features of an image;

[0012] The semantic feature extraction module is used to extract the semantic features of the image;

[0013] The semantic embedding module is used to fuse the semantic features and image features of an image to obtain image features containing semantic information;

[0014] The feature matching module is used to convert image features containing semantic information of an image into a feature matching matrix.

[0015] The feature matching module includes a position encoding layer module, a self-attention layer module, a cross-attention layer module and a multi-layer perceptron module.

[0016] The feature matching module is provided with a loss function, which is as follows:

[0017] The loss function includes a semantic triplet loss function, a control matching loss function and a fine matching loss function;

[0018] Total loss = semantic triplet loss function + control matching loss function + fine matching loss function;

[0019] Among them, the semantic triplet loss function is:

[0020]

[0021] Where C represents the semantic category, T represents the number of samples (the top T samples in terms of confidence values ​​of the sampled semantic category), and D(·,·) represents the L2 distance. represents the distance of the first T positive samples, represents the distance of the first T negative samples, m is the distance interval, [·] + Represents the hinge function.

[0022] Control the matching loss function:

[0023]

[0024] Among them, M ds represents the control matching matrix, M gt It is defined as the matched mutual neighbors in two sets of 1 / 8 resolution images, where i and j are the row and column order numbers of the control matching matrix.

[0025] Fine matching loss function:

[0026]

[0027] in, is predicted by high-resolution features The mathematical expectation of the matching positions from image A to image B, yes By spatial transformation, the real matching position from the high resolution of image A to the high resolution of image B is converted. f are all fine matches, Represents the variance of the feature map.

[0028] The second aspect of the present invention is to disclose a cross-domain registration method of circuit board images based on semantic feature guidance, comprising the following steps:

[0029] S1, training the model;

[0030] Specifically, using data to train the model in step S1 includes pre-training and formal training.

[0031] Pre-training: The circuit board image semantic segmentation dataset is input into the semantic feature extraction module for pre-training.

[0032] Formal training: The training circuit board image and the reference circuit board image are input into the model for formal training, wherein the parameter value of the semantic feature extraction module is frozen and is not updated during the formal training process, and the feature matching matrix output by the feature matching module needs to satisfy the minimum total loss of the loss function.

[0033] S2, inputting the image of the circuit board to be tested and the image of the reference circuit board into the trained model;

[0034] S3, the image feature extraction module extracts the image features of the circuit board image to be tested and the image features of the reference circuit board image;

[0035] The semantic feature extraction module extracts the semantic features of the circuit board image to be tested and the semantic features of the reference circuit board image;

[0036] S4, inputting the image features and semantic features of the circuit board image to be tested and the image features and semantic features of the reference circuit board image into the semantic implantation module;

[0037] S5, the semantic embedding module fuses the image features and semantic features of the circuit board image to obtain the image features containing semantic information of the circuit board image to be tested;

[0038] The semantic embedding module fuses the image features and semantic features of the reference circuit board image to obtain the image features containing semantic information of the reference circuit board image;

[0039] Specifically, the semantic features are added with global average pooling to obtain a semantic potential vector, and then the image features are refined by calculation using a formula, which is as follows:

[0040]

[0041] Among them, h g represents the extracted image features, h s represents the semantic latent vector, and Indicates h g The mean and variance at the channel level, γ(h s ) and β(h s ) represents the use of a 1x1 convolutional neural network to h s Extracted semantic information.

[0042] S6, inputting the image features containing semantic information of the circuit board image to be tested and the image features containing semantic information of the reference circuit board image into the feature matching module;

[0043] S7. The feature matching module converts the image features containing semantic information of the circuit board image to be tested and the image features containing semantic information of the reference circuit board image into a feature matching matrix.

[0044] Flattening the image features containing semantic information of the circuit board image to be tested to obtain a sequence feature of the line structure of the circuit board image to be tested, and then inputting the sequence features into a position coding layer module for position coding, and fusing them with the sequence features to obtain a sequence feature with position coding, and then inputting the sequence feature with position coding into the self-attention layer module for self-transformation to obtain a self-transformed sequence feature of the circuit board image to be tested;

[0045] Flattening the image features containing semantic information of the reference circuit board image to obtain a sequence feature of the line structure of the reference circuit board image, then inputting the sequence feature into a position encoding layer module for position encoding, and fusing the sequence feature with the sequence feature to obtain a sequence feature with position encoding, and then inputting the sequence feature with position encoding into the self-attention layer module for self-transformation to obtain a self-transformed sequence feature of the reference circuit board image;

[0046] Subsequently, the self-transformed sequence features of the circuit board image to be tested and the self-transformed sequence features of the reference circuit board image are input into the cross-attention layer module for cross-correlation operation to obtain a feature matrix with highly correlated feature similarities, and finally input into the multi-layer perceptron module for full-connection transformation operation to obtain a feature matching matrix.

[0047] The advantages of the present invention are as follows:

[0048] (1) The present invention adopts deep learning technology to model the key point matching learning problem as a similar feature learning problem, and learns the registration relationship between the circuit board image and the reference circuit board image in an optimizable way, making the model more robust.

[0049] (2) The present invention integrates semantic information into image features as high-level, essential matching features, and fits semantics with image features as a supervisory signal to keep the semantics and image features consistent, forcing the model to learn semantic features in matching image features, thereby solving the registration problem between the circuit board image and its reference image in the presence of domain difference.

[0050] (3) The present invention uses semantic information as the essential information of the registered image as a breakthrough point, integrates semantic features into image features, and keeps the image features consistent with the semantic information, thereby solving the registration problem between a circuit board image with large style differences and its reference image, solving the recognition challenge caused by the domain difference problem in the field of industrial defect recognition, and solving the comparison problem of circuit board images collected by different photosensitive devices in different shooting environments. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only one embodiment of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0052] Figure 1 This is a structural diagram of a cross-domain registration model for circuit board images guided by semantic features;

[0053] Figure 2 for Figure 1 Structural diagram of the feature matching module in the model shown. DETAILED DESCRIPTION

[0054] The technical solution of the present invention will be clearly and completely described below in conjunction with the embodiments of the present invention and the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0055] Unless otherwise defined, all technical and scientific terms used in the present invention have the same meanings as those commonly understood by technicians in the technical field to which the present invention belongs; the terms used in the specific implementation methods are only for the purpose of describing specific embodiments and are not intended to limit the present invention; the terms "including" and "having" in the specification and claims of the present invention and the above-mentioned figure descriptions and any variations thereof are intended to cover non-exclusive inclusions.

[0056] In the description of the specific implementation methods of the present invention, the technical terms "first", "second", etc. are only used to distinguish different objects, and cannot be understood as indicating or implying relative importance or implicitly indicating the number, specific order or primary and secondary relationship of the indicated technical features. In the description of the embodiments of the present invention, the meaning of "multiple" is more than two, unless otherwise clearly and specifically defined.

[0057] Reference to "embodiments" in the present invention means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described in the present invention may be combined with other embodiments.

[0058] In the description of the embodiments of the present invention, the term "and / or" is only a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in the present invention generally indicates that the associated objects before and after are in an "or" relationship.

[0059] It should be noted that, for the convenience of description, in the following embodiments, all identical technical features are marked with the same symbols.

[0060] Circuit board image registration is an important technology in the industrial field, and is often used to solve the problem of comparing sample images collected by different photosensitive devices in different environments.

[0061] There are two mainstream PCB image registration methods at present: one is the registration technology based on traditional machine vision features, including registration methods based on grayscale information, feature-based registration methods and registration methods based on transform domain. Traditional image registration technology based on machine vision features can find matching mapping relationships based on given feature patterns, such as spikes, dots, gradients, etc. Among them, the grayscale-based registration method usually fits the reference image by gradually translating and rotating the image to minimize the grayscale difference in the overlapping area, thereby finding a transformation method that can fit the two images. The feature-based registration method attempts to solve the registration problem of the entire image by matching the significant features in the image. Common features include point features, line and contour features, and surface and texture features. The transform domain-based registration method introduces a new reference system, namely the frequency domain. It can quickly find the relationship between the translation, rotation and scaling of the two images by changing the image from the coordinate system to the polar coordinate system.

[0062] The second is the feature point registration method based on neural network features. In essence, it still follows the idea of ​​feature-based registration, such as point features, texture features, etc., which are extracted through neural network models to achieve the effect of optimizing feature expression. Unlike traditional visual features, neural network features do not rely on manually defined feature patterns for extraction. Neural network features are extracted through neural network models, and their model parameters are learnable. The features extracted by the neural network change with the changes in parameter values. Neural network features are black box features without established patterns, including both shallow and high-level visual features.

[0063] However, the mainstream circuit board image registration method also has some defects, the specific shortcomings are as follows:

[0064] 1. The biggest drawback of traditional image matching technology is that it is not robust enough. Traditional visual features rely on manually defined feature patterns to extract. The extracted features are closely related to the mathematical expressions that define the feature patterns. This feature is not robust and is easily affected by factors such as image resolution, rotation angle, and image noise.

[0065] 2. Image registration technology based on neural network features can learn feature patterns based on data. Through the model trained with large sample data, the ability to extract features is more robust and can cope with more complex feature matching scenarios. However, when there is a large domain difference between the image and the reference image, the existing image feature point registration technology based on neural network features is difficult to achieve a good matching effect.

[0066] In order to solve the above defects and shortcomings, the present invention discloses a cross-domain registration model and method of circuit board images based on semantic feature guidance to enhance robustness and improve image feature matching.

[0067] The embodiments of the present invention will be described in more detail below through examples and comparative examples. It should be noted that the embodiments of the present invention are not limited to these examples.

[0068] Example

[0069] In a specific embodiment, Figure 1 As shown, a cross-domain registration model of circuit board images based on semantic feature guidance includes a feature extraction module, a semantic feature extraction module, a semantic implantation module, and a feature matching module.

[0070] The specific functions of each module are as follows:

[0071] 1. Image feature extraction module: The function of the image feature extraction module is to extract the features of the circuit board image and its reference image, so as to obtain the matching points of the circuit board image and its reference image through feature matching.

[0072] 2. Semantic feature extraction module: The role of the semantic feature extraction module is to extract the semantic features (i.e., semantic information) of the circuit board image and its reference image. Due to the inconsistency in style between the circuit board image and its reference image, their local features are not sufficient to find the correct matching correspondence, which indicates that the cross-domain circuit board image registration task requires high-level semantic features as a guide. Specifically, although the circuit board image and its reference image may show inconsistent gradient information in local areas, they still share common high-level semantic features. To this end, the semantic features are implanted into the image features. By forcing the model to learn semantic features in the matching image features, the negative impact of the gradient inconsistency between the circuit board image and its reference image can be reduced.

[0073] 3. Semantic embedding module: The function of the semantic embedding module is to integrate the semantic features of the circuit board image into its image features. Since semantic features are features related to the target category attributes and are relatively stable internal information, embedding semantic features into image features allows the model to discover the key points of matching between the circuit board image and its reference image based on the guidance of high-level semantics.

[0074] 4. Feature matching module: The function of the feature matching module is to convert the features fused by the semantic implantation module into a feature matching matrix to obtain the matching rate between each pixel of a pair of circuit board image features. This matching rate can be measured by the similarity of the features between the pixels. The pixel pairs with high correlation output by the feature matching module are the key point pairs matching between the circuit board image and its reference image.

[0075] like Figure 2 As shown, the feature matching module in this embodiment is composed of five parts, namely, feature serialization operation, position encoding layer module, self-attention layer module, cross-attention layer module and multi-layer perceptron module; the main working mode of the feature matching module is to call the features of Figure A and Figure B to input the feature matching module to perform a series of encoding operations. Among them, the feature serialization operation is to flatten the features of the plane structure and turn them into sequence features of the line structure; the position encoding layer is an operation to characterize the geometric position of the feature, and the position feature will be fused with the sequence feature through addition operation; the self-attention layer is an operation to self-transform the features with positions, which can filter noise and strengthen key features; the cross-attention layer is an operation to cross-correlate paired sequence features. Unlike the self-attention layer, the input of the cross-attention layer is two different sequence features, while the input of the self-attention layer is a sequence feature. The cross-attention layer can perform feature similarity learning to form a feature matrix that is highly correlated with similarity; the multi-layer perceptron is an operation to convert this highly similarity-related feature matrix into a feature matching matrix through a fully connected transformation.

[0076] The specific application process of this embodiment is as follows:

[0077] S1. Training the model.

[0078] In this embodiment, a circuit board image semantic segmentation dataset is input into the semantic feature extraction module for pre-training. Generally, the circuit board image semantic segmentation dataset is existing data.

[0079] The model is formally trained with the training circuit board image and the reference circuit board image, wherein the parameters of the semantic feature extraction module are frozen, and no parameter update is performed during the formal training of the model. The feature matching matrix output by the feature matching module needs to satisfy the minimum total loss of the loss function.

[0080] Specifically, the above loss function includes a semantic triplet loss function, a control matching loss function, and a fine matching loss function, where the total loss = semantic triplet loss function + control matching loss function + fine matching loss function:

[0081] Semantic triplet loss function:

[0082]

[0083] Semantic triplet loss is used to supervise the effect of semantic metric learning. Semantic metric learning is to make image features consistent with their semantic categories. The triplet loss is used as the loss function. The goal of triplet loss is to make the inter-class distance between features greater than the intra-class distance by at least a given threshold, where C represents the semantic category, T represents the number of samples (samples with the top T confidence values ​​of the semantic category), and D(·,·) represents the L2 distance. represents the distance of the first T positive samples, represents the distance of the first T negative samples, m is the distance interval, [·] + Represents the hinge function.

[0084] Control the matching loss function:

[0085]

[0086] The control matching loss function is the negative log-likelihood loss on the matrix returned by the dual-softmax operation (i.e., the control matching matrix). This method uses the camera pose and depth information to calculate the GT of the confidence matrix during training as supervision, and defines the GT coarse-grained matching as the mutual neighbors matched in two sets of 1 / 8 resolution images. This distance can be calculated by the projection distance of their center positions, where M ds represents the control matching matrix, M gtIt is defined as the matched mutual neighbors in two sets of 1 / 8 resolution images, where i and j are the row and column order numbers of the control matching matrix.

[0087] Fine matching loss function:

[0088]

[0089] The fine-grained loss uses L2 loss: for each point, the variance of the generated feature map is calculated to measure its uncertainty, so that the refined matching uncertainty is lower, thereby obtaining a weighted loss function, where, is predicted by high-resolution features The mathematical expectation of the matching positions from image A to image B, yes By spatial transformation, the real matching position from the high resolution of image A to the high resolution of image B is converted. f are all fine matches, Represents the variance of the feature map.

[0090] S2. Input the image of the circuit board to be tested and the image of the reference circuit board into the trained model.

[0091] Specifically, on the one hand, the image feature extraction module is input to extract image features. The image feature extraction module is implemented by a lightweight convolutional neural network and adopts an encoder-decode structure. The feature extraction network consists of two parts: backbone and neck. The backbone is implemented by LcNet and the neck is implemented by FPN. LcNet (Cui C, Gao T, Wei S, et al. PP-LCNet: A Lightweight CPU Convolutional Neural Network [J]. 2021. DOI: 10.48550 / arXiv.2109.15099.) and FPN (Lin TY, Dollar P, Girshick R, et al. Feature Pyramid Networks for Object Detection [J]. IEEE Computer Society, 2017. DOI: 10.1109 / CVPR.2017.106.) are both classic convolutional neural network models in the field of computer vision. On the other hand, the semantic feature extraction module is input to extract semantic features.

[0092] S3, the image feature extraction module extracts the image features of the circuit board image to be tested and the image features of the reference circuit board image;

[0093] The semantic feature extraction module extracts the semantic features of the circuit board image to be tested and the semantic features of the reference circuit board image;

[0094] S4, inputting the image features and semantic features of the circuit board image to be tested and the image features and semantic features of the reference circuit board image into the semantic implantation module;

[0095] S5, the semantic embedding module fuses the image features and semantic features of the circuit board image to obtain the image features containing semantic information of the circuit board image to be tested;

[0096] The semantic embedding module fuses the image features and semantic features of the reference circuit board image to obtain the image features containing semantic information of the reference circuit board image;

[0097] Specifically, the semantic features are added with global average pooling to obtain a semantic latent vector, wherein global average pooling is a common operation in neural network models, which is used to compress two-dimensional image features into a feature vector, that is, to calculate a mean of a two-dimensional plane to replace the two-dimensional plane. Then, the obtained semantic latent vector is calculated by a formula to refine the image features, and the formula is as follows:

[0098]

[0099] Among them, h g represents the extracted image features, h s represents the semantic latent vector, and Indicates h g The mean and variance at the channel level, γ(h s ) and β(h s ) represents the use of a 1x1 convolutional neural network to h s Extracted semantic information.

[0100] S6, inputting the image features containing semantic information of the circuit board image to be tested and the image features containing semantic information of the reference circuit board image into the feature matching module;

[0101] S7. The feature matching module converts the image features containing semantic information of the circuit board image to be tested and the image features containing semantic information of the reference circuit board image into a feature matching matrix.

[0102] Flattening the image features containing semantic information of the circuit board image to be tested to obtain a sequence feature of the line structure of the circuit board image to be tested, and then inputting the sequence features into a position coding layer module for position coding, and fusing them with the sequence features to obtain a sequence feature with position coding, and then inputting the sequence feature with position coding into the self-attention layer module for self-transformation to obtain a self-transformed sequence feature of the circuit board image to be tested;

[0103] Flattening the image features containing semantic information of the reference circuit board image to obtain a sequence feature of the line structure of the reference circuit board image, then inputting the sequence feature into a position encoding layer module for position encoding, and fusing the sequence feature with the sequence feature to obtain a sequence feature with position encoding, and then inputting the sequence feature with position encoding into the self-attention layer module for self-transformation to obtain a self-transformed sequence feature of the reference circuit board image;

[0104] Subsequently, the self-transformed sequence features of the circuit board image to be tested and the self-transformed sequence features of the reference circuit board image are input into the cross-attention layer module for cross-correlation operation to obtain a feature matrix with highly correlated feature similarities, and finally input into the multi-layer perceptron module for full-connection transformation operation to obtain a feature matching matrix.

[0105] It should be pointed out that the above is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A cross-domain registration model for circuit board images based on semantic features, characterized in that: It includes an image feature extraction module, a semantic feature extraction module, a semantic embedding module and a feature matching module; The image feature extraction module is used to extract image features of an image; The semantic feature extraction module is used to extract the semantic features of the image; The semantic embedding module is used to fuse the semantic features and image features of an image to obtain image features containing semantic information; The feature matching module is used to convert image features containing semantic information of an image into a feature matching matrix.

2. A cross-domain registration method for circuit board images based on semantic feature guidance, characterized in that: The steps include: S1, training the model; S2, inputting the image of the circuit board to be tested and the image of the reference circuit board into the trained model; S3, the image feature extraction module extracts the image features of the circuit board image to be tested and the image features of the reference circuit board image; The semantic feature extraction module extracts the semantic features of the circuit board image to be tested and the semantic features of the reference circuit board image; S4, inputting the image features and semantic features of the circuit board image to be tested and the image features and semantic features of the reference circuit board image into the semantic implantation module; S5, the semantic embedding module fuses the image features and semantic features of the circuit board image to obtain the image features containing semantic information of the circuit board image to be tested; The semantic embedding module fuses the image features and semantic features of the reference circuit board image to obtain the image features containing semantic information of the reference circuit board image; S6, inputting the image features containing semantic information of the circuit board image to be tested and the image features containing semantic information of the reference circuit board image into the feature matching module; S7. The feature matching module converts the image features containing semantic information of the circuit board image to be tested and the image features containing semantic information of the reference circuit board image into a feature matching matrix.

3. According to the semantic feature-guided cross-domain registration model of circuit board images in claim 1, it is characterized in that: The feature matching module includes a position encoding layer module, a self-attention layer module, a cross-attention layer module and a multi-layer perceptron module.

4. According to the semantic feature-guided cross-domain registration model of circuit board images in claim 3, it is characterized in that: A loss function is provided in the feature matching module; The loss function includes a semantic triplet loss function, a control matching loss function and a fine matching loss function; Total loss = semantic triplet loss function + control matching loss function + fine matching loss function; Among them, the semantic triplet loss function is: Where C represents the semantic category, T represents the number of samples, and D(·, ·) represents the L2 distance. represents the distance of the first T positive samples, represents the distance of the first T negative samples, m is the distance interval, [·] + represents the hinge function; Control the matching loss function: Among them, M ds represents the control matching matrix, M gt It is defined as the matched mutual neighbors in two sets of 1 / 8 resolution images, where i and j are the row and column order numbers of the control matching matrix. Fine matching loss function: in, is predicted by high-resolution features The mathematical expectation of the matching positions from image A to image B, yes By spatial transformation, the real matching position from the high resolution of image A to the high resolution of image B is converted. f are all fine matches, Represents the variance of the feature map.

5. The method for cross-domain registration of circuit board images based on semantic feature guidance according to claim 2 is characterized in that: The steps S1 and S7 also include loss function calculation: The loss function includes a semantic triplet loss function, a control matching loss function and a fine matching loss function, wherein the total loss = semantic triplet loss function + control matching loss function + fine matching loss function, and the formula of the above loss function is as follows; Semantic triplet loss function: Where C represents the semantic category, T represents the number of samples (the top T samples in terms of confidence values ​​of the sampled semantic category), and D(·,·) represents the L2 distance. represents the distance of the first T positive samples, represents the distance of the first T negative samples, m is the distance interval, [·] + represents the hinge function; Control the matching loss function: Among them, M ds represents the control matching matrix, M gt It is defined as the matched mutual neighbors in two sets of 1 / 8 resolution images, where i and j are the row and column order numbers of the control matching matrix. Fine matching loss function: in, is predicted by high-resolution features The mathematical expectation of the matching positions from image A to image B, yes By spatial transformation, the real matching position from the high resolution of image A to the high resolution of image B is converted. f are all fine matches, Represents the variance of the feature map.

6. The method for cross-domain registration of circuit board images based on semantic feature guidance according to claim 5, characterized in that: The step S1 includes pre-training and formal training; Pre-training: inputting the circuit board image semantic segmentation dataset into the semantic feature extraction module for pre-training; Formal training: inputting the training circuit board image and the reference circuit board image into the model for formal training, wherein the parameter value of the semantic feature extraction module is frozen and is not updated during the formal training process; The feature matching matrix output by the feature matching module needs to satisfy the minimum total loss of the loss function.

7. The method for cross-domain registration of circuit board images based on semantic feature guidance according to claim 6 is characterized in that: The step S5 comprises: The semantic features are added with global average pooling to obtain a semantic potential vector, and then the image features are refined. The refinement process is as follows: Among them, h g represents the extracted image features, h s represents the semantic latent vector, and Indicates h g The mean and variance at the channel level, γ(h s ) and β(h s ) represents the use of a 1x1 convolutional neural network to h s Extracted semantic information.

8. The method for cross-domain registration of circuit board images based on semantic feature guidance according to claim 7, characterized in that: The step S7 comprises: Flattening the image features containing semantic information of the circuit board image to be tested to obtain a sequence feature of the line structure of the circuit board image to be tested, and then inputting the sequence features into a position coding layer module for position coding, and fusing them with the sequence features to obtain a sequence feature with position coding, and then inputting the sequence feature with position coding into the self-attention layer module for self-transformation to obtain a self-transformed sequence feature of the circuit board image to be tested; Flattening the image features containing semantic information of the reference circuit board image to obtain a sequence feature of the line structure of the reference circuit board image, then inputting the sequence feature into a position encoding layer module for position encoding, and fusing the sequence feature with the sequence feature to obtain a sequence feature with position encoding, and then inputting the sequence feature with position encoding into the self-attention layer module for self-transformation to obtain a self-transformed sequence feature of the reference circuit board image; Subsequently, the self-transformed sequence features of the circuit board image to be tested and the self-transformed sequence features of the reference circuit board image are input into the cross-attention layer module for cross-correlation operation to obtain a feature matrix with highly correlated feature similarities, and finally input into the multi-layer perceptron module for full-connection transformation operation to obtain a feature matching matrix.