An edge information enhancement and dynamic multi-scale fusion product surface defect detection method

By employing a detection method that combines edge information enhancement with dynamic multi-scale fusion, the problem of low accuracy in defect detection under complex texture environments is solved, achieving efficient and stable industrial surface defect detection, applicable to a variety of industrial products.

CN122175955APending Publication Date: 2026-06-09SHENYANG INSTITUTE OF CHEMICAL TECHNOLOGY

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHENYANG INSTITUTE OF CHEMICAL TECHNOLOGY
Filing Date
2026-04-10
Publication Date
2026-06-09

AI Technical Summary

Technical Problem

Existing industrial surface defect detection methods have low recognition accuracy in complex texture environments, blurred edges of subtle defects, and difficulty in effectively capturing multi-scale defects. Traditional methods are not effective in specific environments, and the local receptive field of convolutional neural networks limits the ability to model global features.

Method used

By combining the edge information enhancement module, the focusing diffusion pyramid fusion module, and the detection and prediction module, adaptive fusion of multi-scale features and efficient extraction of key features are achieved through the edge information enhancement structure, multi-scale pyramid feature fusion, and self-attention mechanism.

Benefits of technology

It significantly improves the model's ability to perceive and locate complex industrial textures and subtle defects, enabling automatic defect identification, real-time detection, and visual feedback, thereby improving detection efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122175955A_ABST
    Figure CN122175955A_ABST
Patent Text Reader

Abstract

This invention discloses a product surface defect detection method that combines edge information enhancement and dynamic multi-scale fusion. The method enhances the edge feature representation capability during feature extraction through an edge information enhancement module, significantly improving the model's perception of subtle defects and blurred boundaries. It achieves effective fusion of multi-scale features and dynamic focusing of contextual information through a focusing diffusion pyramid module, solving the instability problem of multi-scale defect detection against complex texture backgrounds. A large-kernel dynamic sampling structure expands the receptive field while maintaining model lightweightness, improving the model's adaptability to defects of different shapes and sizes. A dynamically weighted regression loss function optimizes the prediction process, further improving detection accuracy and convergence efficiency. The overall structure is simple and efficient with low computational overhead, suitable for embedded deployment, and can be widely applied to various industrial surface inspection scenarios, such as surface quality inspection and intelligent defect recognition of industrial products like metal sheets, glass fibers, aluminum alloys, ceramics, and composite materials.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a method for detecting surface defects in products, and more particularly to a method for detecting surface defects in products that combines edge information enhancement with dynamic multi-scale fusion. Background Technology

[0002] In modern industrial production, the quality of product surfaces directly impacts a company's production stability and brand reputation. Traditional manual inspection methods rely on operator experience, resulting in low efficiency, high subjectivity, and difficulty adapting to continuous high-speed production lines. With the development of computer vision and automation technologies, machine vision inspection is gradually replacing manual inspection, becoming the primary means of identifying industrial surface defects. Traditional image processing methods often rely on manual feature design techniques such as edge detection, grayscale analysis, or frequency domain filtering. While these methods can achieve certain results in specific environments, their universality and robustness are poor, making it difficult to cope with complex lighting, noise interference, and diverse defect morphologies.

[0003] In recent years, the rise of deep learning technology, especially convolutional neural networks, has made automatic feature extraction possible. Detection methods based on convolutional neural networks, such as the YOLO series, SSD, and Faster R-CNN, have made significant progress in industrial surface defect detection. These models, trained end-to-end, achieve efficient target recognition and localization.

[0004] However, the local receptive field of convolutional networks limits their ability to model global features, especially when faced with blurred edges, uneven lighting, low contrast, and multi-scale defects, often resulting in feature diffusion or unclear boundaries. To overcome the local limitations of convolutional models, researchers have introduced a Transformer architecture based on a self-attention mechanism. This architecture can establish global feature dependencies, improving the ability to model complex textures and scale variations. However, existing Transformer-based detection methods still have shortcomings in multi-scale feature fusion and fine-grained edge modeling, easily leading to missed detections of small defects and large-scale false detections. Summary of the Invention

[0005] The purpose of this invention is to provide a product surface defect detection method based on edge information enhancement and dynamic multi-scale fusion. This method is a deep learning-based industrial surface defect detection approach, specifically a focused diffusion pyramid detection model that combines edge information enhancement with a large-kernel dynamic sampling mechanism. By introducing an edge information enhancement module, a focused diffusion pyramid fusion module, and a detection prediction module, this method achieves adaptive fusion of multi-scale features and efficient extraction of key features, thereby significantly improving the model's ability to perceive and locate complex industrial textures and subtle defects. Ultimately, this method can be integrated into industrial inspection systems to achieve automatic defect identification, real-time detection, and visual feedback, greatly improving the intelligence and efficiency of industrial product quality management and inspection.

[0006] The purpose of the invention is achieved through the following technical solution: A method for detecting surface defects in products using edge information enhancement and dynamic multi-scale fusion, the method comprising the following steps: S1. Collect images of industrial surfaces with different types of defects, label the defect areas and classify the categories of each image to form a training sample set; S2. Establish an industrial surface defect detection network, input the training sample set into the detection network for training, and obtain a detection model that can automatically identify defects; S3. Input the image of the industrial surface to be detected into the trained detection model, and output the category, location and confidence level of the defects in the image; The detection network includes a feature extraction layer, a feature fusion layer, and a detection output layer connected in sequence; the feature extraction layer is used to extract edge and texture features, the feature fusion layer is used for multi-scale information aggregation, and the detection output layer is used to predict defect areas.

[0007] The aforementioned method for detecting surface defects in products using edge information enhancement and dynamic multi-scale fusion includes a feature extraction layer comprising an edge information enhancement structure. This edge information enhancement structure consists of directional convolutional units, frequency domain selection units, and coordinate attention units. Its comprehensive response output can be expressed as: ; in, For the input feature map, , These are the convolution kernels in the horizontal and vertical directions, respectively. and These represent the Fourier transform and inverse transform operations, respectively. Choose a weight matrix for the frequency. The output of the coordinate attention function, , , The fusion coefficients are learnable; this structure achieves joint enhancement of edge continuity and detail texture by simultaneously modeling spatial orientation and frequency distribution.

[0008] The aforementioned edge information enhancement and dynamic multi-scale fusion method for detecting product surface defects employs a multi-scale pyramid structure in its feature fusion layer. Features from different levels are spatially aligned and then weighted and fused. The fused output features are represented as follows: ; in, Indicates the first Layer feature map, For adaptive fusion weights, This is a scale alignment operation; the structure enables feature aggregation from local to global to enhance the model's ability to perceive defects of different sizes.

[0009] The method for detecting surface defects in products by edge information enhancement and dynamic multi-scale fusion includes a feature fusion layer comprising a focusing diffusion module and an adaptive upsampling module. The focusing diffusion module performs dilated convolution expansion after multi-scale feature stitching, and its diffusion feature calculation formula is as follows: ; in, Indicates the void ratio Convolution operation, A set of different void ratios; The focused diffusion module achieves context capture under a large receptive field, while the adaptive upsampling module learns the offset. To adjust the sampling position, the calculation method is as follows: ; in, For the neighborhood sampling set, For interpolation weight function, This represents the feature value of the sampling point after adjustment based on the offset; this structure ensures the spatial consistency and positioning accuracy of edge features during the upsampling process.

[0010] The aforementioned edge information enhancement and dynamic multi-scale fusion product surface defect detection method comprises a feature extraction module and a feature fusion module constructed as described above, and a detection and analysis module generating a defect location annotation map and classification results based on the feature output results.

[0011] The aforementioned edge information enhancement and dynamic multi-scale fusion product surface defect detection method, wherein the detection output layer predicts based on a self-attention mechanism, and jointly optimizes the defect category and bounding box by calculating the correlation matrix between features at each location. The correlation calculation formula is as follows: ; in, and These are the query and key vectors, respectively. For feature dimension, For the first With the Attention weights between features.

[0012] The method for detecting product surface defects using edge information enhancement and dynamic multi-scale fusion employs a weighted intersection-over-union (IoU) loss function for bounding box regression. The loss function is defined as follows: ; in, The intersection-union ratio (IU) of the predicted bounding box and the ground truth bounding box. This is a dynamic weighting adjustment coefficient. This is the focusing factor. The loss function adaptively adjusts the gradient strength based on sample quality, improving boundary prediction accuracy while maintaining stable convergence.

[0013] The aforementioned edge information enhancement and dynamic multi-scale fusion product surface defect detection method includes an image acquisition device, a preprocessing module, a feature extraction module, a feature fusion module, and a detection and analysis module.

[0014] The aforementioned edge information enhancement and dynamic multi-scale fusion product surface defect detection method is applicable to industrial surfaces such as steel, glass fiber, aluminum, ceramics and textiles. It can maintain stable detection performance under different lighting conditions and complex texture environments, and realize automatic identification and real-time monitoring of surface defects in industrial production processes.

[0015] The advantages and effects of this invention are: 1. This invention addresses the problems of low accuracy in detecting industrial surface defects in complex texture environments, blurred edges of subtle defects, and difficulty in effectively capturing multi-scale defects in existing methods. This invention proposes an industrial surface defect detection method that combines edge information enhancement with dynamic multi-scale feature fusion. By introducing an edge information enhancement module, a focusing-diffusion pyramid fusion module, and a detection prediction module, this method achieves adaptive fusion of multi-scale features and efficient extraction of key features, thereby significantly improving the model's ability to perceive and locate complex industrial textures and subtle defects. Finally, this method can be integrated into industrial inspection systems to achieve automatic defect identification, real-time detection, and visual feedback, greatly improving the intelligence and efficiency of industrial product quality management and inspection.

[0016] 2. This invention enhances the edge feature representation capability during the feature extraction stage through an edge information enhancement module, significantly improving the model's perception of subtle defects and blurred boundaries. The focusing diffusion pyramid module effectively fuses multi-scale features and dynamically focuses contextual information, solving the problem of instability in multi-scale defect detection against complex texture backgrounds. A large-kernel dynamic sampling structure expands the receptive field while maintaining model lightweightness, improving the model's adaptability to defects of different shapes and sizes. A dynamically weighted regression loss function optimizes the prediction process, further improving detection accuracy and convergence efficiency. The overall structure is simple and efficient with low computational overhead, suitable for embedded deployment, and can be widely applied to various industrial surface inspection scenarios, such as surface quality inspection and intelligent defect recognition of industrial products like metal sheets, glass fibers, aluminum alloys, ceramics, and composite materials.

[0017] 3. The industrial surface defect detection method proposed in this invention, which combines edge information enhancement and dynamic multi-scale feature fusion, achieves systematic optimization in three aspects: feature extraction, feature fusion, and localization regression. This effectively improves detection accuracy, robustness, and generalization ability, providing an efficient, stable, and scalable intelligent detection solution for industrial product quality inspection. Attached Figure Description

[0018] Figure 1 A schematic diagram of the overall structure of the model combining edge information enhancement and dynamic multi-scale feature fusion; Figure 2 This is a diagram of defect instances on the NEU-DET dataset. Detailed Implementation

[0019] The present invention will be further described below with reference to the accompanying drawings and embodiments. It should be understood that the embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit its scope of protection.

[0020] The industrial surface defect detection network of this invention includes a feature extraction module, a focusing-diffusion pyramid fusion module, and a detection prediction module connected in sequence. The input image first passes through the feature extraction module to extract features at different levels, then passes through the focusing-diffusion pyramid module for feature fusion and multi-scale optimization, and finally the detection prediction module outputs the defect category and boundary location.

[0021] The feature extraction module is the core of the network, used to extract texture, structural, and edge features at different levels from the input image. This invention incorporates an edge information enhancement module within the feature extraction module. This module, through the synergistic effect of directional convolution and coordinate attention mechanisms, enables the network to accurately capture the edge features and details of defects. The edge information enhancement module consists of strip convolution, spatial feature filtering convolution, and coordinate weight calculation units. By modeling spatial distribution information in the horizontal and vertical directions respectively, it enhances defect edges and suppresses noise, thereby effectively improving the model's ability to distinguish low-contrast defects and complex background regions.

[0022] The feature fusion module employs a focused-diffusion pyramid structure to achieve multi-scale feature fusion and dynamic optimization. This module combines diffuse feature aggregation with focused feature enhancement mechanisms, utilizing large-kernel dilated convolutions to expand the receptive field and acquire richer contextual information. It also introduces a dynamic sampling mechanism to achieve adaptive matching between features at different scales, thus balancing global information with local details during the fusion process. The focused-diffusion pyramid module internally includes reparameterizable large-kernel dilated convolution units and dynamic upsampling units. The former achieves equivalent large-kernel feature extraction through multi-diffusion rate convolution combinations without increasing computational cost, enhancing the model's global information perception capability; the latter learns pixel-level offsets to achieve adaptive alignment between features, enabling high-level semantic information to be fully integrated with low-level texture features, thereby maintaining stable high-precision performance in defect detection at different scales.

[0023] The detection and prediction module adopts a decoupled structure, with classification and regression branches respectively completing defect category identification and bounding box prediction. The regression part uses a weighted intersection-over-union loss function with a dynamic focusing mechanism, assigning higher weights to high-quality predicted boxes, strengthening the gradient response in key areas, and avoiding the gradient saturation problem that traditional loss functions encounter in highly overlapping areas. This improves the model's localization accuracy and convergence stability under complex defect boundary conditions. Example

[0024] The overall structure of this invention is as follows Figure 1 As shown, this method is based on a deep convolutional feature extraction network. By embedding an edge information enhancement module and a focusing diffusion pyramid module into the network backbone, it achieves high-precision, real-time detection of industrial surface defects. The entire detection framework mainly consists of a data preprocessing module, a feature extraction backbone network, an edge information enhancement module, a focusing diffusion pyramid module, and a detection output module.

[0025] The system input for this invention is a surface image collected from an industrial production line. To ensure the consistency of the input data, the original image is first normalized in size and pixel values. The original image size is uniformly adjusted to 512×512 pixels, and the pixel values ​​are normalized to the [0,1] range through linear transformation. For different industrial scenarios, data augmentation strategies such as rotation, flipping, and brightness perturbation can also be used to improve the robustness of the model to defects under different angles and lighting conditions. The normalized image after preprocessing is denoted as... .like Figure 1 As shown, the preprocessed image is input into the backbone feature extraction network. This network consists of multiple convolutional blocks, batch normalization layers, and nonlinear activation functions, extracting information from shallow edge textures to deep semantic features layer by layer. Shallow features Characterized fine-grained structures such as cracks and scratches; mid-layer features , Describes the relationship between defect morphology and local background; deep features This captures overall semantic and contextual structural information. The backbone network ultimately outputs a set of multi-scale feature maps. .

[0026] To enhance the model's responsiveness to defect edges and detail regions, this invention introduces an edge information enhancement module into the backbone network. This module first performs multi-directional gradient convolution operations on the input feature map, extracting edge direction information through convolution kernels with different directions. The calculation process is as follows: .

[0027] in This represents the convolution kernels in different directions. The average of the absolute values ​​of the responses in each direction yields the comprehensive edge saliency map. .

[0028] Subsequently, the module performs global average pooling on the edge saliency map and generates channel attention weights through two layers of pointwise convolution and sigmoid activation: .

[0029] Finally, the edge-enhanced output features are obtained through element-wise weighted fusion: .

[0030] This structure effectively suppresses background noise while enhancing edge response, giving the network higher sensitivity and discriminative power when extracting linear defects such as cracks, broken yarns, and scratches.

[0031] Next, the enhanced feature map The input is processed by the focusing diffusion pyramid module for dynamic multi-scale feature fusion. This module achieves feature aggregation and information diffusion in three stages: In the first stage, multi-scale dilated convolution is used to obtain contextual features under different receptive fields. Let the set of dilation rates be... Its output is: .

[0032] In the second stage, a focused weighting mechanism is introduced to perform weighted fusion of high- and low-level features. High-level features Contains rich semantic information, low-level features Containing detailed structure, the two are concatenated and then subjected to a 1×1 convolution and a sigmoid function to generate a fused weight map: .

[0033] The fusion result is: .

[0034] In the third stage, the outputs of the diffusion branch and the focusing branch are integrated through a 3×3 convolutional layer to form the final fused feature: .

[0035] The focused diffusion pyramid module achieves a coordinated balance of multi-scale information, enabling the network to simultaneously focus on minute defects and macroscopic structures, thereby improving the integrity and robustness of feature representation.

[0036] During the detection phase, feature fusion The detection head is used for prediction. It includes a classification branch, a bounding box regression branch, and a confidence prediction branch, which output the defect category probability and location parameters, respectively. And the prediction confidence. The total loss function of the network is: .

[0037] in This is to improve the regression accuracy of the model on highly overlapping prediction boxes.

[0038] The model was trained using stochastic gradient descent with an initial learning rate of 0.001, dynamically adjusted using cosine annealing. The batch size was set to 8, and the number of training epochs was 300. In each iteration, batch normalization was performed to stabilize the gradient distribution, and L2 regularization was used to suppress overfitting. After training, the model could be input with an image of the industrial surface to be inspected to output the defect category and location coordinates.

[0039] like Figure 2 As shown, this invention was validated on the NEU-DET industrial surface defect dataset. This dataset contains six typical surface defects: cracks, inclusions, spots, indentations, rolling defects, and scratches, with approximately 300 images per category, all with a uniform image size of 200×200 pixels. To ensure training stability and generalization performance, the dataset was divided into training, testing, and validation sets in an 8:1:1 ratio.

[0040] The method of this invention was systematically compared with several mainstream detection models, including Faster R-CNN, Cascade R-CNN, SSD, YOLOv7, YOLOX, DN-DETR, and RT-DETR. Evaluation metrics included mean precision (AP), recall (R), F1 score, and mean detection precision (mAP50). AP measures the detection accuracy for different categories, R reflects the model's detection completeness, F1 comprehensively evaluates the balance of detection, and mAP50 represents the mean detection precision when the intersection-union threshold is set to 0.5. Experimental results are shown in Table 1.

[0041] Table 1. Comparative experimental results of the method of this invention with other real-time target detection algorithms.

[0042] As shown in Table 1, the defect detection method proposed in this invention, which combines edge information enhancement and dynamic multi-scale fusion, significantly outperforms existing algorithms in detection accuracy for various types of defects. The improvement in detection performance is most pronounced in complex texture scenarios such as cracks, indentations, and rolling defects. Compared to the currently superior RT-DETR method, this invention improves average precision by approximately 2.9%, recall by approximately 2.1%, and overall F1 score by approximately 2.1%, achieving an overall mAP50 of 85.2%, fully demonstrating the effectiveness of the designed edge information enhancement and dynamic multi-scale feature fusion mechanism.

[0043] Experimental results show that the present invention outperforms traditional and mainstream depth detection algorithms in terms of detection accuracy, and can meet the needs of industrial online real-time inspection. This method can be widely applied to intelligent inspection and quality control of surface defects in various industrial products such as steel plates, aluminum materials, photovoltaic glass, and lithium electrode sheets.

Claims

1. A method for detecting surface defects in products using edge information enhancement and dynamic multi-scale fusion, characterized in that, The method The process includes the following: S1. Collect images of industrial surfaces with different types of defects, label the defect areas and classify the categories of each image to form a training sample set; S2. Establish an industrial surface defect detection network, input the training sample set into the detection network for training, and obtain a detection model that can automatically identify defects; S3. Input the image of the industrial surface to be detected into the trained detection model, and output the category, location and confidence level of the defects in the image; The detection network includes a feature extraction layer, a feature fusion layer, and a detection output layer connected in sequence; the feature extraction layer is used to extract edge and texture features, the feature fusion layer is used for multi-scale information aggregation, and the detection output layer is used to predict defect areas.

2. The method for detecting product surface defects by edge information enhancement and dynamic multi-scale fusion according to claim 1, characterized in that, The feature extraction layer includes an edge information enhancement structure, which consists of an oriented convolutional unit, a frequency domain selection unit, and a coordinate attention unit. Its combined response output can be expressed as: ; in, For the input feature map, , These are the convolution kernels in the horizontal and vertical directions, respectively. and These represent the Fourier transform and inverse transform operations, respectively. Choose a weight matrix for the frequency. The output of the coordinate attention function, , , The fusion coefficients are learnable; this structure achieves joint enhancement of edge continuity and detail texture by simultaneously modeling spatial orientation and frequency distribution.

3. The method for detecting product surface defects by edge information enhancement and dynamic multi-scale fusion according to claim 1, characterized in that, The feature fusion layer adopts a multi-scale pyramid structure. Features from different levels are spatially aligned and then weighted and fused. The fused output feature is represented as follows: ; in, Indicates the first Layer feature map, For adaptive fusion weights, This is a scale alignment operation; the structure enables feature aggregation from local to global to enhance the model's ability to perceive defects of different sizes.

4. The method for detecting product surface defects by edge information enhancement and dynamic multi-scale fusion according to claim 1, characterized in that, The feature fusion layer includes a focusing diffusion module and an adaptive upsampling module; the focusing diffusion module performs dilated convolution expansion after multi-scale feature concatenation, and its diffusion feature calculation formula is as follows: ; in, Indicates the void ratio Convolution operation, A set of different void ratios; The focused diffusion module achieves context capture under a large receptive field, while the adaptive upsampling module learns the offset. To adjust the sampling position, the calculation method is as follows: ; in, For the neighborhood sampling set, For interpolation weight function, This represents the feature value of the sampling point after adjustment based on the offset; this structure ensures the spatial consistency and positioning accuracy of edge features during the upsampling process.

5. The method for detecting product surface defects by edge information enhancement and dynamic multi-scale fusion according to claim 4, characterized in that, The feature extraction module and feature fusion module are constructed in the manner described above, and the detection and analysis module generates a defect location annotation map and classification results based on the feature output results.

6. The method for detecting product surface defects by edge information enhancement and dynamic multi-scale fusion according to claim 1, characterized in that, The detection output layer performs prediction based on a self-attention mechanism. It achieves joint optimization of defect categories and bounding boxes by calculating the correlation matrix between features at each location. The correlation calculation formula is as follows: ; in, and These are the query and key vectors, respectively. For feature dimension, For the first With the Attention weights between features.

7. The method for detecting product surface defects by edge information enhancement and dynamic multi-scale fusion according to claim 1, characterized in that, The method employs a weighted intersection-over-union (IoU) loss function for bounding box regression, the loss function being defined as: ; in, The intersection-union ratio (IU) of the predicted bounding box and the ground truth bounding box. This is a dynamic weighting adjustment coefficient. Focusing factor; this loss function adaptively adjusts the gradient strength based on sample quality, improving boundary prediction accuracy while maintaining stable convergence.

8. The method for detecting product surface defects by edge information enhancement and dynamic multi-scale fusion according to claim 1, characterized in that, The system includes an image acquisition device, a preprocessing module, a feature extraction module, a feature fusion module, and a detection and analysis module.

9. The method for detecting surface defects in products by edge information enhancement and dynamic multi-scale fusion according to claim 1, characterized in that, The method is applicable to industrial surfaces such as steel, fiberglass, aluminum, ceramics, and textiles. It can maintain stable detection performance under different lighting conditions and complex texture environments, enabling automatic identification and real-time monitoring of surface defects during industrial production.