Defect detection method and system based on adaptive double-domain filtering and Gaussian mixture prior constraint, medium and equipment
By employing frequency-space dual-domain adaptive feature filtering and mixed Gaussian prior constraints, the problems of noise and artifact interference in ultrasonic nondestructive testing are solved, achieving high-precision detection and improved stability for minute defects.
Patent Information
- Application Number
- CN202511513310.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-22
- Publication Date
- 2026-02-03
AI Technical Summary
Existing unsupervised deep learning methods are not sensitive enough to micron-sized, low-contrast, or weakly structured defects in ultrasonic nondestructive testing, and are easily affected by noise and artifacts, making it difficult to generalize in complex industrial environments.
A frequency-space dual-domain adaptive feature filtering and Gaussian mixture prior constraint method is adopted. The adaptive dual-domain filtering module suppresses noise and artifacts, and the Gaussian mixture modeling and deep and shallow layer feature interaction are combined to improve the detection capability of defects at different scales.
It effectively suppresses noise artifacts, improves the model's sensitivity and robustness to minor defects, enhances the accuracy and stability of defect detection, and strengthens cross-domain robustness.
Smart Images

Figure CN121458633A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer vision, and particularly relates to a defect detection method, system, medium and equipment based on adaptive dual-domain filtering and mixed Gaussian prior constraint. BACKGROUND
[0002] Ultrasonic nondestructive testing is an efficient and non-invasive defect detection method. With the development of imaging technology, C-scan gradually becomes an important mode in ultrasonic testing. Ultrasonic C-scan can display the reflection signals inside the material in the form of two-dimensional images, providing intuitive basis for the positioning and identification of cracks, delamination, porosity, welding defects and other abnormalities. In recent years, deep learning and GPU hardware performance have developed rapidly, and deep learning methods based on ultrasonic C-scan images have shown strong modeling capabilities in defect recognition and positioning.
[0003] Although existing methods have improved the automation level to some extent, defect detection based on ultrasonic C-scan images still faces severe challenges in industrial practical deployment: the annotation data of defect samples in the industry is extremely limited. On the one hand, the probability of defects appearing in actual samples is significantly lower than normal conditions, resulting in a serious lack of available defect data; on the other hand, the annotation process relies on the experience of professionals, is time-consuming and costly. At the same time, with the development of manufacturing processes, new defect patterns are constantly emerging, making traditional supervised learning methods relying on manual annotation lack scalability.
[0004] For the above reasons, in recent years, unsupervised deep learning methods have received increasing attention in ultrasound image anomaly detection. Unsupervised methods do not rely on manual annotation, but model the latent distribution of normal data, so as to identify abnormal regions deviating from the normal distribution in the detection stage. Common unsupervised methods are mainly based on two types of ideas: one is the reconstruction error driven method, that is, the input is reconstructed by using models such as autoencoder and generative adversarial network, normal samples can be accurately reconstructed, and abnormal regions fail to be reconstructed due to not conforming to the learned distribution, so as to appear in the residual; the other is the feature comparison driven method, that is, the feature is extracted by a pre-trained model, the feature space representation of the normal sample is established, and then the distance measurement or distribution modeling method is used to judge the abnormality. However, these methods still have deficiencies in practical application. First, many models lack sensitivity to micrometer-level, low-contrast or weak structural defects, which often show extremely subtle brightness changes in the image and are easily missed. Second, strong noise and various artifacts such as stripe interference, speckle noise and system distortion inevitably exist in the ultrasound imaging process, and existing unsupervised methods often assume that normal regions have highly consistent statistical properties, ignoring the structural noise and complex background in ultrasound images, which are easily disturbed by low-quality normal samples, affecting the discrimination accuracy of the model to the abnormality. Third, the complexity of the industrial application environment leads to serious domain shift problem. Different detection devices, different process batches and different scanning parameters will significantly change the statistical distribution of ultrasound images, so that the model trained on a certain data set is difficult to directly generalize to new production scenes.
[0005] In summary, in the practical application background of ultrasonic nondestructive testing, it is particularly important to study an unsupervised deep learning method that can effectively learn the normal distribution under the condition of no label, maintain high sensitivity to abnormalities, and have anti-noise and cross-domain robustness. This not only helps to improve the defect detection accuracy and stability of ultrasonic C-scan images, but also lays a solid technical foundation for their large-scale application in complex industrial scenarios. SUMMARY
[0006] To solve the above problems, the purpose of the present application is to provide a defect detection method, system, medium and equipment based on adaptive dual-domain filtering and mixed Gaussian prior constraint, which combines frequency-space dual-domain adaptive feature filtering, Gaussian mixture modeling and deep-shallow multi-scale feature interaction, effectively suppresses noise artifacts, highlights defect features, and improves the positioning ability of different scale abnormalities, thereby realizing high-precision and strong-robustness defect detection and identification.
[0007] To achieve the above object, the technical scheme adopted by the present application in the first aspect is: a defect detection method based on adaptive dual-domain filtering and mixed Gaussian prior constraint, comprising: acquiring an input ultrasonic C-scan image and pre-processing, performing multi-scale feature extraction on the input ultrasonic C-scan image through a pre-trained Vision Transformer network to obtain shallow fusion features, deep fusion features and encoder output features; inputting the shallow fusion features and the deep fusion features into a frequency-space dual-domain adaptive feature filtering module respectively, suppressing stripe artifacts and system noise in the spatial domain by using a global self-attention mechanism, and weakening periodic spectral energy and enhancing defect-related high-frequency components in the frequency domain through an FFT gating mechanism; inputting the filtered shallow fusion features and the filtered deep fusion features into a Gaussian mixture modeling module Ada-GMM respectively, modeling normal feature distribution, and generating distribution prior, using Gaussian mean and membership probability to provide statistical constraint for subsequent decoding; using Gaussian mean and membership probability as guidance to perform Ada-GMM-Guided decoding, and using a deep-shallow multi-scale feature interaction mechanism to interact and fuse corresponding deep semantic features and shallow texture features respectively, thereby improving the representation ability of different scales and different morphological defects; comprehensively processing the results, using cosine reconstruction loss, filtering consistency and entropy regularization loss, and distribution alignment loss for optimization, realizing stable training and high-precision anomaly detection under unsupervised conditions; according to the optimization process, adaptively learning normal distribution features, performing model training, and obtaining model weights; in the test stage, using the trained network weights to infer the input ultrasonic C-scan image, realizing anomaly detection and positioning, and outputting an interpretable anomaly heat map.
[0008] Further, the frequency-space dual-domain adaptive feature filtering module comprises: an FFT gating branch, a Transformer encoder branch and a Score Predictor; the three work together to utilize the frequency domain sparsity and the spatial domain global context information to obtain a robust feature representation; The frequency-space dual-domain adaptive feature filtering module filters the shallow fusion features and the deep fusion features respectively to obtain the filtered shallow fusion features and the filtered deep fusion features .
[0009] Further, the filtering method of the frequency-space dual-domain adaptive feature filtering module is: the input feature sequence is processed by the FFT gating branch to obtain the gated frequency domain features ; In the spatial domain, the Transformer encoder is used to model the input features globally, and each layer contains multi-head self-attention mechanism and feedforward network. The output features of the FFT gate and the Transformer encoder are transmitted to the Score Predictor, the features output by the two branches are fused, and then normalized and input into two layers of multi-layer perception (MLP) to generate the weight of each feature. According to the weight, each feature is adaptively amplified or suppressed to obtain the filtered feature.
[0010] Further, the filtered shallow fusion features and deep fusion features are respectively input into the Gaussian mixture modeling module Ada-GMM to model the normal feature distribution and generate the distribution prior. The Gaussian mean and the belonging probability are used to provide statistical constraints for subsequent decoding, including: filtered features and are regarded as unlabeled normal samples and are respectively modeled by K-component Gaussian mixture model; The Gaussian mixture modeling module Ada-GMM adaptively clusters and models the normal features to form an interpretable prototype representation and provides explicit statistical prior constraints for the subsequent decoding stage: Gaussian mean vector , and the posterior probability of each feature belonging to each Gaussian component and .
[0011] Further, the Gaussian mean and the belonging probability are used as guidance for Ada-GMM-Guided decoding, and a deep-shallow multi-scale feature interaction mechanism is adopted to interact and fuse the corresponding deep semantic features and shallow texture features, including: fuse the multi-scale features of the Vision Transformer encoder to obtain as the input of the decoding stage, a multi-layer Ada-GMM-Guided decoder is used, each layer contains a GMM-Attention module, which injects the statistical prior of the Gaussian mixture distribution into the pixel-level feature representation in the decoding stage; The deep-shallow feature interaction mechanism is as follows: for shallow decoding, the Gaussian mean vector and the posterior probability matrix obtained by using the deep encoding features are used as statistical priors, so that the decoding can reduce noise interference and enhance the stable positioning of large-scale defects; for deep decoding, the Gaussian mean vector and the posterior probability matrix As a statistical prior, high-resolution texture details are introduced to improve the detection ability of micro-defects.
[0012] Further, the comprehensive processing result is optimized by using cosine reconstruction loss, filtering consistency and entropy regularization loss, and distribution alignment loss, including: Filtering loss is established to constrain the frequency-space feature filtering module, maintain the stability of the filtering output and promote the gating sparsification; including two parts: maintaining the consistency constraint of filtering features close to the encoder features and promoting the patch score to tend to 0 or 1, so that the gating process is sparse and decisive entropy regularization; Distribution loss is established to constrain the reconstruction accuracy and distribution certainty of Ada-GMM; Reconstruction loss is established to use cosine similarity-based reconstruction constraint, through multi-scale weighted fusion, so that the decoder can maintain the stability of normal area reconstruction while focusing on the abnormal area which is difficult to reconstruct; The filtering loss , the distribution loss and the reconstruction loss are combined to obtain the total loss function ; wherein, is the weight coefficient of the filtering loss, is the weight coefficient of the distribution loss.
[0013] Further, the trained network weight is used to infer the input ultrasonic C-scan image to realize anomaly detection and positioning, including: For each layer of feature, the normal feature representation of the encoder and the reconstruction feature of the decoder (wherein represents the layer) are extracted, and the difference degree between the two is calculated; if the value is greater than the set threshold, it indicates that there is a strong encoding-decoding feature difference at this position, which may correspond to an abnormal area; According to the difference degree of each layer of feature, a layer-by-layer abnormal response difference map is generated, and the difference map is uniformly adjusted to a fixed output resolution by bilinear interpolation; The interpolated difference maps of each layer are spliced in the channel dimension and averaged to obtain the final abnormal positioning heat map; When the input image has defects, the encoding-decoding feature similarity of the corresponding area is lower than the set value, which is shown as a highlighted area in the heat map.
[0014] In a second aspect, the technical scheme adopted by the present application is: a defect detection system based on adaptive dual-domain filtering and mixed Gaussian prior constraint, comprising: a multi-scale feature extraction module, which acquires an input ultrasonic C-scan image and performs preprocessing, extracts multi-scale features from the image through a pre-trained Vision Transformer network, and obtains shallow fusion features, deep fusion features and encoder output features; a dual-domain adaptive feature filtering module, which inputs the shallow fusion features and the deep fusion features into a frequency-space dual-domain adaptive feature filtering module respectively, suppresses stripe artifacts and system noise in the spatial domain using a global self-attention mechanism, and weakens periodic spectral energy and enhances defect-related high-frequency components in the frequency domain through an FFT gating mechanism; a feature distribution modeling module, which inputs the filtered shallow fusion features and deep fusion features into a Gaussian mixture modeling module Ada-GMM respectively, models normal feature distribution, generates distribution priors, and uses Gaussian means and membership probabilities to provide statistical constraints for subsequent decoding; a deep-shallow multi-scale feature interaction mechanism module, which uses Gaussian means and membership probabilities as guidance for Ada-GMM-Guided decoding, and adopts a deep-shallow multi-scale feature interaction mechanism to interactively fuse corresponding deep semantic features and shallow texture features, thereby improving the representation ability for defects of different scales and different morphologies; a loss function determination module, which comprehensively processes the results, adopts cosine reconstruction loss, filtering consistency and entropy regularization loss, and distribution alignment loss for optimization, realizes stable training and high-precision anomaly detection under unsupervised conditions; and an anomaly detection and positioning module, which adaptively learns normal distribution features according to the optimization process, trains the model, obtains model weights, and in the test stage, uses the trained network weights to infer the input ultrasonic C-scan image, realizes anomaly detection and positioning, and outputs an interpretable anomaly heat map.
[0015] In a third aspect, the technical scheme adopted by the present application is: a computer-readable storage medium storing one or more programs, the one or more programs including instructions which, when executed by a computing device, cause the computing device to perform any of the above methods.
[0016] In a fourth aspect, the technical scheme adopted by the present application is: a computing device, comprising: one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs include instructions for performing any of the above methods.
[0017] The present application has the following advantages due to the adoption of the above technical scheme: 1、The frequency-space dual-domain adaptive feature filtering method is adopted, the global context is captured and the stripe noise is suppressed by using the Transformer in the spatial domain, and the periodic artifacts are removed by using the learnable FFT gate in the frequency domain, so that the high signal-to-noise ratio feature is effectively enhanced, and the sensitivity of the model to the micro defect and the robustness to the noise environment are improved.
[0018] 2、The adaptive Gaussian mixture modeling (Ada-GMM) method is adopted, the filtered features are probabilistically modeled under unsupervised conditions, and the statistical prior distribution of normal data is automatically learned. Through end-to-end parameter estimation, the interpretable feature clustering is realized, and the normal mode and abnormal deviation are effectively distinguished.
[0019] 3、The multi-layer decoding mechanism with Gaussian prior constraint is adopted, the Gaussian prototype mean is injected into the decoding process by using the Ada-GMM-Guided decoder, and the deep and shallow feature interaction mechanism is used to realize the bidirectional guidance of deep semantic and shallow texture, and the detection performance of the model for multi-scale defects is significantly improved.
[0020] 4、The multi-loss collaborative optimization strategy is adopted, the filtering consistency loss, the distribution reconstruction loss and the cross-scale cosine reconstruction loss are combined to ensure the feature stability and the distribution separability. This design not only enhances the discriminability of Gaussian mixture modeling, but also improves the model generalization ability in cross-domain scenes. BRIEF DESCRIPTION OF DRAWINGS
[0021] Figure 1 It is a defect detection method flow chart based on adaptive dual-domain filtering and mixed Gaussian prior constraint in the embodiment of the application; Figure 2 It is a detection result schematic diagram of INP-Former and the embodiment of the application on UltraChip; Figure 3 It is a detection result schematic diagram of INP-Former and the embodiment of the application on MVTec; Figure 4 It is a detection result schematic diagram of INP-Former and the embodiment of the application on VisA. DETAILED DESCRIPTION
[0022] In order to solve the problems of complex noise, subtle defects and lack of labeling in ultrasonic nondestructive testing, the present application provides a defect detection method, system, medium and equipment based on adaptive dual-domain filtering and mixed Gaussian prior constraint, which includes dual-domain adaptive feature filtering, adaptive Gaussian mixture modeling and multi-layer Ada-GMM-Guided decoding. First, the global features are extracted by the VisionTransformer encoder, and the frequency-space filter is used to suppress noise and artifacts; then, the adaptive Gaussian mixture modeling is used to model the normal data distribution, and the posterior probability is calculated to realize feature clustering and distribution alignment; in the decoding stage, the multi-layer decoder containing the GMM-Attention module is introduced, the Gaussian statistical prior is injected into the pixel-level feature, only the high-probability area is allowed to participate in the reconstruction, and the low-probability area is enlarged and appears as defects in the anomaly heat map, so as to improve the distinguishability of the abnormal area. In addition, the present application proposes a deep and shallow feature interaction mechanism, which uses deep semantic prior to stably detect large-scale defects, and combines shallow texture prior to enhance the recognition of small defects. Through joint loss function optimization, the model can realize automatic positioning and interpretable display of defects.
[0023] To make the objectives, technical solutions, and advantages of the embodiments of the present application clearer, the technical solutions of the embodiments of the present application will be described below in connection with the drawings of the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. Based on the described embodiments of the present application, all other embodiments obtained by those of ordinary skill in the art belong to the scope of protection of the present application.
[0024] It should be noted that the terms used herein are only intended to describe specific embodiments, and are not intended to limit the exemplary embodiments according to the present application. As used herein, the singular form is intended to include the plural form unless the context clearly indicates otherwise, and furthermore, it should be understood that when the terms "comprise" and / or "include" are used in the specification, there is a feature, step, operation, device, component and / or combination thereof.
[0025] In one embodiment of the present application, a defect detection method based on adaptive dual-domain filtering and mixed Gaussian prior constraint is provided, which relates to an unsupervised defect detection method applied in deep learning. Specifically, the method adaptively filters features in the frequency domain and the spatial domain, models the feature distribution of normal samples by combining a mixed Gaussian model, and then uses distribution prior knowledge to guide image reconstruction, thereby realizing accurate identification and detection of defect areas. As shown in Figure 1 the method includes the following steps: 1) Obtain the input ultrasonic C-scan image and pre-process it, extract multi-scale features through the pre-trained Vision Transformer network, and obtain shallow fusion features, deep fusion features and encoder output features; 2) The shallow fusion features and deep fusion features are respectively input into the frequency-space dual-domain adaptive feature filtering module, the global self-attention mechanism is used in the spatial domain to suppress stripe artifacts and system noise, and the FFT gating mechanism is used in the frequency domain to weaken the periodic spectral energy and enhance the defect-related high-frequency components; 3) The filtered shallow fusion features and deep fusion features are respectively input into the Gaussian mixture modeling module Ada-GMM, the normal feature distribution is modeled, and the distribution prior is generated, and the Gaussian mean and membership probability are used to provide statistical constraints for subsequent decoding; 4) Ada-GMM-Guided decoding is performed using the Gaussian mean and membership probability as guidance, and a deep-shallow multi-scale feature interaction mechanism is adopted to interact and fuse the corresponding deep semantic features and shallow texture features, improving the representation ability of different scales and different morphological defects; 5) The processing results are integrated, and cosine reconstruction loss, filtering consistency and entropy regularization loss, and distribution alignment loss are used for optimization to realize stable training and high-precision anomaly detection under unsupervised conditions; 6) According to the optimization process, the normal distribution features are adaptively learned, the model is trained, and the model weights are obtained; in the test stage, the trained network weights are used to infer the input ultrasonic C-scan image, realize anomaly detection and positioning, and output an interpretable anomaly heat map.
[0026] In the above step 1), the original ultrasonic image is input into the network, resized and center cropped to a uniform size , and the Vision Transformer encoder is used to extract multi-scale features of the input image: the image is divided into H and W patches in x and y directions respectively, and converted into a feature sequence. The shallow (2-5 layers) and deep (6-9 layers) features are respectively fused to obtain the shallow fusion feature sequence and the deep fusion feature sequence ; the encoder output feature is also obtained.
[0027] In the above step 2), the frequency-space dual-domain adaptive feature filtering module includes: FFT gating branch, Transformer encoder branch and Score Predictor; the three work together to utilize the frequency domain sparsity and spatial domain global context information to obtain a robust feature representation.
[0028] In this embodiment, the frequency-space dual-domain adaptive feature filtering module filters the shallow fusion features and the deep fusion features respectively , to obtain filtered shallow fusion features and filtered deep fusion features .
[0029] In this embodiment, the shallow features are taken as an example for illustration. The filtering method of the frequency-space dual-domain adaptive feature filtering module includes the following steps: 2.1) FFT gating branch: the input feature sequence is processed by the FFT gating branch to obtain the gated frequency domain features .
[0030] Specifically, first, the input feature sequence is fused with the position information to obtain a feature sequence , which is rearranged into a two-dimensional tensor , where B is the batch size, is the number of features, H is the number of x-direction patches, W is the number of y-direction patches, D is the dimension of a single feature. Then, a two-dimensional fast Fourier transform (FFT) is applied to to obtain a complex spectrum :
[0031] where represents the real part, represents the imaginary part, represents concatenation in the channel dimension.
[0032] The obtained frequency domain features are modeled by 1×1 point convolution (PWConv) and 3×3 depth convolution (DWConv) combined with GELU activation function:
[0033] Then, the global average pooling GAP is used to calculate the energy statistics of each channel:
[0034] Two layers of learnable convolution and Sigmoid function are used to generate channel gating coefficients:
[0035] Finally, the gated frequency domain features are obtained:
[0036] wherein, denotes channel-wise multiplication. Thus, noise-dominant channels are suppressed, and channel-specific features are enhanced.
[0037] 2.2) Transformer encoder branch: In the spatial domain, a Transformer encoder is adopted to model the input features globally, each layer of which contains multi-head self-attention mechanism and feed-forward network, and can adaptively model cross-feature dependencies.
[0038] Specifically, the attention calculation formula is:
[0039] wherein, the query matrix Q, the key matrix K, and the value matrix V are all from the input feature sequence of the branch , is a scaling factor. is the feature output by the Transformer encoder.
[0040] Through this mechanism, the model can weaken the stripe artifacts and redundant activations, highlight the potential abnormal regions and local details, and thus achieve noise suppression and feature purification in the spatial domain.
[0041] 2.3) Score Predictor: The output features of the FFT gate and the Transformer encoder are transmitted to the Score Predictor, the features output by the two branches are fused, and then normalized and input into two layers of multi-layer perception (MLP) to generate the weight of each feature. According to the weight, each feature is adaptively amplified or suppressed to obtain the filtered feature.
[0042] Specifically, the output features of the FFT gate and the Transformer encoder are fused to obtain , which is normalized by LayerNorm and input into two layers of multi-layer perception (MLP) to generate the weight of each feature . According to the weight, each feature is adaptively amplified or suppressed:
[0043] wherein, is the final output of this step.
[0044] The Score Predictor assigns a lower weight to the noise patch and a higher weight to the discriminative patch, thereby enhancing the information region and suppressing the redundant region, and further improving the feature purity.
[0045] In step 3) above, the filtered shallow fusion features and deep fusion features are respectively input into the Gaussian mixture modeling module Ada-GMM to model the normal feature distribution and generate distribution priors, and the Gaussian mean and membership probability are used to provide statistical constraints for subsequent decoding, including the following steps: 3.1) Filtered features and are regarded as unlabeled normal samples and are respectively modeled by a K-component Gaussian mixture model; 3.2) The Gaussian mixture modeling module Ada-GMM adaptively clusters and models the normal features to form an interpretable prototype representation and provides explicit statistical prior constraints for the subsequent decoding stage: Gaussian mean vector , and the posterior probability of each feature belonging to each Gaussian component and . Wherein, represents the real number field, , represents the mean vector of the th Gaussian component in the shallow feature space and the deep feature space; D represents the dimension of the feature vector; K represents the number of Gaussian components in the Gaussian mixture model; represents the posterior probability of the shallow feature Gaussian component; represents the posterior probability of the deep feature Gaussian component.
[0046] Specifically, the decoder only allows reconstruction in high probability density areas, while inputs falling into low probability areas will be amplified in the residual, and finally presented as potential defects in the anomaly heat map.
[0047] In step 4) above, the Gaussian mean and membership probability are used as guidance for Ada-GMM-Guided decoding, and a deep-shallow multi-scale feature interaction mechanism is adopted to interact and fuse the corresponding deep semantic features and shallow texture features, including: the multi-scale features of the Vision Transformer encoder are fused to obtain as the input of the decoding stage, a multi-layer Ada-GMM-Guided decoder is adopted, each layer contains a GMM-Attention module, and the statistical priors of the Gaussian mixture distribution are injected into the pixel-level feature representation in the decoding stage, thereby improving the distinguishability of the abnormal area.
[0048] Specifically, first, The query tensor Q is obtained by linear mapping, and the Gaussian mean vector is projected as the key K and the value V. Through the attention score under the multi-head attention mechanism and the posterior probability matrix in step 3), the weighting of different Gaussian prototypes is realized, the features consistent with the normal distribution are enhanced, and the features falling into the low probability region are suppressed. Unlike the traditional self-attention module, the residual connection of the original feature is removed in the GMM-Attention process in the application, avoiding the cumulative propagation of low-quality features, so that the decoding process relies more on the pure features after probability constraint.
[0049] Wherein, the deep and shallow feature interaction mechanism is: using the Gaussian mixture model prior information of the deep fusion feature to guide the shallow decoding, using the Gaussian mixture model prior information of the shallow fusion feature to guide the deep decoding, and improving the representation ability of defects of different scales and different forms.
[0050] Specifically, for shallow decoding, the Gaussian mean vector and the posterior probability matrix are used as statistical priors, so that the decoding can utilize global semantics to reduce noise interference and enhance the stable positioning of large-scale defects; for deep decoding, the Gaussian mean vector and the posterior probability matrix are used as statistical priors, introducing high-resolution texture details to improve the detection ability of small defects.
[0051] In the above step 5), the comprehensive processing result is optimized by using cosine reconstruction loss, filtering consistency and entropy regularization loss, and distribution alignment loss, including the following steps: 5.1) Establish filtering loss , which is used to constrain the frequency-space feature filtering module, maintain the stability of the filtering output and promote the gating sparsification; the loss includes two parts: the consistency constraint of keeping the filtering features close to the encoder features and the entropy regularization of promoting the patch score to tend to 0 or 1, so that the gating process is sparse and decisive; Wherein, the filtering loss is:
[0052] In the formula, , correspond to the output features of the encoder shallow layer and the deep layer, , are the corresponding feature maps filtered by the dual-domain filter, is the square Euclidean norm, is the patch score entropy of the two branches, is a balance coefficient, which is set to 0.05 in the application.
[0053] 5.2) Establish distribution loss , to constrain the reconstruction accuracy and distribution determinacy of Ada-GMM; where the distribution loss is:
[0054] where x is the input of the Gaussian mixture model, is the reconstruction output of the Gaussian mixture model, is the average posterior entropy, and is a weight parameter, is set to 1.0 in the present application, is set to 0.1 in the present application. The reconstruction term ensures that the Gaussian prototypes can accurately reproduce the input features, improving the approximation accuracy of normal distribution; the entropy regularization term causes the samples to be more deterministically assigned to a Gaussian component, improving the model's ability to distinguish between normal and abnormal.
[0055] 5.3) Establishing a reconstruction loss , using a reconstruction constraint based on cosine similarity to improve the sensitivity to fine-grained anomalies. This loss is fused by multi-scale weighting, allowing the decoder to maintain reconstruction stability in normal areas while focusing on abnormal areas that are difficult to reconstruct; where the reconstruction loss is:
[0056] where are the feature maps of the first layer decoder and encoder, respectively, in the present application , represents the average over all positions and channels, represents the cosine similarity.
[0057] 5.4) Weighted combination of the filtering loss , the distribution loss and the reconstruction loss to obtain the total loss function ; ; where is the weight coefficient of the filtering loss, which is set to 0.4 in the present application; is the weight coefficient of the distribution loss, which is set to 0.2 in the present application.
[0058] In the above step 6), the trained network weight is used to infer the input ultrasonic C-scan image to realize anomaly detection and positioning, including the following steps: 6.1) For each layer feature, extract the normal feature representation of the encoder and the reconstructed feature of the decoder (where represents the first layer), and calculate the difference degree between the two ; if the value is greater than the set threshold, it indicates that there is a strong encoding-decoding feature difference in this position, which may correspond to the abnormal area; wherein the difference degree is measured by cosine similarity:
[0059] wherein, represents the feature alignment degree.
[0060] 6.2) According to the difference degree of each layer feature generate a layer-by-layer abnormal response difference map, and the difference map is uniformly adjusted to a fixed output resolution by bilinear interpolation to ensure scale consistency; 6.3) The interpolated difference maps of each layer are spliced in the channel dimension and averaged to obtain the final abnormal positioning heat map; 6.4) When the input image has defects (such as microcracks, delamination or pores, etc.), the encoding-decoding feature similarity of the corresponding area is lower than the set value, which is shown as a highlighted area in the heat map.
[0061] In summary, the present application proposes a frequency-space dual-domain adaptive feature filtering method, an adaptive Gaussian mixture modeling method, a Gaussian prior constraint decoding method and a joint loss, which can be applied in an unsupervised anomaly detection model based on deep learning, to improve the positioning accuracy and robustness of the model in complex industrial scenarios such as ultrasonic images.
[0062] The present application will be described in further detail below in conjunction with an embodiment. In an embodiment, the present application is based on an unsupervised anomaly detection model INP-Former based on deep learning, which combines a frequency-space dual-domain adaptive feature filtering method, an adaptive Gaussian mixture modeling method, a multi-scale feature interaction decoding method with Gaussian prior constraint, and a filtering consistency loss and distribution loss. The overall structure of the model includes a Vision Transformer encoder, a dual-domain feature filtering module, a mixed Gaussian modeling module, a deep-shallow multi-scale feature interaction mechanism, and a multi-level Ada-GMM-Guided decoder, realizing end-to-end unsupervised detection from input image to abnormal heat map.
[0063] In this embodiment, in order to verify the effectiveness of the method of the present application, the UltraChip dataset is constructed and used. The UltraChip dataset is designed for the actual industrial scenario of ultrasonic C-scan imaging, covers various packaging structures and defect types, and can truly reflect the high noise interference and subtle defect sensitivity problems commonly existing in ultrasonic detection. This dataset ensures the comprehensiveness and authenticity of the samples, so that the experimental results can directly correspond to the detection needs of actual microelectronic packaging.
[0064] In order to further verify the robustness and cross-domain generalization ability of the method of the present application, experiments are also conducted on two widely used optical detection public datasets: the MVTec AD dataset contains about 5,400 high-resolution images, covering 15 industrial object categories, the samples involve various materials, surface textures and defect types, and have rich manufacturing scene diversity; the VisA dataset contains about 9,300 images, covering 12 industrial product categories, the difficulty lies in containing complex surface structures, intra-class diversity and subtle defects difficult to detect, which is closer to the real production environment.
[0065] The specific implementation steps are as follows: 1) In this embodiment, the input ultrasonic image , the scale uniformity in the network is reset to and the final size is set to by center cropping.
[0066] 2) Feature extraction is performed on the image by the pre-trained Vision Transformer encoder. The Vision Transformer encoder contains multiple levels of feature output, and the feature representations of the 2nd to 9th layers are selected for modeling in this embodiment, wherein the 2nd-5th layers are shallow features that retain local structure and fine-grained texture information; the 6th-9th layers are deep features that capture global context and high semantic representation.
[0067] 3) First, the features of the first four layers (2nd-5th layers) are fused and sent to the frequency-spatial domain adaptive feature filtering module. This module first uses fast Fourier transform (FFT) to extract frequency domain features to suppress periodic noise and background stripes, and then performs weighted fusion with spatial domain Transformer attention features to obtain pure structured features. Subsequently, a Gaussian mixture modeling method is used to model the filtered features, thereby obtaining the corresponding Gaussian prior distribution, and the distribution is used as guide information for the decoding process of the last four layers.
[0068] 4) The deep features (6-9 layers) are fused and also filtered by frequency-space feature and Gaussian modeling to obtain another set of global distribution information. This distribution is used to guide the decoding of shallow features in reverse, so that the shallow details can combine global statistical constraints while maintaining local sensitivity, improving the accuracy of abnormal region positioning.
[0069] 5) In the decoding stage, the invention introduces a deep-shallow multi-scale feature interaction mechanism: on the one hand, the statistical distribution obtained by shallow encoding is used to constrain the decoding process of deep features, so that the decoding result maintains refinement in local details and contours; on the other hand, the global distribution obtained by deep encoding is used to guide the decoding of shallow layers in reverse, thereby ensuring overall structure and global consistency. Each decoding unit can inject prior distribution information of Gaussian mixture model directly into pixel-level feature representation during layer-by-layer feature reconstruction.
[0070] Specifically, in each decoding unit, the relevance score between the input query feature and the Gaussian prototype key vector is calculated using the attention mechanism. The posterior probability obtained in the Gaussian mixture modeling process is used as a gating factor, which is coupled with the relevance score element by element to realize the probability weighting of the feature to the prototype. Through this gating mechanism, the network only retains the part of the feature that is highly consistent with the target distribution to participate in context generation, and the low confidence feature is suppressed. After completing the probability gating, the weight obtained is used to perform weighted aggregation on the value vector to generate the context feature. Unlike traditional decoding structures, the present embodiment removes the direct residual connection between the input feature and the output context, avoiding noise backflow in the residual channel. This allows the network to focus more on the reconstruction features guided by the Gaussian prototype, improving abnormal sensitivity.
[0071] 6) Using the multi-scale reconstruction features obtained by the front and back layer interaction decoding, the cosine similarity calculation method is used to compare the reconstruction features and the encoded features to generate layer-by-layer abnormal response maps, and then unified to the original image scale through bilinear interpolation. Then, the multi-layer abnormal maps are fused to obtain the final abnormal positioning heat map, which is used to identify the possible defect regions in the input image.
[0072] 7) In the present embodiment, the hardware configuration for executing the algorithm is: the CPU is Intel i9, the GPU is a NVIDIA 3090 with 24G memory; the software configuration is: the computer operating system is Ubuntu 20.04, the CUDA version is 11.8, the neural network framework used is Pytorch, and the version is 2.1. The parameter settings are: the initial learning rate and the weight decay are 0.001 and 0.0001 respectively, and the training iteration is 300 times.
[0073] To ensure the stability of feature filtering, the accuracy of distribution modeling and the effectiveness of decoding reconstruction, the embodiment designs a joint loss function, including filtering loss, distribution loss and reconstruction loss, and the weights of the three terms in the final joint loss are 0.4, 0.2 and 1.0 respectively. Other embodiments can adjust the parameters appropriately according to the selected target data set. After training, the weights of the network can be obtained, and in the test stage, the input image to be detected is input into the network, and the abnormality positioning heat map is output through the ViT encoding, the interaction decoding of the front and rear layers and the generation of the abnormality map. The heat map can intuitively indicate the potential defect area, and has good interpretability and robustness.
[0074] In summary, the application can realize high-precision anomaly detection and positioning of defects in ultrasound images, and has the advantages of strong robustness, good interpretability and high adaptability.
[0075] To verify the effectiveness and practicality of the application, an example on the UltraChip, MVTec and VisA data sets is given below, Table 1 shows the detection results of the example on the test set, and the various measurement standards are I-AUROC (Area Under the Receiver Operating Characteristic Curve of image-level), P-AUROC (Area Under the Receiver Operating Characteristic Curve of pixel-level) and AUPRO (Area Under the Per-Region Overlap Curve). The data in Table 1 are the average values of all categories in the data set.
[0076] Table 1 Verification effect of the example on the data set
[0077] As shown in Table 1, Figures 2 to 4As shown, the performance of the present application on the three datasets of UltraChip, MVTec AD and VisA is significantly better than that of the existing representative method INP-Former, and the three core indicators of I-AUROC, P-AUROC and AUPRO are comprehensively improved, which proves the advantages of the present application in accuracy, robustness and cross-domain generalization capability. Further visualization results show that the present application can effectively suppress the noise activation in normal samples and achieve clear boundary and accurate positioning of defect detection effect on abnormal samples, while the existing methods often have problems such as too many false alarms and blurred boundaries. Therefore, the present application not only improves the overall performance of industrial ultrasonic testing, but also significantly improves the explainability and reliability of defect positioning, and has broad application prospects. The present application can also be flexibly applied to other anomaly detection datasets, and the above embodiments are only for the purpose of describing the present application, and are not intended to limit the scope of the present application. Various equivalent replacements and modifications made without departing from the spirit and principles of the present application shall be covered within the scope of the present application.
[0078] In an embodiment of the present application, a defect detection system based on adaptive dual-domain filtering and mixed Gaussian prior constraint is provided, which comprises: A multi-scale feature extraction module acquires an input ultrasonic C-scan image and performs preprocessing, and extracts multi-scale features through a pre-trained Vision Transformer network to obtain shallow fusion features, deep fusion features and encoder output features; A dual-domain adaptive feature filtering module inputs the shallow fusion features and the deep fusion features into a frequency-space dual-domain adaptive feature filtering module respectively, uses a global self-attention mechanism to suppress stripe artifacts and system noise in the spatial domain, and uses an FFT gating mechanism to weaken periodic spectral energy and enhance defect-related high-frequency components in the frequency domain; A feature distribution modeling module inputs the filtered shallow fusion features and deep fusion features into a Gaussian mixture modeling module Ada-GMM respectively, models the normal feature distribution, and generates a distribution prior, using the Gaussian mean and the attribution probability to provide statistical constraints for subsequent decoding; A deep-shallow multi-scale feature interaction mechanism module uses the Gaussian mean and the attribution probability as guidance for Ada-GMM-Guided decoding, and uses a deep-shallow multi-scale feature interaction mechanism to interact and fuse the corresponding deep semantic features and shallow texture features, improving the representation ability of different scales and different morphological defects; A loss function determination module comprehensively processes the results, adopts cosine reconstruction loss, filtering consistency and entropy regularization loss, and distribution alignment loss for optimization, realizing stable training and high-precision anomaly detection under unsupervised conditions; Anomaly detection and positioning module, according to the optimization process, adaptive learning normal distribution characteristics, model training, obtain model weight; in the test stage, using the network weight of training completed to infer the input ultrasonic C scan image, realizing anomaly detection and positioning, and outputting an interpretable anomaly heat map.
[0079] In the above embodiment, the frequency-space dual-domain adaptive feature filtering module comprises: The FFT gating branch, the Transformer encoder branch and the Score Predictor; the three work together to simultaneously utilize the frequency domain sparsity and the spatial domain global context information to obtain a robust feature representation; The frequency-space dual-domain adaptive feature filtering module respectively filters the shallow fusion feature and the deep fusion feature to obtain the filtered shallow fusion feature and the filtered deep fusion feature .
[0080] In the above embodiment, the frequency-space dual-domain adaptive feature filtering module respectively filters the shallow fusion feature The input feature sequence is processed by the FFT gating branch to obtain the gated frequency domain feature ; In the spatial domain, the Transformer encoder is used to globally model the input feature, and each layer contains a multi-head self-attention mechanism and a feedforward network; The output features of the FFT gating and the Transformer encoder are transmitted to the Score Predictor, the features output by the two branches are fused, and then normalized and input to two layers of multi-layer perceptron (MLP) to generate the weight of each feature. According to the weight, each feature is adaptively amplified or suppressed to obtain the filtered feature.
[0081] In the above embodiment, the filtered shallow fusion feature and the deep fusion feature are respectively input into the Gaussian mixture modeling module Ada-GMM to model the normal feature distribution and generate the distribution prior. The Gaussian mean and the belonging probability are used to provide statistical constraints for subsequent decoding, including: The filtered feature and are regarded as unlabeled normal samples and are respectively modeled by the K-component Gaussian mixture model; The Gaussian mixture modeling module Ada-GMM adaptively clusters and models the normal features to form an interpretable prototype representation and provides explicit statistical prior constraints for the subsequent decoding stage: The Gaussian mean vector , and the posterior probability of each feature belonging to each Gaussian component and .
[0082] In the above embodiment, the Ada-GMM-Guided decoding is performed using the Gaussian mean and the belonging probability as guidance, and a deep-shallow multi-scale feature interaction mechanism is adopted to interactively fuse the corresponding deep semantic features and shallow texture features, including: The multi-scale features of the Vision Transformer encoder are fused to obtain As the input of the decoding stage, a multi-layer Ada-GMM-Guided decoder is adopted, and each layer includes a GMM-Attention module, which injects the statistical prior of the Gaussian mixture distribution into the pixel-level feature representation in the decoding stage; The deep-shallow feature interaction mechanism is as follows: for shallow decoding, the Gaussian mean vector and the posterior probability matrix are obtained using the deep encoding features as statistical priors, so that the decoding can utilize global semantics to reduce noise interference and enhance the stable positioning of large-scale defects; for deep decoding, the Gaussian mean vector and the posterior probability matrix are obtained using the shallow encoding features as statistical priors, introducing high-resolution texture details to improve the detection capability of small defects.
[0083] In the above embodiment, the comprehensive processing result is optimized using cosine reconstruction loss, filtering consistency and entropy regularization loss, and distribution alignment loss, including: The filtering loss is established to constrain the frequency-space feature filtering module, maintain the stability of the filtering output, and promote the gating sparsification; including two parts: maintaining the consistency of the filtering features close to the encoder features and promoting the patch score to tend to 0 or 1, making the gating process sparse and decisive entropy regularization; The distribution loss is established to constrain the reconstruction accuracy and distribution certainty of Ada-GMM; The reconstruction loss is established, which adopts a reconstruction constraint based on cosine similarity, and through multi-scale weighted fusion, the decoder can maintain the stability of the normal area reconstruction while focusing on the abnormal area which is difficult to reconstruct; The filtering loss , the distribution loss and the reconstruction loss are combined to obtain the total loss function ; wherein, is the weight coefficient of the filtering loss, The weight coefficient of the distribution loss.
[0084] In the above embodiment, the trained network weight is used to infer the input ultrasonic C-scan image to realize anomaly detection and positioning, including: For each layer feature, the normal feature representation of the encoder is extracted and the reconstructed feature of the decoder , and the difference between the two is calculated ; if the value is greater than the set threshold, it indicates that there is a strong encoding-decoding feature difference at this position, which may correspond to an abnormal region; According to the difference of each layer feature , a layer-by-layer abnormal response difference map is generated, and the difference map is uniformly adjusted to a fixed output resolution by bilinear interpolation; The interpolated difference maps of each layer are spliced in the channel dimension and averaged to obtain the final abnormal positioning heat map. When the input image has defects, the encoding-decoding feature similarity of the corresponding region is lower than the set value, which is shown as a highlighted region in the heat map.
[0085] The system provided in the embodiment is used to execute the above-mentioned method embodiments, and the specific process and detailed content are referred to the above-mentioned embodiments, which will not be described here.
[0086] In an embodiment of the present application, a computing device is provided, which can be a terminal, and can include a processor, a communications interface, a memory, a display screen and an input device. Wherein, the processor, the communications interface and the memory complete mutual communication through a communication bus. The processor is used to provide computing and control capabilities. The memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program, which is executed by the processor to implement the method in each embodiment. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communications interface is used to communicate with external terminals in a wired or wireless manner. The wireless manner can be achieved through WIFI, management network, NFC (near field communication) or other technologies. The display screen can be a liquid crystal display screen or an electronic ink display screen. The input device can be a touch layer overlaid on the display screen, or a key, trackball or touchpad arranged on the shell of the computing device. It can also be an external keyboard, touchpad or mouse, etc. The processor can call the logical instructions in the memory.
[0087] Moreover, the logic instructions in the storage medium of the above-mentioned embodiments can be implemented in the form of software function units and sold or used as an independent product, which can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application essentially or partially contribute to the prior art, or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.
[0088] In an embodiment of the present application, a computer program product is provided, which includes a computer program stored on a non-transitory computer readable storage medium, and the computer program includes program instructions, which, when executed by a computer, enable the computer to perform the method provided by the above-mentioned method embodiments.
[0089] In an embodiment of the present application, a non-transitory computer readable storage medium is provided, which stores server instructions, and the computer instructions enable a computer to perform the method provided by the above-mentioned embodiments.
[0090] The computer readable storage medium provided by the above-mentioned embodiments has similar implementation principles and technical effects to the above-mentioned method embodiments, and will not be described here.
[0091] The present application is described with reference to flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of the flows and / or blocks in the flowcharts and / or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to produce a machine, so that the instructions executed by the computer or other programmable data processing devices produce a device that implements the functions specified in the flowcharts and / or block diagrams. Figure 1 The device that implements the functions specified in one flow or multiple flows and / or blocks Figure 1 The device that implements the functions specified in one flow or multiple flows and / or blocks
[0092] These computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture including instructions which implement the flow Figure 1 The functions specified in the flow or flows and / or the block Figure 1 The functions specified in the flow or flows and / or the block
[0093] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flow Figure 1 The functions specified in the flow or flows and / or the block Figure 1 The functions specified in the flow or flows and / or the block
[0094] Finally, it should be noted that: the above examples are only to illustrate the technical solutions of the present application, rather than limit it; although the present application has been described in detail with reference to the foregoing examples, those skilled in the art should understand: it can still modify the technical solutions recorded in the foregoing examples, or make equivalent replacement for part of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A defect detection method based on adaptive dual-domain filtering and Gaussian mixture prior constraint, characterized in that, The method comprises the following steps: Obtain an input ultrasonic C-scan image and preprocess it, extract multi-scale features from the pre-trained Vision Transformer network to obtain shallow fusion features, deep fusion features and encoder output features; Input the shallow fusion features and the deep fusion features into a frequency-space dual-domain adaptive feature filtering module respectively, suppress stripe artifacts and system noise in the spatial domain by using a global self-attention mechanism, and weaken periodic spectral energy and enhance defect-related high-frequency components in the frequency domain by using an FFT gating mechanism; Input the filtered shallow fusion features and the deep fusion features into a Gaussian mixture modeling module Ada-GMM respectively, model the normal feature distribution, generate a distribution prior, and use the Gaussian mean and the attribution probability to provide statistical constraints for subsequent decoding; Use the Gaussian mean and the attribution probability as guidance for Ada-GMM-Guided decoding, and use a deep-shallow multi-scale feature interaction mechanism to interact and fuse the corresponding deep semantic features and shallow texture features, thereby improving the representation ability of different scales and different morphological defects; Comprehensively process the results, use cosine reconstruction loss, filtering consistency and entropy regularization loss, and distribution alignment loss for optimization, and realize stable training and high-precision anomaly detection under an unsupervised condition; According to the optimization process, the normal distribution features are adaptively learned, the model is trained, and the model weight is obtained; in the test stage, the trained network weight is used to infer the input ultrasonic C-scan image, realize anomaly detection and positioning, and output an interpretable anomaly heat map.
2. The method of claim 1, wherein the method is based on adaptive dual-domain filtering and a mixture Gaussian prior constraint. The frequency-space dual-domain adaptive feature filtering module comprises: An FFT gating branch, a Transformer encoder branch and a Score Predictor; the three branches work together to utilize the frequency domain sparsity and the spatial domain global context information to obtain a robust feature representation; The frequency-space dual-domain adaptive feature filtering module filters and processes shallow fused features separately. and deep fusion features The corresponding filtered shallow fusion features are obtained. and filtered deep fusion features .
3. The method of claim 2, wherein the method of defect detection based on adaptive dual-domain filtering and Gaussian mixture prior constraint is characterized by, The frequency-space dual-domain adaptive feature filtering module respectively uses the following filtering processing method: The input feature sequence is processed by an FFT gating branch to obtain a gated frequency domain feature ; In the spatial domain, a Transformer encoder is used to globally model the input features, and each layer contains a multi-head self-attention mechanism and a feedforward network; The output features of the FFT gating and the Transformer encoder are transmitted to the Score Predictor, the features output by the two branches are fused, then normalized and input into two layers of multi-layer perceptron MLP to generate the weight of each feature, and each feature is adaptively amplified or suppressed according to the weight, to obtain the filtered feature.
4. The method of claim 1, wherein the method is based on adaptive dual-domain filtering and a mixture Gaussian prior constraint. The filtered shallow fusion features and the deep fusion features are input into a Gaussian mixture modeling module Ada-GMM respectively, the normal feature distribution is modeled, and a distribution prior is generated, and the Gaussian mean and the attribution probability are used to provide statistical constraints for subsequent decoding, including: filtered features and normal samples are considered unlabeled and are modeled by a K-component Gaussian mixture model, respectively; The Gaussian mixture modeling module Ada-GMM adaptively clusters and models the normal features to form an interpretable prototype representation, and provides explicit statistical prior constraints for the subsequent decoding stage: Gaussian mean vector , and the posterior probability that each feature belongs to each Gaussian component and .
5. The method of claim 1, wherein the method is based on adaptive dual-domain filtering and a mixture Gaussian prior constraint. Ada-GMM-Guided decoding is performed using Gaussian mean and membership probability as guidance, and a deep-shallow multi-scale feature interaction mechanism is adopted to interactively fuse corresponding deep semantic features and shallow texture features, including: The multi-scale features of the Vision Transformer encoder are fused to obtain As the input of the decoding stage, a multi-layer Ada-GMM-Guided decoder is adopted, and each layer contains a GMM-Attention module, which injects the statistical prior of the Gaussian mixture distribution into the pixel-level feature representation in the decoding stage. The deep and shallow feature interaction mechanism is: for shallow decoding, using the Gaussian mean vector obtained by deep encoding features and posterior probability matrix As a statistical prior, it enables decoding to reduce noise interference and enhance the stable positioning of large-scale defects using global semantics; for deep decoding, using the Gaussian mean vector obtained by shallow encoding features and posterior probability matrix As a statistical prior, it introduces high-resolution texture details to improve the detection capability of small defects.
6. The method of claim 1, wherein the method is based on adaptive dual-domain filtering and a mixture Gaussian prior constraint. The comprehensive processing result is optimized using cosine reconstruction loss, filtering consistency and entropy regularization loss, and distribution alignment loss, including: Establishing filter loss , for constraining the frequency-space feature filtering module, keeping the stability of the filter output and pushing the gating sparsification; including two parts: keeping the consistency constraint of the filter feature close to the encoder feature and pushing the patch score to tend to 0 or 1, making the gating process sparse and decisive entropy regularization; establishing a distribution loss for constraining the reconstruction accuracy and distribution determinacy of the Ada-GMM; Establishing reconstruction loss With the cosine similarity-based reconstruction constraint, the decoder can focus on the abnormal regions that are difficult to reconstruct while maintaining the stability of normal region reconstruction through multi-scale weighted fusion. combining a filtering loss , a distribution loss and a reconstruction loss to obtain a total loss function ; wherein, is a weight coefficient of the filtering loss, is a weight coefficient of the distribution loss.
7. The defect detection method based on adaptive dual-domain filtering and Gaussian mixture prior constraints as described in claim 1, characterized in that, The trained network weight is used to infer the input ultrasonic C-scan image to realize anomaly detection and positioning, including: For each layer of features, extract the normal feature representation of the encoder. Reconstruction features of the decoder (in Representing the (layers), and calculate the degree of difference between them. ;like If the value is greater than the set threshold, it indicates that there is a strong difference in encoding-decoding characteristics at that location, which may correspond to an abnormal region. According to the difference degree of each layer feature A layer-by-layer abnormal response difference map is generated, and the difference map is uniformly adjusted to a fixed output resolution by bilinear interpolation. The difference maps of each layer after interpolation are spliced and averaged in the channel dimension to obtain the final anomaly positioning heat map. When the input image has defects, the encoding-decoding feature similarity of the corresponding region is lower than the set value, which is represented as a highlighted region in the heat map.
8. A defect detection system based on adaptive dual-domain filtering with Gaussian mixture prior constraint, characterized in that, including: A multi-scale feature extraction module acquires and pre-processes the input ultrasonic C-scan image, and extracts multi-scale features from the image using a pre-trained VisionTransformer network to obtain shallow fusion features, deep fusion features, and encoder output features; A dual-domain adaptive feature filtering module inputs the shallow fusion features and the deep fusion features into a frequency-spatial dual-domain adaptive feature filtering module, which uses a global self-attention mechanism in the spatial domain to suppress stripe artifacts and system noise, and uses an FFT gating mechanism in the frequency domain to weaken periodic spectral energy and enhance defect-related high-frequency components; A feature distribution modeling module inputs the filtered shallow fusion features and deep fusion features into a Gaussian mixture modeling module Ada-GMM to model the normal feature distribution and generate a distribution prior, which provides statistical constraints for subsequent decoding using Gaussian mean and membership probability; A deep-shallow multi-scale feature interaction mechanism module uses Gaussian mean and membership probability as guidance for Ada-GMM-Guided decoding, and adopts a deep-shallow multi-scale feature interaction mechanism to interactively fuse corresponding deep semantic features and shallow texture features, improving the representation ability of different scales and different morphological defects; A loss function determination module uses cosine reconstruction loss, filtering consistency and entropy regularization loss, and distribution alignment loss to optimize the comprehensive processing result, realizing stable training and high-precision anomaly detection under unsupervised conditions; An anomaly detection and positioning module adaptively learns normal distribution features during the optimization process, trains the model, obtains the model weight, and uses the trained network weight to infer the input ultrasonic C-scan image to realize anomaly detection and positioning, and outputs an interpretable anomaly heat map.
9. A computer-readable storage medium storing one or more programs, the one or more programs comprising instructions that when executed by a computer cause the computer to perform a method of any of claims 1-8. The one or more programs include instructions that, when executed by a computing device, cause the computing device to perform any of the methods of claims 1-7.
10. A computing device, comprising: including: One or more processors, memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs including instructions for performing any of the methods of claims 1-7.
Citation Information
Cited By
Intelligent ionogram judgment method and system based on non-convex regularization model
CN121904556A
Ionogram intelligent judgment method and system based on non-convex regularization model
CN121904556B