A method for attention residual guided chip defect detection
Patent Information
- Application Number
- CN202610861592.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-15
- Publication Date
- 2026-08-21
- Estimated Expiration
- 2046-06-15
AI Technical Summary
[0006]发明目的:本发明的目的在于提供一种注意力残差引导的芯片缺陷检测方法,以克服现有标准残差连接和统一EMA策略引起的弱缺陷特征淹没和确认偏差等问题
(1)采用多粒度注意力残差机制,通过信息熵驱动的特征分组与不对称注意力残差聚合,有效分离激光芯片端面的多粒度特征,解决低对比度亚微米级缺陷在显微成像下易被背景淹没的问题,有利于改善模型对亚微米级缺陷的检测能力;
Smart Images

Figure CN122415602B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of computer vision and industrial image inspection technology, specifically to an attention residual-guided chip defect detection method. Background Technology
[0002] Semiconductor laser chips are key components in fields such as optical communication. In advanced packaging processes like high-speed eutectic bonding, their light-emitting surfaces are highly susceptible to submicron-level defects due to particulate contamination or mechanical contact. In recent years, neural network-based defect detection technology has been widely applied in industrial production. However, in actual production lines, submicron-level defects typically require high-magnification microscopic imaging, and acquiring pixel-level precisely labeled defect image data is extremely costly. This results in a severe shortage of high-quality labeled samples in actual industrial production lines, significantly hindering the large-scale application of fully supervised defect detection models.
[0003] To alleviate the dependence of model training on labeled data, semi-supervised learning techniques have gradually become a research hotspot. Mainstream methods mostly adopt a Teacher-Student architecture based on consistency regularization, using the Teacher network to generate pseudo-labels from a large amount of unlabeled data to guide the training of the Student network, and using a globally unified exponential moving average (EMA) mechanism to synchronize the parameters between the two.
[0004] However, applying existing semi-supervised frameworks to laser chip end-face inspection faces certain challenges. Firstly, the high reflectivity of the end face and the inherently low signal-to-noise ratio of microscopic imaging result in extremely low defect contrast. Existing standard residual connections often employ weighted addition for feature fusion, making it difficult to distinguish between smooth background semantics and local detail attributes. This easily leads to low-contrast submicron defects being overwhelmed or blurred by large areas of highly reflective background features, hindering the accurate construction of a contextual representation of the target defect. Secondly, the coexistence of multiple defect types and the complex microscopic imaging environment make it easy for some network layers to extract noise features such as microscopic background noise or microscopic shadows. Existing semi-supervised models typically use a globally unified EMA mechanism to update Teacher network parameters. This rigid update method cannot prevent the transmission of low-quality features, causing noise features to accumulate continuously between networks, leading to false label confirmation bias and limiting the model's detection accuracy.
[0005] Therefore, there is an urgent need for a semi-supervised defect detection method that can adaptively distinguish and aggregate features of different granularities and has dynamic parameter transfer and noise reduction capabilities, so as to effectively suppress feature contamination and noise transmission and improve the accuracy and robustness of laser chip defect detection under conditions of few samples. Summary of the Invention
[0006] Objective: This invention aims to provide an attention residual-guided chip defect detection method to overcome the problems of weak defect feature overwhelming and confirmation bias caused by existing standard residual connections and unified EMA strategies. This method introduces a multi-granularity attention residual module, which performs granular partitioning of low signal-to-noise ratio feature maps based on information entropy and allocates asymmetric residual receptive fields to achieve adaptive differentiation and aggregation of deep features. This effectively separates highly reflective background features while preserving the local edges and fine structures of defects. Simultaneously, the method utilizes the topological dependencies of feature flows between network layers to calculate the global utilization of each layer, and adaptively adjusts the exponential moving average coefficient of the Teacher network accordingly. Through the above design, this invention achieves multi-granularity aggregation of deep features and denoising update of network parameters, thereby improving the accuracy and robustness of laser chip defect detection under a semi-supervised framework.
[0007] Technical Solution: To achieve the above objectives, this invention provides an attention residual-guided chip defect detection method, comprising the following steps: S1. Construct a semi-supervised defect detection model based on the Teacher-Student architecture. The model includes a Student network and a Teacher network with the same structure and based on the visual Transformer architecture. S2. Obtain the laser chip end face dataset. During the process of extracting image features, use the multi-granularity attention residual module to group the features into multi-granularity groups based on the information entropy of the token, and assign asymmetric residual receptive fields to different granularity groups. Aggregate historical layer features through cross-layer attention mechanism and output attention residual aggregated features. S3. Based on the attention residual aggregation features, generate the predicted probabilities of the Student network and the Teacher network, and calculate the total loss consisting of the supervised loss and the unsupervised loss based on consistency. S4. During the backpropagation and parameter update phase, the parameters of the Student network are updated using the overall loss. S5. Utilize the topological dependencies of feature flow propagation between network layers to calculate the direct dependency degree between layers, and recursively calculate the global feature centrality from deep to shallow. Normalize to obtain the global utilization of each layer. Based on the global utilization, perform hierarchical independent exponential moving average (EMA) coefficient mapping on each layer of the Teacher network and adaptively update the Teacher network parameters. S6. Once the model training is complete, input the single-frame image of the laser chip end face to be detected into the trained Teacher network and output the defect detection result.
[0008] Further, in step S1, the construction of a semi-supervised defect detection model based on the Teacher-Student architecture specifically includes: defining a parameterized model. Student network and with parameters Teacher Network The Student network and the Teacher network have the same network topology and are both built on the visual Transformer architecture, used to receive input images and extract feature representations during the network forward propagation.
[0009] Furthermore, in step S2, the information entropy based on the token is used to group the features into multiple granularities, and asymmetric residual receptive fields are assigned to different granularity groups. Historical layer features are aggregated through a cross-layer attention mechanism to output attention residual aggregated features. The specific calculation steps and formulas are as follows: (1) Obtain the contents A labeled dataset of individual chip samples and including Unlabeled dataset of chip samples ,in Indicates the input image. Indicates having The true label for each defect category; (2) Introduce weak data augmentation With strong data augmentation The chip end face image is processed to form different enhanced views input to the Student and Teacher networks; (3) Token multi-granularity grouping: Each layer of the feature map of the Student and Teacher networks contains The tokens are granularized based on information entropy to distinguish between high-entropy features containing large areas of highly reflective background and low-entropy features containing local edges and subtle defects. The calculation of the [number]th token... Information entropy of each token in the feature dimension The formula is as follows: , , in, The number of feature channels, For this token in the The activation value of each channel; (4) All Each token is based on the information entropy Arranged in descending order and evenly divided into The granularity group is denoted as the _th _ ... The granularity group sequence of the layer is ,in Corresponding to the coarsest granularity group, This corresponds to the finest granularity group. Each granularity group contains multiple Token elements. The attention residual calculation below is performed on each Token in the granularity group by default. For simplicity, the position index of the Token is omitted below, and only the level and granularity group number are retained. (5) Constructing asymmetric residual candidate objects: For the current... The first layer Any token in a granularity group ( Define independent learnable query vectors. For any historical number Layer Token, select the first one Group to No. The corresponding token in the group is used as the current token. Layer Tokens of granularity The residual candidate range. This processing implicitly constructs an asymmetric semantic aggregation logic, so that fine-grained features correspond to smaller residual receptive fields to prevent high-entropy feature injection from causing blurring of defect edges, while coarse-grained features correspond to larger residual receptive fields to fuse global smooth semantics with local details; (6) Perform a one-dimensional average pooling operation on the Tokens within the residual candidate range to obtain the corresponding key vectors. AND value vector The formula is as follows: , in, Indicates the first in history The output of the first layer Each granularity group corresponds to a specific token. This is a one-dimensional average pooling operation; (7) Feature matching degree calculation: Root mean square normalization (RMSNorm) is introduced to process the key vector to prevent historical features with excessively large values from dominating the attention weight calculation. A kernel function is used. Calculate the feature matching degree to obtain the historical number. Layer to current Attention residual weights The formula is as follows: , in To iterate through the summation index of each historical layer, ; For the first time in history In the layer to the first The granularity group up to the 1st The key vector is obtained by one-dimensional average pooling of the tokens at the corresponding positions of each granularity group. (8) Using the attention residual weights, perform a weighted summation on the value vectors of all historical layers to obtain... The attention residual aggregation output is calculated using the following formula: , Calculate the first according to this formula All within the layer The output of each token within the granularity group yields the _th ... The final characteristic representation of the layer.
[0010] Further, in step S3, image features are extracted using the Student network and Teacher network, and supervised loss and consistency-based unsupervised loss are calculated, specifically including the following steps: (1) Calculate the supervised loss: The Student network receives labeled images that have undergone weak data augmentation. Output prediction probability and with real labels Calculate the standard cross-entropy loss to obtain the supervised loss. The formula is as follows: , in, Represents the standard cross-entropy loss; (2) Calculate unsupervised loss: The Teacher network receives unlabeled images after weak enhancement. Generate prediction probability and through Operations to extract the most probable category and generate defect pseudo-labels Simultaneously, the Student network receives the corresponding strongly enhanced unlabeled image generation prediction probability. Set a confidence threshold. To preserve the predicted probabilities of the Teacher network The highest probability is greater than or equal to The pixels, and calculate the reserved pixels. and The cross-entropy loss between the two sides is used to obtain the unsupervised loss based on consistency. The formula is as follows: , in For indicator functions, Indicating in channel dimension Take the highest probability value; (3) Based on the aforementioned monitoring loss and the unsupervised loss Calculate the total loss The formula is as follows: , in This is the loss trade-off coefficient.
[0011] Further, in step S4, the step of updating the parameters of the Student network using the overall loss during the backpropagation and parameter update stage specifically includes: updating the parameters of the Student network using the overall loss calculated by... The overall loss is calculated using an optimization algorithm. Regarding Student network parameters The gradient is calculated and then backpropagated to the parameters of the Student network. Perform iterative updates to minimize the overall loss. During this backpropagation phase, the parameters of the Teacher network... Preserve gradient truncation and do not participate in direct gradient updates based on the loss function.
[0012] Further, in step S5, the topological dependencies propagated by the feature flow between network layers are used to calculate the direct dependency between layers, and the global feature centrality is recursively calculated from deep to shallow. This is normalized to obtain the global utilization of each layer. Based on the global utilization, a layer-independent exponential moving average (EMA) coefficient mapping is performed on each layer of the Teacher network to adaptively update the Teacher network parameters. The specific calculation steps and formulas are as follows: (1) Calculation of the dependency of each layer: As the network deepens, the surge in historical candidate layers will cause a dilution effect on attention weights. Therefore, a scaling factor is introduced. Unbiased correction is applied to the attention residual weights to calculate the number of nodes in the Student network. Layer to history direct dependency of layers The formula is as follows: , in, The total number of particle size groups. For the first Layer All tokens in the granularity group are assigned to the historical first The average value of the attention residual weights of the layer tokens; (2) Global feature centrality calculation: Set the total number of network layers to be Define the centrality of the final output layer. To measure the global contribution of each network layer to the final decision, a recursive computation paradigm from deep to shallow is used to compute the historical layers. global feature centrality The formula is as follows: , Through this recursive calculation, if the... If the features of a layer are reused by subsequent layers with high feature centrality, then the layer itself will also be given a high global feature centrality. (3) The global feature centrality Min-Max normalization is performed to obtain the global utilization of each network layer during this training. The formula is as follows: , in, It is the global set of feature centralities for each layer. ; (4) Based on the global utilization rate , for the Teacher network ( Layer mapping of independent exponential moving average (EMA) coefficients The formula is as follows: , in, and These are the preset maximum and minimum values for the exponential moving average boundaries; (5) Dynamic parameter update: based on the exponential moving average coefficient For the Teacher network Layer parameters The adaptive update is performed using the following formula: , in, Representing the Student network The corresponding parameters of the layer; update all the layers of the Teacher network using this formula. Layer network parameters will be restricted from being passed to the Teacher network. Network layers with low noise features and low global utilization will have their parameters passed to the Teacher network with higher weights.
[0013] Further, in step S6, after the model training is completed, a single-frame image of the laser chip end face to be detected is input into the trained Teacher network, and the defect detection result is output, specifically including: (1) Extracting the Teacher network after parameter fixing As the final defect detector, among which To solidify the parameters of the Teacher network after training; (2) Acquire the image of the laser chip to be tested The result is input into the Teacher network for forward propagation calculation to generate a global defect prediction probability distribution. The calculation process is expressed as follows: ; (3) In the channel dimension The above is the probability distribution for predicting the defects. implement The maximum probability discrimination operation extracts the highest probability category for each pixel and outputs a pixel-level defect mask. This will be used as the final defect detection result.
[0014] Beneficial effects: Compared with the prior art, the present invention has the following significant advantages: (1) By adopting a multi-granularity attention residual mechanism, the multi-granularity features of the laser chip end face are effectively separated through feature grouping driven by information entropy and asymmetric attention residual aggregation. This solves the problem that low-contrast submicron level defects are easily submerged by the background under microscopic imaging, which is conducive to improving the model's ability to detect submicron level defects. (2) By using the dynamic parameter transfer strategy, the global utilization of each layer is quantified based on the topological dependency relationship between the feature flow and the network layers. This aims to weaken the cumulative effect of microscopic noise features between models, realize the noise reduction and update of network parameters, effectively suppress the confirmation bias in the semi-supervised training process, and enhance the reliability of pseudo-labels. (3) The constructed semi-supervised detection framework synergistically optimizes supervised and unsupervised loss, realizes full mining of the distribution information of unlabeled data, and effectively reduces the dependence on pixel-level accurate labeling data in industrial production scenarios while ensuring detection accuracy and robustness, thus adapting to the deployment needs of laser chip production lines. Attached Figure Description
[0015] Figure 1 This is a flowchart of a semi-supervised laser chip defect detection method according to an embodiment of the present invention.
[0016] Figure 2 This is a schematic diagram of the overall structure of the multi-granularity attention residual module and the dynamic parameter transfer mechanism in an embodiment of the present invention. Detailed Implementation
[0017] The technical solution of the present invention will be further described below with reference to the accompanying drawings.
[0018] like Figure 1As shown, this invention provides an attention residual-guided chip defect detection method. This method aims to achieve adaptive aggregation of deep features through multi-granularity attention residual modules and dynamically update model parameters by combining network layer topological dependencies, thereby improving the detection accuracy of laser chip end-face defects under limited sample conditions. The specific implementation steps are as follows:
[0019] Step S1: Construct a semi-supervised defect detection model based on the Teacher-Student architecture: S11. Network Architecture Setup: Defining Parameterized Network Architecture Student network and with parameters Teacher Network In this embodiment, all networks use a pre-trained DINOv2-B network architecture as the backbone feature extraction network to receive input single-frame microscopic images and extract feature representations; S12. Model Initialization Settings: In the initial stage of model training, the weights of the decoder and newly added modules of the Student network are randomly initialized, and the initial parameter states of the Teacher network are kept completely synchronized with those of the Student network, i.e., set... .
[0020] Step S2: Obtain the defect dataset and input it into the model, then use the multi-granularity attention residual module to perform adaptive aggregation of deep features: S21. Data Acquisition and Preprocessing: Single-frame images of the laser chip end face are captured using a Mitutoyo high-magnification microscope objective to obtain the original dataset containing defect samples. This dataset is then divided into training and test sets at a preset ratio of 8:2. Within the training set, labeled and unlabeled images are further divided at a preset ratio of 1:7. For example... Figure 2 As shown, it will contain A labeled dataset of individual chip samples and including Unlabeled dataset of chip samples Weak data augmentation introduced into the sample images (e.g., random cropping, horizontal flipping) or strong data augmentation Processing techniques such as color perturbation and Gaussian noise injection are used to create different enhanced view inputs for the Student and Teacher networks. Indicates the input image. Indicates having The categories are real pixel-level labels, with the defect categories being dirt, scratches, and dents; S22, Token Multi-granularity Grouping: Each layer of feature maps extracted by the Student and Teacher networks contains... The token is divided into granularities based on information entropy. The calculation of the [number]th token... Information entropy of each token in the feature dimension The specific calculation formula is as follows: , , in, The number of feature channels, For this token in the The activation value of each channel; S23, All Each token is based on the information entropy Arranged in descending order and evenly divided into The granularity group is denoted as the _th _ ... The granularity group sequence of the layer is ,in The coarsest granular group corresponding to high entropy contains large areas of smooth background information. The finest granularity group corresponding to low entropy contains information on local edges and subtle defects; S24, For the current... The first layer Any token in a granularity group ( Define independent learnable query vectors. ,in This represents the learnable parameter vector corresponding to this granularity group; S25. Constructing asymmetric residual candidate objects: For any historical... Layer Token, select the first Token in that layer. Group to No. The corresponding position token of the group is used as the current number. Layer Tokens of granularity The range of candidate residuals; S26. Perform a one-dimensional average pooling operation on the tokens within the residual candidate range to obtain the corresponding key vectors. AND value vector The specific calculation formula is as follows: , in, Indicates the first in history The output of the first layer Each granularity group corresponds to a specific token. This is a one-dimensional average pooling operation; S27. Feature Matching Degree Calculation: Root Mean Square Normalization (RMSNorm) is introduced to process the key vector, utilizing a kernel function. Calculate the feature matching degree. Obtain the historical [number]. Layer to current Attention residual weights The specific calculation formula is as follows: , in To iterate through the summation index of each historical layer, ; For the first time in history In the layer to the first The granularity group up to the 1st The key vector is obtained by one-dimensional average pooling of the tokens at the corresponding positions of each granularity group. S28. Residual Feature Aggregation: The value vectors of all historical layers are weighted and summed using the aforementioned attention residual weights to obtain... The attention residual aggregation output is calculated using the following formula: , Calculate the first according to this formula All within the layer The output of each token within the granularity group yields the _th ... The final aggregated feature representation of the layer.
[0021] Step S3: Generate prediction probabilities based on the attention residual aggregation features, and calculate the total loss consisting of supervised loss and unsupervised loss: S31. Calculate the supervised loss: Input the weakly enhanced labeled image into the Student network and output the predicted probability. and with real labels Calculate the standard cross-entropy loss to obtain the supervised loss. The loss is calculated as follows: , in, Represents the standard cross-entropy loss; S32. Calculate the unsupervised loss: Input the weakly enhanced unlabeled image into the Teacher network to generate predicted probabilities. And extract the pseudo-label from the category with the highest probability. Simultaneously, the corresponding strongly enhanced unlabeled image is input into the Student network to generate predicted probabilities. Set confidence threshold (Preferred value is 0.95 in specific implementation), retaining the prediction probability of the Teacher network. The maximum probability value is greater than or equal to For the pixels, calculate the consistency loss for the retained pixels. : , in For indicator functions, Indicating in channel dimension Take the highest probability value; S33. Calculate the total loss ,in This is the tradeoff coefficient for unsupervised loss (preferably set to 1.0 in specific implementations).
[0022] Step S4: In the backpropagation and parameter update stage, the parameters of the Student network are updated using the overall loss, specifically including the following steps: S41. Hierarchical Learning Rate Optimizer Parameter Settings: The AdamW optimizer is introduced for parameter updates, and a hierarchical learning rate setting strategy is adopted: the learning rate of the pre-trained DINOv2-B backbone network is set to 0.000005; simultaneously, the learning rate of the remaining parts of the network (such as the multi-granularity attention residual module, decoder, etc.) is set to 0.0002. Furthermore, the weight decay coefficient of the optimizer is set to 0.01. S42. Gradient Descent and Iterative Update: Based on the overall loss calculated in step S3... The optimizer configured above is used to calculate... Regarding Student network parameters The gradient is calculated. The learning rate is dynamically adjusted during training using a cosine annealing strategy, and the parameters of the Student network are adjusted via backpropagation. Perform iterative updates; S43. Gradient Truncation: In this backpropagation phase, the parameters of the Teacher network are strictly controlled. Gradient truncation is performed to block the path of direct gradient update through the loss function, thereby ensuring the stability and noise resistance of the pseudo-labels generated by the Teacher network.
[0023] Step S5: Calculate the global utilization rate using the topological dependencies of the feature flow and adaptively update the Teacher network parameters. To overcome noise accumulation caused by uniform EMA updates, this embodiment performs dynamic parameter passing for each network layer based on the pre-trained DINOv2-B network architecture. S51. Dependency Calculation for Each Layer: Introducing a Scaling Factor Unbiased correction is applied to the attention weights, defining the first [weight] in the Student network. Layer to history direct dependency of layers : , in, The total number of particle size groups. For the first Layer All tokens in the granularity group are assigned to the historical first The average value of the attention residual weights of the layer tokens; S52. Global Feature Centrality Calculation: Set the total number of layers in the DINOv2-B network to... Define the centrality of the final output layer. A recursive computation paradigm, proceeding from deep to shallow, is used to compute the historical layer. global feature centrality : ; S53, Global Utilization Normalization: (This refers to...) Min-Max normalization is performed to obtain the global utilization of each network layer during training. : , in, It is the global set of feature centralities for each layer; S54, EMA coefficient mapping: such as Figure 2 As shown, based on the global utilization rate , for the Teacher network ( Layer mapping of independent exponential moving average (EMA) coefficients : , in, and To preset the EMA boundary, it can be set to 0.01 and 0.001 respectively in specific implementations; S55, Teacher Network Dynamic Update: Utilizing Calculated Coefficients For the Teacher network Layer parameters Adaptive updates are performed, and the specific update formula is as follows: , in, Representing the Student network The corresponding parameters of each layer. Based on this formula, update all L-layer network parameters of the Teacher network.
[0024] Step S6: Model inference and output of defect detection results, specifically including the following steps: S61. Detector Extraction: After the Teacher and Student networks have completed 180 training epochs on the training set, the training process is stopped. The Teacher network with fixed parameters is extracted as the final defect detector. And deployed in high-performance inference servers equipped with multi-GPUs; S62. Forward inference prediction: During visual inspection on a high-speed eutectic bonding production line, acquire samples of the laser chip to be inspected. The data stream is scheduled via the GigE Vision communication protocol and input into the Teacher network for forward propagation calculation to generate a global defect prediction probability distribution. The calculation process is expressed as follows: ; S63. Mask Generation and Result Output: Predicting the probability distribution of the aforementioned defects. Perform maximum probability discrimination operation on the channel dimension ( Generate initial pixel-level defect mask. The final test results are fed back to the HMI central control client in real time.
[0025] One or more embodiments in this application are intended to cover all such substitutions, modifications, and variations that fall within the broad scope of this application. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of one or more embodiments in this application should be included within the protection scope of this application.
Claims
1. A chip defect detection method guided by attention residuals, characterized in that, Includes the following steps: S1. Construct a semi-supervised defect detection model based on the Teacher-Student architecture. The model includes a Student network and a Teacher network with the same structure and based on the visual Transformer architecture. S2. Obtain the laser chip end face dataset. During the process of extracting image features, use the multi-granularity attention residual module to group the features into multi-granularity groups based on the information entropy of the token, and assign asymmetric residual receptive fields to different granularity groups. Aggregate historical layer features through cross-layer attention mechanism and output attention residual aggregated features. S3. Based on the attention residual aggregation features, generate the predicted probabilities of the Student network and the Teacher network, and calculate the total loss consisting of the supervised loss and the unsupervised loss based on consistency. S4. During the backpropagation and parameter update phase, the parameters of the Student network are updated using the overall loss. S5. Utilize the topological dependencies of feature flow propagation between network layers to calculate the direct dependency degree between layers, and recursively calculate the global feature centrality from deep to shallow. Normalize to obtain the global utilization of each layer. Based on the global utilization, perform hierarchical independent exponential moving average (EMA) coefficient mapping on each layer of the Teacher network and adaptively update the Teacher network parameters. S6. Once the model training is complete, input the single-frame image of the laser chip end face to be detected into the trained Teacher network and output the defect detection result.
2. The chip defect detection method guided by attention residuals according to claim 1, characterized in that, In step S2, the multi-granularity attention residual module performs multi-granularity grouping of the tokens in the feature map, specifically including the following steps: S21. Introduce weak data augmentation. With strong data augmentation The chip end face image is processed to form different enhanced views, which are then input into the Student and Teacher networks to extract features. S22, Each layer of feature maps in the Student and Teacher networks contains Calculate the token. Information entropy of each token in the feature dimension ; S23, All Each token is based on the information entropy Arranged in descending order and evenly divided into The granularity group is denoted as the _th _ ... The granularity group sequence of the layer is ,in Corresponding to the coarsest granularity group, Corresponding to the finest granularity group.
3. The chip defect detection method guided by attention residuals according to claim 2, characterized in that, In step S2, the dynamic residual receptive field and historical feature matching degree are calculated for different granularity groups, and the attention residual aggregation feature is output. This specifically includes the following steps: S24, Regarding the current network... The first layer Any token in a granularity group ( Define independent learnable query vectors. ,in This represents the learnable parameter vector corresponding to this granularity group. The number of feature channels; S25. Constructing asymmetric residual candidate objects: For any historical... Layer Token, select the first Token in that layer. Group to No. The corresponding token in the group is used as the current token. Layer Tokens of granularity The range of candidate residuals; S26. Calculate the key vector and value vector: Perform a one-dimensional average pooling operation on the tokens within the residual candidate range to obtain the corresponding key vectors. AND value vector The formula is as follows: , in, Indicates the first in history The output of the first layer Each granularity group corresponds to a specific token. This is a one-dimensional average pooling operation; S27. Feature matching degree calculation: Root mean square normalization (RMSNorm) is introduced to process the key vector, and a kernel function is used. Calculate the feature matching degree; based on this, obtain the historical number. Layer to current Attention residual weights The formula is as follows: , in To iterate through the summation index of each historical layer, ; For the first time in history In the layer to the first The granularity group up to the 1st The key vector is obtained by one-dimensional average pooling of the tokens at the corresponding positions of each granularity group. S28. Residual Feature Aggregation: The value vectors of all historical layers are weighted and summed using the attention residual weights to obtain... The attention residual aggregation output is calculated using the following formula: , Calculate the first according to this formula All within the layer The output of each token within the granularity group yields the _th ... The final characteristic representation of the layer.
4. The chip defect detection method guided by attention residuals according to claim 1, characterized in that, In step S3, calculating the overall loss specifically includes the following steps: S31. Input the weakly enhanced labeled image into the Student network to output the predicted probability. and with real labels Calculate the standard cross-entropy loss to obtain the supervised loss. ; S32. Input the weakly enhanced unlabeled image into the Teacher network to generate prediction probabilities. And extract the pseudo-label from the category with the highest probability. The corresponding strongly enhanced unlabeled image is input into the Student network to generate predicted probabilities. Based on confidence threshold The predicted probabilities of the Teacher network are retained. The highest probability is greater than or equal to The pixels, calculate the retained pixels. and The cross-entropy loss between the two sides yields the unsupervised loss. ; S33, Based on the aforementioned monitoring loss and the unsupervised loss Calculate the total loss ,in This is the loss trade-off coefficient.
5. The chip defect detection method guided by attention residuals according to claim 3, characterized in that, In step S5, by utilizing the topological dependencies and indirect flow paths of features in the network, and measuring the global utilization of each layer through recursive feature flow centers, the adaptive update of the Teacher network parameters is achieved. This specifically includes the following steps: S51. Dependency Calculation for Each Layer: Introducing a Scaling Factor Unbiased adjustments are made to the attention weights to eliminate the attention dilution effect caused by the surge in historical candidate layers. The first [level] in the Student network is defined as [the [level]... Layer to history direct dependency of layers The formula is defined as follows: , in, The total number of particle size groups. For the first Layer All tokens in the granularity group are assigned the historical number The average value of the attention residual weights of the layer tokens; S52, Global Feature Centrality Calculation: Set the total number of network layers to... Define the centrality of the final output layer. A recursive computation paradigm, proceeding from deep to shallow, is employed to compute the historical layer. global feature centrality The formula is as follows: ; S53, Regarding the global feature centrality Min-Max normalization is performed to obtain the global utilization of each network layer during training. The formula is as follows: , in, It is the global set of feature centralities for each layer. ; S54, Based on the global utilization rate , for the Teacher network Layer mapping independent exponential moving average (EMA) coefficients The formula is as follows: , in, and These are the preset maximum and minimum values for the EMA boundary; S55, according to the coefficients For the Teacher network Layer parameters The update is performed using the following formula: , in, Representing the Student network The parameters of each layer are updated according to this formula, and all L-layer network parameters of the Teacher network are updated accordingly.
Citation Information
Patent Citations
Target detection method and system based on multi-scale feature map reconstruction and knowledge distillation
CN111626330A
Semi-supervised target detection method and system based on teacher and student models and strong and weak branches
CN116091886A