An anti-blurring double-flow surface defect detection method and device for industrial vision
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- NANJING UNIV OF SCI & TECH
- Filing Date
- 2026-04-22
- Publication Date
- 2026-06-26
Smart Images

Figure CN122289244A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of image processing and computer vision, specifically to an anti-blurring dual-flow surface defect detection method for industrial vision, belonging to the field of intelligent manufacturing and industrial vision inspection technology. This method significantly improves the accuracy and robustness of surface defect detection for metal parts by performing anti-blurring processing on blurred images acquired under high-speed motion. Background Technology
[0002] With the rapid development of intelligent manufacturing and industrial vision inspection technologies, surface defect detection systems for metal parts are widely used in industries such as automotive manufacturing, aerospace, rail transportation, and precision machining. Traditional defect detection methods rely on high-resolution, well-focused image input to extract and classify defect areas. However, in industrial environments such as high-speed production lines, due to factors such as high conveyor belt speeds, severe equipment vibrations, and unstable lighting conditions, the acquired images of metal parts often suffer from motion blur, defocusing, or noise superposition, severely reducing the accuracy of defect localization and identification.
[0003] Existing surface defect detection methods, such as those based on deep learning algorithms like CNN and YOLO, have limited resistance to interference from blurred images, making it difficult to meet the application requirements of real-time and accurate detection in high-speed production line environments. Especially under complex working conditions such as high temperature, dust, oil stains, or strong reflections, image quality deteriorates further, making it difficult to reliably identify minute defects such as micro-cracks, dents, and scratches.
[0004] Therefore, there is an urgent need for a method that can effectively resist the effects of motion blur and image defocusing, significantly improve the image clarity and detection accuracy of surface defects in metal parts, adapt to the high-speed production needs of complex industrial environments, and further improve the overall detection performance and production efficiency of intelligent manufacturing systems. Summary of the Invention
[0005] To address the shortcomings of existing technologies, this invention provides an anti-fuzzy dual-flow surface defect detection method and apparatus for industrial vision, overcoming the deficiencies of existing technologies.
[0006] To achieve the above objectives, the present invention provides the following technical solution:
[0007] An anti-fuzzy dual-flow surface defect detection method for industrial vision includes the following steps:
[0008] S1. Acquire images of the surface of low-quality metal parts under high-speed vibration or conveyor belt conditions;
[0009] S2. Input the surface image of the low-quality metal part into a pre-constructed end-to-end anti-blurring dual-stream feature enhancement network; the anti-blurring dual-stream feature enhancement network includes an adversarial detail recovery subnetwork and an inter-layer feature reshaping subnetwork that share the same backbone feature extraction network and are set in parallel; the backbone feature extraction network includes a multi-scale guidance module, which includes, in sequence, a residual dense connection unit, a spatial attention unit, a channel attention unit, and a multi-scale feature fusion unit that captures defect features at different scales by setting multiple parallel convolutional branches with different receptive fields;
[0010] S3. The image is processed by the adversarial detail recovery sub-network to restore the high-frequency detail loss in the image and output the restored high-frequency detail image; simultaneously, the image is processed by the inter-layer feature reshaping sub-network to output a pixel-level segmentation image of the small defects on the metal surface; wherein, the features reconstructed and enhanced by the adversarial detail recovery sub-network are used to improve the segmentation accuracy of the inter-layer feature reshaping sub-network, and the segmentation result of the inter-layer feature reshaping sub-network is used to guide the adversarial detail recovery sub-network to focus on the defect-related region;
[0011] S4. Based on the defect region location information in the pixel-level segmented image, extract the corresponding defect region image block from the high-frequency detail image;
[0012] S5. Input the image block of the defect area into the defect recognition subnet and output the defect classification and recognition result.
[0013] Preferably, the anti-blurring dual-stream feature enhancement network is an end-to-end multi-task learning network; the adversarial detail recovery subnetwork and the inter-layer feature reshaping subnetwork share the same backbone feature extraction network, and jointly optimize the defect segmentation and detail reconstruction tasks through a collaborative learning mechanism (i.e., an end-to-end training method that shares the backbone network and jointly optimizes the segmentation loss and reconstruction loss); wherein, the adversarial detail recovery subnetwork is used to restore high-frequency detail loss in the image, and the inter-layer feature reshaping subnetwork is used to perform pixel-level segmentation of small defect regions; the feature enhancement of detail reconstruction is used to improve segmentation accuracy, and the segmentation result is used to guide the reconstruction subnetwork to focus on defect-related regions.
[0014] Preferably, the adversarial detail recovery subnet adopts a generative adversarial network architecture, including a detail reconstruction network as a generator and an adversarial network as a discriminator;
[0015] The encoder of the detail reconstruction network includes multiple feature enhancement guidance modules for performing convolutional downsampling and feature extraction on the input image; and concatenating and fusing the extracted feature maps at multiple scales with the input image, and then upsampling and amplifying the fused feature maps to generate high-frequency detail restoration images;
[0016] The discriminator is used to distinguish between the image generated by the detail reconstruction network and the real high-quality image. Through adversarial training between the generator and the discriminator, the detail reconstruction network learns to transform low-quality blurred images into high-quality deblurred images.
[0017] Preferably, the inter-layer feature reshaping subnetwork adopts an encoder-decoder structure, and fuses the high-frequency texture features recovered by the adversarial detail recovery subnetwork with the multi-scale semantic features extracted by itself through cross-layer skip connections to perform pixel-level defect segmentation; the inter-layer feature reshaping subnetwork is trained by minimizing the pixel-level cross-entropy loss function.
[0018] Preferably, a multi-scale guidance module is introduced into the adversarial detail recovery subnetwork and the inter-layer feature reshaping subnetwork;
[0019] The multi-scale guidance module includes, in sequence, a residual dense connection unit, a spatial attention unit, a channel attention unit, and a multi-scale feature fusion unit;
[0020] The multi-scale feature fusion unit captures defect features at different scales by setting up multiple parallel convolutional branches with different receptive fields.
[0021] Preferably, the loss function of the discriminator includes a focus perception loss term;
[0022] The key perception loss term generates a focus weight matrix based on the true location of the defect region, weights the feature maps extracted by the discriminator from the generated image and the real image, and calculates the weighted perception loss to guide the network to prioritize the feature consistency of the defect region.
[0023] A surface defect detection device for metal parts, used to implement the anti-fuzzy dual-flow surface defect detection method described in any one of the above claims, comprising:
[0024] The image acquisition and preprocessing module is used to acquire images of the surface of metal parts under high-speed motion or vibration environments, and to perform anti-blurring preprocessing on the images.
[0025] The feature extraction and segmentation module incorporates the anti-blurring dual-stream feature enhancement network described above, which is used to input the preprocessed image and simultaneously output the high-frequency restored image and the defect segmentation image.
[0026] The defect region localization and extraction module is used to locate the defect coordinates based on the defect segmentation image and extract the corresponding defect region image block from the high-frequency recovery image.
[0027] The defect recognition module has a built-in defect recognition network, which is used to classify and recognize the extracted defect area image blocks and output the final defect detection results.
[0028] This invention provides an anti-fuzzy dual-flow surface defect detection method and apparatus for industrial vision. It has the following beneficial effects:
[0029] Improve recognition accuracy: Construct an adversarial detail recovery subnet to achieve super-resolution restoration of low-quality images through generative adversarial learning, significantly restore high-frequency texture information caused by vibration, motion blur and reflection, and provide key detail support for subsequent identification of defects such as micro cracks and scratches;
[0030] Optimize feature extraction capabilities: Introduce an inter-layer feature reshaping subnetwork, fusing multi-scale texture and semantic information. Through cross-layer skip connections and reconstruction feature feedback mechanisms, achieve accurate pixel-level segmentation of complex defect regions. Simultaneously, design a multi-scale guidance module, combining spatial-channel attention and multi-scale convolution, to enhance the response to minute defect features, improving robustness and perceptual range.
[0031] Enhance application adaptability: Combine key perception modules and introduce perception consistency constraints and high-frequency structure alignment mechanisms based on defect region weighting in generative adversarial training to guide the network to focus on defect locations and improve detection stability and accuracy under various complex conditions (such as high-speed acquisition, background interference, local reflection, etc.).
[0032] Improved recognition accuracy: Experimental results on public datasets of metal surface defects (NEU-DET and DAGM) show that the average structural similarity (SSIM) is improved by 11.7%, the peak signal-to-noise ratio (PSNR) is improved by about 4.1 dB, and the segmentation accuracy of small defects (such as scratches and pits) is improved by 8.6% compared with the traditional U-Net model, which significantly enhances the model's ability to restore and detect details of complex textured surfaces.
[0033] Improved anti-interference capability: By integrating multi-scale guidance modules and key perception modules into the backbone network and combining spatial and channel attention mechanisms, dynamic weighting and noise reduction processing are performed on high-frequency texture and defect area features, so that the defect detection accuracy remains above 91.5% under complex working conditions (such as strong reflection, metal reflection, high speed blur), effectively improving the robustness and generalization ability of the system.
[0034] Improved real-time processing capabilities: The overall model structure adopts a lightweight convolution and parameter compression strategy, keeping the total number of network parameters below 13M and the average inference latency below 78ms, meeting the real-time and deployment adaptation requirements of high-speed online inspection of industrial-grade metal parts. Attached Figure Description
[0035] Figure 1 This is a schematic diagram of the surface defect detection method of the present invention;
[0036] Figure 2This is a diagram of the anti-fuzzy dual-stream feature enhancement network structure of the present invention;
[0037] Figure 3 This is a structural diagram of the key sensing module of the present invention;
[0038] Figure 4 This is a framework diagram of the surface defect detection method of the present invention;
[0039] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, 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, 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.
[0040] like Figures 1-2 As shown, an anti-fuzzy dual-flow surface defect detection method for industrial vision includes the following steps:
[0041] S1. Image Acquisition and Input: Under high-speed vibration or conveyor belt conditions, low-quality images of the surface of metal parts are acquired and input into a pre-constructed end-to-end anti-blurring dual-stream feature enhancement network for preliminary processing.
[0042] S2. Dual-Stream Network Collaborative Processing: The input image is processed by a parallel Adversarial Detail Reconstruction (ADRR) subnetwork and an Inter-Layer Feature Reconstruction (IFRF) subnetwork. The ADRR subnetwork focuses on recovering high-frequency details lost due to motion, vibration, and other factors, thus clarifying the image structure; the IFRF subnetwork focuses on pixel-level segmentation of minute defect areas on the metal surface. The two subnetworks share a backbone feature extraction architecture and achieve joint optimization and complementary enhancement of detail reconstruction and defect segmentation information through a collaborative learning mechanism.
[0043] S3, Dual-stream network output: The network outputs two results in parallel: one is the recovered high-frequency detail image, which provides clear and rich image information for subsequent defect identification; the other is the pixel-level segmentation image of the metal surface defect, which provides accurate location information of the defect area.
[0044] S4. Precise Defect Region Extraction: The defect region localization and extraction module accurately extracts image blocks of the defect region on the metal surface from the high-frequency recovery image based on the defect region location information in the segmentation image, ensuring that the subsequent recognition input has sufficient resolution and clarity.
[0045] S5. Defect Classification and Recognition: The extracted defect image blocks are input into the Defect Recognition Subnet (DefectNet) to classify and recognize specific defect types (such as cracks, scratches, pits, etc.), and finally output the defect detection results to achieve high-precision metal surface defect recognition.
[0046] Specifically, the Adversarial Detail Reconstruction (ADRR) subnetwork and the Inter-Layer Feature Reconstruction (IFRF) subnetwork operate in parallel, forming an integrated dual-stream end-to-end structure. This effectively avoids the error accumulation problem that may arise from directly embedding the ADRR reconstruction results into the backbone network. The two subnetworks share the same backbone feature extraction architecture. The ADRR subnetwork focuses on restoring high-frequency details lost due to factors such as high-speed transmission, equipment vibration, and surface reflection, improving overall texture clarity. The IFRF subnetwork, on the other hand, focuses on precise pixel-level segmentation of minute defect areas on the metal surface. Detail reconstruction enhances feature representation during segmentation, and the segmentation results, in turn, guide the reconstruction subnetwork to focus on defect-related regions, achieving dual-stream feature interaction and complementarity, and synergistically improving the accuracy and robustness of defect detection.
[0047] The dual-stream network of this invention employs a collaborative learning mechanism, namely, by sharing a backbone feature extraction network and jointly optimizing the reconstruction loss of the adversarial detail recovery subnet and the segmentation loss of the inter-layer feature reshaping subnet, end-to-end multi-task training is achieved. During training, high-frequency features recovered by the reconstruction subnet are injected into the segmentation subnet through cross-layer connections to enhance segmentation accuracy; the defect attention map output by the segmentation subnet is used to weight the loss function of the reconstruction subnet, guiding reconstruction to focus on defect regions, thereby forming a bidirectional feature interaction and loss synergy.
[0048] Specifically, the Adversarial Detail Reconstruction (ADRR) subnet is implemented as follows: Images of metal parts acquired under high-speed vibration or conveyor belt conditions often suffer from high-frequency detail loss due to motion blur, vibration, and reflection. The primary task is to recover minute defect features by reconstructing the degraded high-frequency texture information of the metal surface. Given the diverse types of motion blur and the complex operating conditions, the ADRR subnet structure offers advantages such as high flexibility and compressible parameters, making it well-suited for this task.
[0049] The Adversarial Detail Recovery (ADRR) subnetwork is used as a generator to play an adversarial game with the discriminator. It learns the data distribution differences between low-quality blurred images and clear, high-quality images, guiding the network to implicitly transform low-quality metal surface images into high-quality super-resolution deblurred images.
[0050] In the case of small defects, shallow texture features are particularly crucial for identifying minute flaws such as cracks and scratches. The input image undergoes convolutional downsampling and feature extraction via an encoder composed of four Feature Enhancement Guidance Modules (FEGMs). The feature map size is reduced by a factor of 2 to help the model acquire multi-scale texture information. The Adversarial Detail Recovery (ADRR) subnetwork concatenates the first three layers of feature maps extracted by the encoder with the input image, extracts texture cues at different scales, and fuses them with the original image features. Subsequently, the feature maps are interpolated and enlarged by a factor of 4 to expand the range of defect features, ensuring that small targets on the metal surface are fully reconstructed. The objective function for its adversarial training is:
[0051]
[0052] in, and These represent the generator and discriminator, respectively, with parameters as follows: and , Represents the distribution of true, clear images. This represents the distribution of blurred images of metal parts. For high-quality, realistic image input, Noisy random input data is used as the initial input to the generator; To reduce random noise The super-resolution deblurred image is obtained after inputting the generator G. For the discriminator to distinguish real images The output of the discrimination probability indicates that the image is considered real; the higher the value, the more likely it is to be considered a real image. The discriminator outputs the discrimination probability of the image G(z) generated by the generator;
[0053] The discriminator aims to maximize the probability of classifying real images, while the generator aims to minimize the probability that its generated image is identified as "fake" by the discriminator. As they continuously interact, the images generated by ADRR increasingly resemble real, high-quality images. The generator's reconstruction loss can be further expressed as:
[0054]
[0055] in, This refers to the number of samples used in the loss calculation. Indicates parameters For the configured judge, For parameters APIR subnet configured for generator. For low-quality, blurry input images; ADRR uses low-quality images The goal is to generate a corresponding super-resolution deblurred image as input. By minimizing the generator's loss function, ADRR is encouraged to generate high-quality super-resolution deblurred images.
[0056] Specifically, the Inter-Layer Feature Reconstruction Subnetwork (IFRF) is implemented as follows: The IFRF performs pixel-level segmentation of defect regions in the surface image of metal parts to accurately locate minute cracks, scratches, and dents. During super-resolution reconstruction and motion blur removal, the Adversarial Detail Reconstruction Subnetwork (ADRR) feeds back the recovered high-frequency texture features to the network backbone. The encoder of the IFRF combines these detailed information with its own extracted multi-scale semantic features. Cross-layer skip connections can transfer the reconstructed features to deeper structures and fuse them with shallow high-resolution features during the decoding stage, thereby achieving more accurate defect segmentation. In this way, the ADRR and IFRF work together in a multi-task joint manner to achieve dual-stream information fusion for minute defect feature recovery and segmentation tasks. To train the IFRF, pixel-level cross-entropy loss is introduced.
[0057]
[0058] in Represents the total number of pixels. Number of representative categories (defects and background). Let i be the true label value of the i-th pixel in class c. Let be the model's predicted probability that the pixel belongs to class c; the goal is to minimize the value of the loss function so that the model can accurately segment the small defect region on the metal surface.
[0059] Specifically, the anti-blurring dual-stream feature enhancement network also introduces a multi-scale guided module (MSGM), as follows: To enhance the network's ability to represent defective regions and prioritize information on minor imperfections, a multi-scale guided module (MSGM) is designed. This module first extracts image features through a residual dense connection unit, which removes the batch normalization (BN) layer to preserve original texture information and reduce computational complexity and memory usage. Subsequently, the multi-scale guided module (MSGM) inputs the extracted feature map into a spatial attention unit, which guides the network's attention to defective regions that occupy only a small area of the image through weight mapping. Next, the feature channels are recalibrated through a channel attention unit to emphasize high-frequency details and reflective channel features, effectively filtering background noise. This allows the network to filter and enhance the channel features most sensitive to minor defects in feature mappings at different levels.
[0060] Furthermore, the Multi-Scale Guidance Module (MSGM) introduces a multi-scale feature fusion unit. This unit uses multiple parallel convolutional branches (such as 3×3, 5×5, and dilated convolutions) to capture feature responses under different receptive fields, thereby improving the model's ability to perceive defect regions of varying sizes and shapes. The fused multi-scale attention features not only preserve local details but also enhance the modeling ability of contextual information, effectively improving the performance of subsequent segmentation and reconstruction modules.
[0061] like Figure 3 As shown, to optimize the adversarial training process, this invention introduces a focus-aware loss term into the discriminator's loss function. To calculate this loss term, a corresponding focus-aware module is designed, as follows:
[0062] During the training of a generative adversarial network, in order to ensure that the discriminator pays attention to the defect region, a focusing weight matrix is generated based on the location of the defect in the original image. In the matrix, the weight of the defect region is set to a large value (e.g., 50), and the weight of the background region is 1; then, the j-th layer of the discriminator compares the real image x with the generated image. Extract features separately and The weighted perceptual loss is calculated by multiplying it with the focusing matrix:
[0063]
[0064] This loss term prioritizes and aligns the features of defect regions during training. To further enhance the discriminator's sensitivity to detailed regions, this focus-aware loss term can also introduce a consistency constraint based on feature map gradients, encouraging the generated image to maintain local structural consistency with the real image in high-frequency regions such as edges and textures. This effectively improves the model's ability to reproduce complex defect textures in high-precision detection scenarios.
[0065] like Figure 4 As shown, on the other hand, the present invention also provides a surface defect detection device for metal parts, used to implement the anti-fuzzy dual-flow surface defect detection method described in any of the above claims, comprising:
[0066] Image acquisition and preprocessing module: Used to acquire image datasets of metal parts surface. It uses industrial cameras to acquire images in high-speed motion or vibration environments. After anti-blur image processing operations, including detail enhancement, high-frequency texture restoration and blur removal, the image clarity and segmentability are significantly improved and used as input for model training and inference.
[0067] Feature extraction and segmentation module: It is used to input the preprocessed image into the anti-blurring dual-stream feature enhancement network, and by integrating the adversarial detail recovery subnetwork (ADRR) and the inter-layer feature reshaping subnetwork (IFRF), it jointly uses multi-scale convolution to extract high-frequency details and feature maps, and outputs high-frequency recovery map and defect segmentation map.
[0068] Defect region localization and extraction module: Based on the defect location output by the segmentation map, accurately extract the defect region image block from the high-frequency image. Specifically, the pixel coordinates in the segmentation map are mapped to the high-frequency image through coordinate mapping, and then the boundary is fine-tuned (such as by using morphological dilation or erosion operations) to ensure that the extracted region contains the complete defect boundary, thereby ensuring image quality and defect integrity.
[0069] Defect Recognition Module: The extracted defect image patches are input into the DefectNet defect recognition network. This network uses a deep convolutional neural network and combines a multi-scale feature fusion structure (such as a feature pyramid or attention fusion module) to enhance the ability to recognize defect features at different scales. Finally, the post-processing module outputs high-confidence defect detection results.
[0070] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. An anti-aliasing dual-stream surface defect detection method for industrial vision, characterized in that, Includes the following steps: S1. Acquire images of the surface of low-quality metal parts under high-speed vibration or conveyor belt conditions; S2. Input the surface image of the low-quality metal part into a pre-constructed end-to-end anti-blurring dual-stream feature enhancement network; the anti-blurring dual-stream feature enhancement network includes an adversarial detail recovery subnetwork and an inter-layer feature reshaping subnetwork that share the same backbone feature extraction network and are set in parallel; the backbone feature extraction network includes a multi-scale guidance module, which includes, in sequence, a residual dense connection unit, a spatial attention unit, a channel attention unit, and a multi-scale feature fusion unit that captures defect features at different scales by setting multiple parallel convolutional branches with different receptive fields; S3. The image is processed by the adversarial detail recovery sub-network to restore the high-frequency detail loss in the image and output the restored high-frequency detail image; simultaneously, the image is processed by the inter-layer feature reshaping sub-network to output a pixel-level segmentation image of the small defects on the metal surface; wherein, the features reconstructed and enhanced by the adversarial detail recovery sub-network are used to improve the segmentation accuracy of the inter-layer feature reshaping sub-network, and the segmentation result of the inter-layer feature reshaping sub-network is used to guide the adversarial detail recovery sub-network to focus on the defect-related region; S4. Based on the defect region location information in the pixel-level segmented image, extract the corresponding defect region image block from the high-frequency detail image; S5. Input the image block of the defect area into the defect recognition subnet and output the defect classification and recognition result.
2. The anti-aliasing dual-stream surface defect detection method of claim 1, wherein, The anti-blurring dual-stream feature enhancement network is an end-to-end multi-task learning network. The adversarial detail restoration subnetwork and the inter-layer feature reshaping subnetwork share the same backbone feature extraction network. Through a collaborative learning mechanism (i.e., an end-to-end training method that shares the backbone network and jointly optimizes the segmentation loss and reconstruction loss), they jointly optimize the defect segmentation and detail reconstruction tasks. The adversarial detail restoration subnetwork is used to restore high-frequency detail loss in the image, and the inter-layer feature reshaping subnetwork is used to perform pixel-level segmentation of small defect regions. The feature enhancement of detail reconstruction is used to improve segmentation accuracy, and the segmentation results are used to guide the reconstruction subnetwork to focus on defect-related regions.
3. The anti-aliasing dual-stream surface defect detection method of claim 1, wherein, The adversarial detail recovery subnet adopts a generative adversarial network architecture, including a detail reconstruction network as a generator and an adversarial network as a discriminator; The encoder of the detail reconstruction network includes multiple feature enhancement guidance modules for performing convolutional downsampling and feature extraction on the input image; and concatenating and fusing the extracted feature maps at multiple scales with the input image, and then upsampling and amplifying the fused feature maps to generate high-frequency detail restoration images; The discriminator is used to distinguish between the image generated by the detail reconstruction network and the real high-quality image. Through adversarial training between the generator and the discriminator, the detail reconstruction network learns to transform low-quality blurred images into high-quality deblurred images.
4. The anti-aliasing dual-stream surface defect detection method of claim 1, wherein, The interlayer feature reshaping subnetwork adopts an encoder-decoder structure, and fuses the high-frequency texture features recovered by the adversarial detail recovery subnetwork with the multi-scale semantic features extracted by itself through cross-layer skip connections to perform pixel-level defect segmentation; the interlayer feature reshaping subnetwork is trained by minimizing the pixel-level cross-entropy loss function.
5. The anti-fuzzy dual-flow surface defect detection method according to claim 1 or 3, characterized in that, The adversarial detail recovery subnet and the interlayer feature reshaping subnet introduce a multi-scale guidance module; The multi-scale guidance module includes, in sequence, a residual dense connection unit, a spatial attention unit, a channel attention unit, and a multi-scale feature fusion unit; The multi-scale feature fusion unit captures defect features at different scales by setting up multiple parallel convolutional branches with different receptive fields.
6. The anti-fuzzy dual-flow surface defect detection method according to claim 3, characterized in that, The loss function of the discriminator incorporates a key perception loss term. The key perception loss term generates a focus weight matrix based on the true location of the defect region, weights the feature maps extracted by the discriminator from the generated image and the real image, and calculates the weighted perception loss to guide the network to prioritize the feature consistency of the defect region.
7. A surface defect detection device for metal parts, used to implement the anti-fuzzy dual-flow surface defect detection method according to any one of claims 1 to 6, characterized in that, include: The image acquisition and preprocessing module is used to acquire images of the surface of metal parts under high-speed motion or vibration environments, and to perform anti-blurring preprocessing on the images. The feature extraction and segmentation module incorporates the anti-blurring dual-stream feature enhancement network as described in any one of claims 1 to 6, for inputting the preprocessed image and simultaneously outputting the high-frequency restored image and the defect segmentation image; The defect region localization and extraction module is used to locate the defect coordinates based on the defect segmentation image and extract the corresponding defect region image block from the high-frequency recovery image. The defect recognition module has a built-in defect recognition network, which is used to classify and recognize the extracted defect area image blocks and output the final defect detection results.