Industrial Defect Visual Inspection Method and System for Decoupling Defect Features and Imaging Conditions

By decoupling the causal decoupling network model between defect features and imaging conditions, the problem of insufficient generalization ability of industrial defect visual detection models under varying imaging conditions is solved, enabling rapid, low-cost migration and efficient detection under different working conditions.

CN121544611BActive Publication Date: 2026-04-03SHANGHAI UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-01-19
Publication Date
2026-04-03

AI Technical Summary

Technical Problem

Existing industrial defect visual detection models suffer from insufficient generalization ability due to changes in imaging conditions, high cost of cross-condition migration, and difficulty in effectively detecting product defects in new scenarios.

Method used

By decoupling defect features from imaging conditions, a region-guided causal decoupling network model is constructed. Multi-supervised loss training is used to separate the inherent features of defects from imaging features. Furthermore, a causal intervention mechanism is introduced to learn defect representations that are independent of imaging conditions.

Benefits of technology

It significantly improves the detection accuracy and robustness of the model in complex environments, enables rapid and low-cost adaptation across different working conditions, and reduces the dependence on the amount of data and annotation costs for new working conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121544611B_ABST
    Figure CN121544611B_ABST
Patent Text Reader

Abstract

This invention belongs to the field of industrial manufacturing technology, specifically providing a method and system for visual detection of industrial defects by decoupling defect features from imaging conditions. The method includes: collecting defect samples of industrial products under different operating conditions; wherein the defect samples include defect images and corresponding defect annotations; based on the defect samples, constructing a region-guided causal decoupling network model by combining a feature decoupling mechanism guided by defect regions and a causal invariance learning mechanism based on imaging simulation; performing multi-supervised loss joint optimization training on the causal decoupling network model to obtain a converged causal decoupling network model; and detecting defects in industrial products under target operating conditions based on the converged causal decoupling network model to obtain defect detection results. This invention can significantly improve the generalization and robustness of defect detection algorithms in complex industrial environments, enabling rapid and low-cost model transfer between different operating conditions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of industrial manufacturing technology, specifically relating to an industrial defect visual inspection method and system that decouples defect features from imaging conditions. Background Technology

[0002] In industrial manufacturing, manufacturers typically rely on visual features to detect, locate, and analyze product defects, serving as the basis for subsequent defect repair and process optimization. Existing defect detection methods heavily depend on training models using defect data collected under specific working conditions. While these models perform well in their original environments, their ability to generalize across different working conditions is significantly insufficient. This is primarily because the features learned by visual inspection models are a hybrid representation of the inherent geometric texture of the defect and external imaging conditions (such as lighting and environmental vibrations). The model cannot effectively distinguish between inherent attributes of the defect itself and external interference introduced by imaging conditions; therefore, it uses all features indiscriminately for learning. For example, minute scratches on a workpiece surface are difficult to detect in low light conditions, and critical details are lost due to overexposure under strong light. This oversensitivity to imaging conditions causes the model to deteriorate rapidly in new scenarios. Current solutions to this problem often require extensive data re-labeling and model retraining under new working conditions, which is costly and inefficient. Therefore, there is an urgent need in this field for a new method that can decouple the inherent features of defects from the interference of imaging conditions. When the operating conditions change, the inherent features can be frozen to retain the core knowledge, and the features related to imaging conditions can be quickly adapted to achieve rapid and robust model transfer. Summary of the Invention

[0003] To address the problems of insufficient generalization ability and high cost of cross-condition migration in existing industrial defect visual detection models due to changes in imaging conditions, this invention proposes an industrial defect visual detection method and system that decouples defect features from imaging conditions. The aim is to decompose the visual features in defect images into inherent features related to the essence of the product defect and external features related to imaging conditions. By learning defect representations independent of imaging conditions, the robustness of the model in variable industrial environments is improved, ultimately achieving rapid and low-cost adaptation across different operating conditions.

[0004] To achieve the above objectives, the present invention provides the following solution:

[0005] Industrial defect visual inspection methods that decouple defect features from imaging conditions include:

[0006] Collect defect samples of industrial products under different working conditions; wherein, the defect samples include defect images and corresponding defect annotations;

[0007] Based on the defect samples, a region-guided causal decoupling network model is constructed by combining a feature decoupling mechanism guided by the defect region and a causal invariance learning mechanism based on imaging simulation.

[0008] The causal decoupling network model is jointly optimized and trained using multi-supervised loss to obtain a converged causal decoupling network model.

[0009] Based on a convergent causal decoupling network model, defects in industrial products under target operating conditions are detected, and defect detection results are obtained.

[0010] Preferably, the structure of the causal decoupling network model includes:

[0011] The feature decoupling layer is used to extract the inherent features and imaging features of the defect sample, and to perform feature stitching to obtain stitched features;

[0012] The decoder contains three stacked deconvolutional layers (deconv-bn-relu) to reconstruct the original image of the defective sample based on the stitched features, thereby obtaining the reconstructed image.

[0013] The defect detection head contains two parallel fully connected layers for obtaining defect detection results based on the inherent features.

[0014] The causal intervention training layer is used to obtain simulated imaging features based on the extracted low-frequency features of the defect image, and combine the inherent features to complete the causal intervention training of the causal decoupling network model.

[0015] Preferably, the feature decoupling layer includes:

[0016] A shared feature encoder, employing a pre-trained ResNet50 model, is used to extract shared features from the defect samples.

[0017] The region prediction module contains three stacked conv-bn-relu convolutional layers, which are used to generate a defect region attention map with the same spatial resolution as the defect sample based on the shared features through end-to-end learning.

[0018] An intrinsic feature extractor is used to spatially weight the attention map of the defect region and, in combination with the shared features, extract intrinsic features that are essentially related to the geometric shape of the defect.

[0019] An imaging feature extractor is used to obtain a reverse attention map based on the attention map of the defect region, and to extract imaging features related to external factors by combining the shared features.

[0020] Preferably, the causal intervention training layer includes:

[0021] An imaging condition simulator, with a conditional U-Net as its core architecture, is used to obtain simulated imaging features by combining the low-frequency features of the defect image with a random noise vector.

[0022] The feature stitching layer is used to stitch together the simulated imaging features and the inherent features to train the causal intervention on the causal decoupling network model.

[0023] Preferably, the method for joint optimization training of the causal decoupling network model using multi-supervised loss includes:

[0024] Based on the shared features, defect region attention map, inherent features, imaging features, simulated imaging features, reconstructed image, and defect detection results output by the causal decoupling network model, a multi-supervised loss is calculated; wherein, the multi-supervised loss includes defect detection loss, feature decoupling orthogonal loss, image reconstruction loss, region clustering loss, and causal intervention loss;

[0025] Based on the multi-supervised loss, a total loss function is constructed, and the parameters of the causal decoupling network model are updated using the gradient descent algorithm to complete the joint optimization training of the multi-supervised loss.

[0026] This invention also provides an industrial defect visual inspection system that decouples defect features from imaging conditions, for implementing the method, comprising:

[0027] The sample acquisition module is used to collect defect samples of industrial products under different working conditions; wherein, the defect sample includes a defect image and a corresponding defect annotation;

[0028] The model building module is used to construct a region-guided causal decoupling network model based on the defect samples, by combining a feature decoupling mechanism guided by the defect region and a causal invariance learning mechanism based on imaging simulation.

[0029] The model optimization module is used to perform joint optimization training of the causal decoupling network model with multi-supervised loss to obtain a converged causal decoupling network model.

[0030] The defect detection module is used to detect defects in industrial products under target operating conditions based on a convergent causal decoupling network model and obtain defect detection results.

[0031] Preferably, in the model building module, the structure of the causal decoupling network model includes:

[0032] The feature decoupling layer is used to extract the inherent features and imaging features of the defect sample, and to perform feature stitching to obtain stitched features;

[0033] The decoder contains three stacked deconvolutional layers (deconv-bn-relu) to reconstruct the original image of the defective sample based on the stitched features, thereby obtaining the reconstructed image.

[0034] The defect detection head contains two parallel fully connected layers for obtaining defect detection results based on the inherent features.

[0035] The causal intervention training layer is used to obtain simulated imaging features based on the extracted low-frequency features of the defect image, and combine the inherent features to complete the causal intervention training of the causal decoupling network model.

[0036] Preferably, the model optimization module includes:

[0037] The loss calculation unit is used to calculate multi-supervised loss based on the shared features, defect region attention map, inherent features, imaging features, simulated imaging features, reconstructed image, and defect detection results output by the causal decoupling network model; wherein, the multi-supervised loss includes defect detection loss, feature decoupling orthogonal loss, image reconstruction loss, region clustering loss, and causal intervention loss;

[0038] The joint optimization unit is used to construct a total loss function based on the multi-supervised loss, update the parameters of the causal decoupling network model through the gradient descent algorithm, and complete the joint optimization training of the multi-supervised loss.

[0039] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0040] 1. Accurate and robust characterization of the essence of defects is achieved through feature decoupling. This invention explicitly decouples defect features into inherent features and imaging features, and uses defect region attention for spatial guidance, enabling the model to eliminate background interference and focus on the essential geometry and texture deformation of the defect region. This significantly improves the detection accuracy of subtle defects and its robustness in complex imaging environments.

[0041] 2. Based on the feature decoupling framework, a causal intervention mechanism is introduced, which forces the model to learn the true invariant defect essence to imaging changes from the inherent features after decoupling. This effectively overcomes the dependence on the false correlation between "defect-imaging conditions" in the training data, thus demonstrating excellent generalization ability when transferring across working conditions.

[0042] 3. The decoupled model architecture constructed in this invention provides a structural advantage for achieving rapid migration. During cross-condition adaptation, thanks to the pre-decoupling of features, the inherent feature extraction network can be fixed to retain core knowledge, while only lightweight imaging-related modules are fine-tuned. This allows for efficient and rapid deployment of the model under new conditions with extremely low data annotation and computational costs. Attached Figure Description

[0043] To more clearly illustrate the technical solution of the present invention, the drawings used in the embodiments are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0044] Figure 1 This is a framework diagram of an industrial defect visual inspection method for decoupling defect features and imaging conditions according to an embodiment of the present invention;

[0045] Figure 2 This is a structural diagram of the causal decoupling network model according to an embodiment of the present invention;

[0046] Figure 3 This is a flowchart of an industrial defect visual inspection method for decoupling defect features and imaging conditions according to an embodiment of the present invention. Detailed Implementation

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

[0048] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0049] Example 1:

[0050] like Figure 1 , Figure 3 As shown, an industrial defect visual inspection method that decouples defect features from imaging conditions includes:

[0051] S1: Collect defect samples of industrial products under different operating conditions; the defect samples include defect images and corresponding defect annotations. Specifically, from existing... The system systematically collects labeled data containing various product defects under different operating conditions. Each defect sample includes an image. and corresponding defect labels (Category labels and bounding box annotations). The collected raw defect samples underwent standardized preprocessing, including image size unification and numerical normalization. The training dataset is constructed by applying data augmentation techniques, including random flipping, brightness and contrast jitter, and noise addition, to obtain augmented training datasets. N represents the total number of training samples, and i represents the current training sample.

[0052] S2: Based on defect samples, a region-guided causal decoupling network model is constructed by combining a feature decoupling mechanism guided by defect regions and a causal invariance learning mechanism based on imaging simulation. For example... Figure 2 As shown. A further implementation involves a causal decoupling network model structure comprising:

[0053] A feature decoupling layer is used to extract the inherent features and imaging features of defect samples, and to perform feature stitching to obtain stitched features; a further implementation method is that the feature decoupling layer includes:

[0054] Shared feature encoder A ResNet50 model pre-trained on the ImageNet dataset is used to extract shared features from defect samples. .

[0055] Regional prediction module It contains three stacked conv-bn-relu convolutional layers for use based on shared features. Through end-to-end learning, a defect region attention map with the same spatial resolution as the defect samples is generated. ; each of the elements Indicates the position of the corresponding pixel The probability of belonging to a defect region. This defect region attention map explicitly identifies the likelihood of a defect at each location in the image in the form of probability values, thus providing clear spatial guidance for subsequent feature decoupling. Based on this attention-guided mechanism, the feature decoupling process achieves a transformation from coarse-grained global separation to refined region focusing.

[0056] Intrinsic Feature Extractor It shares the same architecture as the region prediction module m, and is used to spatially weight the attention map of the defect region, i.e. Combined with shared features Extracting inherent features that are essential to the geometric shape of defects. Specifically, the intrinsic feature extractor The input features are weighted in the A-space to limit their actual receptive field to... Within the defined high-probability defect region, this design forces the intrinsic feature extractor to accurately capture those intrinsic features that are truly related to the essence of the defect geometry. .

[0057] Imaging Feature Extractor and intrinsic feature extractor Same architecture, used for defect region attention map Obtain the reverse attention map, and use the weighted features of the reverse attention map, i.e. and combined with shared features Extracting imaging features related to external factors Specifically, imaging feature extractor The input is back attention graph Modulated, guided Avoiding potentially defective areas, the focus is on extracting imaging features related to external factors such as lighting conditions and camera characteristics from the intact background areas of the product. This spatial guidance mechanism effectively prevents subtle defect features from being submerged in a large amount of background information during feature decoupling, while also avoiding contamination of the essential information of defects by the imaging feature extractor.

[0058] decoder It contains three stacked deconvolutional layers of deconv-bn-relu for use based on concatenated features. Reconstruct the original image of the defective sample to obtain the reconstructed image. .

[0059] Defect detection head It contains two parallel fully connected layers for using inherent features. Obtain defect detection results = (Category labels and bounding box annotations).

[0060] A causal intervention training layer is used to obtain simulated imaging features based on extracted low-frequency features of defect images, and combine them with inherent features to complete the causal intervention training of the causal decoupling network model. To overcome the model's dependence on spurious correlations between "defect features and imaging conditions" in defect data, this invention introduces an imaging condition simulator. Training with causal interventions to learn the true characteristics of causal invariance.

[0061] A further implementation method is that the causal intervention training layer includes:

[0062] Imaging Condition Simulator It uses a conditional U-Net as its core architecture to combine low-frequency features of defective images with random noise vectors. Where 0 represents a mean of 0, and I represents the unit covariance matrix, the simulated imaging features are obtained; specifically, random sampling is performed from the standard normal distribution, and low-frequency features of the current batch of defect samples are extracted as conditions. By injecting conditions at the skip connections of the decoder This enables the output of diverse simulated imaging features independent of the input defect image. , ,… .

[0063] The feature stitching layer is used to stitch together simulated imaging features and intrinsic features to train the causal decoupling network model for causal intervention. Specifically, during model training, for each batch of data, the extracted true intrinsic features are... Multiple sets generated by the simulator By combining these elements, a series of post-intervention features can be formed. ..., loss through causal intervention The supervised model's output for all these feature combinations is compared with that using only The output remains consistent, thereby enhancing the extraction of imaging condition-independent features.

[0064] This mechanism, by actively intervening in imaging conditions and requiring predictions to remain unchanged, theoretically cuts off the path for imaging conditions to influence model decisions as confounding factors, forcing the model to base its judgments entirely on the pure, inherent characteristics of the defects. superior.

[0065] This embodiment uses Initialize or load pre-trained weights to initialize the parameters of the above modules.

[0066] S3: Perform multi-supervised loss joint optimization training on the causal decoupling network model to obtain a converged causal decoupling network model.

[0067] A further implementation method involves performing joint optimization training of the causal decoupling network model using multi-supervised loss, including:

[0068] Shared features based on the output of the causal decoupling network model Defect area attention map Inherent characteristics Imaging features Simulated imaging features , Reconstructing images and defect detection results Calculate the multi-supervised loss; where the multi-supervised loss includes the defect detection loss. Feature decoupling orthogonal loss Image reconstruction loss Regional clustering losses and causal intervention loss ;

[0069] Based on multi-supervised loss, a total loss function is constructed, and the parameters of the causal decoupling network model are updated through the gradient descent algorithm to complete the joint optimization training of multi-supervised loss.

[0070] Specifically, defect detection loss The inherent characteristics of supervision It can accurately identify and locate defects, among which These represent the predicted and actual defect coordinates, respectively. The tags are as follows:

[0071] ;

[0072] In the formula, Represents the smoothing of absolute error loss. This represents the cross-entropy loss.

[0073] Feature decoupling orthogonal loss Forced inherent features With imaging features Mutually orthogonal to achieve separation in feature space: F represents the norm. This represents the sum of squares of all elements.

[0074] Image reconstruction loss To ensure the inherent characteristics after decoupling With imaging features After coupling, the complete original image can be reconstructed: , It represents the sum of the absolute values ​​of all elements.

[0075] Regional focus loss Constraining inherent characteristics Strongly correlated with defect regions, imaging features Weakly correlated with defective regions, among which Cosine similarity:

[0076] .

[0077] Causal intervention loss Using an imaging condition simulator Generate diverse simulated imaging features , etc., and the inherent characteristics of reality By combining the KL divergence constraint model to ensure consistent predictions of intrinsic features and combinations of multiple simulated imaging features, the model is forced to learn defect features independent of imaging conditions.

[0078] .

[0079] In the formula, o represents the index of the current simulated imaging feature.

[0080] Combining the above losses, we obtain the total loss function for model training. :

[0081] ,

[0082] In the formula, The weighting coefficients represent the feature decoupling orthogonal loss during the model training phase. , and These represent the weighted coefficients for image reconstruction loss, region focusing loss, and causal intervention loss, respectively.

[0083] Update the parameters of all modules using the gradient descent algorithm. .

[0084] Repeat the above steps until the model's performance on the validation set converges.

[0085] S4: Based on a convergent causal decoupling network model, detect industrial product defects under the target working condition (i.e., the new working condition) and obtain defect detection results.

[0086] To achieve rapid, low-cost, and highly robust transfer of the trained model to new operating conditions, this invention designs an imaging condition-selective adaptation mechanism. Specifically, the converged causal decoupled network model is deployed to the target operating environment. The shared encoder is frozen. Regional prediction module Intrinsic Feature Extractor Imaging Condition Simulator decoder The parameters. These modules carry general defect knowledge and causal invariance, maintaining stability. A small amount of data is collected on the target operating condition. ,generally The labeled samples constitute the adaptation dataset. .

[0087] Fine-tuning the imaging-related feature extractor and defect detection head The parameters, using Calculate defect detection loss Feature decoupling orthogonal loss and reconstruction loss Using a small sample of the target operating conditions, and It rapidly adapts to the target working condition, enabling it to quickly learn and adapt to the imaging conditions specific to that condition, thereby extracting the inherent characteristics of defects under the current working condition to achieve cross-condition adaptation.

[0088] .

[0089] In the formula, and This represents the weighting coefficient of the feature decoupling orthogonal loss and the reconstruction loss during the cross-condition adaptation stage. This represents traversing the entire adaptation dataset. Optimization yields the best and The parameters.

[0090] Evaluate the performance of the fine-tuned model on a hold-out validation set of the adaptation dataset. If the performance meets the target, the adaptation is complete; otherwise, perform more rounds of fine-tuning.

[0091] After model training or adaptation is complete, online defect detection is performed. For new input images... Only the forward propagation path needs to be run: → The final defect detection result can then be obtained. The imaging-related branches and decoder do not participate in the calculation during the inference stage, ensuring high efficiency.

[0092] This mechanism enables stable and efficient cross-condition migration, which can retain the defect detection capability of the defect detector under existing conditions, and significantly reduce the dependence on the amount of data and annotation costs of new conditions.

[0093] In summary, this invention proposes an industrial defect visual detection method and system that decouples defect features from imaging conditions, solving the problems of poor cross-condition transferability and high deployment costs of defect detection models due to variable imaging conditions. Through feature decomposition modeling, the visual features of defect images are decoupled into two independent factors: one is the inherent geometric and texture deformation determined by the product's own defects, and the other is the observational changes caused by imaging conditions such as illumination and temperature. Based on this model, a defect essence representation network capable of learning independently of imaging conditions is constructed. Imaging interference is removed through specific constraint mechanisms, ensuring that the learned features are highly correlated with the defects and remain robust under different imaging conditions. Finally, when migrating the model to new production lines and equipment, this decoupling structure enables rapid cross-condition adaptation: the network extracting inherent defect features is fixed, and only the model components related to imaging conditions are lightly fine-tuned. This invention significantly improves the generalization and robustness of defect detection algorithms in complex industrial environments, enabling rapid and low-cost model migration across different operating conditions.

[0094] Example 2:

[0095] This invention also provides an industrial defect visual inspection system that decouples defect features from imaging conditions, for implementing the method of embodiment one, comprising:

[0096] The sample acquisition module is used to collect defect samples of industrial products under different working conditions; the defect samples include defect images and corresponding defect annotations.

[0097] The model building module is used to construct a region-guided causal decoupling network model based on defect samples, in conjunction with a feature decoupling mechanism guided by defect regions and a causal invariance learning mechanism based on imaging simulation.

[0098] The model optimization module is used to perform joint optimization training of the causal decoupling network model with multi-supervised loss to obtain a converged causal decoupling network model.

[0099] The defect detection module is used to detect defects in industrial products under target operating conditions based on a convergent causal decoupling network model and obtain defect detection results.

[0100] A further implementation method involves the following: In the model building module, the structure of the causal decoupling network model includes:

[0101] The feature decoupling layer is used to extract the inherent features and imaging features of defect samples, and then perform feature stitching to obtain stitched features.

[0102] The decoder contains three stacked deconvolutional layers (deconv-bn-relu) to reconstruct the original image of the defective sample based on the spliced ​​features, thus obtaining the reconstructed image.

[0103] The defect detection head contains two parallel fully connected layers for obtaining defect detection results based on inherent features.

[0104] The causal intervention training layer is used to obtain simulated imaging features based on the extracted low-frequency features of the defect image, and combine them with the inherent features to complete the causal intervention training of the causal decoupling network model.

[0105] A further implementation method includes a model optimization module comprising:

[0106] The loss calculation unit is used to calculate multi-supervised loss based on the shared features, defect region attention map, inherent features, imaging features, simulated imaging features, reconstructed image, and defect detection results output by the causal decoupling network model. The multi-supervised loss includes defect detection loss, feature decoupling orthogonal loss, image reconstruction loss, region clustering loss, and causal intervention loss.

[0107] The joint optimization unit is used to construct the total loss function based on multi-supervised loss, update the parameters of the causal decoupled network model through the gradient descent algorithm, and complete the joint optimization training of multi-supervised loss.

[0108] The embodiments described above are merely preferred embodiments of the present invention and are not intended to limit the scope of the present invention. Various modifications and improvements made to the technical solutions of the present invention by those skilled in the art without departing from the spirit of the present invention should fall within the protection scope defined by the claims of the present invention.

Claims

1. An industrial defect visual inspection method that decouples defect features from imaging conditions, characterized in that, include: Collect defect samples of industrial products under different working conditions; wherein, the defect samples include defect images and corresponding defect annotations; Based on the defect samples, a region-guided causal decoupling network model is constructed by combining a feature decoupling mechanism guided by the defect region and a causal invariance learning mechanism based on imaging simulation. The causal decoupling network model is jointly optimized and trained using multi-supervised loss to obtain a converged causal decoupling network model. Based on a convergent causal decoupling network model, defects in industrial products under target operating conditions are detected, and defect detection results are obtained. The structure of the causal decoupling network model includes: The feature decoupling layer is used to extract the inherent features and imaging features of the defect sample, and to perform feature stitching to obtain stitched features; Decoder, containing 3 deconv-bn-relu Stacked deconvolutional layers are used to reconstruct the original image of the defective sample based on the stitched features, thereby obtaining a reconstructed image; The defect detection head contains two parallel fully connected layers for obtaining defect detection results based on the inherent features. The causal intervention training layer is used to obtain simulated imaging features based on the extracted low-frequency features of the defect image, and combine the inherent features to complete the causal intervention training of the causal decoupling network model. The feature decoupling layer includes: A shared feature encoder, employing a pre-trained ResNet50 model, is used to extract shared features from the defect samples. The regional prediction module contains 3 conv-bn-relu Stacked convolutional layers are used to generate a defect region attention map with the same spatial resolution as the defect samples through end-to-end learning based on the shared features. An intrinsic feature extractor is used to spatially weight the attention map of the defect region and, in combination with the shared features, extract intrinsic features that are essentially related to the geometric shape of the defect. An imaging feature extractor is used to obtain a reverse attention map based on the defect region attention map, and to extract imaging features related to external factors by combining the shared features. The causal intervention training layer includes: Imaging condition simulator, in conditional U-Net The core architecture is used to obtain simulated imaging features by combining the low-frequency features of the defect image with a random noise vector. The feature stitching layer is used to stitch together the simulated imaging features and the inherent features to train the causal intervention network model for causal decoupling. The method for joint optimization training of the causal decoupling network model using multi-supervised loss includes: Based on the shared features, defect region attention map, inherent features, imaging features, simulated imaging features, reconstructed image, and defect detection results output by the causal decoupling network model, a multi-supervised loss is calculated; wherein, the multi-supervised loss includes defect detection loss, feature decoupling orthogonal loss, image reconstruction loss, region clustering loss, and causal intervention loss; Based on the multi-supervised loss, a total loss function is constructed, and the parameters of the causal decoupling network model are updated using the gradient descent algorithm to complete the joint optimization training of the multi-supervised loss.

2. An industrial defect visual inspection system that decouples defect features from imaging conditions, used to implement the method described in claim 1, characterized in that, include: The sample acquisition module is used to collect defect samples of industrial products under different working conditions; wherein, the defect sample includes a defect image and a corresponding defect annotation; The model building module is used to construct a region-guided causal decoupling network model based on the defect samples, by combining a feature decoupling mechanism guided by the defect region and a causal invariance learning mechanism based on imaging simulation. The model optimization module is used to perform joint optimization training of the causal decoupling network model with multi-supervised loss to obtain a converged causal decoupling network model. The defect detection module is used to detect defects in industrial products under target operating conditions based on a convergent causal decoupling network model and obtain defect detection results.

3. The system according to claim 2, characterized in that, The structure of the causal decoupling network model in the model building module includes: The feature decoupling layer is used to extract the inherent features and imaging features of the defect sample, and to perform feature stitching to obtain stitched features; Decoder, containing 3 deconv-bn-relu Stacked deconvolutional layers are used to reconstruct the original image of the defective sample based on the stitched features, thereby obtaining a reconstructed image; The defect detection head contains two parallel fully connected layers for obtaining defect detection results based on the inherent features. The causal intervention training layer is used to obtain simulated imaging features based on the extracted low-frequency features of the defect image, and combine the inherent features to complete the causal intervention training of the causal decoupling network model.

4. The system according to claim 2, characterized in that, The model optimization module includes: The loss calculation unit is used to calculate multi-supervised loss based on the shared features, defect region attention map, inherent features, imaging features, simulated imaging features, reconstructed image, and defect detection results output by the causal decoupling network model; wherein, the multi-supervised loss includes defect detection loss, feature decoupling orthogonal loss, image reconstruction loss, region clustering loss, and causal intervention loss; The joint optimization unit is used to construct a total loss function based on the multi-supervised loss, update the parameters of the causal decoupling network model through the gradient descent algorithm, and complete the joint optimization training of the multi-supervised loss.

Citation Information

Patent Citations

  • Small sample image defect target detection method based on self-supervised pre-training

    CN116994047A

  • Progressive industrial product surface defect detection method based on decoupling characterization

    CN120070401A