A method for detecting surface defects of cutting tools on a machine

By acquiring tool surface defect images through on-machine detection devices and combining image preprocessing and enhancement techniques, building a database, and using deep learning models for classification and segmentation, the problems of low efficiency and insufficient accuracy in tool surface defect detection in existing technologies are solved, and efficient and diverse defect detection is achieved.

CN116539620BActive Publication Date: 2025-09-16DALIAN UNIV OF TECH
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202310456141.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-25
Publication Date
2025-09-16
Estimated Expiration
2043-04-25

AI Technical Summary

Technical Problem

Existing tool surface defect detection methods are inefficient, difficult to detect on-machine, unable to effectively detect multiple defects, have a low degree of image processing automation, and an insufficient number of training database images, which affects detection accuracy and generalization ability.

Method used

An on-machine detection device is used to obtain tool surface defect images. A tool image database is constructed by combining image preprocessing and enhancement technology. The ResNet-18 model is used for classification and the U-Net model is used for segmentation to achieve efficient detection of tool defects.

Benefits of technology

The efficiency and accuracy of tool surface defect detection are improved, and it can detect a variety of defects and adapt to actual processing occasions. The image processing method does not affect the processing accuracy, expands the number of database images, and enhances the generalization ability of the detection model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116539620B_ABST
    Figure CN116539620B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for on-machine detection of tool surface defects, comprising the following steps: obtaining a tool surface defect image through an on-machine detection device and preprocessing the image; constructing a tool image database and performing image enhancement to expand the number of images in the database; after respectively labeling the defect type and defect area of ​​the images in the database, dividing the images into a training set and a test set; adjusting the parameters of the tool image classification model and the image segmentation model according to the error conditions during the test; and performing on-machine detection of tool defects through a combination of an on-machine detection device, a tool image classification model, and an image segmentation model. The present invention obtains tool images through an on-machine detection device integrated in the machine tool turret, and has high detection efficiency while not affecting the workpiece processing accuracy. The present invention amplifies tool surface defect images through image enhancement technology, effectively solving the problems of insufficient number of images and imbalanced number of defect samples.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of tool surface defect detection, and in particular to an on-machine detection method for tool surface defects. Background Art

[0002] With the continuous development of the manufacturing industry, there is growing concern about the impact of tool surface defects on product processing costs and quality during CNC machine tool cutting. Downtime due to tool surface defects during cutting processes accounts for 7%-20% of the total machining time, while tool damage and replacement costs account for 3%-12% of the total machining cost. With the advancement of my country's manufacturing industry, traditional methods of tool defect detection are no longer able to meet the requirements of modern production and highly automated measurement. The importance of automated tool surface defect detection is increasing.

[0003] Methods for detecting tool surface defects by analyzing images have many advantages, such as intuitively observing changes in tool surface defect morphology and being less susceptible to environmental noise and inherent machine tool noise, and have therefore gained widespread application. Chinese patent application CN111383227A discloses a neural network-based method for identifying tool wear types and measuring wear values. This method uses a tool wear type identification model trained using a convolutional neural network to classify tool wear types in tool wear images and, based on the classification results, determines whether tool change conditions have been met, thereby avoiding tool waste or substandard workpiece quality. However, this method fails to account for the presence of multiple defects in the same image, and the proposed wear value detection method has a low degree of automation and is highly dependent on human intervention. Furthermore, the image preprocessing method can easily degrade the image quality of the worn area. Chinese patent application CN111300144B discloses an image-processing-based method for automatically detecting tool wear. This method acquires tool images using on-machine inspection equipment and, after preprocessing, uses a convolutional neural network to determine the tool type. However, this method can only detect a limited number of types, making it difficult to apply in actual machining scenarios. Furthermore, the method can only determine the tool wear state, not the specific wear value.

[0004] The current methods for tool surface defect detection have the following main shortcomings: 1) The acquisition of tool surface defect images mainly relies on the method of taking images through visual equipment after disassembling the tool, which is inefficient, and repeated disassembly will also affect the processing accuracy of the machine tool; 2) Current methods mainly focus on the detection of tool wear, and rarely mention methods for detecting other defects that occur during the cutting process, such as breakage and built-up edge, which seriously affects their application in actual industrial processing scenarios; 3) Images directly obtained through visual equipment are often too large to be used directly. Existing detection methods generally use direct compression, which neither highlights the defective part in the image nor reduces the clarity of the defective area; 4) Most methods involve deep learning models, but the number of images in the database used in their training process is small, and it is impossible to train a model with high accuracy and strong generalization ability.

[0005] In order to improve the efficiency of tool surface defect detection and achieve high-efficiency detection, a detection method with high practical applicability is urgently needed. Summary of the Invention

[0006] The purpose of the present invention is to provide a method for detecting surface defects of cutting tools on a machine, so as to solve the above-mentioned technical problems of detecting surface defects of cutting tools.

[0007] To achieve this purpose, the present invention adopts the following technical solution: a method for detecting surface defects of a tool on a machine, comprising the following steps:

[0008] Step S1: Obtain a tool surface defect image through an on-machine detection device and pre-process the image; the specific steps are as follows:

[0009] Step S11, graying the original tool surface defect image, and then processing the image through Gaussian filtering or bilateral filtering;

[0010] Step S12, performing threshold segmentation processing on the filtered image to obtain a binary image, wherein the threshold segmentation method includes Otsu's method and adaptive threshold segmentation method;

[0011] Step S13, obtaining the outer contour edge of the tool by finding the maximum contour of the image according to the binary image, and then using polygons to approximate the contour of the obtained maximum contour;

[0012] Step S14, using the SHI-TOMASI algorithm to detect corners of the contour after contour approximation, and performing non-maximum suppression on the detection results;

[0013] Step S15: Obtain the coordinates of each corner point in the original tool surface defect image, determine a 6×6 matrix centered on the obtained coordinates of each corner point, and then calculate the overall pixel value corresponding to the 36 pixels of each matrix based on the image pixel value of the corresponding position of each matrix element in the original tool surface defect image. According to the calculation result, the corner point corresponding to the tool tip point has the largest overall pixel value.

[0014] Step S16 is to crop the original tool surface defect image based on the coordinate value of the corner point corresponding to the tool tip point to obtain a pre-processed image.

[0015] Step S2, constructing a tool image database and performing image enhancement to expand the number of images in the database;

[0016] Step S3: After labeling the defect types and defect areas of the images in the database, the images are divided into a training set and a test set;

[0017] Step S4, training the tool image classification model and the image segmentation model using the training set, testing the tool image classification model and the image segmentation model using the test set, and adjusting the parameters of the tool image classification model and the image segmentation model according to the error conditions during the test;

[0018] Step S5: Perform on-machine detection of tool defects by combining an on-machine detection device, a tool image classification model, and an image segmentation model. The specific steps are as follows:

[0019] Step S51: The detection process begins. After receiving the image capture signal, the machine tool pauses the cutting process and moves the turret to a preset position. After that, high-pressure gas is used to clean the dirt on the tool surface.

[0020] Step S52, the on-machine detection device quickly moves to an image capturing position and acquires a tool flank defect image;

[0021] Step S53, performing pre-processing operations on the image;

[0022] Step S54: Process the pre-processed tool surface defect image using the trained image classification model and classify it as a damage defect or extensive wear defect image. If the image is classified as a damage defect image, proceed to step S57; if the image is classified as extensive wear defect, proceed to step S55.

[0023] Step S55, processing the extensive wear defect image using the trained image segmentation model to obtain various types of extensive wear defect regions and labeling their types;

[0024] Step S56, quantifying each type of extensive wear defect area obtained, obtaining the width and area information of each type of area, and determining whether it exceeds a set threshold. If it exceeds the threshold, proceed to step S57; if not, proceed to step S58;

[0025] Step S57: The machine tool alarms to remind the machine tool operator to change the tool;

[0026] Step S58, the on-machine detection device returns to its initial position;

[0027] In step S59, the machine operator determines whether the cutting process is completed. If it is completed, the processing is terminated. If it is not completed, the next cycle of processing and inspection is carried out.

[0028] Preferably, the tool surface in step S1 is the back surface of a CNC turning tool.

[0029] Preferably, the on-machine detection device in step S1 is a device that integrates a visual inspection device on a machine tool turret. The device is in an initial position when the tool is performing cutting processing so as not to interfere with the processing process. After the device receives the shooting signal, the visual inspection device is moved to the shooting position through the transmission device. At the same time, the angle of the visual inspection device is adjusted by the rotating table during shooting so that the tool surface image can be captured at the correct angle.

[0030] Preferably, the image enhancement method in step S2 is a random enhancement method or an adversarial network enhancement method. The random enhancement method includes a random rotation method, a translation transformation method, a random scaling method, and a noise addition method; the adversarial network enhancement method is a method of enhancing the original image through a WGAN-GP network.

[0031] Preferably, the image classification model in step S4 is a ResNet-18 model, and the image segmentation model is a U-Net model.

[0032] Preferably, the extensive wear defects include built-up edge, flank wear, boundary wear, adhesive wear and coating peeling.

[0033] Compared with the prior art, the technology of the present invention has the following substantial characteristics and significant advantages:

[0034] 1. The present invention obtains tool images through an on-machine detection device integrated into the machine tool turret, which has high detection efficiency and does not affect the workpiece processing accuracy.

[0035] 2. The present invention amplifies the tool surface defect image through image enhancement technology, effectively solving the problems of insufficient number of images and unbalanced number of defect samples.

[0036] 3. The present invention combines image classification and image segmentation technology, and can detect a wider range of tool surface defects, making it more suitable for actual processing occasions.

[0037] 4. The image preprocessing method proposed in the present invention can reduce the overall size of the image while ensuring the expression effect of the defective area in the image. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 This is a flow chart of the on-machine tool defect detection method based on deep learning of the present invention;

[0039] Figure 2 This is a structural diagram of the on-machine detection device;

[0040] Figure 3 It is a top view of the on-board detection device at the initial position and the shooting position;

[0041] Figure 4 It is a flow chart of the tool surface defect image preprocessing process;

[0042] Figure 5 This is the flow chart of on-machine detection of tool defects.

[0043] In the figure: 1-turret; 2-connecting plate; 3-tool; 4-light source; 5-lens; 6-industrial camera; 7-rotating table; 8-L-shaped connecting plate; 9-base; 10-screw; 11-motor. DETAILED DESCRIPTION

[0044] The specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0045] The specific embodiments described herein are specific embodiments of the present invention and are used to illustrate the concept of the present invention. They are all illustrative and exemplary and should not be construed as limiting the embodiments of the present invention and the scope of the present invention. In addition to the embodiments described herein, those skilled in the art can also adopt other obvious technical solutions based on the claims and the disclosure of the specification. These technical solutions, including any obvious replacements and modifications of the embodiments described herein, are all within the scope of protection of the present invention.

[0046] On-machine tool defect detection method based on deep learning, reference Figure 1 As shown, the following steps are included: Step S1, obtaining a tool flank defect image through an on-machine detection device and preprocessing the image.

[0047] In this embodiment, the on-machine detection device refers to Figure 2 and Figure 3. The visual inspection device in the inspection device includes a light source 4, a lens 5 and an industrial camera 6, which are used to obtain the surface defect image of the tool 3. The visual inspection device is installed on the L-shaped connecting plate 8 through a rotating table 7. The L-shaped connecting plate 8 is installed on the first section of the transmission device, which includes a screw 10 and a base 9. Under the drive of the screw 10, the L-shaped connecting plate 8 can move linearly along the base 9. The second section of the transmission device has the same structure as the first section of the transmission device. The two are connected by a connecting plate 2 to realize the linkage telescopic function. The second section of the transmission device is installed on the machine tool turret 1. As shown Figure 3 As shown, when the tool 3 is cutting, the on-machine detection device is in the initial position, at which point the first transmission device and the visual detection device are in the set leftmost position; when the on-machine detection device receives a shooting signal, it will move to the shooting position, during which the motors 11 in the first transmission device and the second transmission device will operate simultaneously to shorten the movement time. After the movement is completed, the first transmission device and the visual detection device will be in the set rightmost position, at which point the image will be captured. The turntable 7 is used to adjust the angle of the visual detection device so that the surface image of the tool 3 can be captured at the correct angle, rather than capturing the projection of the back cutting surface. It should be noted that the angle of the turntable 7 is adjusted before the machine tool performs cutting, and the angle of the turntable 7 will no longer be changed during the cutting process and during the process of the on-machine detection device acquiring images.

[0048] In this embodiment, the visual inspection device hardware specifically includes an industrial camera (MV-CS060-10GM), a telecentric lens (MVL-MY-2-65-MP), and a light source (HL-RD0-90-4-W). The accuracy of the captured tool surface defect images is primarily ensured by the telecentric lens's 1 / 1.8" target size, 65 mm object distance, 0.3 mm depth of field, and maximum imaging range of 3.69 mm × 2.46 mm, combined with the industrial camera's 3072 × 2048 pixel resolution and 2.4 µm × 2.4 µm pixel size.

[0049] refer to Figure 3 , the image preprocessing process mainly includes the following steps:

[0050] Step S11, graying the original tool surface defect image, and then processing the image through GaussianBlur or bilateral filter;

[0051] Step S12, performing threshold segmentation processing on the filtered image to obtain a binary image, wherein the threshold segmentation method includes Otsu method and adaptive threshold segmentation method;

[0052] Step S13, obtaining the outer contour edge of the tool by finding the maximum contour of the image according to the binary image, and then using polygons to approximate the contour of the obtained maximum contour;

[0053] Step S14, using the SHI-TOMASI algorithm to detect corners on the approximated contour, and performing non-maximum suppression on the detection results;

[0054] In this embodiment, the non-maximum suppression method is specifically as follows: first, for the obtained corner point sequence, the score value of each corner point is solved in order. The score value is calculated by the sum of the absolute values ​​of the differences between the 16 points on the circle centered on the corner point and the pixel position of the corner point; then, after calculating the score value of each corner point, each corner point is screened using a 3×3 neighborhood, and only the corner point with the highest score is retained, and the other corner points are deleted.

[0055] Step S15: Obtain the coordinates of each corner point in the original tool surface defect image, determine a 6×6 matrix centered on the obtained coordinates of each corner point, and then calculate the overall pixel value corresponding to the 36 pixels of each matrix based on the image pixel value of the corresponding position of each matrix element in the original tool surface defect image. According to the calculation result, the corner point corresponding to the tool tip point has the largest overall pixel value.

[0056] Step S16 , the original tool surface defect image is cropped with the coordinate value of the corner point corresponding to the tool tip point obtained as the center, to obtain two pre-processed images of sizes 224 pixel×224 pixel and 572 pixel×572 pixel.

[0057] Step S2: construct a tool image database and perform image enhancement to expand the number of images in the database.

[0058] In this embodiment, the image enhancement method is a random enhancement method or an adversarial network enhancement method. The random enhancement method includes but is not limited to one or more of random rotation, translation transformation, random scaling, and noise addition; the adversarial network enhancement method is to enhance the original tool surface defect image using a WGAN-GP network.

[0059] In step S3, the defect types of the images with a size of 224 pixels × 224 pixels in the database are annotated. After the wear defect areas of the images with a size of 572 pixels × 572 pixels are annotated, the images with a size of 224 pixels × 224 pixels in the database are divided into a training set A1 and a test set A2, and the images with a size of 572 pixels × 572 pixels in the database are divided into a training set B1 and a test set B2.

[0060] In this embodiment, the defect type is marked as marking the image as one of general wear and damage, wherein general wear defects specifically include built-up edge, flank wear, boundary wear, adhesive wear, and coating peeling.

[0061] Step S4: Use training set A1 to train the classification model, use data set A2 to test the trained tool image classification model, use training set B1 to train the segmentation model, and use data set B2 to test the trained tool image segmentation model; adjust the parameters of the tool image classification model and image segmentation model according to the error situation during the test process.

[0062] In this embodiment, the image classification model is a ResNet-18 model, and the image segmentation model is a U-Net model.

[0063] Step S5: constructing an on-machine detection method for tool defects by combining an on-machine detection device, a tool image classification model, and an image segmentation model.

[0064] refer to Figure 4 As shown, the on-machine detection process for tool defects specifically includes the following steps:

[0065] Step S51: The detection process begins. After receiving the image capture signal, the machine tool pauses the cutting process and moves the turret to a preset position. After that, high-pressure gas is used to clean the dirt on the tool surface.

[0066] Step S52, the on-machine detection device quickly moves to an image capturing position and acquires a tool flank defect image;

[0067] Step S53, performing pre-processing operations on the image;

[0068] Step S54: Using the trained image classification model, the pre-processed 224×224 pixel tool surface defect image is processed and classified as a damage defect or a widespread wear defect image. If the image is classified as a damage defect image, step S57 is performed; if the image is classified as a widespread wear defect, step S55 is performed.

[0069] Step S55 , processing the pre-processed 572 pixel×572 pixel general wear defect image using the trained image segmentation model to obtain various types of general wear defect areas and label their types;

[0070] Step S56, quantifying each type of extensive wear defect area obtained, obtaining the width and area information of each type of area, and determining whether it exceeds a set threshold. If it exceeds the threshold, proceed to step S57; if not, proceed to step S58;

[0071] In this embodiment, the threshold value is for the flank wear defect, and the specific value is in accordance with the recommended value of ISO 3685-1993, that is, if the flank wear is non-uniform, the threshold value is in accordance with VB max = 0.6 mm, if it is uniform wear, then VB ave = 0.3mm.

[0072] Preferably, in actual applications, machine tool operators can independently set thresholds for various types of general wear defects according to actual processing requirements.

[0073] Step S57: The machine tool alarms to remind the machine tool operator to change the tool;

[0074] Step S58, the on-machine detection device returns to its initial position;

[0075] In step S59, the machine operator determines whether the cutting process is completed. If it is completed, the processing is terminated. If it is not completed, the next cycle of processing and inspection is carried out.

[0076] The present invention is not limited to this embodiment, and any equivalent concepts or modifications within the technical scope disclosed by the present invention are included in the protection scope of the present invention.

Claims

1. A method for detecting surface defects of a cutting tool on a machine, characterized by: The steps include: Step S1: Obtain a tool surface defect image through an on-machine detection device and pre-process the image; the specific steps are as follows: Step S11, graying the original tool surface defect image, and then processing the image through Gaussian filtering or bilateral filtering; Step S12, performing threshold segmentation processing on the filtered image to obtain a binary image, wherein the threshold segmentation method includes Otsu's method and adaptive threshold segmentation method; Step S13, obtaining the outer contour edge of the tool by finding the maximum contour of the image according to the binary image, and then using polygons to approximate the contour of the obtained maximum contour; Step S14, using the SHI-TOMASI algorithm to detect corners of the contour after contour approximation, and performing non-maximum suppression on the detection results; Step S15: Obtain the coordinates of each corner point in the original tool surface defect image, determine a 6×6 matrix centered on the obtained coordinates of each corner point, and then calculate the overall pixel value corresponding to the 36 pixels of each matrix based on the image pixel value of the corresponding position of each matrix element in the original tool surface defect image. According to the calculation result, the corner point corresponding to the tool tip point has the largest overall pixel value. Step S16, cutting the original tool surface defect image with the coordinate value of the corner point corresponding to the tool tip point as the center to obtain a pre-processed image; Step S2, constructing a tool image database and performing image enhancement to expand the number of images in the database; Step S3: After labeling the defect types and defect areas of the images in the database, the images are divided into a training set and a test set; Step S4, training the tool image classification model and the image segmentation model using the training set, testing the tool image classification model and the image segmentation model using the test set, and adjusting the parameters of the tool image classification model and the image segmentation model according to the error conditions during the test; Step S5: Perform on-machine detection of tool defects by combining an on-machine detection device, a tool image classification model, and an image segmentation model. The specific steps are as follows: Step S51: The detection process begins. After receiving the image capture signal, the machine tool pauses the cutting process and moves the turret to a preset position. After that, high-pressure gas is used to clean the dirt on the tool surface. Step S52, the on-machine detection device quickly moves to an image capturing position and acquires a tool flank defect image; Step S53, performing pre-processing operations on the image; Step S54: Process the pre-processed tool surface defect image using the trained image classification model and classify it as a damage defect or extensive wear defect image. If the image is classified as a damage defect image, proceed to step S57; if the image is classified as extensive wear defect, proceed to step S55. Step S55, processing the extensive wear defect image using the trained image segmentation model to obtain various types of extensive wear defect regions and labeling their types; Step S56, quantifying each type of extensive wear defect area obtained, obtaining the width and area information of each type of area, and determining whether it exceeds a set threshold. If it exceeds the threshold, proceed to step S57; if not, proceed to step S58; Step S57: The machine tool alarms to remind the machine tool operator to change the tool; Step S58, the on-machine detection device returns to its initial position; In step S59, the machine operator determines whether the cutting process is completed. If it is completed, the machining is terminated. If not, the machining and inspection process of the next cycle is carried out. The on-machine inspection device in step S1 is a device that integrates a visual inspection device on a machine tool turret. The device is in an initial position when the tool is cutting to avoid interfering with the machining process. After the device receives a shooting signal, the visual inspection device is moved to a shooting position via a transmission device. At the same time, the angle of the visual inspection device is adjusted via a rotating table during shooting so that the tool surface image is captured at a correct angle. The image classification model in step S4 is a ResNet-18 model, and the image segmentation model is a U-Net model.

2. The on-machine detection method for tool surface defects according to claim 1, characterized in that: The tool surface in step S1 is the flank surface of a CNC turning tool.

3. The on-machine detection method for tool surface defects according to claim 1, characterized in that: The image enhancement method in step S2 is a random enhancement method or an adversarial network enhancement method; the random enhancement method includes a random rotation method, a translation transformation method, a random scaling method and a noise addition method; the adversarial network enhancement method is a method of enhancing the original image through a WGAN-GP network.

4. The on-machine detection method for tool surface defects according to claim 1, characterized in that: The extensive wear defects include built-up edge, flank wear, boundary wear, adhesive wear and coating peeling.

Citation Information

Patent Citations

  • Automatic Detection Method for Tool Wear Based on Image Processing

    CN111300144B

  • Tool wear type identification method and wear value determination method based on neural network

    CN111383227A

  • Tool damage detection method based on visual feature extraction

    CN111122587A

  • Workpiece wear detection method and system based on deep learning

    CN111260626A