Glazed ceramic tile surface defect detection method based on improved Faster R-CNN
By adopting the improved Faster R-CNN model in the detection of surface defects of glazed tiles, the ECA attention mechanism and FPG feature pyramid components are introduced, and the problem of low detection accuracy of small target defects in complex background is solved, achieving high accuracy and Robust detection effect.
Patent Information
- Application Number
- CN202411570226.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-06
- Publication Date
- 2025-02-18
AI Technical Summary
The prior art has problems of low efficiency and low detection accuracy in the detection of surface defects of glazed ceramic tiles, especially in the complex background, where small target defects are insufficient.
Using the ECANet-FPG method based on the improved Faster R-CNN, the ECA attention mechanism and FPG feature pyramid components are introduced into the feature extraction network to enhance the expression ability of deep features and the fusion effect of multi-scale features.
It significantly improves the detection accuracy and robustness of small-size defects on the surface of glazed tiles, and improves the accuracy and efficiency of detection.
Smart Images

Figure BDA0005120266550000031 
Figure BDA0005120266550000032 
Figure BDA0005120266550000041
Abstract
Description
Technical Field
[0001] The invention relates to a method for detecting surface defects of ceramic tiles, and in particular to a method for detecting surface defects of glazed ceramic tiles based on an improved Faster R-CNN. Background Art
[0002] In an industrial production environment, the manufacturing process of glazed tiles includes multiple links such as raw material mixing and grinding, dehydration, embryo pressing, inkjet printing, glazing, firing, polishing, quality inspection and packaging. With the development of industrial automation, the production process has basically been unmanned. However, the quality inspection link still relies mainly on manual labor. Generally speaking, a production line needs to be equipped with 2 to 6 quality inspectors, who observe the surface of the tiles with the naked eye for a long time in a high-light environment to find defects. Due to factors such as the short duration of concentration of quality inspectors and diseases caused by long-term excessive use of the eyes, the quality inspection cost is high, the efficiency is low, and the quality of quality inspection is uneven.
[0003] With the rapid development of machine vision technology, automated defect detection has become an important way to improve production efficiency and inspection quality. The defects on the surface of glazed tiles are diverse and complex, including glaze collapse, white spots, dirt, impurities, wear, cracks and marks. These defects often account for a small proportion of the image and have low contrast with the background. In addition, the gloss and reflection effect of the tile surface lead to an increase in the background noise of the tile image, which further affects the clarity of the defective area and reduces the detection accuracy.
[0004] To solve these problems, an ECANet-FPG method is proposed based on the Faster R-CNN model for surface defect detection of glazed tiles. The adaptive weighting method and multi-scale feature fusion technology are introduced to enhance the model's ability to identify small target defects in complex backgrounds. By introducing a dynamic weighting mechanism in the feature extraction network, different weights are calculated for each channel in the feature map, thereby enhancing the expression ability of important channels and improving the model's response to key features. In addition, a multi-scale feature fusion strategy is adopted. By introducing multiple conversion modules and jump connections, the information flow and fusion effect between features of different scales are improved, and multi-level feature information is fully utilized, thereby improving the detection accuracy of small target defects. Summary of the invention
[0005] The purpose of the present invention is to provide a method for detecting surface defects of glazed ceramic tiles based on an improved Faster R-CNN. The method enhances the expression ability of deep features by introducing the ECA attention mechanism in the feature extraction network; the FPG feature pyramid component is used to improve the fusion effect of multi-scale features and effectively enhance the detection ability of small-size defects. The proposed method shows high accuracy and robustness in the task of detecting surface defects of glazed ceramic tiles.
[0006] The objective of the present invention is achieved through the following technical solutions:
[0007] A method for detecting surface defects of glazed ceramic tiles based on an improved Faster R-CNN, the method comprising the following steps:
[0008] (1)ECANet-FPG target detection method:
[0009] A dynamic weighting mechanism is introduced into the feature extraction network to calculate different weights for each channel in the feature map, thereby enhancing the expression ability of important channels and improving the response of the model to key features. In addition, a multi-scale feature fusion strategy is adopted to improve the information flow and fusion effect between features of different scales by introducing multiple conversion modules and jump connections, making full use of multi-level feature information, thereby improving the detection accuracy of small target defects.
[0010] (2) Improved feature extraction network:
[0011] Introduce attention mechanism in feature extraction network to strengthen the model's attention to defect information. Use ECANet as the ResNet50 feature extraction network of the original Faster R-CNN;
[0012] ECANet is a feature extraction network based on ResNet. Its core lies in the introduction of the ECA attention mechanism after each convolutional layer of ResNet, which can dynamically calculate the importance of each channel in the feature map;
[0013] (3) Improved feature pyramid:
[0014] Use FPG (Feature Pyramid Generator) as the feature pyramid component of Faster R-CNN; FPG enhances the relationship modeling and interaction between features of different scales by introducing graph structure and attention mechanism, and achieves more efficient and accurate feature fusion;
[0015] Through the above steps, the FPG structure can effectively fuse feature information at different levels, enhance the feature expression ability of small-size targets, and improve the detection accuracy of small-scale defects in glazed tile images. At the same time, the attention mechanism introduced in FPG helps to reduce semantic conflicts and improve the overall detection performance.
[0016] The method for detecting surface defects of glazed ceramic tiles based on the improved Faster R-CNN is described. Different weights are assigned to each channel, thereby enhancing the expression ability of key channels, avoiding the loss and confusion of feature information, and thus improving the overall detection speed and accuracy. The specific implementation steps are as follows:
[0017] 1) Global Average Pooling (GAP): For the input feature map F∈R C*H*W Perform global pooling to obtain the descriptor Z∈R for each channel c , the calculation formula is as follows:
[0018]
[0019] 2) One-dimensional convolution: Through one-dimensional convolution operation, the local dependencies between channels are captured and the attention weight α of each channel is generated. c , the calculation formula is as follows:
[0020] α c =σ(Conv 1*k (Z)) (2)
[0021] Among them, Conv 1*k represents a one-dimensional convolution operation, σ is the sigmoid activation function; k is the convolution kernel width, which is adaptively determined by the mapping of the channel dimension C. The calculation formula is as follows:
[0022]
[0023] where |t| add represents the odd number closest to t, γ and b are equal to 1
[0024] 3) Feature recalibration: Apply the attention weight to the original feature map to achieve feature recalibration. The specific formula is as follows:
[0025] F c '=α c ·F c +F c c=1,2,3…C (4)
[0026] Among them, α c is the attention weight, F c is the original feature map, F c ' is the recalibrated feature map;
[0027] Through the above steps, ECANet can effectively enhance the feature expression of important channels, suppress irrelevant or redundant features, and improve the detection performance of the overall network.
[0028] The method for detecting surface defects of glazed ceramic tiles based on improved Faster R-CNN, the feature fusion process of FPG includes the following three steps:
[0029] 1) Feature alignment: In order to ensure the consistency of feature maps at different levels in spatial scale, feature maps at different levels are adjusted to the same resolution through upsampling and downsampling operations to ensure the alignment and compatibility of feature information. The low-resolution feature maps are upsampled using the bilinear interpolation method; the high-resolution feature maps are downsampled using a 3*3 convolution kernel.
[0030] 2) Channel unification: The 1*1 convolution operation used unifies the number of channels of feature maps at each layer to ensure the consistency of features at different levels in the channel dimension; the formula is as follows:
[0031] F i '=Conv 1*1 (F i ) (5)
[0032] Among them, F i represents the feature map of the i-th layer, F i ' is the feature map after unifying the channels;
[0033] 3) Multi-scale fusion: The unified feature maps are weighted and fused by introducing the attention mechanism, and the feature expression of small-scale targets is enhanced by combining context information. The formula is as follows:
[0034]
[0035] Among them, α i is the weight coefficient of the i-th layer feature, and N is the number of layers of the feature pyramid.
[0036] The advantages and effects of the present invention are:
[0037] This paper proposes a surface defect detection method for glazed tiles based on improved Faster R-CNN, ECANet-FPG. By introducing the ECA attention mechanism in the feature extraction network, the expression ability of deep features is enhanced; the FPG feature pyramid component is used to improve the fusion effect of multi-scale features and effectively enhance the detection ability of small-size defects. The proposed method shows high accuracy and robustness in the task of surface defect detection of glazed tiles, which is significantly better than traditional methods. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 This is the ECANet structure diagram of the present invention;
[0039] Figure 2 This is a characteristic pyramid grid structure diagram of the present invention. DETAILED DESCRIPTION
[0040] The present invention will be described in detail below with reference to the embodiments shown in the accompanying drawings.
[0041] 1.ECANet-FPG target detection method
[0042] An ECANet-FPG method is proposed based on the Faster R-CNN model. By introducing a dynamic weighting mechanism in the feature extraction network, different weights are calculated for each channel in the feature map, thereby enhancing the expression ability of important channels and improving the model's response to key features. In addition, a multi-scale feature fusion strategy is adopted. By introducing multiple conversion modules and jump connections, the information flow and fusion effect between features of different scales are improved, and multi-level feature information is fully utilized, thereby improving the detection accuracy of small target defects.
[0043] 2. Improved feature extraction network
[0044] The original Faster R-CNN model uses ResNet as the feature extraction network, but ResNet will ignore some important feature information when processing small targets or edge targets. In order to overcome this problem, it is considered to introduce an attention mechanism in the feature extraction network to strengthen the model's attention to defect information. There are many commonly used attention mechanisms, including SE attention mechanism, CBAM attention mechanism, ECA attention mechanism, BAM attention mechanism and CSART attention mechanism. The CBAM attention mechanism and the BAM attention mechanism combine channel attention and spatial attention, but their computational overhead is relatively high when processing high-resolution feature maps. The Transformers attention mechanism is based on the self-attention mechanism, but due to its complexity and large amount of computation, the training and inference time is long. Since the SE attention mechanism uses two fully connected layers for calculation, it consumes more computing resources, and the ECA attention mechanism is an optimization of the SE attention mechanism. It replaces the fully connected layer with a one-dimensional convolution, which reduces the computational complexity and improves the feature extraction capability. Therefore, the present invention uses ECANet as the ResNet50 feature extraction network of the original Faster R-CNN (the network structure is as shown in Figure 1 shown).
[0045] ECANet is a feature extraction network based on ResNet. Its core lies in the introduction of the ECA attention mechanism after each convolutional layer of ResNet, which can dynamically calculate the importance of each channel in the feature map. This mechanism assigns different weights to each channel in the feature map, thereby enhancing the expression ability of key channels, avoiding the loss and confusion of feature information, and thus improving the overall detection speed and accuracy. The specific implementation steps are as follows:
[0046] 1) Global Average Pooling (GAP): For the input feature map F∈R C*H*W Perform global pooling to obtain the descriptor Z∈R for each channel c, the calculation formula is as follows:
[0047]
[0048] 2) One-dimensional convolution: Through one-dimensional convolution operation, the local dependencies between channels are captured and the attention weight α of each channel is generated. c , the calculation formula is as follows:
[0049] α c =σ(Conv 1*k (Z)) (2)
[0050] Among them, Conv 1*k represents a one-dimensional convolution operation, σ is the sigmoid activation function. k is the convolution kernel width, which is adaptively determined by mapping the channel dimension C. The calculation formula is as follows:
[0051]
[0052] where |t| add represents the odd number closest to t, γ and b are equal to 1
[0053] 3) Feature recalibration: Apply the attention weight to the original feature map to achieve feature recalibration. The specific formula is as follows:
[0054] F c '=α c ·F c +F c c=1,2,3…C (4)
[0055] Among them, α c is the attention weight, F c is the original feature map, F c ' is the recalibrated feature map.
[0056] Through the above steps, ECANet can effectively enhance the feature expression of important channels, suppress irrelevant or redundant features, and improve the detection performance of the overall network.
[0057] 4) Improved feature pyramid
[0058] Traditional FPN (Feature Pyramid Network) upsamples and concatenates feature maps of different scales through top-down paths and lateral connections to achieve multi-scale feature fusion. However, FPN fails to fully consider the relationship and interaction between features of different scales, which limits its performance in processing multi-scale targets, especially in small-scale targets.
[0059] To this end, the present invention uses FPG (Feature Pyramid Generator) as the feature pyramid component of Faster R-CNN (structure as Figure 2 As shown in Figure 1). By introducing graph structure and attention mechanism, FPG enhances the relationship modeling and interaction between features of different scales, and achieves more efficient and accurate feature fusion. The feature fusion process of FPG includes the following three steps:
[0060] 1) Feature alignment: To ensure the consistency of feature maps at different levels in spatial scale, feature maps at different levels are adjusted to the same resolution through upsampling and downsampling operations to ensure the alignment and compatibility of feature information. The low-resolution feature maps are upsampled using bilinear interpolation, and the high-resolution feature maps are downsampled using a 3*3 convolution kernel.
[0061] 2) Channel unification: The 1*1 convolution operation used unifies the number of channels of feature maps at each layer to ensure the consistency of features at different levels in the channel dimension. The formula is as follows:
[0062] F i '=Conv 1*1 (F i ) (5)
[0063] Among them, F i represents the feature map of the i-th layer, F i ' is the feature map after unifying the channels.
[0064] 3) Multi-scale fusion: The unified feature maps are weighted and fused by introducing the attention mechanism, and the feature expression of small-scale targets is enhanced by combining context information. The formula is as follows:
[0065]
[0066] Among them, α i is the weight coefficient of the i-th layer feature, and N is the number of layers of the feature pyramid.
[0067] Through the above steps, the FPG structure can effectively integrate feature information at different levels, enhance the feature expression ability of small-sized targets, and significantly improve the detection accuracy of small-scale defects in glazed tile images. At the same time, the attention mechanism introduced in FPG helps to reduce semantic conflicts and improve the overall detection performance.
Claims
1. A method for detecting surface defects of glazed tiles based on improved FasterR-CNN, characterized in that: The method comprises the following steps: (1)ECANet-FPG target detection method: A dynamic weighting mechanism is introduced into the feature extraction network to calculate different weights for each channel in the feature map, thereby enhancing the expression ability of important channels and improving the response of the model to key features. In addition, a multi-scale feature fusion strategy is adopted to improve the information flow and fusion effect between features of different scales by introducing multiple conversion modules and jump connections, making full use of multi-level feature information, thereby improving the detection accuracy of small target defects. (2) Improved feature extraction network: Introducing the attention mechanism into the feature extraction network to strengthen the model's attention to defect information; using ECANet as the ResNet50 feature extraction network of the original FasterR-CNN; ECANet is a feature extraction network based on ResNet. Its core lies in the introduction of the ECA attention mechanism after each convolutional layer of ResNet, which can dynamically calculate the importance of each channel in the feature map; (3) Improved feature pyramid: Use FPG (Feature Pyramid Generator) as the feature pyramid component of Faster R-CNN; FPG enhances the relationship modeling and interaction between features of different scales by introducing graph structure and attention mechanism, and achieves more efficient and accurate feature fusion; Through the above steps, the FPG structure can effectively fuse feature information at different levels, enhance the feature expression ability of small-size targets, and improve the detection accuracy of small-scale defects in glazed tile images. At the same time, the attention mechanism introduced in FPG helps to reduce semantic conflicts and improve the overall detection performance.
2. According to claim 1, a method for detecting surface defects of glazed tiles based on improved FasterR-CNN is characterized in that: Each channel is assigned a different weight, thereby enhancing the expression ability of the key channel, avoiding the loss and confusion of feature information, and thus improving the overall detection speed and accuracy; the specific implementation steps are as follows: 1) Global Average Pooling (GAP): For the input feature map F∈R C*H*W Perform global pooling to obtain the descriptor Z∈R for each channel c , the calculation formula is as follows: 2) One-dimensional convolution: Through one-dimensional convolution operation, the local dependencies between channels are captured and the attention weight α of each channel is generated. c , the calculation formula is as follows: a c =σ(Conv 1*k (Z)) (2) Among them, Conv 1*k represents a one-dimensional convolution operation, σ is the sigmoid activation function; k is the convolution kernel width, which is adaptively determined by the mapping of the channel dimension C. The calculation formula is as follows: where |t add represents the odd number closest to t, γ and b are equal to 1 3) Feature recalibration: Apply the attention weight to the original feature map to achieve feature recalibration. The specific formula is as follows: F c '=α c ·F c +F c c=1,2,3…C (4) Among them, α c is the attention weight, F c is the original feature map, F c ' is the recalibrated feature map; Through the above steps, ECANet can effectively enhance the feature expression of important channels, suppress irrelevant or redundant features, and improve the detection performance of the overall network.
3. The method for detecting surface defects of glazed ceramic tiles based on improved FasterR-CNN according to claim 1, characterized in that: The feature fusion process of the FPG includes the following three steps: 1) Feature alignment: In order to ensure the consistency of feature maps at different levels in spatial scale, feature maps at different levels are adjusted to the same resolution through upsampling and downsampling operations to ensure the alignment and compatibility of feature information. The low-resolution feature maps are upsampled using the bilinear interpolation method; the high-resolution feature maps are downsampled using a 3*3 convolution kernel. 2) Channel unification: The 1*1 convolution operation used unifies the number of channels of feature maps at each layer to ensure the consistency of features at different levels in the channel dimension; the formula is as follows: F i '=Conv 1*1 (F i ) (5) Among them, F i Represents the feature map of the i-th layer, F i ' is the feature map after unifying the channels; 3) Multi-scale fusion: The unified feature maps are weighted and fused by introducing the attention mechanism, and the feature expression of small-scale targets is enhanced by combining context information. The formula is as follows: Among them, α i is the weight coefficient of the i-th layer feature, and N is the number of layers of the feature pyramid.