Golden finger defect detection method based on mixed multi-fine-grained frequency

By mixing multiple fine-grained frequencies of gold finger defect detection method, residual convolution and frequency attention modules are used to improve detection accuracy in complex scenarios, solving the problems of insufficient detection accuracy and stability in existing technologies.

CN120655645AActive Publication Date: 2025-09-16SHENZHEN ZHIJIAN HUITONG TECH CO LTD +1

Patent Information

Application Number
CN202511157385.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-19
Publication Date
2025-09-16
Estimated Expiration
2045-08-19

AI Technical Summary

Technical Problem

Existing technologies have difficulty ensuring the accuracy and stability of gold finger defect detection in complex scenarios such as complex backgrounds, high reflective interference, multi-scale targets, and blurred edges.

Method used

A gold finger defect detection method based on hybrid multi-fine-grained frequencies is adopted. Encoding is performed through the residual convolution module, and the hybrid cross-frequency attention module extracts spatial features under different receptive fields and performs frequency domain decomposition. The pooling operation is combined to enhance the key frequency band response, and finally defect detection is performed through the decoding structure.

Benefits of technology

It significantly improves the detection accuracy and stability in complex scenes such as complex backgrounds, high reflective interference, multi-scale targets and edge blur, and enhances the detection capability of fine-grained defects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120655645A_ABST
    Figure CN120655645A_ABST
Patent Text Reader

Abstract

The invention discloses a gold finger defect detection method based on mixed multi-fine-grained frequency, relates to the technical field of gold finger defect detection, and solves the technical problem that gold finger defect detection precision and stability are difficult to ensure in a complex scene. The method comprises the following steps: coding a training data set to obtain a first feature map; inputting the first feature map into a hybrid crossover frequency attention module to obtain a second feature map, and inputting the second feature map into a multi-fine-grained frequency attention module to obtain a frequency response feature map; performing pooling operation on the frequency response feature map, adding output results in a channel dimension, and outputting a double-path attention map; performing element multiplication operation on the double-path attention map and the frequency response feature map to generate a frequency enhancement feature map; decoding based on the first feature map and the frequency enhancement feature map, and outputting a golden finger prediction image; and inputting the golden finger image to be detected to obtain a detection result. The method improves the recognition capability and robustness of the key abnormal region, and improves the detection precision and stability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of gold finger defect detection, and in particular to a gold finger defect detection method based on mixed multi-fine-grained frequencies. Background Art

[0002] In modern electronic manufacturing and assembly processes, circuit boards are core components in electronic systems, and their connection reliability directly affects the performance and stability of the overall product. The gold finger area set on the circuit board is an important contact point for achieving high-speed electrical connection between the board and other modules. Its conductive performance and physical integrity are crucial. The surface of the gold finger is usually a metal plating structure and must maintain good flatness and smoothness. Once defects such as scratches, fractures, oxidation, and foreign matter residue appear, it is very easy to cause poor contact, increased resistance, and even electrical breakdown, seriously affecting the reliability and safety of electronic products. Therefore, defect detection in the gold finger area has become an important part of the quality control of circuit boards before they leave the factory, with extremely high practical application requirements and engineering value.

[0003] Current methods for detecting gold finger defects fall into two main categories: traditional image processing-based algorithms and intelligent deep learning-based detection algorithms. For example, a defect enhancement method based on the HSV (Hue, Saturation, Value) color space and an improved MSECE (Multi-Scale Enhanced Color Enhancement) image enhancement algorithm, combined with a two-pass connected region labeling and area thresholding algorithm, identifies gold finger defects. This method improves image contrast and has a certain degree of detection capability for minor defects, but is prone to false detections in complex backgrounds or areas with unclear boundaries. Other methods, based on image structure, use a network architecture based on ZS (Zhang-Suen) skeleton extraction to extract skeleton line features from the gold finger region for defect detection. This effectively improves the recognition rate for linear cracks, but has weaker responses to nonlinear defects and areas with blurred edges. Other methods use the least squares method for noise fitting and suppression, and introduce a region growing algorithm to detect target defects. This method is suitable for detecting spot-like defects against homogeneous backgrounds, but suffers from instability when dealing with multi-scale and multi-morphological defects. Another approach, based on the classic ResNet50 convolutional neural network, integrates a multi-attention mechanism with a pyramid pooling structure, enabling the model to achieve cross-scale semantic aggregation capabilities and improve the perception of fine-grained defects in complex scenarios. However, this method does not adequately model the structural characteristics of gold finger detection, and misjudgments may still occur, especially in situations such as metal mirror highlight interference and repetitive texture backgrounds. Furthermore, based on the structural and distribution characteristics of gold finger detection, a boundary extraction algorithm based on Gaussian blur and corrosion operations was designed. The gold finger region was located using a histogram-based adaptive binarization method, and finally, a transfer learning strategy was combined to achieve defect classification and identification within the region. This method is highly structural and adaptable to regular gold finger detection, but it is not effective in extracting target regions with severe deformation or occlusion interference.

[0004] In the process of implementing the present invention, the inventors discovered that the prior art has at least the following problems: In the gold finger defect detection method, it is difficult to ensure detection accuracy and stability in complex scenarios such as complex backgrounds, high reflective interference, multi-scale targets and edge blur. Summary of the Invention

[0005] The present invention aims to provide a gold finger defect detection method based on a hybrid multi-granularity frequency approach to address the technical challenges of existing gold finger defect detection methods, which struggle to ensure detection accuracy and stability in complex scenarios, such as complex backgrounds, high reflective interference, multi-scale objects, and blurred edges. The various technical benefits achieved by the preferred solutions provided by the present invention are detailed below.

[0006] To achieve the above objectives, the present invention provides the following technical solutions: The present invention provides a gold finger defect detection method based on hybrid multi-fine-grained frequency, comprising the following steps: S100: performing normalization and image enhancement operations on multiple original gold finger images to construct a training data set and a verification data set; S200: inputting the images of the training data set into three series-connected residual convolution modules for encoding to obtain three first feature maps at different levels; S300: inputting the three first feature maps into a hybrid cross-frequency attention module, respectively using parallel convolution kernel operations of different sizes to obtain three second feature maps, and inputting each second feature map into a multi-fine-grained frequency attention module to obtain three frequency response feature maps of a low-frequency response map, a medium-frequency response map, and a high-frequency response map; S400: respectively inputting the three frequency response feature maps into different pooling operation channels Perform a pooling operation, the three pooling operation results enter the fully connected structure and the output results are added in the channel dimension to obtain the frequency attention map and then activate it to output the dual-path attention map; S500: the dual-path attention map is fused by element-by-element addition, and element-by-element multiplication operation is performed with the frequency response feature map to generate a frequency enhancement feature map; S600: based on the first feature map and the frequency enhancement feature map, decoding is performed, and the training data set is used to train the gold finger defect detection neural network, and the verification data set is used during the training process to evaluate and tune the model performance of the gold finger defect detection neural network, and finally a trained gold finger defect detection network is obtained; S700: the gold finger image to be detected is input into the trained gold finger defect detection network to obtain the detection result of the gold finger defect.

[0007] Preferably, in step S200, the residual convolution module uses downsampling to increase the feature channel dimension; each of the residual convolution modules includes two 3×3 convolution layers and one 1×1 convolution identity mapping residual path, and the convolution layers are all provided with normalization operations and activation functions.

[0008] Preferably, in the step S300, the parallel convolution kernels are 7×7 convolution kernels, 5×5 convolution kernels, and 3×3 convolution kernels, which respectively extract spatial semantic features with large, medium, and small receptive fields through convolution operations to obtain corresponding large receptive field feature maps, medium receptive field feature maps, and small receptive field feature maps. Three second feature maps are obtained.

[0009] Preferably, in the step S300, the multi-fine-grained frequency attention module decomposes the large receptive field feature map, the medium receptive field feature map, and the small receptive field feature map through a discrete cosine filter, and divides them into three channels of low frequency, medium frequency, and high frequency, which correspond to the overall contour, texture structure, and edge mutation area of ​​the image, and perform inter-channel multiplication operations with the first feature map at three levels: shallow, medium, and deep, to obtain a low-frequency response map, a medium-frequency response map, and a high-frequency response map.

[0010] Preferably, in step S400, the low-frequency response map, the medium-frequency response map, and the high-frequency response map are respectively input into the minimum pooling operation channel, the average pooling operation channel, and the maximum pooling operation channel for pooling operations, and the regional response features of the corresponding frequencies are extracted, and are input into their respective fully connected structures for feature compression and enhancement.

[0011] Preferably, in the step S400, the output results of the three fully connected structures are added in the channel dimension to obtain a frequency attention map, and activated by a Sigmoid function; and the activated frequency attention map is divided into two paths, which are respectively subjected to element multiplication and element division operations with the frequency response feature map to output a dual-path attention map.

[0012] Preferably, the decoding is performed through a decoding structure in the S600 step, and the decoding structure includes a residual upsampling module with a three-level structure. Each of the residual upsampling modules performs upsampling through transposed convolution to restore spatial resolution, followed by two 3×3 convolution kernels for extracting fine features, and setting a residual connection path; each residual upsampling module simultaneously receives two input signals of the first feature map of the frequency enhancement feature.

[0013] Preferably, in the step S600, the Adam optimizer is selected for parameter update in the training process, different learning rates are used for the frequency domain related layer and the spatial domain related layer, and the learning rate is proportionally attenuated when the loss of the validation set does not decrease; and the Dropout strategy and L2 regularization term are used in the training process to prevent overfitting, and the Cutout operation is used on some feature maps to enhance the network's robustness to occlusion and interference.

[0014] Preferably, in the step S600, the multi-scale knowledge distillation loss function based on cosine similarity is used during training. , and perform cosine similarity on multiple feature layers in spatial position Alignment ensures that the deep structure expression consistency of the gold finger defect detection neural network is maintained; during training, the spectrum of each frequency band feature after discrete cosine transform decomposition is also supervised.

[0015] Preferably, in the step S600, the loss function , cosine similarity The expressions are: , , in, Indicates the kth layer of the encoding network and the height is , width is The output tensor of Represents the kth layer of the decoding network, with a height of , width is The output tensor of represents the mapping from the input image to the encoded feature space, 、 、 Represent the number of channels, height and width of the k-th layer feature map, respectively. represents the cosine distance of the kth layer in space, Indicates the number of features.

[0016] Implementing one of the above technical solutions of the present invention has the following advantages or beneficial effects: The present invention improves the network's recognition ability and robustness for key abnormal areas through a hybrid cross-frequency attention module. The module extracts spatial features under different receptive fields through multi-scale convolution, and introduces a frequency domain decomposition mechanism to divide the feature map into low-frequency, medium-frequency and high-frequency components. It combines maximum, average and minimum pooling operations to enhance the response of key frequency bands, focusing on highlighting the defect characteristics in high-frequency areas. It can effectively suppress high-reflective interference and background texture noise, enhance the model's detection ability for fine-grained defects such as slight scratches and notches, and significantly improve the detection accuracy and stability in complex scenarios such as complex backgrounds, high-reflective interference, multi-scale targets and edge blur. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. Those skilled in the art can also derive other drawings based on these drawings without inventive work. In the drawings: Figure 1 This is a flow chart of a gold finger defect detection method based on mixed multi-fine-grained frequency according to an embodiment of the present invention; Figure 2 It is a structural diagram of a gold finger defect detection method based on mixed multi-fine-grained frequencies according to an embodiment of the present invention. DETAILED DESCRIPTION

[0018] In order to make the objects, technical solutions and advantages of the present invention clearer, the various exemplary embodiments to be described below will refer to the corresponding drawings, which constitute a part of the exemplary embodiments, in which various exemplary embodiments that may be used to implement the present invention are described. Unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementation methods described in the following exemplary embodiments do not represent all implementation methods consistent with the present disclosure. It should be understood that they are only examples of processes, methods and devices that are consistent with some aspects of the present disclosure as detailed in the appended claims, and other embodiments may also be used, or structural and functional modifications may be made to the embodiments listed herein without departing from the scope and essence of the present invention.

[0019] In the description of the present invention, it should be understood that the terms "center", "longitudinal", "transverse" and the like indicate the orientation or positional relationship based on the figures, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the elements referred to must have a specific orientation, be constructed and operated in a specific orientation. The terms "first", "second" and the like are only used for descriptive purposes and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. The term "multiple" means two or more. The terms "connected" and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, an integral connection, a mechanical connection, an electrical connection, a communication connection, a direct connection, an indirect connection through an intermediate medium, and can be the internal connection of two elements or the interaction relationship between two elements. The term "and / or" includes any and all combinations of one or more related listed items. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to the specific circumstances.

[0020] In order to illustrate the technical solution of the present invention, a specific embodiment is provided below, in which only the parts related to the embodiment of the present invention are shown.

[0021] Example: like Figure 1 、 Figure 2As shown, the present invention provides a gold finger defect detection method based on mixed multi-fine-grained frequencies, comprising the following steps: S100: performing normalization and image enhancement operations on multiple original gold finger images (i.e., multiple original images including gold fingers). Normalization is a technique used to adjust data or features to a specific range or distribution, with the purpose of accelerating training, stabilizing gradients, and improving model performance. Image enhancement generates diverse and reasonable training samples by randomly transforming images, thereby improving the generalization ability of the model. A training dataset and a validation dataset are constructed. The training dataset is used to train the model, and the validation dataset is used to tune hyperparameters (such as learning rate and number of network layers) and evaluate the model effect to avoid overfitting. The validation dataset does not participate in training and is only used to verify the performance of the model on unseen data. The ratio of the two can be set according to training needs, such as the validation dataset accounting for 10%-20%. S200: The images in the training dataset are input into three series-connected residual convolution modules for encoding. The residual convolution modules are used to address the degradation problem in deep network training while improving feature extraction capabilities and training stability. The encoding compresses the input image into a low-dimensional, high-order feature representation. The core goal is to extract key information, remove redundancy, and convert the original image data into a task-related compact representation, thereby obtaining first feature maps at three different levels: shallow (edges, colors, textures, corners), middle (local components, simple shapes, texture combinations), and deep (global structure). Each residual convolution module corresponds to a first feature map at one level. S300: In this embodiment, the output features of the three first feature maps are used simultaneously in two paths: the skip connection in the decoding stage and the input of the hybrid cross-frequency attention module, realizing multi-path multiplexing of the encoded features. The three first feature maps are fed into a hybrid cross-frequency attention module, where parallel convolution kernels of different sizes are applied to generate three second feature maps. The parallel convolution kernels extract features separately and then fuse the outputs, improving the model's ability to model multi-scale and multi-modal features. Each second feature map is fed into a multi-fine-grained frequency attention module to generate three frequency response feature maps: a low-frequency response map, a mid-frequency response map, and a high-frequency response map. The frequency response feature maps are used to indicate preferences for different spatial frequencies, providing a frequency-domain perspective for model interpretation, robustness analysis, and compression optimization. S400: The three frequency response feature maps are fed into different pooling operation channels for pooling. The three pooling operation results are fed into a fully connected structure and the outputs are summed along the channel dimension to generate a frequency attention map, which is then activated and output as a dual-path attention map. S500: The dual-path attention maps are fused element-wise by addition and element-wise multiplied with the frequency response feature map to generate a frequency-enhanced feature map. This enhanced feature map is preferably integrated and output through a 3×3 convolution kernel for subsequent decoding.S600: Based on the first feature map and the frequency-enhanced feature map, decoding is performed and the gold finger defect detection neural network is trained using the training dataset. During the training process, the validation dataset is used to evaluate the model performance of the gold finger defect detection neural network (only the validation dataset is used to measure model metrics, without adjusting model weights) and to perform fine-tuning (using feedback from the validation dataset to modify hyperparameters, early stopping, and model selection). This process improves the model's detection accuracy and stability for gold finger images, ultimately resulting in a fully trained gold finger defect detection network. S700: The gold finger image to be detected is input into the trained gold finger defect detection network to obtain gold finger defect detection results. This embodiment addresses the problems of diverse defect types, large scale differences, complex image textures, and local high reflectivity in the actual detection of gold finger areas of circuit boards. By using a hybrid cross-frequency attention module, the network's recognition ability and robustness for key abnormal areas are improved. This module extracts spatial features under different receptive fields through multi-scale convolution, and introduces a frequency domain decomposition mechanism to divide the feature map into low-frequency, medium-frequency, and high-frequency components. It combines maximum, average, and minimum pooling operations to enhance the response of key frequency bands, highlighting the defect characteristics of high-frequency areas. This can effectively suppress high-reflectivity interference and background texture noise, enhance the model's detection ability for fine-grained defects such as minor scratches and notches, and significantly improve detection accuracy and stability in complex scenarios such as complex backgrounds, high-reflectivity interference, multi-scale targets, and blurred edges.

[0022] As an optional implementation, Figure 2 As shown in step S200, the residual convolution module uses downsampling to increase the dimension of the feature channel, thereby compensating for the loss of spatial information. It can also control the amount of computation through grouped convolution or depthwise separable convolution, which can reduce spatial redundancy while enhancing feature expression capabilities. Each residual convolution module includes two 3×3 convolutional layers and a 1×1 convolution identity mapping residual path. The 3×3 convolutional layer achieves the best balance between parameter efficiency, expression power, and computational cost. It can not only extract local features but also expand the receptive field through combination. In addition, the convolutional layers all have normalization operations and activation functions. The normalization operation is used to achieve stable training and slow convergence, and the activation function enables the network to learn complex patterns.

[0023] As an optional implementation, in step S300, the parallel convolution kernels are 7×7 convolution kernels (the receptive field of one convolution is 49 pixels), 5×5 convolution kernels (the receptive field of one convolution is 25 pixels), and 3×3 convolution kernels (the receptive field of one convolution is 9 pixels). The spatial semantic features with large, medium, and small receptive fields are extracted through convolution operations, respectively, and three second feature maps of large receptive field feature map, medium receptive field feature map, and small receptive field feature map are obtained, which correspond to the global, component structure, and local details of the image, respectively.

[0024] As an optional implementation, in step S300, the multi-fine-grained frequency attention module decomposes the large receptive field feature map, the medium receptive field feature map, and the small receptive field feature map through a discrete cosine filter (Discrete Cosine Transform Filter, DCT filter, a frequency domain filter constructed based on discrete cosine transform, which converts the image block of the spatial domain signal into a frequency domain coefficient through a two-dimensional discrete cosine transform), and divides them into three channels: low frequency, medium frequency, and high frequency (the image energy is mainly concentrated in the low frequency, and the high frequency is mostly noise or details), which correspond to the overall contour, texture structure, and edge mutation area of ​​the image. Specifically, the 7×7 large receptive field branch is used to specifically process low-frequency global contour defects (such as large-area oxidation and overall deformation), and the 5×5 medium receptive field branch is used to process low-frequency global contour defects (such as large-area oxidation and overall deformation). The branch processes mid-frequency texture defects (such as surface scratches and texture anomalies), and the 3×3 small receptive field branch processes high-frequency edge defects (such as tiny cracks and edge burrs), thereby solving the technical problem that defects with different frequency characteristics require specialized processing, and performs inter-channel multiplication operations with the first feature map at the shallow, middle and deep levels to obtain a low-frequency response map (obtained by inter-channel multiplication of the large receptive field feature map and the shallow first feature map), a mid-frequency response map (obtained by inter-channel multiplication of the middle receptive field feature map and the middle first feature map), and a high-frequency response map (obtained by inter-channel multiplication of the small receptive field feature map and the deep first feature map).

[0025] As an optional implementation, in step S400, the low-frequency response map, mid-frequency response map, and high-frequency response map are input into the minimum pooling operation channel, the average pooling operation channel, and the maximum pooling operation channel for pooling operations, respectively. Minimum pooling prevents subtle changes in low-frequency global defect detection from being masked by averaging, average pooling reduces noise interference in mid-frequency texture defects, and maximum pooling prevents weak signals in high-frequency edge defects from being suppressed. Regional response features of corresponding frequencies are extracted and input into their respective fully connected structures for feature compression and enhancement to improve model efficiency and expression capabilities. In this embodiment, each branch of the pooling operation contains two layers of fully connected operations.

[0026] As an optional implementation, in step S400, the output results of the three fully connected structures are added in the channel dimension to obtain a frequency attention map. The frequency attention map performs weighted processing on the features in the frequency domain, highlights the key frequency components, and suppresses redundant or noise frequency bands, thereby enhancing the model's perception of the spectral structure, and is activated by the Sigmoid function to map any real number input to (0, 1); and the activated frequency attention map is divided into two paths, which are respectively subjected to element-wise multiplication and element-wise division operations with the frequency response feature map to output a dual-path attention map. The multiplication operation amplifies the abnormal feature response, and the division operation suppresses background noise interference, thereby forming a bidirectional modulation mechanism for the abnormal area.

[0027] As an optional implementation, in step S600, decoding is performed through a decoding structure, such as Figure 2 As shown, the decoding structure includes a three-level residual upsampling module, which uses residual connections to losslessly bring high-frequency details in low-resolution features to high-resolution space, avoiding edge blur and information loss caused by interpolation / transposed convolution. Each residual upsampling module performs upsampling to restore spatial resolution through transposed convolution (by exchanging the roles of forward / backward propagation, mapping low-resolution input to high-resolution output to achieve learnable upsampling), followed by two 3×3 convolution kernels for extracting fine features and setting residual connection paths. The residual connection enables attention to enhance control weights, making the deep network learn quickly and stably. Each residual upsampling module simultaneously receives two input signals, namely the first feature map of the frequency enhancement feature (in this embodiment, the first feature map is connected via a jump connection, which fuses the high-resolution features (spatial details) in the encoder with the upsampled features (semantic information) in the decoder to compensate for the loss of spatial information caused by downsampling, improve the segmentation / reconstruction accuracy, make the segmentation edges sharper, and prevent small targets from disappearing. The encoder features are cropped to the same size as the decoder features and then spliced ​​together to achieve a jump connection), to achieve complementary fusion of the enhanced information after frequency domain processing and the original spatial domain detail information, so as to improve the quality of edge restoration.

[0028] As an optional implementation, in step S600, the training process selects the Adam optimizer (Adaptive Moment Estimation, which automatically adjusts the learning step size of each parameter through momentum and adaptive learning rate, taking into account fast convergence and stable training) to update parameters, and adopts different learning rates for the frequency domain related layers and the spatial domain related layers. The initial learning rate is set to 0.001, and the learning rate is proportionally decayed when the loss of the validation set does not decrease. Since the frequency domain and spatial domain modules have different convergence characteristics, a smaller learning rate is used for the frequency domain related layers to maintain the stability of the frequency domain features, and a standard learning rate is used for the spatial domain related layers to ensure the learning efficiency of the spatial domain features, thereby avoiding instability during the frequency domain feature training process. In addition, the Dropout strategy and L2 regularization term are used during training to prevent overfitting. Dropout reduces variance through model averaging and randomly shuts down neurons to break co-adaptation. L2 reduces bias through weight shrinkage and punishes large weights to prevent overfitting. L2 controls the weight scale first, and then Dropout randomly perturbs the activation, which can significantly reduce overfitting. The Cutout operation is used on some feature maps to enhance the network's robustness to occlusion and interference. The Cutout operation randomly blocks a rectangular area on the input image (pixel values ​​are set to 0), allowing the network to use image context information rather than local features for learning, thereby improving generalization ability. It can also be combined with Mixup and AutoAugment operations to further improve robustness.

[0029] As an optional implementation, in step S600, the multi-scale knowledge distillation loss function based on cosine similarity during training That is, at multiple spatial scales, cosine similarity is used to measure the directional consistency of teacher and student features, weakening the absolute numerical difference and strengthening structural consistency rather than numerical fitting, thereby improving the generalization ability of the student model; and cosine similarity of spatial positions is performed on multiple feature layers. Alignment ensures that the deep structure expression of the gold finger defect detection neural network remains consistent. Cosine similarity alignment enforces directional consistency rather than numerical consistency, making it an efficient and robust optimization goal in learning. During training, spectrum preservation supervision is also performed on the features of each frequency band after discrete cosine transform decomposition (Discrete Cosine Transform, DCT decomposition, which projects time / spatial signals onto a cosine basis to obtain frequency domain coefficients with highly concentrated energy) to ensure the quality of intermediate feature learning. At the same time, combined with frequency domain consistency constraints, the network maintains the accuracy of frequency domain decomposition while learning spatial multi-scale features, preventing distortion of frequency domain information during deep propagation, thereby improving the model's adaptability to multi-scale defects and detection accuracy.

[0030] As an optional implementation, in step S600, the loss function , cosine similarity The expressions are: , , in, Indicates the kth layer of the encoding network and the height is , width is The output tensor of Represents the kth layer of the decoding network, with a height of , width is The output tensor of represents the mapping from the input image to the encoded feature space, 、 、 Represent the number of channels, height and width of the k-th layer feature map, respectively. Indicates the cosine distance of the kth layer in spatial position (the larger the value, the more abnormal it is). Represents the number of features. This loss function compares the consistency of the responses of the encoding and decoding networks in the multi-layer feature space point by point, guiding the decoding network to learn the high-dimensional embedding representation of the encoding network for normal images in both shallow and deep layers, thereby more sensitively perceiving abnormal areas during the inference phase.

[0031] The embodiment is only a special example and does not represent only one way of implementing the present invention.

[0032] The foregoing is merely a preferred embodiment of the present invention. Those skilled in the art will appreciate that various changes or equivalent substitutions may be made to these features and embodiments without departing from the spirit and scope of the present invention. Furthermore, under the guidance of the present invention, these features and embodiments may be modified to suit specific circumstances and materials without departing from the spirit and scope of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed herein, and all embodiments falling within the scope of the claims of this application are intended to be within the scope of the present invention.

Claims

1. A gold finger defect detection method based on mixed multi-fine-grained frequency, characterized in that: The following steps are involved: S100: performing normalization and image enhancement operations on multiple original cheat images to construct a training dataset and a verification dataset; S200: Inputting the image of the training data set into three series-connected residual convolution modules for encoding to obtain first feature maps at three different levels: shallow, middle, and deep; S300: Input the three first feature maps into the hybrid cross-frequency attention module, respectively use parallel convolution kernel operations of different sizes to obtain three second feature maps, and input each second feature map into the multi-fine-grained frequency attention module to obtain three frequency response feature maps: low-frequency response map, mid-frequency response map, and high-frequency response map; S400: Input the three frequency response feature maps into different pooling operation channels for pooling operation respectively. The three pooling operation results enter the fully connected structure and the output results are added in the channel dimension to obtain the frequency attention map and then activate it to output the dual-path attention map. S500: The dual-path attention map is fused by element-wise addition and element-wise multiplication is performed with the frequency response feature map to generate a frequency enhancement feature map; S600: Decoding is performed based on the first feature map and the frequency-enhanced feature map, and a training data set is used to train a gold finger defect detection neural network. During the training process, a validation data set is used to evaluate and optimize the model performance of the gold finger defect detection neural network, ultimately obtaining a trained gold finger defect detection network. S700: Inputting the gold finger image to be detected into the trained gold finger defect detection network to obtain a gold finger defect detection result.

2. The method for detecting gold finger defects based on mixed multi-granularity frequencies according to claim 1, characterized in that: In the step S200, the residual convolution module uses downsampling to increase the dimension of the feature channel; each residual convolution module includes two 3×3 convolution layers and one 1×1 convolution identity mapping residual path, and the convolution layers are all equipped with normalization operations and activation functions.

3. The gold finger defect detection method based on mixed multi-fine-grained frequency according to claim 1, characterized in that: In the step S300, the parallel convolution kernels are 7×7 convolution kernel, 5×5 convolution kernel, and 3×3 convolution kernel, which respectively extract spatial semantic features with large, medium, and small receptive fields through convolution operations to obtain three second feature maps of corresponding large receptive field feature map, medium receptive field feature map, and small receptive field feature map.

4. The method for detecting gold finger defects based on mixed multi-granularity frequencies according to claim 3, characterized in that: In the step S300, the multi-fine-grained frequency attention module decomposes the large receptive field feature map, the medium receptive field feature map, and the small receptive field feature map through a discrete cosine filter, and divides them into three channels: low frequency, medium frequency, and high frequency, which correspond to the overall contour, texture structure, and edge mutation area of ​​the image, and performs inter-channel multiplication operations with the first feature map at three levels: shallow, medium, and deep, to obtain a low-frequency response map, a medium-frequency response map, and a high-frequency response map.

5. The method for detecting gold finger defects based on mixed multi-granularity frequencies according to claim 1, characterized in that: In step S400, the low-frequency response map, the medium-frequency response map, and the high-frequency response map are respectively input into the minimum pooling operation channel, the average pooling operation channel, and the maximum pooling operation channel for pooling operations, and the regional response features of the corresponding frequencies are extracted. The features are then input into their respective fully connected structures for feature compression and enhancement.

6. The method for detecting gold finger defects based on mixed multi-granularity frequencies according to claim 5, characterized in that: In the step S400, the output results of the three fully connected structures are added in the channel dimension to obtain a frequency attention map, and activated by a Sigmoid function; and the activated frequency attention map is divided into two paths, which are respectively subjected to element-wise multiplication and element-wise division operations with the frequency response feature map to output a dual-path attention map.

7. The method for detecting gold finger defects based on mixed multi-granularity frequencies according to claim 1, characterized in that: In step S600, decoding is performed through a decoding structure, which includes a three-level residual upsampling module. Each residual upsampling module performs upsampling to restore spatial resolution through transposed convolution, followed by two 3×3 convolution kernels for extracting fine features, and a residual connection path is set; each residual upsampling module simultaneously receives two input signals of the first feature map of the frequency enhancement feature.

8. The method for detecting gold finger defects based on mixed multi-granularity frequencies according to claim 7, characterized in that: In step S600, the Adam optimizer is selected for parameter update in the training process, different learning rates are used for the frequency domain related layer and the spatial domain related layer, and the learning rate is proportionally attenuated when the loss of the validation set does not decrease; and the Dropout strategy and L2 regularization term are used in the training process to prevent overfitting, and the Cutout operation is used on some feature maps to enhance the network's robustness to occlusion and interference.

9. The method for detecting gold finger defects based on mixed multi-granularity frequencies according to claim 7, characterized in that: In the step S600, the multi-scale knowledge distillation loss function based on cosine similarity is used during training. , and perform cosine similarity on multiple feature layers in spatial position Alignment ensures that the deep structure expression consistency of the gold finger defect detection neural network is maintained; during training, the spectrum of each frequency band feature after discrete cosine transform decomposition is also supervised.

10. The method for detecting gold finger defects based on mixed multi-granularity frequencies according to claim 9, characterized in that: In the step S600, the loss function , cosine similarity The expressions are: , , in, Indicates the kth layer of the encoding network and the height is , width is The output tensor of Represents the kth layer of the decoding network, with a height of , width is The output tensor of represents the mapping from the input image to the encoded feature space, 、 、 Represent the number of channels, height and width of the k-th layer feature map, respectively. represents the cosine distance of the kth layer in space, Indicates the number of features.

Citation Information

Patent Citations

  • Deep forgery detection method and corresponding device

    CN115311525A

  • Method and system for restoring a compressed image with raindrops

    US20250252721A1

Cited By

  • Non-supervision defect detection method and system based on fusion of frequency domain drive and multi-modal information

    CN121305309A

  • Unsupervised defect detection method and system driven by frequency domain and fusing multi-modal information

    CN121305309B