Cutter damage intelligent quantitative detection method based on improved Swinin-Transform

By introducing PatchPartition, LinearEmbeding, PatchMerging and SW-MSA modules in the Swin-Transformer model, combining multiple loss functions, the problem of insufficient tool damage detection accuracy and reliability in the existing technology is solved, and high-precision quantification of tool damage is achieved Chemical evaluation is suitable for industrial applications and reduces the cost of damage-induced.

CN119091270AActive Publication Date: 2024-12-06NANJING UNIV OF SCI & TECH

Patent Information

Application Number
CN202411028400.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-29
Publication Date
2024-12-06
Estimated Expiration
2044-07-29

AI Technical Summary

Technical Problem

The prior art is difficult to achieve accurate quantitative evaluation of tool damage, resulting in insufficient detection accuracy and reliability in industrial applications, which cannot meet the industry's demand for high precision and reliability of tool wear.

Method used

Using the intelligent quantitative detection method of tool damage based on Swin-Transformer, the PatchPartition partition module, LinearEmbeding linear embedding layer, PatchMerging merge layer, LayerNorm layer, global pooling layer and SW-MSA shift window multi-head self-attention module are combined with tool average Loss band width L2 loss, cross entropy function and mask binary cross entropy loss function to improve model performance and detection accuracy.

Benefits of technology

It significantly improves the accuracy and accuracy of tool wear detection, can efficiently conduct quantitative evaluation of tool damage type and degree, and is suitable for industrial applications of machine tools and reduces industrial costs caused by tool damage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119091270A_ABST
    Figure CN119091270A_ABST
Patent Text Reader

Abstract

The invention provides a tool damage intelligent quantitative detection method based on Swindow-Transform, and the method comprises the steps: firstly carrying out the fine pixel-level marking of a tool image segmentation data set, and constructing a proportional scale between an actual diameter and a pixel diameter; in the training process, by introducing cutter average damaged band width loss and combining an SW-MSA (shift window multi-head self-attention) module, the problems that a traditional self-attention mechanism is insufficient in local information sensitivity and sensitive to noise are effectively solved. According to the technology, information from different space areas can be efficiently processed, target task features are more accurately captured, the sensitivity of the model to the tool average abrasion belt width features is enhanced, and the calculation cost is remarkably reduced. Compared with the prior art, the technology not only optimizes the utilization of the multi-scale features and reduces the model calculation complexity, but also focuses on the quantitative detection target of the tool damage, so that the detection performance is remarkably improved, and the further development of the intelligent detection field of the tool damage is promoted.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of tool damage detection, and more specifically, relates to an intelligent quantitative detection method for tool damage based on an improved Swin-Transformer. Background Art

[0002] Tool damage detection is the core link of quality control and cost optimization in the manufacturing process, and it has immeasurable value in ensuring product quality and reducing production costs. With the vigorous rise of artificial intelligence technology, deep learning-driven visual inspection technology has opened up a new path for tool damage detection. In recent years, the cross-research of deep learning and tool damage detection has become popular. Researchers have achieved significant breakthroughs in this field by deeply mining the intrinsic patterns and features in tool damage images. However, current methods are mostly limited to qualitative analysis of tool damage, which is difficult to meet the urgent needs of the industry for accurate quantification of damage degree and high reliability. Overcoming the difficulties of quantitative detection of tool damage is a key step in promoting this technology from the laboratory to the production line and realizing industrialization. Its theoretical significance and application prospects cannot be ignored. Therefore, it is urgent to develop a new method that integrates tool visual inspection and quantitative analysis to lay a solid foundation for the industrial application of tool damage detection.

[0003] Chinese Patent Publication No. CN116309458A discloses a tool damage intelligent detection and early warning method based on improved YOLOX, which can automatically identify whether the input image is damaged and judge the tool damage category and area. At the same time, it can provide tool health warning based on the damage type, and also provide new ideas for industrial deployment by replacing the lightweight backbone network. However, it is still unable to perform quantitative evaluation of tool wear, and its industrial applicability has great limitations; Chinese Patent Publication No. CN116993711A discloses a tool damage intelligent detection method based on self-distillation. This method abandons the traditional two-stage training strategy of knowledge distillation, and squeezes knowledge out of the deep network into the shallow network by splitting the internal part of the teacher-student network into different shallow parts, and performs single-stage end-to-end training, while reducing the model complexity and model scale, providing an industrial application basis for production line machine tool tool detection. However, this method mainly performs model compression on larger network models, and does not consider the quantitative evaluation of the model on the degree of tool wear, which is difficult to adapt to the quantitative detection needs of tool damage; Chinese Patent Publication No. CN1 17197427A discloses a tool damage target detection method based on improved RTMDet. This method can improve the feature reuse capability of the network and improve the learning effect of the model by improving the shortest gradient path, while improving the perception ability of spatial channels, enhancing the network model's suppression of redundant features and thus improving the detection accuracy; finally, the model is optimized through the TensorRT framework and deployed on the embedded platform, which improves the model's detection speed for tool damage and solves the problem of high latency in edge platform calculations. This method can take into account the detection accuracy and processing speed of the target detection algorithm and is suitable for the real-time requirements of the tool damage detection system. However, this method ignores the quantitative evaluation requirements for tool wear and is difficult to meet the accuracy and reliability requirements for tool damage in industrial applications.Chinese Patent Publication No. CN1 17733649A discloses a tool wear value monitoring method based on improved Swin-Transformer. This method replaces the MLP structure in the original model with a residual block and reduces the number of layers of the model stacking block, thereby realizing effective and accurate monitoring of tool wear values ​​under the same cutting parameters by collecting vibration, cutting force and other signals. However, this method can only monitor wear for one-dimensional sensor signals and requires preprocessing of the original signal, which increases the monitoring cost. At the same time, this method still remains in the qualitative monitoring stage of tool damage and is difficult to cope with the challenge of high-precision monitoring of damage in industrial applications; Chinese Patent Authorization No. CN1 10930405B discloses a tool damage detection method based on image area division, which divides the tool damage area into a wear area and a broken area, extracts the two areas respectively, and uses the geometric features of the sum of the two areas as the criterion for determining the degree and type of tool damage; the wear area is extracted by pixel block segmentation and local threshold, while the broken area is extracted by data fitting and differential method. This method can diagnose the type and degree of tool damage, but this method is mainly for wear and breakage types, with a low degree of quantitative detection. At the same time, based on manual parameter adjustment, the diagnostic accuracy is low. In addition, this model is difficult to adapt to the general task of tool damage detection; Chinese Patent Authorization No. CN1111225 87B discloses a tool damage detection method based on visual feature extraction. The tool damage area is divided into a wear area and a broken area. After extracting the two areas respectively, the geometric features of the sum of the two areas are used as the judgment standard for the tool damage degree and damage type. The target fusion and differential method are used to extract them respectively, and the damage degree and type are judged by geometric features. This method can judge the tool damage type and damage degree, but the judgment accuracy is low only through target fusion and differential method, and it is difficult to cover the damage of small areas. At the same time, the method adopted is based on artificial neural network, which requires a lot of prior knowledge and manual parameter adjustment. The recognition speed and accuracy are insufficient, and it does not have good generalization performance, which is difficult to adapt to the needs of industrialization. In summary, the current tool damage detection method still has certain shortcomings. At the same time, the research on the quantitative evaluation of tool wear degree is not in-depth enough, and it is difficult to adapt to the current status of industrial application of tool wear detection with high precision and reliability. Therefore, a set of high-precision, high-efficiency and high-reliability intelligent quantitative detection methods for tool damage are urgently needed to meet the needs of industrialization of tool wear detection and realize the monitoring of the processing status of machine tool tools. Summary of the invention

[0004] The purpose of this invention is to provide a Swin-Transformer-based intelligent quantitative detection method for tool damage, which is specifically used for tool damage detection. This technology can not only intelligently identify the damage type of the tool, but also accurately quantify the degree of damage, significantly improve the accuracy and reliability of detection, and thus significantly reduce the industrial costs caused by tool damage.

[0005] The technical solution to achieve the purpose of the present invention is:

[0006] An intelligent quantitative detection method for tool damage based on Swin-Transformer includes the following steps: uniformly numbering and graying the collected tool images, setting the tool damage type, which is defined as four types: breakage, chipping, cracking and flank wear, and then classifying and annotating the images according to the damage type, wherein the objects of pixel annotation are: tool diameter, breakage damage width, and chipping damage width; and setting the scale between the actual diameter and the tool diameter pixel, and adding the width as a new loss function into the annotation file after calculation, so that the images and the corresponding annotation files obtained are randomly divided into a training set, a validation set and a test set according to the ratio of 7:1:2;

[0007] Establish a Swin-Transformer-based intelligent quantitative detection model for tool damage, which includes PatchPartition partition module, LinearEmbeding linear embedding layer, PatchMerging merging layer, LayerNorm layer, global pooling layer and fully connected layer. Then add SW-MSA shifted window multi-head self-attention module to the network. This module enhances the interaction between windows by introducing window position displacement between consecutive layers. By allowing windows to overlap, the model can more effectively capture long-distance dependencies. At the same time, the attention calculation is limited to the local window to reduce the computational cost and make the model more efficient. Finally, the flow of contextual information between different spatial regions is promoted by moving the feature window, so that the model can better understand the relationship between the object and its surrounding environment, thereby enhancing its performance. In addition, three loss functions are added, including the average tool damage band width L2 loss, cross entropy function and masked binary cross entropy loss, to improve model performance;

[0008] Conduct model training and obtain the optimal detection model by adjusting hyperparameters and increasing the number of iterations.

[0009] Compared with the existing intelligent detection method for tool damage, the invention has the following significant advantages:

[0010] (1) The present invention mainly performs quantitative evaluation on the degree of tool wear. By training the average tool damage width and length, the network model can learn the characteristics of tool wear, thereby improving the accuracy of tool wear detection. Compared with similar methods, the quantitative degree information of tool damage type is added, which greatly improves the model detection accuracy.

[0011] (2) The present invention adopts a combination module of Patch Partition module, Linear Embedding layer and Patch Merging layer through network architecture setting, which expands the global receptive field and enhances the model's feature learning ability for tool loss types. Compared with similar model detection algorithms, the detection accuracy can be improved by more than 5%.

[0012] (3) The present invention enhances the interaction between windows by adding a SW-MSA shifted window multi-head self-attention module and introducing the displacement of window positions in continuous layers. By allowing windows to overlap, the model can more effectively capture long-distance dependencies. At the same time, the attention calculation is limited to the local window to reduce the computational cost, making the model more efficient. Finally, the flow of contextual information between different spatial regions is promoted by moving the feature window, so that the model can better understand the relationship between the object and its surrounding environment, thereby enhancing its performance. Compared with other tool damage detection algorithms, the accuracy is improved while the computational cost is reduced. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] Figure 1 It is a flow chart of the intelligent quantitative detection method of tool damage based on improved Swin-Transformer;

[0014] Figure 2 Figure 1 is a diagram showing the types of tool damage and their marking examples; Figure (a) is a diagram showing the circumscribed circle of the tool, Figure (b) is a diagram showing the width of the tool chipping and the damage zone, Figure (c) is a diagram showing the width of the tool breakage and the damage zone, Figure (d) is a diagram showing the wear of the tool flank, and Figure (e) is a diagram showing the crack of the tool.

[0015] Figure 3 The network structure diagram of the intelligent quantitative detection method for tool damage based on the improved Swin-Transformer;

[0016] Figure 4 This is the network structure diagram of the SW-MSA shift window multi-head self-attention module; DETAILED DESCRIPTION

[0017] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0018] In order to realize intelligent quantitative detection of tool damage, this embodiment provides an intelligent quantitative detection model of tool damage based on improved Swin-Transformer, which specifically includes two parts: establishment of intelligent quantitative detection model of tool damage and model training.

[0019] The intelligent quantitative detection model of tool damage is established, such as Figure 3 As shown, the following process is included:

[0020] First, prepare the training set, collect images of damaged tools through the tool image acquisition system, and then perform pixel-level annotation. At the same time, use L2 loss to calculate the damage band width V AB , as a new element to be added to the annotation file, the method is shown in Formula 1, and then the original image is enhanced, including: 1) horizontal + vertical flip; 2) 30°, 60°, 90° rotation; 3) adding mixed noise. V AB =α||(A, B)||2 (1) Here α represents the actual diameter and pixel scale, A and B represent the spatial vectors of the two endpoints of the desired line segment, respectively. A(x1, y1) and B(x2, y2) calculate the distance between spatial pixels by the bi-norm, and the actual damage band width is calculated in combination with the scale.

[0021] Then determine the type of tool damage, such as Figure 2 As shown in the figure, there are four main types: 1. Chipping: In the early stage of cutting (at the beginning of cutting or after a short period of cutting), the tool is subjected to thermal and mechanical shock, which often manifests as a small notch on the cutting edge; 2: Breakage: After a long period of cutting, the tool will be broken into pieces, and it is likely that the tool will be difficult to continue cutting; 3: Flank wear: During the operation of the tool, the wear caused by the friction between the flank and the machined surface, and the wear surface is roughly parallel to the machined surface; 4: Crack: After the intermittent cutting time of the carbide tool continues for a long time, the front and rear blades of the tool will have fatigue-induced damage; the cracks are divided into two categories: one is mechanical fatigue cracks, which are parallel to the cutting edge or in a network; the other is thermal cracks, which are generally perpendicular to or inclined to the cutting edge. Crack extension usually causes damage to the blade; the images are annotated according to the determined type, and then randomly divided into training set, validation set, and test set in a ratio of 7:2:1.

[0022] In order to adapt to the training model, all images are processed in grayscale and the input image size is uniformly set to 224×224.

[0023] Then, the network design of intelligent quantitative detection method for tool damage based on Swin-Transformer is carried out, such as Figure 3 As shown in the figure, specifically, the backbone network is divided into a Patch Partition module, a Linear Embedding layer, a Patch Merging layer, a Layer Norm layer, a global pooling layer, and a fully connected layer to obtain the final output. At the same time, a SW-MSA shift window multi-head self-attention module is added after the continuous layer to increase feature learning while reducing computational complexity; thereby ensuring that the model improves detection accuracy while learning more features; the learning efficiency of the model is controlled by increasing loss functions from different sources. The second one is the classification cross entropy loss for tool wear types, as shown in Formula 1: Here N is the number of samples, M is the number of categories of tool wear, here it is 4, y ic represents the sign function (0 or 1), if the true category of sample i is equal to c, it takes 1, otherwise it takes 0; p ic is the predicted probability that the observed sample i belongs to category c. The last loss function uses the mask-based BCE (Binary Cross Entropy Loss) loss function, that is, the binary cross entropy loss function, which measures the difference between the predicted mask (generated by the model) and the ground truth mask (the actual mask representing the required segmentation). The goal is to minimize this difference and ensure that the predicted mask accurately reflects the true segmentation of the input image, as shown in Equation 3, that is: Where yi represents the ground truth mask, a value of 1 indicates the existence of the object, and a value of 0 indicates the absence of the object; Represents the predicted mask, with a value between 0 and 1, indicating the probability of the object existing at each pixel. The sum is traversed over all pixels in the mask. The goal is to minimize this loss value, which means that the model should generate a predicted mask that is closely similar to the ground truth mask. The total loss is the sum of the above three losses, as shown in Equation 4:

[0024] Set the number of iterations to 6000, the training batch size to 4, the shift window size to 7×7, the channel depth to 128, the number of multi-head attention heads to 3, the learning rate to 0.1-0.0001, the momentum to 0.9, the weight decay to 0.0001, and the SGD algorithm to be used for optimization. Perform model training. When the accuracy does not meet the expected requirements, fine-tune by increasing the number of iterations and adjusting the hyperparameters to finally obtain the expected model.

[0025] The above-mentioned Swin-Transformer-based intelligent quantitative detection model for tool damage has good performance and high training efficiency. Compared with similar detection networks, it can perform high-precision quantitative damage assessment. It is also suitable for industrial applications of machine tool tool detection, and it also has the ability to detect tool images with noise in actual machining environments.

[0026] The specific implementation methods described above provide a detailed description of the technical solutions and beneficial effects of the present invention. It should be understood that the above is only the most preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, supplements and equivalent substitutions made within the scope of the principles of the present invention should be included in the protection scope of the present invention.

Claims

1. An intelligent quantitative detection method for tool damage based on Swin-Transformer, characterized in that: The following steps are involved: Step 1: Establish a tool damage image dataset based on Swin-Transformer Step 1.1: Collect tool damage images through industrial cameras, perform data enhancement by flipping, rotating, adding noise, etc., and expand the number of data set samples; Step 1.2: Calculate the scale based on the actual diameter of the tool and the corresponding image pixel size; Step 1.3: Annotate the tool image samples, segment the tools with different damage types, and write the average damage band width as a new element into the annotation file; Step 1.3: Divide the labeled tool damage dataset into a training set, a validation set, and a test set; Step 2: Construct an intelligent quantitative detection network model for tool damage based on improved Swin-Transformer Step 2.1: Add the loss function based on the average width of the tool damage zone; Step 2.2: Divide the detection network model into the corresponding Patch Partition module, LinearEmbeding layer, Patch Merging layer and the corresponding prediction output layer; Step 2.3: Select the constructed data set to test network performance; Step 3: Construct SW-MSA shift window multi-head self-attention module Step 3.1: This module enhances the interaction between windows by introducing a shift in window positions between consecutive layers, allowing windows to overlap, thus enabling the model to capture long-range dependencies more effectively. Step 3.2: Reduce the computational cost by limiting the attention calculation to a local window, making the model more efficient while maintaining its ability to capture relevant information; Step 3.3: Promote the flow of contextual information between different spatial regions by moving the feature window, so that the model can better understand the relationship between the object and its surrounding environment, thereby enhancing its performance; Step 4: Train the network model for intelligent quantitative detection of tool damage based on improved Swin-Transformer in steps 2 and 3 Step 4.1: Set the number of training iterations and fine-tune hyperparameters; Step 4.2: Set the input image size and format to be uniform; Step 4.3: Set the input uniform moving window size, channel depth, and number of multi-head attention modules; Step 4.4: Add the corresponding loss function; Step 4.5: Use the pre-trained weights of the instance segmentation network for training; Step 5: Evaluate the model Step 5.1: Evaluate the model of the tool damage intelligent quantitative detection method based on the improved Swin-Transformer trained in step 4 according to the following evaluation indicators: detection accuracy, mean damage band width error mse; Step 5.2: Adjust the training parameters. If the highest detection accuracy has been achieved, the optimal detection model is obtained; otherwise, repeat step 4.

1.

2. The intelligent quantitative detection method for tool damage based on improved Swin-Transformer according to claim 1, characterized in that: In step 1.3, the number of tool damage types is set to i, i ≥ 2, i ∈ N, and the setting of i is based on the tool damage category.

3. The intelligent quantitative detection method for tool damage based on improved Swin-Transformer according to claim 1, characterized in that: In step 2, the division of the network structure part should be carried out in the order of a Patch Partition module, a Linear Embeding layer, three Patch Merging layers, a Layer Norm layer, a global pooling layer, and a fully connected layer. The specific number of modules can be added or deleted according to the task requirements.

4. The intelligent quantitative detection method for tool damage based on improved Swin-Transformer according to claim 1, characterized in that: In step 4.4, the addition of the loss function, which is generally the damage band width loss, cross-entropy loss, and masked binary cross-entropy loss. The loss function is shown in Equation i: The total loss function is calculated by superimposing three loss functions.

5. The intelligent quantitative detection method for tool damage based on improved Swin-Transformer according to claim 1, characterized in that: In step 4.1, train the tool damage segmentation model. The initial number of iterations is set to j, where 500 ≤ j ≤ 10000 and j ∈ N. It is selected according to the number of images in the training set, generally not less than 500 images.

6. The intelligent quantitative detection method for tool damage based on improved Swin-Transformer according to claim 1, characterized in that: In step 4, for model training, the unified image format is set to a×a, and the image size is based on the processor memory, generally not less than 224×224.

7. The intelligent quantitative detection method for tool damage based on improved Swin-Transformer according to claim 1, characterized in that: In step 4, for model training, the training batch size is set to b, where 4 ≤ b < 256 and b ∈ N; the value of b is based on the video card memory, and the larger the memory, the larger the value of b.

8. The intelligent quantitative detection method for tool damage based on improved Swin-Transformer according to claim 1, characterized in that: In step 4, for model training, the training window size is set to c, where 1 ≤ c < 16 and c ∈ N; the value of c is based on the video card memory, and the larger the memory, the larger the value of c; the channel depth is set to d, where 96 < d < 1536 and d ∈ N; the value of d is related to the number of network layers, and the more layers, the larger the value of d; the number of heads in the multi-head attention module is set to e, where 2 < e < 300 and e ∈ N; the value of e is based on the target type, and the more types, the larger the value of e.

9. The intelligent quantitative detection method for tool damage based on improved Swin-Transformer according to claim 1, characterized in that: In step 4, for model training, the optimization algorithm used during training is set to the SGD algorithm.

Citation Information

Patent Citations

  • Steel surface defect detection method and device and computer storage medium

    CN114494164A

  • Cutter wear value monitoring method based on improved Swinin-Transform

    CN117733649A

  • Swin-Transform-based numerical control turning tool wear state classification method and device under variable working conditions

    CN117972476A

Cited By

  • Wear type quantitative identification method based on image segmentation

    CN121904382A