A method and device for identifying sawtooth chipping defects based on edge enhancement

Through the identification method based on edge enhancement, convolutional neural network and semantic segmentation model are used to solve the problem of low efficiency and accuracy in the detection of saw blade chipping defects, achieve fast and accurate chipping defect identification, and ensure the quality of the saw blade. and security.

CN118247279BActive Publication Date: 2024-09-13XIANGJIANG LAB
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410673377.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-28
Publication Date
2024-09-13
Estimated Expiration
2044-05-28

AI Technical Summary

Technical Problem

The existing technology has low detection efficiency and low accuracy in detecting saw blade chipping defects, is prone to missed detections and false detections, and is difficult to deal with the randomness of sawtooth edges and small target identification problems.

Method used

The sawtooth chipping defect identification method based on edge enhancement is used to obtain the jagged image through a convolutional neural network, perform feature extraction and edge enhancement, and combine the semantic segmentation model and multi-scale depth separable convolution to locate the jagged edge and identify the chipping defect.

Benefits of technology

It achieves fast and accurate automatic identification of saw tooth chipping defects, improves detection accuracy and reliability, reduces missed detections and false detections, and ensures the quality and safety of saw blades.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118247279B
    Figure CN118247279B
Patent Text Reader

Abstract

The present invention discloses a method and device for identifying sawtooth and chipped tooth defects based on edge enhancement, and the method comprises the following steps: step S01. obtaining a sawtooth image to be identified, and preliminarily locating the ROI region of the sawtooth region; step S02. extracting features from the ROI region to obtain feature maps of different resolutions, and performing edge enhancement to obtain an edge enhancement map; step S03. semantically segmenting the feature map and the edge enhancement map to locate the sawtooth edge position, and performing convolution operations on the feature maps corresponding to at least two specified positions in the semantic segmentation model using deformable hole convolution kernels with different expansion rates, merging semantic information of different scales with the edge enhancement map, and performing multi-scale depth-separable convolution operations; step S04. cutting out the sawtooth region, and inputting it into a chipped tooth defect detection model for identification to obtain an identification result. The present invention has the advantages of simple implementation method, low complexity, high detection efficiency, high precision, and strong robustness.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of saw blade defect detection, and in particular to a sawtooth chipping defect identification method and device based on edge enhancement. Background Art

[0002] Saw blades are a kind of cutting tool widely used in machinery, hand tools, electric saws and other fields in the field of mechanical manufacturing, and can be used to cut various materials. Quality inspection of saw blades can ensure their quality and safety. Detection of chipped teeth defects in saw blades is an important part of saw blade quality inspection. For the detection of chipped teeth defects in saw blades, manual sampling is currently the main method used. If chipped teeth are detected, the defective area is marked for saw blade quality assessment. However, the manual sampling method has low detection efficiency on the one hand, and can only be used to inspect the produced saw blades, which makes it difficult to cover all produced saw blades, and can only be performed when the saw blades are stationary. On the other hand, the detection accuracy is not high, which can easily lead to missed detections, false detections, etc.

[0003] The intelligent defect detection method is to collect the characteristics of the object to be tested, use intelligent detection algorithms to locate and identify the defects to be detected, and intelligently identify the defect location, which can improve the efficiency and accuracy of detection. However, the intelligent detection algorithm in the existing technology is usually suitable for the detection of surface defects, that is, defects located on the surface of the carrier. Unlike surface defects, saw blade tooth chipping defects mainly occur at the edge of the sawtooth, and the defect geometry, size, and position have a certain randomness. The defect shape and the sawtooth edge are often integrated, that is, the tooth chipping defect and the saw blade edge are integrated. The specific manifestation of the tooth chipping defect is that the saw blade edge has a certain geometric defect. Since the area of ​​the tooth chipping defect is small, and the shape of the sawtooth at different positions has certain changes due to factors such as the sawtooth action and the manufacturing process, the use of traditional defect detection methods to directly locate and identify defects will face the problem of small target detection and identification and the serious imbalance of positive and negative samples, resulting in low detection efficiency and accuracy, and prone to missed detection and false detection. Summary of the Invention

[0004] The technical problem to be solved by the present invention is: in response to the technical problems existing in the prior art, the present invention provides a sawtooth chipping defect identification method and device based on edge enhancement with simple implementation method, low complexity, high detection efficiency and accuracy, which can realize fast and accurate automatic identification of sawtooth chipping defects.

[0005] In order to solve the above technical problems, the technical solution proposed by the present invention is:

[0006] A method for identifying sawtooth chipping defects based on edge enhancement, comprising the following steps:

[0007] Step S01: Obtain the serration image to be identified and preliminarily locate the ROI (Region of Interest) area of ​​the serration area;

[0008] Step S02: Using a convolutional neural network to extract features of the ROI region to obtain feature maps of different resolutions, and performing edge enhancement on the obtained feature maps to obtain an edge enhanced map of the ROI region;

[0009] Step S03: Inputting the feature map and the edge enhancement map into a pre-built semantic segmentation model for semantic segmentation to locate the jagged edge position. In the semantic segmentation model, the feature maps of different resolutions corresponding to at least two specified positions are convolved using deformable dilated convolution kernels with different dilation rates to obtain semantic information of different scales. The semantic information of different scales is merged with the edge enhancement map, and the merged results are subjected to multi-scale depth-separable convolution operations using different convolution kernel receptive fields to fuse the semantic information of different scales.

[0010] Step S04: extracting a sawtooth region according to the sawtooth edge position, and inputting the extracted sawtooth region into a chipped tooth defect detection model pre-trained using a chipped tooth defect sample dataset for identification to obtain a chipped tooth defect identification result.

[0011] Furthermore, in step S03, the semantic segmentation model is constructed based on the deeplabv3+ module, and a DSPP (Deformable Spatial Pyramid Pooling) module is set in the deeplabv3+ module to perform deformable convolution and hole convolution operations with different expansion rates on feature maps of different resolutions to obtain semantic information of different scales, and an MDWS (multiscale depth-wise sepseparable) module composed of multiple parallel depth-separable convolutions is set to merge the output of the DSPP module with the edge enhancement map and perform multi-scale depth-separable convolution operations in parallel using different convolution kernel receptive fields.

[0012] Furthermore, the DSPP module performs a deformable convolution operation according to the following formula:

[0013]

[0014]

[0015] in, represents the input, H is the height, W is the width, C is the number of channels, and G is the number of spatial aggregation groups; for the g-th group, represents the input / output feature map of the slice, where represents the group dimension; represents the spatial aggregation weight of the kth sampling point in the gth group; represents the kth position in the grid sampling points predefined with different expansion rates in the dilated convolution, and K represents the total number of positions; is the grid sampling position corresponding to the gth group The offset, axis =-1 represents the last axis in a multidimensional array, Represents the center point of the convolution kernel.

[0016] Furthermore, it also includes setting a SCAF (spatial-channel attention fusion) module that fuses the attention mechanism with the residual structure in the semantic segmentation model, so as to respectively adopt a channel attention mechanism based on the MLP multi-layer perceptron and a channel attention mechanism based on 1×1 convolution for the output of the MDWS module, and then multiplying the results of the two attention mechanisms and adding them to the output of the MDWS module to obtain the final fusion result.

[0017] Furthermore, in step S02, the phase consistency model is used to perform edge enhancement on the obtained feature map to obtain an edge enhancement map of the ROI region. The calculation expression of the phase consistency measure at position x is:

[0018]

[0019] Where, Indicates the n indivual Fourier the magnitude of the component; Indicates location x at The local phase of the component, Yes exist x The weighted average of the local phase angles of the Fourier components when the maximum value is taken at .

[0020] Furthermore, the step S03 also includes pre-training the semantic segmentation model. During the training process, the weights of the public dataset are first used as the initial weights, and the original sample dataset is reduced in size. The model is initially coarsely trained using the reduced sample dataset based on the cross loss function. After the coarse training is completed, the pre-trained weights generated by the coarse training are used as the initial weights for fine training. The model is fine-tuned using the size resolution of the original sample data and dice loss to obtain the final semantic segmentation model weights. The step S04 also includes pre-training the classification model. During the training process, the weights trained on the public defect detection dataset are first used as pre-training weights. The classification model is preliminarily trained using normal labels and cross loss functions to obtain pre-training weights. The sample labels are then smoothed using the pre-training weights, and the model is fine-tuned using focal loss to obtain the final classification model weights.

[0021] Furthermore, the step S04 further includes pre-generating a chipped tooth defect sample dataset to train a chipped tooth defect detection model. The step of generating the chipped tooth defect sample dataset includes:

[0022] Generate mask images of tooth chipping defects of different shapes and sizes;

[0023] Slide the chipped tooth defect mask image along the sawtooth edge position, perform matrix multiplication on the slid position and the local image corresponding to the normal sawtooth area image, and generate a defect composite image dataset at different positions;

[0024] Constructing a generative adversarial network, using the original defect dataset and the defect synthetic image dataset as a training set to train the generative adversarial network to establish a data enhancement model, and generating a chipped tooth defect enhanced dataset through the data enhancement model;

[0025] The original defect dataset, the defect synthetic image dataset, and the chipped tooth defect enhanced dataset generated by the generative adversarial network are merged as the final chipped tooth defect sample dataset.

[0026] Furthermore, the step of generating mask images of chipped teeth defects of different shapes and sizes includes:

[0027] Obtain binary images of tooth chipping defects of different shapes and sizes, generate tooth chipping masks of different shapes and sizes, and obtain binary mask images;

[0028] Obtaining a minimum circumscribed matrix of the binary mask image;

[0029] A mask region is intercepted according to the minimum circumscribed matrix, and the intercepted mask region is inverted to obtain a final tooth chipping defect mask image.

[0030] A device for identifying sawtooth and chipped tooth defects based on edge enhancement, comprising the following steps:

[0031] The ROI area preliminary positioning module is used to obtain the serration image to be identified and preliminarily locate the ROI area of ​​the serration area;

[0032] A feature extraction module is used to extract features from the ROI region using a convolutional neural network to obtain feature maps of different resolutions, and to perform edge enhancement on the obtained feature maps to obtain an edge enhanced map of the ROI region;

[0033] a jagged edge location module, configured to input the feature map and edge enhancement map into a pre-built semantic segmentation model for semantic segmentation to locate the jagged edge position, wherein the semantic segmentation model obtains semantic information of different scales by performing convolution operations on the feature maps of different resolutions corresponding to at least two specified positions using deformable dilated convolution kernels with different dilation rates, respectively, merging the semantic information of different scales with the edge enhancement map, and performing multi-scale depth-separable convolution operations on the merged results using different convolution kernel receptive fields to fuse the semantic information of different scales;

[0034] The defect recognition module is used to cut out a sawtooth area according to the located sawtooth edge position, and input the cutout sawtooth area into a classification model for identification to obtain a defect type.

[0035] A device for identifying sawtooth and chipped tooth defects based on edge enhancement includes a processor and a memory, wherein the memory is used to store a computer program, and the processor is used to execute the computer program to perform the above method.

[0036] Compared with the prior art, the advantages of the present invention are:

[0037] 1. The present invention preliminarily determines the ROI area of ​​the sawtooth area, extracts the feature map and performs edge enhancement to obtain the edge enhancement map, and then inputs the feature map and edge enhancement map of the ROI area into the semantic segmentation model to realize the extraction of the sawtooth edge, and then accurately cuts out the sawtooth area based on the determined sawtooth edge position, and finally uses the cut-off sawtooth area image to input into the chipped tooth defect detection model for defect recognition, which can avoid the small target detection problem and the positive and negative sample imbalance problem caused by directly locating the defect area for detection, improve the accuracy and reliability of sawtooth chipped tooth defect recognition, and thus ensure the quality and safety of the saw blade.

[0038] 2. When the present invention uses a semantic segmentation model to extract jagged edges, the feature extraction capability of the model can be improved by adopting deformable hole convolution with different expansion rates for different feature maps. The edge representation capability of the feature map can be enhanced by fusing the edge enhanced image with the feature map of the original image. Multi-scale depth-separable convolution operations are performed using different convolution kernel receptive fields. Not only can the operation speed be accelerated through separable convolution, but also semantic information of different scales can be fused through convolution kernel receptive fields of different sizes, thereby further improving the model's feature extraction capability for images, thereby obtaining clear and characteristic jagged areas for defect identification, so that the chipped tooth defects of the jagged teeth under different processes and different types of jagged shapes can be quickly and accurately identified, reducing missed detection and false detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 This is a schematic diagram of the implementation process of the sawtooth chipping defect recognition method based on edge enhancement in this embodiment.

[0040] Figure 2 Schematic diagram of the structure and principle of the data acquisition system used in this embodiment.

[0041] Figure 3 It is a schematic diagram of the sawtooth imaging effect obtained in a specific application embodiment of the present invention.

[0042] Figure 4 It is a schematic diagram of the effect of the sawtooth initial ROI area obtained in a specific application embodiment of the present invention.

[0043] Figure 5 It is a schematic diagram of the ROI area effect obtained under the condition of sawtooth uneven illumination in a specific application embodiment of the present invention.

[0044] Figure 6 This is a schematic diagram of the implementation process of the present embodiment for achieving precise positioning of the sawtooth area.

[0045] Figure 7 This is a schematic diagram of the structural principle of the improved deeplabv3+ semantic segmentation model used in this embodiment.

[0046] Figure 8 FIG. 4 is a schematic diagram of the structural principle of the DSPP module used in this embodiment.

[0047] Figure 9 It is a schematic diagram of the structural principle of the MDWS module used in this embodiment.

[0048] Figure 10 FIG. 4 is a schematic diagram of the structural principle of the SCAF module used in this embodiment.

[0049] Figure 11This is a flowchart of the implementation of semantic segmentation model training in this embodiment.

[0050] Figure 12 This is a schematic diagram of the implementation process of constructing a chipped tooth defect dataset to enhance the chipped tooth defect data in this embodiment.

[0051] Figure 13 Schematic diagram of the structural principle of the data enhancement model used in this embodiment.

[0052] Figure 14 This is a schematic diagram of the implementation process of the chipped tooth defect detection model training in this embodiment.

[0053] Figure 15 It is a schematic diagram of the sawtooth chipping identification results obtained in a specific application embodiment of the present invention. DETAILED DESCRIPTION

[0054] The present invention will be further described below in conjunction with the accompanying drawings and specific preferred embodiments, but the scope of protection of the present invention is not limited thereby.

[0055] like Figure 1 As shown, the steps of the sawtooth chipping defect recognition method based on edge enhancement in this embodiment include:

[0056] Step S01: Obtain the serration image to be identified and preliminarily locate the ROI area of ​​the serration area;

[0057] Step S02: Using a convolutional neural network to extract features from the ROI region to obtain feature maps of different resolutions, and performing edge enhancement on the obtained feature maps to obtain an edge enhanced map of the ROI region;

[0058] Step S03: Input the feature map and the edge enhancement map into a pre-built semantic segmentation model for semantic segmentation to locate the jagged edge position. In the semantic segmentation model, semantic information of different scales is obtained by convolving feature maps of different resolutions corresponding to at least two specified positions using deformable dilated convolution kernels with different dilation rates. The semantic information of different scales is merged with the edge enhancement map, and the merged results are subjected to multi-scale depth-separable convolution operations using different convolution kernel receptive fields to fuse the semantic information of different scales.

[0059] Step S04: Cut out the sawtooth area according to the sawtooth edge position, and input the cutout sawtooth area into a chipped tooth defect detection model that has been pre-trained using a chipped tooth defect sample dataset for identification to obtain a chipped tooth defect identification result.

[0060] This embodiment first preliminarily determines the ROI area of ​​the jagged area, then extracts the feature map and performs edge enhancement to obtain an edge enhancement map, and then inputs the feature map of the ROI area of ​​the jagged area and its edge enhancement map into the semantic segmentation model to achieve accurate extraction of the jagged edge, and then accurately cuts out the jagged area based on the determined jagged edge position, and finally inputs the cut-off jagged area image into the chipped tooth defect detection model for defect recognition. The jagged area can be accurately obtained for defect recognition, and at the same time, the small target detection problem and the imbalance problem of positive and negative samples (defective area and background area) caused by directly locating and detecting the defect area can be avoided. At the same time, when using the semantic segmentation model to extract jagged edges, the feature extraction capability of the model can be improved by adopting deformable hole convolution with different expansion rates for different feature maps. The edge representation capability of the feature map can be enhanced by fusing the edge enhanced image with the feature map of the original image. The multi-scale depth-separable convolution operation is performed using different convolution kernel receptive fields. Not only can the operation speed be accelerated through separable convolution, but also semantic information of different scales can be fused through the receptive fields of convolution kernels of different sizes, thereby further improving the model's feature extraction capability for images, thereby obtaining clear and characteristic jagged areas for defect identification, effectively improving the accuracy and reliability of sawtooth chipping defect identification, so that sawtooth chipping defects under different processes and different types of sawtooth shapes can be quickly and accurately identified, reducing missed detection and false detection, thereby ensuring the quality and safety of saw blades.

[0061] In this embodiment, a data acquisition system is first arranged to collect sawtooth images. The data acquisition system includes an LED ring light source, an industrial color camera, and a camera bracket, etc. Figure 2 As shown, the industrial camera is perpendicular to the horizontal plane, the sawtooth plane is parallel to the industrial camera image plane, and the ring light source is tilted so that the light source can directly illuminate the sawtooth plane, ensuring that the sawtooth plane has sufficient light source and clear imaging. The sawtooth imaging effect obtained in the specific application embodiment is as follows Figure 3 shown.

[0062] In step S01 of this embodiment, a fixing device is specifically used to fix the saw blade so that its position in the y-axis direction is fixed. After obtaining the sawtooth image to be measured, the initial ROI area of ​​the sawtooth area is obtained at a fixed position using prior knowledge to improve real-time performance and reduce the impact of background on the sawtooth area acquisition. The initial ROI area obtained in the specific application embodiment is as follows: Figure 4 shown.

[0063] In step S02 of this embodiment, the sawtooth ROI region is specifically subjected to feature extraction using a CNN (convolutional neural network) basic model (such as ResNet and MobileNet) to obtain feature maps of different resolutions. The obtained feature maps are then subjected to edge enhancement using a phase congruency model to obtain an edge-enhanced map of the ROI region. The calculation expression for the phase congruency metric at position x is:

[0064]

[0065] Where, Indicates the n indivual Fourier the magnitude of the component; Indicates location x at The local phase of the component, Yes exist x The weighted average of the local phase angles of the Fourier components when the maximum value is taken at .

[0066] Phase congruency is a method for edge detection that utilizes image phase information. This embodiment employs a phase congruency model to enhance the edges of feature maps, improving edge detection in low-contrast conditions while also capturing more image details, such as corners and texture. It is understood that, depending on actual needs, feature extraction methods other than those described above can be used to extract feature maps from the ROI region, or alternative edge enhancement algorithms (such as the Sobel operator, Canny operator, or edge detection transformer) can be used to generate edge-enhanced maps.

[0067] In step S03 of this embodiment, the semantic segmentation model is specifically constructed based on the deeplabv3+ module, and a DSPP module is set in the deeplabv3+ module to perform deformable convolution and dilation convolution operations with different dilation rates on feature maps of different resolutions to obtain semantic information of different scales, and an MDWS module composed of multiple parallel depth-wise separable convolutions is set to merge the output of the DSPP module with the edge enhancement map and perform multi-scale depth-wise separable convolution operations in parallel using different convolution kernel receptive fields.

[0068] As a deep learning semantic segmentation network, the deeplabv3 module is based on dilated convolution to improve segmentation accuracy and receptive field. deeplabv3+ is an improved version of deeplabv3, which introduces a codec structure that can better handle multi-scale and multi-downsampled images, further improving the performance of the model. However, the traditional deeplabv3+ module directly uses the ASPP (Dilated Spatial Pyramid Pooling) module to perform dilated convolutions with different expansion rates, which has limited feature extraction capabilities for small targets and image edge representation capabilities. Due to factors such as manufacturing process, some jagged areas may have uneven lighting, resulting in grayscale values ​​similar to the background (the reflective area between the jagged edges), such as Figure 5 As shown, if the traditional threshold segmentation algorithm is used for segmentation, it is easy to cause large misidentifications. The use of the traditional target detection algorithm will lead to inaccurate positioning of the jagged area due to the instability of the detection frame. Considering that the key to jagged area positioning is that the positioning rectangular frame should accurately include the jagged area, this embodiment uses semantic segmentation technology to segment and identify the jagged area to enhance the algorithm's robustness to uneven lighting and the accuracy of jagged area positioning. At the same time, considering that the area of ​​the jagged area is small, and the shape, size and position of the jagged tooth defect have a certain degree of randomness, the jagged edge varies greatly. In order to improve the ability to recognize jagged edges, this embodiment forms an improved deeplabv3+ semantic segmentation model combined with edge enhancement by improving the deeplabv3+ module to achieve accurate extraction of jagged edges.

[0069] like Figure 6 As shown, after initially acquiring the ROI region, this embodiment extracts the feature map and edge enhancement map and inputs them into the improved deeplabv3+ semantic segmentation model. After semantic segmentation of the ROI region, a binary image of the jagged region is obtained. The minimum circumscribed moment of each connected domain in the binary image is calculated. Connected domains with areas and aspect ratios less than a preset threshold are filtered out to reduce the impact of semantic segmentation misidentification. The minimum circumscribed moment of the jagged region's edges is then calculated to accurately locate the jagged region. The length and width of the circumscribed moment can also be expanded by a certain number of pixels to reduce the impact of inaccurate edges extracted by semantic segmentation on the characteristic representation of the chipped tooth defect.

[0070] like Figure 7As shown, in the improved deeplabv3+ semantic segmentation model of this embodiment, the DSPP module is used to perform deformable hole convolution with different expansion rates on feature maps of different resolutions to obtain semantic information of different scales, which can improve the model's feature extraction ability. By fusing multi-scale semantic information and enhancing the model's adaptability to object morphology changes, the algorithm model's ability to extract image features is improved. Then, by fusing the edge-enhanced image with the feature map of the original image, the edge representation ability of the feature map can be effectively enhanced. An MDWS module is also provided in the deeplabv3+ module. The MDWS module uses multiple parallel depth-separable convolutions with different receptive fields for feature extraction. On the one hand, the separable convolution can speed up the calculation speed. On the other hand, the convolution kernel receptive fields of different sizes can be used to obtain semantic information of different scales and fuse them, further improving the model's feature extraction ability for the image, so that the jagged edge position can be accurately located, thereby obtaining a clear jagged area with obvious features.

[0071] In this embodiment, the feature maps of two different resolutions corresponding to two positions in the third layer and the last layer are respectively sent to the DSPP module. The network structure of the DSPP module is as follows: Figure 8 As shown in the figure, the third-generation deformable convolution module DCNv3 + dilated convolution is used to improve the model's feature extraction capabilities. The DCNv3 deformable convolution operation is performed in the DSPP module according to the following formula:

[0072] (1)

[0073] (2)

[0074] in, represents the input, H is the height, W is the width, C is the number of channels, and G is the number of spatial aggregation groups; for the g-th group, represents the input / output feature map of the slice, where represents the group dimension; represents the spatial aggregation weight of the kth sampling point in the gth group, which is the modulation scalar; represents the kth position in the grid sampling points predefined with different expansion rates in the dilated convolution, and K represents the total number of positions; is the grid sampling position corresponding to the gth group The offset of axis represents the coordinate axis in the multidimensional array. axis =-1 represents the last axis in a multidimensional array, Represents the center point of the convolution kernel.

[0075] In the improved deeplabv3+ semantic segmentation model of this embodiment, the two feature maps with different resolutions output by the DSPP module are further merged with the edge enhancement map to enhance the edge representation capability of the overall feature map, and the merged feature maps are respectively sent to the MDWS module. Figure 9 As shown in the figure, the MDWS module includes three parallel depthwise separable convolutions (with convolution kernel receptive fields of 1×1, 3×3, and 5×5, respectively), which perform 1×1, 3×3, and 5×5 depthwise separable convolutions, respectively. The separable convolution method not only speeds up the operation, but also integrates semantic information of different scales through the receptive fields of convolution kernels of different sizes, further improving the model's feature extraction ability for images. It is understandable that the MDWS module can also be configured with more than four parallel depthwise separable convolutions with different convolution kernel receptive fields according to actual needs.

[0076] The improved deeplabv3+ semantic segmentation model of this embodiment also includes a SCAF module that uses a fusion of an attention mechanism and a residual structure to respectively use a channel attention mechanism based on an MLP multi-layer perceptron and a channel attention mechanism based on 1×1 convolution for the output of the MDWS module, and then multiply the results of the two attention mechanisms and add them to the output of the MDWS module to obtain the final fusion result.

[0077] like Figure 10 As shown in Figure 1, the SCAF model is constructed by integrating an attention module with a residual structure. The attention module consists of two parallel attention mechanisms: a channel-wise attention mechanism based on an MLP multi-layer perceptron and a channel-wise attention mechanism based on 1×1 convolution. The results of the two attention mechanisms are multiplied together to produce the final output of the attention module. The sum of the attention module output and the SCAF module input serves as the final output of the SCAF module. By incorporating this SCAF module into the semantic segmentation model, the interdependencies between different scales and channels can be effectively captured, improving object localization accuracy.

[0078] The detailed steps of using the improved deeplabv3+ semantic segmentation model to accurately extract jagged edges in this embodiment include:

[0079] Step S301. The feature maps of different resolutions at the two positions are respectively sent to the DSPP module, and the feature maps are convolved using deformable dilated convolution kernels with different expansion rates to obtain semantic information of different scales. The multi-scale semantic information is then fused through the DSPP module to enhance the model's adaptability to changes in object morphology.

[0080] Step S302: Merge the two feature maps with different resolutions output by the DSPP module and the edge enhancement map to enhance the edge representation capability of the overall feature map, and send the merged feature maps to the MDWS module respectively.

[0081] Step S303. The output of the MDWS module is used as the input of the SCAF module. The output obtained by the SCAF module is subjected to 1×1 convolution for feature extraction. The low-resolution 1×1 convolution output is upsampled and merged with the high-resolution 1×1 convolution output. Finally, the merged feature map is upsampled to obtain the final semantic segmentation output result.

[0082] After semantic segmentation of the ROI area according to the above steps, a binary image of the jagged area is obtained. Then, the minimum circumscribed moment of each connected domain in the binary image is calculated. The connected domains with an area less than a threshold 1 and an aspect ratio less than a threshold 2 are filtered out to reduce the impact of semantic segmentation misrecognition. Finally, the minimum circumscribed moment of the edge of the jagged area is calculated, and the length and width of the circumscribed moment are expanded by a certain number of pixels to reduce the impact of the inaccurate edge extraction of the semantic segmentation on the expression of the tooth chipping defect feature, thereby obtaining accurate positioning of the jagged area.

[0083] It is understandable that in addition to using the deeplabv3+ model to form a semantic segmentation model, of course, other deeplabv series semantic segmentation models can also be used according to actual needs, such as the deeplabv3 model, etc., and even other types of semantic segmentation models such as U-Net can be used.

[0084] In step S03 of this embodiment, the semantic segmentation model is also pre-trained. In view of the fact that the background area of ​​the zigzag image accounts for a large proportion and the foreground (zigzag area) target area is small, this embodiment adopts a coarse training + fine training semantic segmentation model training method to improve the generalization ability of the model. Specifically, Figure 11 As shown in the figure, during the training process, the weights of the public dataset are first used as the initial weights, and the original sample dataset is reduced. The model is initially coarsely trained using the reduced sample dataset based on the cross loss function. After the coarse training is completed, the pre-trained weights generated by the coarse training are used as the initial weights for fine training. The model is fine-tuned using the large-scale resolution of the original sample data and the dice loss function to obtain the final semantic segmentation model weights.

[0085] In a specific application embodiment, the calculation formula of dice loss is specifically:

[0086] (4)

[0087] Here, |X∩Y| represents the intersection of X and Y, |X| and |Y| represent the number of elements in X and Y, respectively. The coefficient 2 in the numerator is because the denominator repeatedly counts the common elements between X and Y. In the semantic segmentation problem, X represents the ground truth segmentation image, and Y represents the predicate segmentation image.

[0088] In step S04 of this embodiment, a chipped tooth defect sample data set is generated in advance to train a chipped tooth defect detection model. Considering that chipped tooth defects usually occur in the sawtooth edge area, the position, shape, and size of chipped tooth defects are somewhat random (e.g., Figure 4 As shown in Figure 2 ), it is difficult to accurately describe chipped tooth features using traditional feature descriptors. Therefore, in step S04 of this embodiment, a CNN-based image classification algorithm is used to identify chipped tooth defects. Due to the imbalance between chipped tooth defect data and normal sawtooth data, to reduce the impact of data imbalance on the recognition accuracy of the chipped tooth defect detection model, this embodiment further utilizes a method that combines mask-based sawtooth chipped tooth defect data synthesis with a Generative Adversarial Network (GAN)-based sawtooth chipped tooth defect data enhancement. This method enhances chipped tooth defect data and transforms the problem of insufficient defect samples in target detection or segmentation into a problem of insufficient defect samples in image classification, effectively simplifying the problem model.

[0089] like Figure 12 As shown, the detailed steps of generating a chipped tooth defect sample dataset in this embodiment include:

[0090] Generate mask images of tooth chipping defects of different shapes and sizes;

[0091] Slide the chipped tooth defect mask image along the sawtooth edge position, perform matrix multiplication on the local image corresponding to the slid position and the normal sawtooth area image to generate a dataset of defect composite images at different positions;

[0092] Construct a generative adversarial network, and use the original defect dataset and the defect synthetic image dataset as a training set to train the generative adversarial network to obtain a data enhancement model. The data enhancement model is used to generate an enhanced dataset for chipped tooth defects.

[0093] The original defect dataset, the defect synthetic image dataset, and the chipped tooth defect enhanced dataset generated by the generative adversarial network are merged as the final chipped tooth defect sample dataset.

[0094] In this embodiment, the specific steps of generating mask images of chipped tooth defects of different shapes and sizes include:

[0095] Obtain binary images of tooth chipping defects of different shapes and sizes, generate tooth chipping masks of different shapes and sizes, and obtain binary mask images;

[0096] Find the minimum circumscribed matrix of the binary mask image;

[0097] The mask area is intercepted according to the minimum circumscribed matrix, and the intercepted mask area is inverted to obtain the final tooth chipping defect mask image.

[0098] In a specific application embodiment, the generation of a chipped tooth defect mask image primarily involves obtaining binary images of chipped tooth defect primitives of various shapes and sizes, employing an algorithm or using annotation tools to generate chipped tooth masks of various shapes and sizes, and then calculating the minimum circumscribed moment of the binary mask image. The masked area is then intercepted using the minimum circumscribed moment and inverted to obtain a final binary image of the chipped tooth defect primitive (foreground = 0, background = 1). The obtained primitive defect image is then slid along the sawtooth edge (i.e., the zero point of the primitive image is the coordinate point of the sawtooth image edge) and matrix-multiplied with the local image corresponding to the sawtooth image (i.e., corresponding pixel points are multiplied) to obtain composite defects at different locations.

[0099] In this embodiment, the data enhancement model is constructed using a conditional generative adversarial network. The model structure is as follows: Figure 13 As shown, x represents the image data of the broken tooth defect used for training (including the original broken tooth defect data and the broken tooth defect data synthesized based on the mask), the image size is 180×58, z represents the random noise vector of the Gaussian distribution with a size of 1×100, y represents the category label vector of size n×1, which is used to define the type of broken tooth defect. There is only one type of broken tooth defect, and n is the number of batch input discriminator images. The generator G is used to generate sample data that is "indistinguishable from the real thing", and the discriminator D is used to identify whether the sample data is real data during the training process. The trained adversarial network is used as the broken tooth defect data enhancement model, and then the model is used to generate broken tooth defect data. Then, normal serration data and broken tooth defect data (including original defect data, broken tooth defect data synthesized based on the mask, and data generated by the data enhancement model) are used as samples to train the broken tooth defect detection model.

[0100] In step S04 of this embodiment, the classification model is also pre-trained. During the training process, the weights trained on the public defect detection dataset are first used as pre-training weights. The classification model is initially trained using normal labels and a cross loss function to obtain pre-training weights. The sample labels are then smoothed using the pre-training weights, and the model is fine-tuned using focal loss to obtain the final classification model weights.

[0101] In order to improve the generalization ability of the model, this embodiment specifically adopts a model training method that combines normal labels and label smoothing to implement model training. During the training process, the weights trained on the public defect detection dataset are first used as pre-training weights. The classification model is initially trained using normal labels and a cross loss function to obtain pre-training weights. The sample labels are then smoothed using the pre-training weights, and the model is fine-tuned using focal loss to obtain the final classification model weights. Figure 14 As shown in the figure, the training process of the chipped tooth defect detection model is as follows:

[0102] The weights trained on the public defect detection dataset are used as pre-training weights. The normal label + cross loss function is used to perform preliminary training of the model to obtain the pre-training weights.

[0103] Using the pre-trained weights as pre-trained weights, we smoothed the sample labels (to prevent the model from over-trusting the labels and causing overfitting), and used focal loss to fine-tune the model to improve the model's generalization ability, thus obtaining the final tooth chipping defect detection model weights.

[0104] The final chipped tooth defect detection model is used to realize chipped tooth defect recognition. The recognition effect diagram obtained in the specific application embodiment is shown in FIG. Figure 15 As shown, red represents defects and green represents normal aliasing.

[0105] The present embodiment is a device for identifying sawtooth and chipped tooth defects based on edge enhancement, and the steps include:

[0106] The ROI area preliminary positioning module is used to obtain the serration image to be identified and preliminarily locate the ROI area of ​​the serration area;

[0107] The feature extraction module is used to extract features from the ROI region using a convolutional neural network to obtain feature maps of different resolutions, and to perform edge enhancement on the obtained feature maps to obtain edge enhanced maps of the ROI region;

[0108] The jagged edge localization module is used to input the feature map and edge enhancement map into a pre-built semantic segmentation model for semantic segmentation to locate the jagged edge position. In the semantic segmentation model, feature maps of different resolutions corresponding to at least two specified positions are convolved using deformable hole convolution kernels with different expansion rates to obtain semantic information of different scales. The semantic information of different scales is merged with the edge enhancement map, and the merged results are subjected to multi-scale depth-separable convolution operations using different convolution kernel receptive fields to fuse the semantic information of different scales.

[0109] The defect recognition module is used to cut out the sawtooth area according to the located sawtooth edge position, and input the cutout sawtooth area into the classification model for identification to obtain the defect type.

[0110] In this embodiment, the semantic segmentation model in the jagged edge positioning module is constructed based on the deeplabv3+ module. The deeplabv3+ module includes a DSPP module for performing deformable convolution and hole convolution operations with different expansion rates on feature maps of different resolutions to obtain semantic information of different scales, and an MDWS module composed of multiple parallel depth-separable convolutions, which is used to merge the output of the DSPP module with the edge enhancement map and perform multi-scale depth-separable convolution operations in parallel using different convolution kernel receptive fields. It also includes a SCAF module that uses an attention mechanism and a residual structure to be set in the semantic segmentation model, so as to use a channel attention mechanism based on an MLP multi-layer perceptron and a channel attention mechanism based on 1×1 convolution on the output of the MDWS module, and then multiply the results of the two attention mechanisms and add them to the output of the MDWS module to obtain the final fusion result.

[0111] The sawtooth chipping defect recognition device based on edge enhancement in this embodiment corresponds one to one with the above-mentioned sawtooth chipping defect recognition method based on edge enhancement, and will not be described in detail here.

[0112] In another embodiment, the sawtooth and chipped tooth defect identification device based on edge enhancement of the present invention may also include a processor and a memory, the memory is used to store a computer program, and the processor is used to execute the computer program to perform the above method.

[0113] It is understandable that the above method of this embodiment can be executed by a single device, such as a computer or server, etc., and can also be applied to a distributed scenario and completed by multiple devices cooperating with each other. In the case of a distributed scenario, one of the multiple devices can only execute one or more steps in the above method of this embodiment, and multiple devices interact to complete the above method. The processor can be implemented in the form of a general-purpose CPU, a microprocessor, an application-specific integrated circuit, or one or more integrated circuits, etc., for executing relevant programs to implement the above method of this embodiment. The memory can be implemented in the form of a read-only memory ROM, a random access memory RAM, a static storage device, and a dynamic storage device. The memory can store an operating system and other application programs. When the above method of this embodiment is implemented by software or firmware, the relevant program code is stored in the memory and called and executed by the processor.

[0114] The above description is merely a preferred embodiment of the present invention and does not constitute any form of limitation to the present invention. Although the present invention has been disclosed above with reference to the preferred embodiment, it is not intended to limit the present invention. Therefore, any simple modifications, equivalent variations, and modifications to the above embodiment that do not depart from the technical solution of the present invention and are based on the technical essence of the present invention shall fall within the scope of protection of the technical solution of the present invention.

Claims

1. A method for identifying sawtooth chipping defects based on edge enhancement, characterized in that the steps include: Step S01. Obtain the serration image to be identified and preliminarily locate the ROI area of ​​the serration area; Step S02: extracting features from the ROI region using a convolutional neural network to obtain feature maps of different resolutions, and performing edge enhancement on the obtained feature maps to obtain an edge enhanced map of the ROI region; Step S03. Input the feature map and the edge enhancement map into a pre-built semantic segmentation model for semantic segmentation to locate the jagged edge position. In the semantic segmentation model, the feature maps of at least two resolutions are convolved using deformable hole convolution kernels with different expansion rates to obtain semantic information of different scales. The semantic information of different scales is merged with the edge enhancement map respectively, and the merged results are subjected to multi-scale depth-separable convolution operations using different convolution kernel receptive fields to fuse semantic information of different scales. Step S04: extracting a sawtooth region according to the sawtooth edge position, and inputting the extracted sawtooth region into a chipped tooth defect detection model pre-trained with a chipped tooth defect sample data set for identification to obtain a chipped tooth defect identification result.

2. The method for identifying sawtooth chipping defects based on edge enhancement according to claim 1, characterized in that: In the step S03, the semantic segmentation model is constructed based on the deeplabv3+ module, and a DSPP module is set in the deeplabv3+ module to perform deformable convolution and hole convolution operations with different dilation rates on feature maps of different resolutions to obtain semantic information of different scales, and an MDWS module composed of multiple parallel depth-separable convolutions is set to merge the output of the DSPP module with the edge enhancement map and perform multi-scale depth-separable convolution operations in parallel using different convolution kernel receptive fields.

3. The method for identifying sawtooth chipping defects based on edge enhancement according to claim 2, characterized in that: The DSPP module performs a deformable convolution operation according to the following formula: Among them, x g ,y g ∈R H×W×C′ They represent the input feature map and output feature map of the slice of the g-th group, respectively, where C′=C / G represents the group dimension, H is the height, and W is the width; represents the spatial aggregation weight of the kth sampling point in the gth group; pk represents the kth position in the grid sampling points predefined with different expansion rates in the dilated convolution, and K represents the total number of positions; Δp gk is the grid sampling position p corresponding to the gth group k The offset of the convolution kernel is as follows: axis=-1 indicates the last axis in the multidimensional array, and p0 indicates the center point of the convolution kernel.

4. The method for identifying sawtooth chipping defects based on edge enhancement according to claim 2, characterized in that: It also includes setting a SCAF module that fuses the attention mechanism with the residual structure in the semantic segmentation model, so as to respectively use a channel attention mechanism based on an MLP multi-layer perceptron and a channel attention mechanism based on 1×1 convolution for the output of the MDWS module, and then multiplying the results of the two attention mechanisms and adding them to the output of the MDWS module to obtain the final fusion result.

5. The method for identifying sawtooth chipping defects based on edge enhancement according to any one of claims 1 to 4, characterized in that: In step S02, the phase consistency model is used to perform edge enhancement on the obtained feature map to obtain an edge enhancement map of the ROI region. The calculation expression of the phase consistency metric at position x is: Where, Fp n represents the amplitude of the nth Fourier component; represents Fp at position x n The local phase of the component, It is the weighted average of the local phase angles of the Fourier components when PC(x) takes the maximum value at x.

6. The method for identifying sawtooth chipping defects based on edge enhancement according to any one of claims 1 to 4, characterized in that: The step S03 also includes pre-training the semantic segmentation model. During the training process, the weights of the public data set are first used as the initial weights, and the original sample data set is reduced. The model is initially coarsely trained using the reduced sample data set based on the cross loss function. After the coarse training is completed, the pre-training weights generated by the coarse training are used as the initial weights for fine training. The model is fine-tuned using the size resolution of the original sample data and dice loss to obtain the final semantic segmentation model weights. The step S04 also includes pre-training the classification model. During the training process, the weights trained with the public defect detection data set are first used as the pre-training weights. The classification model is preliminarily trained using normal labels and cross loss functions to obtain pre-training weights. Then, the sample labels are smoothed using the pre-training weights, and the model is fine-tuned using focal loss to obtain the final classification model weights.

7. The method for identifying sawtooth chipping defects based on edge enhancement according to any one of claims 1 to 4, characterized in that: The step S04 further includes pre-generating a sample data set of broken tooth defects to train a broken tooth defect detection model. The step of generating the sample data set of broken tooth defects includes: Generate mask images of tooth chipping defects of different shapes and sizes; Slide the chipped tooth defect mask image along the sawtooth edge position, perform matrix multiplication on the slid position and the local image corresponding to the normal sawtooth area image, and generate defect composite image data sets at different positions; Construct a generative adversarial network, use the original defect data set and the defect synthetic image data set as a training set to train the generative adversarial network to establish a data enhancement model, and generate a chipped tooth defect enhancement data set through the data enhancement model; The original defect dataset, the defect synthetic image dataset, and the chipped tooth defect enhanced dataset generated by the generative adversarial network are combined as the final chipped tooth defect sample dataset.

8. The method for identifying sawtooth chipping defects based on edge enhancement according to claim 7, characterized in that: The step of generating mask images of tooth chipping defects of different shapes and sizes comprises: Acquire binary images of tooth chipping defects of different shapes and sizes, generate tooth chipping masks of different shapes and sizes, and obtain binary mask images; Obtaining a minimum circumscribed matrix of the binary mask image; The mask area is intercepted according to the minimum circumscribed matrix, and the intercepted mask area is inverted to obtain a final chipped tooth defect mask image.

9. A device for identifying sawtooth chipping defects based on edge enhancement, characterized in that the steps include: The ROI area preliminary positioning module is used to obtain the sawtooth image to be identified and preliminarily locate the ROI area of ​​the sawtooth area; A feature extraction module, used to extract features from the ROI region using a convolutional neural network to obtain feature maps with different resolutions, and to perform edge enhancement on the obtained feature maps to obtain an edge enhancement map of the ROI region; A jagged edge positioning module, used for inputting the feature map and the edge enhancement map into a pre-built semantic segmentation model for semantic segmentation to locate the jagged edge position, wherein the feature maps of at least two resolutions are convolved using deformable hole convolution kernels with different expansion rates to obtain semantic information of different scales, and the semantic information of different scales is merged with the edge enhancement map respectively, and the merged results are subjected to multi-scale depth-separable convolution operations using different convolution kernel receptive fields to fuse semantic information of different scales; The defect recognition module is used to cut out the sawtooth area according to the located sawtooth edge position, and input the cut-out sawtooth area into the classification model for identification to obtain the defect type.

10. A sawtooth chipping defect recognition device based on edge enhancement, comprising a processor and a memory, wherein the memory is used to store a computer program, characterized in that: The processor is configured to execute the computer program to perform the method according to any one of claims 1 to 8.