A method and system for detecting tile defects

By using a detection model of a deformable convolutional network and a self-attention module in the detection of tiles, the problem of difficult to detect tiles with large scale changes and large spatial position changes in the prior art is solved, and higher detection accuracy and ability are achieved.

CN114841987BActive Publication Date: 2025-07-01YUNNAN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210578252.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-25
Publication Date
2025-07-01
Estimated Expiration
2042-05-25

AI Technical Summary

Technical Problem

The prior art is difficult to accurately detect tiles with large scale changes and large spatial location changes, especially those under complex background patterns.

Method used

The tile defect detection model based on a deformable convolutional network and self-attention module is adopted to identify defect characteristics of different scales and spatial positions through the scale perception layer and the spatial perception layer, and complex background patterns are processed through the self-attention module.

Benefits of technology

Accurate detection of defects in tiles with large scale changes and large spatial location changes are achieved, and the accuracy and ability of defect detection are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114841987B_ABST
    Figure CN114841987B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and system for detecting tile defects, which relates to the technical field of tile production. The method for detecting tile defects includes: acquiring a target tile image; obtaining a tile defect detection result according to the target tile image and a tile defect detection model; the tile defect detection model is established based on a deformable convolutional network and a self-attention module; the tile defect detection result includes whether there are defects in the target tile image, as well as the defect category and position information when there are defects. By establishing a tile defect detection model through a deformable convolutional network and a self-attention module, the present invention can detect defects with large scale changes, large spatial position changes, and those located under complex background patterns, improving the tile defect detection ability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of tile production, and particularly to a tile defect detection method and system. Background Art

[0002] As an important material in the home decoration process, tiles have a complex production process, and various types of defects will appear during the process. These defects will not only affect the appearance of the tiles, but also cause them to lose their protective function for buildings. Therefore, how to effectively detect defective products has become an issue that tile manufacturers must pay attention to. Although the traditional method of manual inspection can achieve certain results, due to human subjective factors, there will inevitably be cases of missed inspection and misjudgment. Therefore, using an automated method to efficiently complete the inspection task has become a research direction of great significance.

[0003] With the development of deep learning, in recent years, some defect detection networks based on Faster R-CNN and YOLO series have achieved good results in the defect detection of concrete building components and steel components. However, these defects are all relatively large in size, and it is relatively simple to obtain their defect features. In the field of tile defect detection, the types of defects not only include large-size defects such as edge abnormalities and corner abnormalities, but also small defects such as spots, and the defects also have various angles of rotation. Therefore, the defects of tiles have the problems of large scale variation and large spatial position variation. In addition, some defects are located in complex background patterns, and the current mainstream networks cannot successfully detect such defects. Summary of the Invention

[0004] The purpose of the present invention is to provide a tile defect detection method and system, which can detect defects with large scale variation, large spatial position variation and located under complex background patterns, and improve the tile defect detection ability.

[0005] To achieve the above purpose, the present invention provides the following solutions:

[0006] A tile defect detection method includes:

[0007] Obtain a target tile image;

[0008] Obtain a tile defect detection result according to the target tile image and a tile defect detection model; the tile defect detection model is established based on a deformable convolutional network and a self-attention module; the tile defect detection result includes whether there are defects in the target tile image and the defect category and position information when there are defects.

[0009] Optionally, the method for determining the tile defect detection model is:

[0010] Obtain training data; the training data includes defective tile training pictures and corresponding defect labels; the defect labels include whether there are defects in the defective tile training pictures and the defect positions when there are defects.

[0011] Input the training data into the deformable convolutional network, use the preliminary detection result output by the deformable convolutional network as the input of the self-attention module, and train with the goal of minimizing the loss between the tile defect prediction result output by the self-attention module and the defect label to obtain the tile defect detection model.

[0012] Optionally, before the step of obtaining training data, it further includes:

[0013] Construct a deformable convolutional network and a self-attention module connected in sequence; the deformable convolutional network includes a scale perception layer, a spatial perception layer, a deformable convolutional layer, and a deformable pooling layer connected in sequence; the self-attention module includes an encoding module, a decoding module, and a prediction module connected in sequence.

[0014] Optionally, before the step of inputting the training data into the deformable convolutional network, using the preliminary detection result output by the deformable convolutional network as the input of the self-attention module, and training with the goal of minimizing the loss between the tile defect prediction result output by the self-attention module and the defect label to obtain the tile defect detection model, it further includes:

[0015] Preprocess the training data to obtain preprocessed data.

[0016] Optionally, the step of preprocessing the training data to obtain preprocessed data specifically includes:

[0017] Construct a sample screening module;

[0018] Input the sliced data into the sample screening module for defect screening to obtain preprocessed data.

[0019] The present invention also provides a tile defect detection system, including:

[0020] An image acquisition module, configured to obtain a target tile picture;

[0021] A defect detection module, configured to obtain a tile defect detection result according to the target tile picture and the tile defect detection model; the tile defect detection model is established based on a deformable convolutional network and a self-attention module; the tile defect detection result includes whether there are defects in the target tile picture and the defect positions when there are defects.

[0022] Optionally, it further includes: a model determination module; the model determination module is used to determine the tile defect detection model; the model determination module includes:

[0023] A data acquisition unit, configured to acquire training data; the training data includes training pictures of defective tiles and corresponding defect labels; the defect labels include whether there are defects in the training pictures of defective tiles and the defect positions when there are defects.

[0024] A model training unit, configured to input the training data into the deformable convolutional network, use the preliminary detection result output by the deformable convolutional network as the input of the self-attention module, and train with the goal of minimizing the loss between the tile defect prediction result output by the self-attention module and the defect label to obtain the tile defect detection model.

[0025] Optionally, the model determination module further includes:

[0026] A model construction unit, configured to construct a deformable convolutional network and a self-attention module connected in sequence; the deformable convolutional network includes a scale perception layer, a spatial perception layer, a deformable convolutional layer, and a deformable pooling layer connected in sequence; the self-attention module includes an encoding module, a decoding module, and a prediction module connected in sequence.

[0027] Optionally, the model determination module further includes:

[0028] A preprocessing unit, configured to preprocess the training data to obtain preprocessed data.

[0029] Optionally, the preprocessing unit includes:

[0030] A filter construction subunit, configured to construct a sample filter module;

[0031] A screening subunit, configured to input the sliced data into the sample filter module for defect screening to obtain preprocessed data.

[0032] According to the specific embodiments provided by the present invention, the following technical effects are disclosed by the present invention:

[0033] The present invention discloses a method and system for detecting tile defects. The tile defect detection method includes using a tile defect detection model to detect defects in a target tile image, obtaining a tile defect detection result of the target tile. The tile defect detection model is established based on a deformable convolutional network and a self-attention module. The tile defect detection result includes whether there are defects in the target tile image, and the defect category and location information when there are defects. The present invention can not only detect microstructural defects by using a deformable convolutional network, solving the problem that the current technology cannot accurately identify tile defects with large scale changes and large spatial position changes in tiles, but also identify defects located under complex background patterns by using a self-attention module, improving the defect detection ability. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required in the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.

[0035] Figure 1 It is a schematic flowchart of the method for detecting tile defects of the present invention;

[0036] Figure 2 It is a logical schematic diagram of the method for detecting tile defects of the present invention;

[0037] Figure 3 It is a schematic diagram of the tile defect detection model of the method for detecting tile defects of the present invention;

[0038] Figure 4 It is a bar chart of the defect distribution of the training data of the method for detecting tile defects of the present invention;

[0039] Figure 5 It is a pie chart of the defect distribution of the training data of the method for detecting tile defects of the present invention

[0040] Figure 6 It is a schematic diagram of the deformable convolutional network of the method for detecting tile defects of the present invention;

[0041] Figure 7 It is a schematic diagram of the deformable ROI pooling layer of the method for detecting tile defects of the present invention;

[0042] Figure 8 It is a schematic diagram of the self-attention module of the method for detecting tile defects of the present invention;

[0043] Figure 9 It is a visualization diagram of the first experimental result of the method for detecting tile defects of the present invention

[0044] Figure 10 This is the visualization diagram of the second experimental result of the tile defect detection method of the present invention;

[0045] Figure 11 This is the schematic structural diagram of the tile defect detection system of the present invention.

[0046] Symbol description:

[0047] 1 - Image acquisition module; 2 - Defect detection module. Detailed implementation manners

[0048] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

[0049] The purpose of the present invention is to provide a tile defect detection method and system, which can detect defects with large scale changes, large spatial position changes, and those under complex background patterns, and improve the tile defect detection ability.

[0050] To make the above objects, features, and advantages of the present invention more obvious and understandable, the present invention will be further described in detail below in conjunction with the accompanying drawings and specific implementation manners.

[0051] As Figure 1 shown, a tile defect detection method provided by an embodiment of the present invention includes:

[0052] Step 100: Obtain a target tile picture.

[0053] Step 200: Obtain a tile defect detection result according to the target tile picture and a tile defect detection model; the tile defect detection model is established based on a deformable convolutional network and a self-attention module; the tile defect detection result includes whether there are defects in the target tile picture and the defect category and location information when there are defects.

[0054] Among them, in step 200, the determination method of the tile defect detection model is:

[0055] The first step: Obtain training data; the training data includes defective tile training pictures and corresponding defect labels; the defect labels include whether there are defects in the defective tile training pictures and the defect category and location information when there are defects.

[0056] In the second step, input the training data into the deformable convolutional network, and use the preliminary detection result output by the deformable convolutional network as the input of the self-attention module. Train with the goal of minimizing the loss between the tile defect prediction result output by the self-attention module and the defect label to obtain the tile defect detection model.

[0057] As a preferred implementation, before the first step, it further includes:

[0058] Construct a deformable convolutional network and a self-attention module connected in sequence; the deformable convolutional network includes a scale perception layer, a spatial perception layer, a deformable convolutional layer, and a deformable pooling layer connected in sequence; the self-attention module includes an encoding module, a decoding module, and a prediction module connected in sequence, as Figure 3 shown.

[0059] As a preferred implementation, before the second step, it further includes:

[0060] Preprocess the training data to obtain preprocessed data, specifically including:

[0061] S1: Construct a sample filter module.

[0062] S2: Input the sliced data into the sample filter module for defect screening to obtain preprocessed data.

[0063] Refer to Figure 2 shown. As an implementation, in step 200, an industrial camera is used to capture high-resolution (8000*6000) tile pictures, and through manual marking, a set of training data is obtained. The training data includes defective tile training pictures and corresponding defect labels; the defect labels include whether there are defects in the defective tile training pictures and the defect category and location information when there are defects. The defect distribution of the training data is as Figures 4 - 5 shown.

[0064] In order to enable the tile defect detection model to process the high-resolution images in the above steps, image slicing and defect screening are performed. Among them, defect screening is to balance the number of positive and negative samples through sample balancing technology to improve the training and inference effects of the model. The specific approach is:

[0065] In the first step, perform slicing operations on the pictures and labels in the training data. Cut the high-resolution pictures into pictures with a resolution of 512*512, and at the same time, in order to prevent a single defect from being cut into different pictures, set the overlapping rate of the slices to 0.2.

[0066] In the second step, after the previous step of processing, 1.316 million sub-images with a resolution of 512*512 are obtained. After analyzing the data, it is found that there are a large number of flawless samples in the sliced dataset. The specific quantities are 50,000 flawed samples and 1.266 million flawless samples, with a ratio of 1:21. At this time, sample balancing technology is used to balance the number of positive and negative samples.

[0067] The specific approach of the sample balancing technology is as follows: At the very beginning of model construction, a sample screening module is added. The image labels are read iteratively, and then it is judged whether there are flaws in the labels. If there are flaws, the label and the corresponding image are sent into the network for training; if there are no flaws, it is skipped without processing. Then continue to process the next label.

[0068] The sub-images after label processing are divided into 10 parts, among which 7 parts are used as the training set and 3 parts are used as the test set. The types of tile flaws selected in this embodiment are edge anomalies, corner anomalies, white dot flaws, light-colored block flaws, dark dot flaws, and aperture flaws. The types of tile flaws can be adjusted according to the actual situation.

[0069] Analysis of the training data can reveal that dark dot flaws and white dot flaws in the tile data respectively account for 52% and 20% of the total number of flaws, and such tiny flaws account for a relatively large proportion. It can be seen that there are problems with large scale variations and large spatial position variations among various flaws, and some flaws are located in complex background patterns. The currently mainstream detection networks cannot successfully detect these flaws. However, the tile flaw detection model constructed based on the deformable convolutional network and the self-attention module in the present invention can well solve this problem. The composition steps of the tile flaw detection model are as follows.

[0070] Refer to Figure 6 As shown, first, construct a deformable convolutional network:

[0071] In the first step, construct a scale perception layer.

[0072] Since there are both large-scale aperture flaws and micro-structured dot flaws in this training data. In order to be able to detect these flaws simultaneously, in the present invention, a scale perception attention layer is used to enable the network to adaptively learn the importance of the information at different positions of the feature map for the detection result, so as to adaptively adjust the weights of different-scale features. The specific approach is as follows: First, the input image is used for feature extraction by resnet50, and the extracted feature map is used as the input of the scale perception layer, denoted as where L represents the number of different scale levels in the feature pyramid. We first scale the feature maps of these different layers to the same size, and the new feature map obtained is denoted as F∈R L×H×W×C, where \(L\) represents the total number of different scale levels of the feature map, and \(H\), \(W\), and \(C\) represent the height, width, and number of channels of the feature map. Let \(S = H\times W\), then the feature map can also be denoted as \(F\in\mathbb{R}\) L ×S×C . By applying the scale-aware attention function on the corresponding channels of the \(L\) number, the network can identify the defect information at different scale levels. The specific approach is as follows:

[0073]

[0074] \(\pi\) L is the attention function acting on the scale dimension of the feature map. \(f(\cdot)\) is a linear function, \(S\) represents the spatial dimension of the feature map, and \(C\) represents the channel dimension of the feature map. This scale-aware attention function will enable the network to learn the importance of each scale feature information in the feature map for the detection result, thereby adjusting its own weights.

[0075] The second step is to construct the spatial-aware layer.

[0076] Take the output of the previous step as the input of this module, denoted as \(F'\in\mathbb{R}^0\) L×S×C , where the spatial dimension \(S\) contains the spatial position information of the defects in the feature map, including the rotation information and spatial position transformation information of the defects. Apply the spatial-aware attention function on this dimension, so that the network can identify the defects of the rotation type. The specific method is as follows:

[0077]

[0078] \(\pi\) S is the spatial-aware attention function acting on the spatial dimension \(S\), where \(K\) is the number of sampling points, \(L\) represents the total number of different scale levels of the feature map, \(p\) k is the offset of the sampling point, from which the position \(p\) k +\(\Delta p\) k of the new sampling point can be calculated, \(\Delta m\) k is the scale scaling factor, used to perform the scaling operation on the bounding box, \(k\) represents enumerating the positions of all sampling points at each \(l\) scale level, \(l\) represents enumerating each scale level from 1 to \(L\), \(c\) represents the channel dimension of the feature map, \(w\) l,k represents the weight value at the \(k\) position at the \(l\) scale level. After the steps of the scale-aware layer and the spatial-aware layer, we will get the feature map \(W(F)=\pi\) S \((\pi\) L (F)\cdot F)\cdot F\), and send it to the subsequent module for processing.

[0079] The third step is to construct the deformable convolutional layer.

[0080] The convolution operation in the field of deep learning is as follows:

[0081]

[0082] Among them, I is the image of the input network, R is the convolution kernel, i and j represent the coordinate values of each point of the feature map, m represents the width of the convolution kernel, and n represents the height of the convolution kernel.

[0083] On the one hand, due to its translational invariance, the standard convolution will cause the network to be unable to recognize defects with large spatial position transformations. On the other hand, the size of the convolution kernel used in the convolution operation is rectangular, so its sampling points are also sampled for fixed pixels of the input image. However, the appearance of tile defects varies greatly and there are rotations at different angles. Using the standard convolution cannot well recognize such defects. Therefore, a deformable convolution module is added to the network to enable the network to adaptively learn the sampling positions of the defects. Let the convolution kernel R be:

[0084] R = {(-1, -1), (-1, 0),..., (0, 1), (1, 1)} (4)

[0085] Perform a convolution operation on the input image to obtain the feature map y:

[0086]

[0087] In Equation (5), p n is all elements of the convolution kernel R, x(p0 + p n ) represents the value at the position p0 + p of the feature map n , and w(p n ) represents the value at the position p of the convolution kernel n .

[0088] The difference between deformable convolution and standard convolution is that it will add an offset of the form Δp n to each sampling point of the convolution kernel during the sampling process: {Δp n | n = 1,..., N}, where N = |R|, and Δp n is the offset of each sampling point of the convolution kernel learned by the network. The convolution operation in Equation (5) then becomes:

[0089]

[0090] By applying this variable of the offset, the sampling position of the convolution kernel can be changed, enabling the network to learn more defect feature information.

[0091] Step 4: Construct a deformable pooling layer.

[0092] Standard ROI pooling maps the region proposal boxes back to the original image at fixed positions. However, for defects with large scale variations, the region proposal boxes need to be fine-tuned so that the defect regions can occupy most of the proposal boxes, avoiding misdetection by the network caused by interference from irrelevant background factors, such as Figure 7 as shown

[0093] Assume the input image is x, the size of the region proposal box is w×h, and p0 is a point on the proposal box. ROI pooling first maps the region proposal box to the original image and divides this region into k×k regions, and then outputs a feature map y of size k×k. For each region bin(i,j) (0 ≤ i,j ≤ k), that is:

[0094]

[0095] where n ij is the number of pixel points in bin(i,j), p0 is the position of the top left corner of the grid, p represents traversing each position in region bin(i,j), and Δp i,j represents the offset of the (i,j)-th position in bin(i,j) learned by the network, and Δp i,j satisfies {Δp i,j |0 ≤ i,j ≤ k}. Applying Δp i,j to each element of bin(i,j) we will get the offset RoI region:

[0096]

[0097] The input image is processed by the RoI pooling layer and then sent to the FC layer, and then the learned offset information is set to The variable Δp in Equation (8) is obtained through the following formula i,j :

[0098]

[0099] where λ is a prior value, set to 0.2 in this embodiment, and the symbol represents the dot product of vectors, and w0, h0 represent the width and height of the RoI box

[0100] Secondly, construct the self-attention module:

[0101] During the training process of bounding box-based defect detection networks such as Faster R-CNN and YOLO series, some background interference factors will be incorporated into the bounding boxes, preventing the network from learning effective feature information. Especially for defects like edge anomalies, due to their large size, the size of their bounding boxes will also increase. However, because of their long and narrow shape, the proportion of defect feature information within the bounding box is relatively small, which may cause the network to produce false detections due to excessive background interference in the bounding box. On the other hand, due to the accumulation process after sampling at the sampling points in convolutional operations, this accumulation process will also incorporate background interference information into the feature map, which is not conducive to the network's learning of defect features. The present invention adds a self-attention module to the backbone network to identify such defects by learning the degree of association between different positions in the image. Refer to Figure 8 as shown, which specifically includes the following steps:

[0102] The first step is to construct an encoding module.

[0103] This first module converts the feature map output by the deformable convolutional network into a sequence, and then obtains the position information of this sequence through encoding. After fusing the obtained position information with the original sequence, it is sent into the multi-head self-attention module of the encoding module. This multi-head self-attention module calculates the degree of association between each element of the feature map and outputs it as an attention matrix. The value of each element in the matrix represents the degree of association between each point in the sequence and other points. After repeating this module 6 times, it is output to the decoding part.

[0104] The second step is to construct a decoding module.

[0105] The structure of the decoding module is basically the same as that of the encoding module. The difference is that n query vectors are sent into this module together. n is a parameter set artificially, and the purpose is to limit the number of outputs of the decoding module. This parameter represents the maximum number of prediction boxes in the feature map. Set this parameter to 30, and then send the output into the prediction module.

[0106] The third step is to construct a prediction module.

[0107] Since the matching process between the prediction box and the ground truth box can be regarded as a bipartite graph matching. In this embodiment, the Hungarian algorithm is used for processing, and the loss between the prediction box and the ground truth box is calculated, denoted as a matrix, and then a combination with the smallest loss is selected as the final result (i.e., taking the minimum loss as the iterative constraint condition). In addition, since the number of prediction boxes output by the decoding module is greater than the number of ground truth boxes, we need to set an empty category to correspond to these extra prediction boxes. Thus, the construction of the network is completed. Start the training steps of the network.

[0108] Finally, due to the large number of network parameters, in order to enable the tile defect detection model to learn better parameters, in this embodiment, transfer learning technology is used to first train the network in the COCO large dataset for 30 epochs to obtain a pre-trained network. In particular, due to the certain differences between the feature information of tile defects and the feature information of objects in the COCO dataset, the Fine-tune technology of transfer learning is used to open the parameters of the feature extraction layer, and the pre-trained model is trained on this tile dataset for 70 epochs to fine-tune the network parameters, and finally the tile defect detection model FDTR is obtained.

[0109] Load the obtained tile defect detection model into the tile real-time detection system, detect the tile images in the dataset, and compare with the main methods in the current defect detection field. The mAP index is shown in Table 1, and the efficiency index is shown in Table 2.

[0110] Table 1: Comparison of the effects of the present invention and the current mainstream detection networks Unit: %

[0111]

[0112] Among them, mAP_s represents the detection index of the network for small defects, mAP_m is the detection index of the network for medium-sized defects, mAP_l is the detection index of the network for large-sized defects, and mAP is the evaluation detection index of the network. It can be seen from the data in the above table that each index of the FDTR network of the present invention on the tile defect detection dataset is significantly better than other networks.

[0113] Table 2: Comparison of the performance of the present invention and the current mainstream detection networks

[0114]

[0115]

[0116] It can be seen from the above table that the FDTR method of the present invention can still achieve good performance in the training and detection stages when the mAP is greatly improved. The detection speed of 27 images per second can basically meet the requirements of real-time detection in tile production.

[0117] Refer to Figures 9 - 10 It can be seen that whether it is a tiny defect or a defect under the background pattern, the network can successfully detect it.

[0118] Some steps in the embodiments of the present invention can be implemented by software, and the corresponding software program can be stored in a readable storage medium, such as an optical disc or a hard disk, etc.

[0119] Refer to Figure 11As shown in the figure, the present invention also provides a tile defect detection system, including: an image acquisition module 1 and a defect detection module 2.

[0120] The image acquisition module 1 is used to obtain a target tile picture.

[0121] The defect detection module 2 is used to obtain a tile defect detection result according to the target tile picture and a tile defect detection model; the tile defect detection model is established according to a deformable convolutional network and a self-attention module; the tile defect detection result includes whether there are defects in the target tile picture and the defect positions when there are defects.

[0122] As a preferred implementation manner, the tile defect detection system further includes: a model determination module; the model determination module is used to determine the tile defect detection model; the model determination module includes: a data acquisition unit and a model training unit.

[0123] The data acquisition unit is used to acquire training data. The training data includes defective tile training pictures and corresponding defect labels; the defect labels include whether there are defects in the defective tile training pictures and the defect positions when there are defects.

[0124] The model training unit is used to input the training data into the deformable convolutional network, use the preliminary detection result output by the deformable convolutional network as the input of the self-attention module, and perform training with the goal of minimizing the loss between the tile defect prediction result output by the self-attention module and the defect label, so as to obtain the tile defect detection model.

[0125] In a further solution, the model determination module further includes: a model construction unit.

[0126] The model construction unit is used to construct a deformable convolutional network and a self-attention module connected in sequence; the deformable convolutional network includes a scale perception layer, a space perception layer, a deformable convolutional layer, and a deformable pooling layer connected in sequence; the self-attention module includes an encoding module, a decoding module, and a prediction module connected in sequence.

[0127] Specifically, the model determination module further includes: a preprocessing unit.

[0128] The preprocessing unit is used to preprocess the training data to obtain preprocessed data.

[0129] Specifically, the preprocessing unit includes: a filter construction subunit and a filtering subunit.

[0130] The filter construction subunit is used to construct a sample filter module.

[0131] The screening subunit is configured to input the slice data into the sample screening module for defect screening to obtain preprocessed data.

[0132] In the present specification, the various embodiments are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. For the same or similar parts among the various embodiments, reference can be made to each other. For the system disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple. For the relevant parts, reference can be made to the description in the method section.

[0133] In this article, specific examples are used to elaborate on the principles and implementation manners of the present invention. The descriptions of the above embodiments are only used to help understand the method of the present invention and its core idea. At the same time, for those of ordinary skill in the art, based on the idea of the present invention, there will be changes in the specific implementation manners and application scopes. In summary, the content of this specification should not be construed as a limitation on the present invention.

Claims

1. A method for detecting tile defects, characterized in that, Including: Obtain the target tile image; Obtain the tile defect detection result according to the target tile image and the tile defect detection model; The tile defect detection model is established based on the deformable convolutional network and the self-attention module; the tile defect detection result includes whether there are defects in the target tile image and the defect category and location information when there are defects; The deformable convolutional network includes a scale perception layer, a spatial perception layer, a deformable convolutional layer, and a deformable pooling layer connected in sequence; the self-attention module includes an encoding module, a decoding module, and a prediction module connected in sequence; The deformable convolutional layer is used to enable the deformable convolutional network to adaptively learn the sampling positions of defects; constructing the deformable convolutional layer specifically includes: Perform convolutional operations on the deep learning field: Among them, S(i,j) is the convolutional operation of the deep learning field, I is the image input to the network, R is the convolutional kernel, i and j represent the coordinate values of each point of the feature map, m represents the width of the convolutional kernel, and n represents the height of the convolutional kernel; Perform convolutional operations on the input image to obtain a feature map; Among them, y(p0) is the feature map obtained by performing a convolution operation on the input image, p n is all elements of the convolution kernel R, p0 is a point on the region proposal box, and Δp n is the offset of each sampling point of the convolution kernel, x(·) is the input image, and x(p0 + p n+ Δp n ) represents the value at p0 + p n+ Δp n in the input image, and w(p n ) represents the value of the convolution kernel pn at that position; The deformable pooling layer is used to fine-tune the region proposal box so that the tile defect region can occupy most of the region proposal box, avoiding misdetection of the deformable convolutional network caused by the interference of irrelevant background factors; constructing the deformable pooling layer specifically includes: Map the region proposal box to the original feature map, where the original feature map is the input of the scale perception layer, and divide the region proposal box mapped to the original feature map into k×k regions, for each region bin(i,j)(0≤i, j≤k): Apply Δp i,j to each element of bin(i, j) to obtain the offset RoI region, and output the feature map of each element after offset: Process the feature map with the offset of each element through the RoI pooling layer and send it to the FC layer; Among them, x(·) is the input image, y(i,j) is the feature map after offset of each element, and n ij is the number of pixels in bin(i,j), p0 is the point on the region proposal box, p represents traversing each position of region bin(i,j), and Δp i,j represents the offset of the (i,j)-th position in bin(i,j) learned by the network, {Δp i,j | 0 ≤ i, j ≤ k}, λ is the prior value, Regarding the learned offset information, the symbol represents the dot product of vectors, and w0, h0 represent the width and height of the RoI box.

2. The tile defect detection method according to claim 1, wherein The method for determining the tile defect detection model is: Obtain training data; the training data includes defective tile training pictures and corresponding defect labels; the defect labels include whether there are defects in the defective tile training pictures and the defect category and location information when there are defects; Input the training data into the deformable convolutional network, use the preliminary detection result output by the deformable convolutional network as the input of the self-attention module, and train with the goal of minimizing the loss between the tile defect prediction result output by the self-attention module and the defect label to obtain the tile defect detection model.

3. The tile defect detection method according to claim 2, wherein, Before the step of obtaining the training data, it further includes: Construct a deformable convolutional network and a self-attention module connected in sequence.

4. The tile defect detection method according to claim 2, wherein Before the step of inputting the training data into the deformable convolutional network, using the preliminary detection result output by the deformable convolutional network as the input of the self-attention module, and training with the goal of minimizing the loss between the tile defect prediction result output by the self-attention module and the defect label to obtain the tile defect detection model, it further includes: Preprocess the training data to obtain preprocessed data.

5. The tile defect detection method according to claim 4, characterized in that The step of preprocessing the training data to obtain preprocessed data specifically includes: Construct a sample screening module; Input the sliced data into the sample screening module for defect screening to obtain preprocessed data.

6. A tile defect detection system, characterized in that, Including: An image acquisition module for obtaining target tile pictures; A defect detection module for obtaining a tile defect detection result based on the target tile picture and a tile defect detection model; the tile defect detection model is established based on a deformable convolutional network and a self-attention module; the tile defect detection result includes whether there are defects in the target tile picture and the defect category and location information when there are defects; The deformable convolutional network includes a scale perception layer, a spatial perception layer, a deformable convolutional layer, and a deformable pooling layer connected in sequence; the self-attention module includes an encoding module, a decoding module, and a prediction module connected in sequence; The deformable convolutional layer is used to enable the deformable convolutional network to adaptively learn the sampling positions of defects; constructing the deformable convolutional layer specifically includes: Performing a convolutional operation on the deep learning field: Where S(i,j) is the convolutional operation of the deep learning field, I is the image input to the network, R is the convolutional kernel, i and j represent the coordinate values of each point of the feature map, m represents the width of the convolutional kernel, and n represents the height of the convolutional kernel; Performing a convolutional operation on the input image to obtain a feature map: Among them, y(p0) is the feature map obtained by performing a convolution operation on the input image, p n are all elements of the convolution kernel R, p0 is a point on the region proposal box, and Δp n is the offset of each sampling point of the convolution kernel, x(·) is the input image, and x(p0 + p n+ Δp n ) represents the value of the input image at p0 + p n+ Δp n , and w(p n ) represents the value taken by the convolution kernel at pn ; The deformable pooling layer is used to fine-tune the region proposal box so that the tile defect region can occupy most of the region proposal box, avoiding misdetection of the deformable convolutional network caused by interference from irrelevant background factors; constructing the deformable pooling layer specifically includes: Mapping the region proposal box to the original feature map, where the original feature map is the input of the scale perception layer, and dividing the region proposal box mapped to the original feature map into k×k regions, for each region bin(i,j) (0≤i, j≤k): Apply Δp i,j to each element of bin(i,j) to obtain the offset RoI region, and output the feature map with each element offset: Processing the feature map with each element offset through the RoI pooling layer and sending it to the FC layer: Among them, x(·) is the input image, y(i,j) is the feature map after offset of each element, and n ij is the number of pixels in bin(i,j), p0 is the point on the region proposal box, p represents traversing each position of region bin(i,j), and Δp i,j represents the offset of the (i,j)-th position in bin(i,j) learned by the network, {Δp i,j | 0 ≤ i, j ≤ k}, λ is the prior value, The learned offset information, the symbol represents the dot product of vectors, and w0, h0 represent the width and height of the RoI box.

7. The tile defect detection system according to claim 6, characterized in that, It further includes: A model determination module; The model determination module is used to determine the tile defect detection model; The model determination module includes: A data acquisition unit for acquiring training data; the training data includes defective tile training pictures and corresponding defect labels; the defect labels include whether there are defects in the defective tile training pictures and the defect category and location information when there are defects; A model training unit for inputting the training data into the deformable convolutional network, using the preliminary detection result output by the deformable convolutional network as the input of the self-attention module, and training with the goal of minimizing the loss between the tile defect prediction result output by the self-attention module and the defect label to obtain the tile defect detection model.

8. The tile defect detection system according to claim 7, wherein The model determination module further includes: A model construction unit for constructing a deformable convolutional network and a self-attention module connected in sequence; the deformable convolutional network includes a scale perception layer, a spatial perception layer, a deformable convolutional layer, and a deformable pooling layer connected in sequence; the self-attention module includes an encoding module, a decoding module, and a prediction module connected in sequence.

9. The tile defect detection system according to claim 7, characterized in that, The model determination module further includes: A preprocessing unit for preprocessing the training data to obtain preprocessed data.

10. The tile defect detection system according to claim 9, wherein, The preprocessing unit includes: A filter construction subunit for constructing a sample filter module; A screening subunit, configured to input the slice data into the sample screening module for defect screening to obtain preprocessed data.

Citation Information

Patent Citations

  • Ceramic tile flaw detection and recognition method and system

    CN113627435A

  • Small sample SAR target classification method based on deformable convolution and double attention

    CN113655479A