A workpiece surface roughness prediction method

By combining the improved U-Net segmentation model and LSTM network with visual detection and parameter prediction, an integrated network model is constructed. This solves the problems of single feature and many model parameters in the prediction of surface roughness and tool wear in the existing technology, and achieves higher prediction accuracy and representativeness.

CN116523865BActive Publication Date: 2026-06-05NINGBO YUNDE MATERIALS INC

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
NINGBO YUNDE MATERIALS INC
Filing Date
2023-04-25
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

Existing technologies rely excessively on sensor signals for surface roughness and tool wear prediction. They have limited features, are easily affected by environmental interference, and have many model parameters, which affects the accuracy of prediction results.

Method used

By combining visual inspection and parameter prediction, an improved U-Net segmentation model and LSTM network are used to construct an integrated network model using image descriptors and machining parameters to predict workpiece surface roughness and tool wear.

Benefits of technology

It outputs accurate tool wear values ​​and workpiece surface roughness with fewer inputs, improving the accuracy and representativeness of predictions and avoiding the problems of insufficient parameter representativeness of a single model and excessively large training parameters caused by too much data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116523865B_ABST
    Figure CN116523865B_ABST
Patent Text Reader

Abstract

The application discloses a workpiece surface roughness prediction method, adopts an integrated network model, can output a tool surface wear value and a workpiece surface roughness prediction value under the condition of less input, and has higher reference value for machine tool operators; the method combines visual detection and parameter prediction, avoids problems of low parameter representativeness and incapability of quantitative detection caused by a single model, and further plays the value brought by the image processed by the segmentation model; the prediction unit of the surface roughness prediction model contains machining parameters, kinetic parameters, tool states and the like, has strong parameter representativeness, can effectively represent a machining process, performs feature dimension reduction in a data processing process, extracts feature data, and avoids the problem of excessive network model training parameters caused by a large amount of data participating in the prediction process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent manufacturing technology, and specifically to a method for predicting the surface roughness of a workpiece. Background Technology

[0002] In recent years, with the development of machine learning and artificial intelligence, the manufacturing industry has made tremendous progress in terms of intelligence. Against this backdrop, accurate and efficient monitoring of various parameters in the cutting process is of great significance for ensuring product quality and improving the intelligence level of the machining process. In machining, workpiece surface roughness and tool wear are two of the most important physical quantities, affecting the machining accuracy and efficiency of parts. Surface roughness is a key parameter describing the microscopic morphology of a part's surface and measuring its quality. It not only affects the wear resistance, fatigue strength, corrosion resistance, sealing performance, and fit stability of the part, but also influences its surface optical properties, electrical and thermal conductivity, and appearance. Tool wear directly affects the machining quality of parts and the operating condition of machines, severely restricting the improvement of production efficiency and the reduction of production costs.

[0003] Currently, the determination of surface roughness and tool wear is mainly based on the collected sensor cutting signals, and machine learning technology is used to achieve intelligent prediction of surface roughness and tool wear. Invention patent CN 202010893197.1 provides a surface roughness prediction method based on an improved LSTM network. This method uses vibration signals as input, employs a filtered feature set processed by a CNN network and a manually selected feature set as inputs to train the LSTM network layers to obtain a full feature set. Then, an FCN network is used to train the full feature set to obtain a prediction model corresponding to the vibration signal and roughness value. However, this method relies excessively on vibration signals for roughness prediction, has a single feature set, is easily affected by environmental interference, and is difficult to adapt to different cutting processing scenarios. Invention patent CN 202210367064.X proposes a surface roughness and tool wear prediction method based on stacked denoising autoencoders and multi-task learning. It extracts time-domain and frequency-domain features from the cutting signals to train a stacked denoising autoencoder network, and on this basis, builds a multi-task learning model to achieve surface roughness and tool wear prediction. This method mainly uses fully connected networks for prediction, resulting in a large number of parameters to be trained in the model. Due to the large amount of interference in the signals collected by the sensors, the accuracy of the prediction results is greatly affected by the extracted time-domain and frequency-domain features. Summary of the Invention

[0004] The present invention provides a method for predicting the surface roughness of a workpiece to solve the technical problems of existing technologies that rely excessively on sensor signals and have incomplete data features.

[0005] To achieve the above objectives, the technical solution proposed by this invention is as follows:

[0006] A method for predicting the surface roughness of a workpiece includes the following steps:

[0007] Step S1: Conduct a cutting experiment, collect tool surface wear images and record cutting data during the process, and then create corresponding mask images based on the wear images to build a tool surface wear image database.

[0008] Step S2: Divide the image database into a training set and a test set, which are used to train and test the U-Net segmentation model, respectively. Adjust the parameters of the U-Net segmentation model according to the error during training and testing to obtain a U-Net segmentation model that meets the requirements.

[0009] Step S3: Use the U-Net segmentation model trained in step S2 to analyze the wear image to obtain the mask image of the tool wear image;

[0010] Step S4: Obtain the tool wear value by identifying the upper and lower boundaries of the wear area in the mask image;

[0011] Step S5: Fill the worn area in the mask image to eliminate holes and smooth the edges. Then, use image descriptors to describe the features of the mask image and obtain descriptors. Here, the image descriptor refers to the perimeter of the region outline, the area after filling the region, the equivalent diameter, the convex area, the solidity, the major axis of the equivalent ellipse, the minor axis of the equivalent ellipse, and the eccentricity of the equivalent ellipse.

[0012] Step S6, construct prediction units The workpiece surface roughness, Ra, is the labeled data, and the cutting distance L refers to the length of the chips removed during the cutting process. The average value of the cutting force, v, f, and a, is measured over a time interval during the cutting process. p These refer to cutting speed, feed rate, and depth of cut, respectively; the prediction units are sorted in ascending order of cutting distance to construct a cutting database;

[0013] Step S7: Divide the cutting database into a training set and a test set, which are used to train and test the surface roughness prediction model, respectively. Adjust the parameters of the surface roughness prediction model according to the error during the test to obtain a surface roughness prediction model that meets the requirements.

[0014] Furthermore, the cutting data mentioned in step S1 includes cutting distance, average cutting force, cutting speed, feed rate, depth of cut, and workpiece surface roughness. Except for cutting speed, feed rate, and depth of cut, the other parameters need to be measured periodically at certain intervals.

[0015] Furthermore, the U-Net segmentation model described in step S2 is an improved model using the CBAM attention module. The improvement to the U-Net segmentation model is achieved by adding the CBAM module to the skip connection process of U-Net, and the data processed by the CBAM module is connected with the upsampled data using CONCAT.

[0016] The CBAM module consists of an improved channel attention module (CAM) and an improved spatial attention module (SAM).

[0017] The improved channel attention module (CAM) calculation is shown in formula (1):

[0018]

[0019] In the formula, F refers to the feature map generated by the U-Net segmentation model during the processing of the tool image, and C, H, and W represent the number of channels, height, and width of the feature map, respectively, and σ refers to the sigmoid function. and W0 and W1 represent the average pooling feature and max pooling feature in CAM processing, respectively. and The weights in the processing, B0 is The regularization and ReLU transformation performed during the processing, B1 is The regularization and ReLU transformation performed during the processing result in M ​​of the feature map F after CAM processing. c ,and

[0020] The Spatial Attention Module (SAM) is calculated as shown in Equation (2):

[0021]

[0022] Where f refers to the convolution kernel, which has a size of 5×5. and Let M represent the average pooling feature and the max pooling feature in the SAM processing, respectively. The feature map F after SAM processing is M. s ,and

[0023] After the feature map F is processed by CAM and SAM, it is then processed by formulas (3)-(4) to obtain the output value:

[0024]

[0025]

[0026] Where F' is the intermediate processing feature map, Mc (F) refers to performing CAM processing on F, M s (F') indicates that SAM processing is performed on F', symbol The expression indicates multiplication, and F” represents the result obtained after CBAM processing.

[0027] Furthermore, the surface roughness prediction model described in step S7 is composed of an LSTM network followed by a fully connected network.

[0028] Furthermore, the surface roughness prediction model is trained using surface roughness as the labeled data and employs the GSE loss function, the formula of which is:

[0029]

[0030] Where f(x) represents the predicted value of the surface roughness prediction model, y represents the label data, and |f(x)-y| represents the weight parameter, thereby realizing the dynamic weight adjustment function.

[0031] Optionally, the LSTM network can be replaced with a BiLSTM network or a GRU network.

[0032] Furthermore, the fully connected network consists of two layers. The number of neurons in the first layer is related to the output data of the LSTM network, while the second layer has only one neuron, namely the surface roughness prediction value.

[0033] Compared with the prior art, the present invention has the following prominent substantive features and significant advantages:

[0034] This invention employs an integrated network model that can output tool surface wear values ​​and workpiece surface roughness predictions with less input, providing greater reference value for machine tool operators. This method combines visual inspection and parameter prediction, avoiding the problems of low parameter representativeness and inability to quantitatively detect caused by single models, and further leveraging the value of images processed by the segmentation model. The prediction unit for the surface roughness prediction model includes machining parameters (v, f, ap) and dynamic parameters. Tool status (Ra, image descriptor, etc.) parameters are highly representative and can effectively characterize the machining process. Using image descriptors is equivalent to feature dimensionality reduction, extracting feature data and avoiding the problem of excessive training parameters for the network model caused by a large amount of data participating in the prediction process. Attached Figure Description

[0035] Figure 1 This is a flowchart of the present invention;

[0036] Figure 2 This is a schematic diagram of the improved segmentation model network structure of this invention;

[0037] Figure 3 This is a schematic diagram of the network structure of the network model used in this invention. Detailed Implementation

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

[0039] The specific embodiments described herein are particular embodiments of the present invention, used to illustrate the concept of the invention, and are illustrative and exemplary, and should not be construed as limiting the embodiments or scope of the present invention. In addition to the embodiments described herein, those skilled in the art can employ other obvious technical solutions based on the content disclosed in the claims and specification of this application. These technical solutions include those that make any obvious substitutions and modifications to the embodiments described herein, all of which are within the protection scope of the present invention.

[0040] like Figure 1 As shown, a method for predicting the surface roughness of a workpiece includes the following steps:

[0041] Step S1: Conduct a cutting experiment, collect tool surface wear images and record cutting data during the process, and then create corresponding mask images based on the wear images to build a tool surface wear image database.

[0042] Step S2: Divide the image database into a training set and a test set, which are used to train and test the U-Net segmentation model, respectively. Adjust the model parameters according to the error during training and testing to obtain a U-Net segmentation model that meets the requirements.

[0043] Step S3: Use the U-Net segmentation model trained in step S2 to analyze the wear image to obtain the mask image of the tool wear image;

[0044] Step S4: Obtain the tool wear value by identifying the upper and lower boundaries of the wear area in the mask image;

[0045] Step S5: The flooding algorithm in OpenCV is used to fill the worn area in the mask image, eliminate holes in the area, and smooth the edges using morphological opening operation. Then, the image descriptor is used to describe the features of the mask image to obtain the descriptor. Here, the image descriptor refers to the perimeter of the region outline, the area after filling the region, the equivalent diameter, the convex area, the solidity, the major axis of the equivalent ellipse, the minor axis of the equivalent ellipse, and the eccentricity of the equivalent ellipse.

[0046] Step S6, Construct prediction units The workpiece surface roughness, Ra, is the labeled data, and the cutting distance L refers to the length of chips removed during the cutting process. The average value of the cutting force, v, f, and a, is measured over a time interval during the cutting process. p These refer to cutting speed, feed rate, and depth of cut, respectively; the prediction units are sorted in ascending order of cutting distance to construct a cutting database;

[0047] Step S7: Divide the cutting database into a training set and a test set, which are used to train and test the surface roughness prediction model, respectively. Adjust the parameters of the surface roughness prediction model according to the error during the test to obtain a surface roughness prediction model that meets the requirements.

[0048] Furthermore, the cutting data mentioned in step S1 includes cutting distance, average cutting force, cutting speed, feed rate, depth of cut and workpiece surface roughness. Except for cutting speed, feed rate and depth of cut, the other parameters need to be measured periodically at certain intervals.

[0049] The tool wear images were collected using a Hikvision vision inspection device, specifically configured as follows: an industrial camera (model MV-CS060-10GM), a telecentric lens (model MVL-MY-2-65-MP), and a light source (model HL-RD0-90-4-W). The image accuracy of the acquired tool surface wear images was primarily ensured by the telecentric lens with a target size of 1 / 1.8", an object distance of 65 mm, a depth of field of 0.3 mm, and a maximum imaging range of 3.69 mm × 2.46 mm, and the industrial camera with a resolution of 3072 pixels × 2048 pixels and a pixel size of 2.4 μm × 2.4 μm.

[0050] The preprocessing performed after image acquisition mainly includes Gaussian filtering and contrast enhancement, and then the image is cropped to a size of 512 pixels × 512 pixels.

[0051] The surface roughness was measured using a Mitutoyo handheld surface roughness meter (model SJ-210), which can detect surface roughness in the range of -200μm±160μm, meeting the needs of most tests.

[0052] The creation of mask images in the image database is mainly done through the software Labelme. After inputting the image into the software, the worn area can be selected to create the mask for that area.

[0053] Furthermore, the ratio of the training set to the test set mentioned in step S2 is 8:2, and the model parameters during training are as follows: the loss function is selected as the Binary CrossEntropy function, the optimizer is selected as Adam, the initial learning rate is 0.001, the learning rate is gradually reduced using the cosine descent algorithm, and the accuracy is determined by the IOU index.

[0054] like Figure 2As shown, the U-Net segmentation model described in step S2 is an improved model using the CBAM attention module. This module can learn to strengthen or suppress relevant feature information, effectively helping information to be transmitted in the network. The improvement to the U-Net segmentation model is achieved by adding the CBAM module to the skip connection process of U-Net. The data processed by the CBAM module is then connected with the upsampled data using CONCAT.

[0055] The CBAM module consists of an improved channel attention module (CAM) and an improved spatial attention module (SAM).

[0056] The improved channel attention module (CAM) calculation is shown in formula (1):

[0057]

[0058] Where F refers to the feature map generated by the U-Net segmentation model during the processing of the tool image, and C, H, and W represent the number of channels, height, and width of the feature map, respectively, and σ refers to the sigmoid function. and W0 and W1 represent the average pooling feature and max pooling feature in CAM processing, respectively. and The weights in the processing, B0 is The regularization and ReLU transformation performed during the processing, B1 is The regularization and ReLU transformation performed during the processing result in M ​​of the feature map F after CAM processing. c ,and

[0059] The Spatial Attention Module (SAM) is calculated as shown in Equation (2):

[0060]

[0061] Where f refers to the convolution kernel, which has a size of 5×5. and B0 and B1 represent the average pooling feature and max pooling feature in SAM processing, respectively. and The regularization and ReLU transformation performed during the processing result in M ​​of the feature map F after SAM processing. s ,and

[0062] After the feature map is processed by CAM and SAM, the output value can be obtained by further processing using formulas (3)-(4):

[0063]

[0064]

[0065] Where F' is the intermediate processing feature map, M c (F) refers to performing CAM processing on F, M s (F') indicates that SAM processing is performed on F', symbol The expression indicates multiplication, and F” represents the result obtained after CBAM processing.

[0066] Further, the step of obtaining the wear value in step S4 is as follows: First, the mask image is converted into a binary image, and the pixel value of the wear area is 255; the image is scanned from left to right, and the pixel difference in the vertical direction between the first pixel with a pixel value of 255 at the top and the first pixel with a pixel value of 255 at the bottom is found; after the scan is completed, the largest difference is selected, and this value is multiplied by the pixel size of the image, 2.4μm, and the result is the tool wear value.

[0067] Furthermore, in step S6 The force gauge is used to measure the average value of the cutting force over a certain processing time interval.

[0068] Furthermore, the surface roughness prediction model described in step S7 is composed of an LSTM network followed by a fully connected network.

[0069] The surface roughness prediction model is trained using surface roughness as the labeled data, employing the Adam optimizer with an initial learning rate of lr = 0.001. A cosine descent algorithm is used to gradually decrease the learning rate, and the GSE loss function is used, the formula of which is:

[0070]

[0071] Where f(x) represents the predicted value of the surface roughness prediction model, y represents the label data, and |f(x)-y| represents the weight parameter, thereby realizing the dynamic weight adjustment function;

[0072] Optionally, the LSTM network can be replaced with a BiLSTM network or a GRU network.

[0073] Furthermore, the fully connected network consists of two layers. The first layer has 32 neurons and uses a linear activation function, while the second layer has only one neuron, which is the surface roughness prediction value.

[0074] The network structure diagram of the network model used in the actual application of this invention in cutting machining is shown below. Figure 3 As shown, the steps are as follows:

[0075] A visual inspection device is used to capture tool images and preprocess them. The images are then input into a trained segmentation model to obtain a mask image. The mask image is analyzed to obtain tool wear values ​​and image descriptors. These two values, along with average cutting force, cutting distance, and cutting parameters, form a prediction unit. The prediction unit is then input into a surface roughness prediction model to obtain the predicted surface roughness value.

[0076] This invention is not limited to this embodiment. Any equivalent concept or modification within the technical scope disclosed in this invention shall be included within the protection scope of this invention.

Claims

1. A method for predicting the surface roughness of a workpiece, characterized in that: Includes the following steps: Step S1: Conduct a cutting experiment, collect tool surface wear images and record cutting data during the process, and then create corresponding mask images based on the wear images to build a tool surface wear image database. Step S2: Divide the image database into a training set and a test set, which are used to train and test the U-Net segmentation model, respectively. Adjust the parameters of the U-Net segmentation model according to the error during training and testing to obtain a U-Net segmentation model that meets the requirements. Step S3: Use the U-Net segmentation model trained in step S2 to analyze the wear image to obtain the mask image of the tool wear image; Step S4: Obtain the tool wear value by identifying the upper and lower boundaries of the wear area in the mask image; Step S5: Fill the worn area in the mask image to eliminate holes and smooth the edges. Then, use image descriptors to describe the features of the mask image and obtain descriptors. Here, the image descriptor refers to the perimeter of the region outline, the area after filling the region, the equivalent diameter, the convex area, the solidity, the major axis of the equivalent ellipse, the minor axis of the equivalent ellipse, and the eccentricity of the equivalent ellipse. Step S6, construct prediction unit Unit = [Ra, L, , v , f , a p [VB, descriptor], where the workpiece surface roughness Ra is the tag data, and the cutting distance L refers to the length of the chips removed during the cutting process. This refers to the average value of the cutting force measured between intervals during the cutting process. v, f, a p These refer to cutting speed, feed rate, and depth of cut, respectively; the prediction units are sorted in ascending order of cutting distance to construct a cutting database; Step S7: Divide the cutting database into a training set and a test set, which are used to train and test the surface roughness prediction model, respectively. Adjust the parameters of the surface roughness prediction model according to the error during the test to obtain a surface roughness prediction model that meets the requirements.

2. The method for predicting workpiece surface roughness according to claim 1, characterized in that: The cutting data mentioned in step S1 includes cutting distance, average cutting force, cutting speed, feed rate, depth of cut and workpiece surface roughness. Except for cutting speed, feed rate and depth of cut, the other parameters need to be measured periodically at certain intervals.

3. The method for predicting workpiece surface roughness according to claim 1, characterized in that: The U-Net segmentation model described in step S2 is an improved model using the CBAM attention module. The improvement to the U-Net segmentation model is achieved by adding the CBAM module to the U-Net skip connection process, and then performing a CONCAT connection between the data processed by the CBAM module and the upsampled data. The CBAM module consists of an improved channel attention module (CAM) and an improved spatial attention module (SAM). The improved channel attention module (CAM) calculation is shown in formula (1): (1) In the formula, F refers to the feature map generated by the U-Net segmentation model during the processing of the tool image, and C, H, and W represent the number of channels, height, and width of the feature map, respectively. σ Refers to the sigmoid function. and W0 and W1 represent the average pooling feature and max pooling feature in CAM processing, respectively. and The weights in the processing, B0 is The regularization and ReLU transformation performed during the processing, B1 is The regularization and ReLU transformation performed during the processing result in the feature map F after CAM processing. ,and ; The Spatial Attention Module (SAM) is calculated as shown in Equation (2): (2) in, f The convolution kernel has a size of 5×5. and These represent the average pooling feature and the max pooling feature in the SAM processing, respectively. The result of feature map F after SAM processing is: ,and ; After the feature map F is processed by CAM and SAM, it is then processed by formulas (3)-(4) to obtain the output value: (3) (4) Where F' is the intermediate processing feature map, M c (F) refers to performing CAM processing on F, M s (F') indicates that SAM processing is performed on F', symbol The expression indicates multiplication, and F” represents the result obtained after CBAM processing.

4. The method for predicting workpiece surface roughness according to claim 1, characterized in that: The surface roughness prediction model described in step S7 is composed of an LSTM network followed by a fully connected network.

5. The method for predicting workpiece surface roughness according to claim 4, characterized in that: The surface roughness prediction model described above uses surface roughness as the label data during training and employs the GSE loss function, the formula of which is: (5) in, Used to identify the sample sequence number in the training dataset; This represents the total number of samples used for model training; for the th For each sample, there exists a corresponding set of input features. Tag data and model predictions , Indicates the first The weight parameters of each sample are used to achieve dynamic weight adjustment.

6. The method for predicting workpiece surface roughness according to claim 4, characterized in that: The LSTM network is replaced with a BiLSTM network or a GRU network.

7. The method for predicting workpiece surface roughness according to claim 4, characterized in that: The fully connected network consists of two layers. The number of neurons in the first layer is related to the output data of the LSTM network, while the second layer has only one neuron, which is the predicted surface roughness value.