Construction of multi-working-condition tool wear monitoring model and tool wear monitoring method, system, device and medium

By introducing the attention mechanism ECA and multi-source domain transfer learning into the tool wear monitoring model, and optimizing the convolution kernel size and hyperparameters, the problems of low adaptability and efficiency of the tool wear monitoring model under multiple working conditions are solved, and higher monitoring accuracy and construction efficiency are achieved.

CN121052295BActive Publication Date: 2026-02-10QILU UNIVERSITY OF TECHNOLOGY (SHANDONG ACADEMY OF SCIENCES)
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202511604226.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-11-05
Publication Date
2026-02-10
Estimated Expiration
2045-11-05

AI Technical Summary

Technical Problem

Existing tool wear monitoring models are poorly adapted to complex working conditions where multiple cutting parameters change simultaneously, resulting in low monitoring accuracy and construction efficiency. Furthermore, the performance of traditional convolutional neural networks degrades when working conditions change.

Method used

A multi-condition tool wear monitoring model is adopted. By introducing the attention mechanism ECA and embedding a two-dimensional convolutional neural network (2D-CNN), and combining multi-source domain transfer learning and Bayesian optimization, the model is pre-trained and fine-tuned to optimize the convolution kernel size and hyperparameters, thereby improving the model's generalization ability under varying working conditions.

Benefits of technology

This improved the accuracy and efficiency of tool wear monitoring models under complex working conditions, and enhanced the model's adaptability and flexibility to new environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121052295B_ABST
    Figure CN121052295B_ABST
Patent Text Reader

Abstract

The embodiment of the application provides a kind of multi-working condition cutter wear monitoring model construction and its wear monitoring method, system, equipment and medium, belong to neural network field.The method comprises: based on Pytorch deep learning framework, attention mechanism ECA is embedded into two-dimensional convolutional neural network, and the main network of multi-working condition cutter wear monitoring model is constructed;Through the training and fine-tuning strategy of multi-source domain transfer learning pre-training, the main network is trained and fine-tuned;And bayesian optimization is applied to the convolution kernel size of pre-training stage and the hyperparameter optimization process of fine-tuning stage respectively, to obtain the multi-working condition cutter wear monitoring model.Using transfer learning, the information related to tool state in signals under different working conditions can be learned, which can improve the generalization ability of the tool wear monitoring model under variable working conditions.The pre-training-fine-tuning strategy is introduced into the model construction process, which improves the adaptability of the model to new environment and the construction efficiency of the model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of neural network technology, specifically to the construction of a multi-condition tool wear monitoring model and its wear monitoring method, system, equipment, and medium. Background Technology

[0002] In machining environments, cutting conditions often vary significantly depending on the machining task. However, most current tool wear monitoring models are typically trained and validated under fixed or single-parameter changes, exhibiting poor adaptability to complex conditions where multiple cutting parameters change simultaneously. When cutting parameters are adjusted during actual machining, the characteristic distribution of sensor signals changes accordingly, leading to a significant decline in model performance and misjudgments. This is because these models often lack strong generalization ability to multi-condition features, making it difficult to distinguish between signal fluctuations caused by changes in conditions and actual wear evolution. Furthermore, models trained under fixed conditions require extensive retraining with a large amount of target condition data when conditions change, consuming computational resources and time, resulting in low model building efficiency and limiting their application in complex and changing cutting environments. Therefore, improving the monitoring accuracy and construction efficiency of tool wear monitoring models under complex conditions where multiple cutting parameters change simultaneously is of great significance.

[0003] Traditional convolutional neural networks (CNNs) are widely used in tool wear monitoring due to their powerful data processing capabilities. However, their architecture mainly relies on stacked convolutional layers, pooling layers, and fully connected layers to extract hierarchical features from the data. This structure treats all channels equally, without considering the differences in importance and dependencies between channels, which may result in the loss of some crucial information.

[0004] Moreover, in actual machining processes, working conditions are often changing. A model trained under fixed working conditions may perform poorly when cutting parameters or tool and workpiece materials change. Retraining the model is time-consuming and requires a large amount of new working condition data, resulting in low model building efficiency and performance. Summary of the Invention

[0005] The purpose of this invention is to provide a method, system, device, and medium for constructing a multi-condition tool wear monitoring model and monitoring its wear. By using transfer learning to learn information related to tool state from signals under different conditions, the generalization ability of the tool wear monitoring model under varying conditions can be improved. Multi-source domain transfer learning enables the model to better adapt to new target domains and is more suitable for machining environments requiring high flexibility and adaptability. Introducing a pre-training-fine-tuning strategy into the transfer learning model construction process improves the model's adaptability to new environments and the efficiency of model construction.

[0006] To achieve the above objectives, embodiments of the present invention provide a method for constructing a multi-condition tool wear monitoring model, comprising:

[0007] Based on the PyTorch deep learning framework, the attention mechanism ECA is embedded into the two-dimensional convolutional neural network 2D-CNN to construct a 2D-CNN-ECA model, which is then used as the main network of the multi-condition tool wear monitoring model.

[0008] The main network is trained and fine-tuned using a multi-source domain transfer learning pre-training and fine-tuning strategy. Bayesian optimization is applied to the convolution kernel size in the pre-training stage and the hyperparameter optimization process in the fine-tuning stage, so that the 2D-CNN-ECA model can adjust its structure and parameters to the optimal level according to the task data, thus obtaining a multi-condition tool wear monitoring model based on BO-2D-CNN-ECA-PTFT.

[0009] Optionally, the Bayesian optimization process is as follows:

[0010] Definition steps: Define the kernel size, hyperparameter search range, optimizer, and loss function in the 2D-CNN-ECA model;

[0011] Initialize the surrogate model and search for samples: Based on historical observation data, divide the input space into a first region and a second region, and use kernel density estimation to model the two regions respectively. Select the convolutional kernel size and hyperparameter combination with the highest probability of occurrence in the first region as the next search point. The first region is characterized as the region with good performance, and the second region is characterized as the region with poor performance.

[0012] Sample point evaluation steps: Each sample point is iterated using the 2D-CNN-ECA model, and the defined loss function is used as the sample evaluation. If the number of iterations is reached or the loss does not decrease after multiple iterations, the iteration of the current sample is stopped and the iteration of the next sample is started.

[0013] Output steps: Set the number of searches. If the set number of searches is not reached, return to the initialization of the surrogate model and the search for samples to continue the search. If the set number of searches is reached, end the optimization and output the current best convolution kernel size and hyperparameter combination.

[0014] Optionally, the formulas for calculating the probability density of the first region and the probability density of the second region are as follows:

[0015] ;

[0016] ;

[0017] In the formula, Represents historical sample data. and For kernel function, As weight, This indicates historical sample data that performed well. This indicates historical sample data that represents poor performance.

[0018] Optionally, the process of training the main network using a multi-source domain transfer learning pre-training strategy includes:

[0019] Multiple source domain data and historical working condition data of the target domain are acquired and input into a 2D-CNN-ECA model with Bayesian optimization of the convolution kernel size. The maximum mean difference is used to measure the distance between multiple source domain data and target domain data. The weighted sum of the maximum mean difference and the mean error of the output of the 2D-CNN-ECA model is normalized and used as the total loss.

[0020] The 2D-CNN-ECA model is trained using initial hyperparameters, which narrows the distance between multiple source and target domains, enabling the 2D-CNN-ECA model to adapt to various working conditions. The weight and bias parameters of the 2D-CNN-ECA model are saved to obtain the pre-trained model.

[0021] Optionally, the maximum mean difference can be calculated using the following formula:

[0022] ;

[0023] In the formula, m and n are the number of samples in domain P and domain Q, respectively. , , This represents the value of the kernel function.

[0024] Optionally, the process of fine-tuning the main network using a fine-tuning strategy includes:

[0025] The target domain data is input into the pre-trained model, and the optimal hyperparameter combination obtained by Bayesian optimization is used to retrain the pre-trained model so that the pre-trained model can accurately adapt to the target task. The loss function used in the fine-tuning stage is the mean square error. When the mean square loss converges to the minimum or reaches the target number of iterations, the training stops and the multi-condition tool wear monitoring model is output.

[0026] Secondly, the present invention also provides a method for monitoring the wear of cutting tools under multiple working conditions, comprising:

[0027] The cutting force signal, vibration signal and acoustic emission signal are collected during the turning process, and the force signal, vibration signal and acoustic emission signal are converted into two-dimensional signals in the time and frequency domain using short-time Fourier transform;

[0028] The time-frequency domain two-dimensional signal is input into the two-dimensional convolutional layer of the multi-condition tool wear monitoring model described above to extract local features and generate a feature map.

[0029] The feature map is input into the attention mechanism ECA introduced after the first convolutional layer. Spatial information is compressed by global average pooling, and then channel attention weights are generated by one-dimensional convolution and sigmoid function to weight the channels of the feature map to enhance the feature representation of the channels. ReLU activation function and max pooling layer are introduced after every two convolutional layers to reduce the spatial dimension of the feature map.

[0030] By using multiple convolution and pooling operations, the spatial dimension of the feature map is compressed, and the feature map is compressed into a feature vector of a preset size through an adaptive average pooling layer, thus integrating global spatiotemporal information.

[0031] The compressed feature vector is input into the fully connected layer, which maps the features to the prediction space of the wear value and outputs the tool wear state.

[0032] Optionally, the force signal, vibration signal, and acoustic emission signal can be converted into two-dimensional signals in the time-frequency domain according to the following formula:

[0033] ;

[0034] In the formula, x(t) represents the time-domain signal, w(t) is the window function, τ represents the time node, and ω represents the frequency node. It is the imaginary unit.

[0035] Thirdly, the present invention also provides a wear monitoring system for multi-condition cutting tools applied to a wear monitoring method for multi-condition cutting tools, comprising:

[0036] The acquisition unit is used to acquire cutting force signals, vibration signals, and acoustic emission signals during the turning process, and uses short-time Fourier transform to convert the force signals, vibration signals, and acoustic emission signals into two-dimensional signals in the time and frequency domains.

[0037] The feature extraction unit is used to input the time-frequency domain two-dimensional signal into the two-dimensional convolutional layer of the multi-condition tool wear monitoring model to extract local features and generate feature maps;

[0038] The feature processing unit is used to input the feature map into the attention mechanism ECA introduced after the first convolutional layer. It compresses spatial information through global average pooling, and then generates channel attention weights through one-dimensional convolution and the Sigmoid function to weight the channels of the feature map to enhance the feature representation of the channels. Specifically, a ReLU activation function and a max pooling layer are introduced after every two convolutional layers to reduce the spatial dimension of the feature map.

[0039] The feature compression unit is used to compress the spatial dimension of the feature map through multiple convolution and pooling operations, and to compress the feature map into a feature vector of a preset size through an adaptive average pooling layer, integrating global spatiotemporal information;

[0040] The output unit is used to input the compressed feature vector into the fully connected layer. The fully connected layer maps the features to the prediction space of the wear value and outputs the tool wear state.

[0041] Fourthly, the present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the above-described method for constructing a multi-condition tool wear monitoring model.

[0042] Fifthly, the present invention also provides a storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the method for constructing the multi-condition tool wear monitoring model described above.

[0043] By employing the above technical solutions, transfer learning can improve the generalization ability of the tool wear monitoring model under varying working conditions by learning information related to tool status from signals under different operating conditions. Multi-source domain transfer learning enables the model to better adapt to new target domains and is more suitable for machining environments requiring high flexibility and adaptability. Introducing a pre-training-fine-tuning strategy into the transfer learning model construction process improves the model's adaptability to new environments and the efficiency of model construction.

[0044] Other features and advantages of the embodiments of the present invention will be described in detail in the following detailed description section. Attached Figure Description

[0045] The accompanying drawings are provided to further illustrate embodiments of the present invention and form part of the specification. They are used together with the following detailed description to explain the embodiments of the present invention, but do not constitute a limitation thereof. In the drawings:

[0046] Figure 1 This is a flowchart of a method for constructing a multi-condition tool wear monitoring model provided in an embodiment of the present invention;

[0047] Figure 2 This is a schematic diagram illustrating the construction process of a multi-condition tool wear monitoring model provided in an embodiment of the present invention;

[0048] Figure 3 This is a structural diagram of a 2D-CNN-ECA model provided in an embodiment of the present invention;

[0049] Figure 4 A flowchart of a Bayesian optimization algorithm provided in this embodiment of the invention;

[0050] Figure 5 A schematic diagram of a multi-source domain adaptation strategy provided in an embodiment of the present invention;

[0051] Figure 6 A schematic diagram of a pre-training-fine-tuning strategy provided in an embodiment of the present invention;

[0052] Figure 7 This is a flowchart illustrating the implementation of a multi-condition tool wear monitoring method provided in an embodiment of the present invention;

[0053] Figure 8 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0054] Various embodiments of this disclosure will be described more fully in the following detailed description. This disclosure may have various embodiments, and adjustments and changes may be made therein. However, it should be understood that there is no intention to limit the various embodiments of this disclosure to the specific embodiments disclosed herein, but rather this disclosure should be understood to cover all adjustments, equivalents, and / or alternatives falling within the spirit and scope of the various embodiments of this disclosure.

[0055] In the following, the terms “comprising” or “may include”, which may be used in various embodiments of this disclosure, indicate the presence of the disclosed functions or operations and do not limit the addition of one or more functions or operations. Furthermore, as used in various embodiments of this disclosure, the terms “comprising,” “having,” and their cognates are intended only to indicate a specific feature, number, step, operation, or combination of the foregoing and should not be construed as primarily excluding the presence of one or more other features, numbers, steps, operations, or combinations of the foregoing, or the possibility of adding one or more features, numbers, steps, operations, or combinations of the foregoing.

[0056] In various embodiments of this disclosure, the expression "or" or "at least one of A and / or B" includes any combination or all combinations of the words listed simultaneously. For example, the expression "A or B" or "at least one of A and / or B" may include A, may include B, or may include both A and B.

[0057] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0058] See Figure 1 , Figure 2 As shown, Figure 1 This is a flowchart of a method for constructing a multi-condition tool wear monitoring model in a specific embodiment. Figure 2 This is a schematic diagram of the construction process of a multi-condition tool wear monitoring model in a specific embodiment, including the following execution steps:

[0059] Step 100: Based on the PyTorch deep learning framework, embed the attention mechanism ECA into the two-dimensional convolutional neural network 2D-CNN to construct the 2D-CNN-ECA model, and use it as the main network of the multi-condition tool wear monitoring model.

[0060] For details, please refer to Figure 3 As shown, the ECA mechanism is a lightweight channel attention mechanism. Compared with traditional channel attention mechanisms, it replaces complex dimensionality increase and decrease operations with one-dimensional convolution operations, reducing information loss and making the final attention weights more accurately reflect the importance of the original channel information. Furthermore, the ECA mechanism has fewer parameters and lower computational cost, enhancing the model's expressiveness without significantly increasing computational complexity or the number of parameters. The cutting force signal, vibration signal, and acoustic emission signal during the turning process are converted into two-dimensional signals in the time-frequency domain using short-time Fourier transform. After convolution processing, the feature values ​​are input into the ECA mechanism. The workflow of the ECA mechanism is as follows:

[0061] (1) Feature input: Input a feature with dimensions C×H×W, where C represents the number of channels, and H and W represent the height and width of the feature, respectively.

[0062] (2) Global Avgpool: Based on For each channel, the entire spatial dimension (including height and width) is averaged down to a single value. The result is a vector of length C. It represents the global context information for each channel. Indicates features in The values ​​at the location, H and W, represent the height and width of the feature, respectively.

[0063] (3) Calculate channel attention weights: One-dimensional convolution is used to capture cross-channel information interaction and generate channel attention weights. A small kernel size k is used to limit the receptive field, thereby reducing computational complexity and the number of parameters. The kernel size k is a small odd value dynamically determined according to the number of channels to ensure that each channel and its several adjacent channels are covered. The result after one-dimensional convolution is processed by the Sigmoid activation function to obtain the final channel attention weights. These weights are used to reflect the importance of each channel. The attention weights of each channel are processed by multiple two-dimensional convolutional layers and max pooling layers and then fed into a fully connected layer to output the wear value.

[0064] In summary, the ECA mechanism uses one-dimensional convolution to quickly generate attention weights for each channel, avoiding the global processing of interaction information between all channels. This not only results in high computational efficiency but also requires very few additional parameters. Furthermore, ECA does not perform dimensionality reduction, operating directly on the two-dimensional plane, which preserves more original information and reduces information loss caused by dimensionality reduction or upgrading. This ensures that the final attention weights more accurately reflect the importance of the original channel information. Therefore, introducing the ECA mechanism into 2D-CNN helps the model better focus on key features, thereby improving its ability to capture important features and overall performance.

[0065] Step 101: Train and fine-tune the main network using a multi-source domain transfer learning pre-training and fine-tuning strategy; apply Bayesian optimization to the convolution kernel size in the pre-training stage and the hyperparameter optimization process in the fine-tuning stage, so that the 2D-CNN-ECA model can adjust its structure and parameters to the optimal level according to the task data, thus obtaining a multi-condition tool wear monitoring model based on BO-2D-CNN-ECA-PTFT.

[0066] This application applies Bayesian optimization to two parts: optimizing the model's convolutional kernel size before pre-training and optimizing the hyperparameter combination before fine-tuning. This method saves time wasted on manual tuning and more accurately finds the optimal combination, improving model accuracy.

[0067] In some implementations, see Figure 4 As shown, the Bayesian optimization process is as follows:

[0068] S1 Definition Steps: Define the kernel size, hyperparameter search range, optimizer, and loss function in the 2D-CNN-ECA model.

[0069] Specifically, small-sized convolutional kernels have the advantages of fewer parameters, lower computational cost, better extraction of local details, and avoidance of overfitting. Therefore, the kernel size range selected in this embodiment is: kernel_sizes = {(a,b)|a∈S,b∈S}, where S={3,5,7}. The learning rate Lr, weight decay coefficient Weight_decay, and dropout ratio are all key factors affecting model training performance. Reasonably adjusting these hyperparameters is crucial for improving model performance. In this embodiment, the hyperparameter range is defined as: Lr = 0.0001 ~ 0.001, Weight-decay = 1e-5 ~ 1e-1, Dropout = 0.0 ~ 0.5. The model used is a 2D-CNN-ECA model. The Adam (Adaptive Moment Estimation) optimizer is used to... The loss is used to evaluate the performance of the proxy model in each search. It is the actual value; This is the predicted value; n is the sample size. The square of the prediction error for each data point.

[0070] S2 Initialization of Proxy Model and Sample Search Steps: Based on historical observation data, the input space is divided into a first region and a second region, and kernel density estimation is used to model these two regions respectively. The kernel size and hyperparameter combination with the highest probability of occurrence in the first region are selected as the next search point. The first region is characterized as a region with good performance, and the second region is characterized as a region with poor performance.

[0071] Specifically, the TPE (Tree-structured Parzen Estimator) algorithm is used to construct the surrogate model. Its principle is to divide the input space into two regions, "good performance" and "poor performance," based on historical observation data, and then model these two regions separately using kernel density estimation. The kernel size and hyperparameter combination with the highest probability of occurrence in the "good performance" region are then selected as the next search point. Historical data is... The formulas for calculating the probability density estimates of good samples and bad samples, i.e., the probability density of the first region and the probability density of the second region, are as follows:

[0072] ;

[0073] ;

[0074] In the formula, Represents historical sample data. and For kernel function, As weight, This indicates historical sample data that performed well. This indicates historical sample data that represents poor performance.

[0075] It should be understood that the next sample (with a new kernel size and hyperparameter combination) Depend on The determination guides the search direction in the Bayesian optimization process, indicating the combination of convolution kernel size and hyperparameters that maximizes the "probability of good samples / probability of bad samples" as the next sample.

[0076] S3 Sample Point Evaluation Steps: Each sample point is iterated using the 2D-CNN-ECA model, and the defined loss function is used as the sample evaluation. If the number of iterations is reached or the loss does not decrease after multiple iterations, the iteration of the current sample is stopped, and the iteration of the next sample is started.

[0077] For example, each sample point is iterated 10 times using a 2D-CNN-ECA model and the target domain data. The loss is used as a sample for evaluation. If the loss does not decrease after the number of iterations or after 5 iterations, the iteration stops and the next sample is iterated.

[0078] S4 Output Steps: Set the number of searches. If the set number of searches is not reached, return to the initialization of the surrogate model and the search for samples to continue the search. If the set number of searches is reached, end the optimization and output the current best convolution kernel size and hyperparameter combination.

[0079] In some implementations, the process of training the main network using a multi-source domain transfer learning pre-training strategy includes the following steps:

[0080] Sa: Acquire multiple source domain data and historical operating condition data of the target domain, and input the multiple source domain data and historical operating condition data of the target domain into the 2D-CNN-ECA model with Bayesian optimization of the convolution kernel size. Use the maximum mean difference to measure the distance between the multiple source domain data and the target domain data, and use the weighted sum of the maximum mean difference and the mean error of the output result of the 2D-CNN-ECA model after normalization as the total loss.

[0081] Specifically, the source domain data comes from machining conditions or environments related to but different from the target working condition, and is used to pre-train the model to extract general features. It includes: sensor signals under multiple working conditions: cutting force signals: triaxial force (X / Y / Z) data under different materials (e.g., steel, aluminum alloy) and cutting parameters (e.g., feed rate, depth of cut); vibration signals: vibration acceleration data under different machine tool states (e.g., new tools, worn tools) or fixture configurations; acoustic emission signals: acoustic emission waveforms under different tool types (e.g., cemented carbide, ceramic) or material removal rates; and annotation information: tool wear values ​​or wear status labels. The target domain data comes from the specific working condition that needs to be monitored, and is used for model fine-tuning to adapt to new environments. It includes: sensor signals of the current working condition: cutting force, vibration, and acoustic emission signals of the same type as the source domain, but collected from the target machine tool or machining task; partially labeled data: a small amount of data with wear labels for supervised fine-tuning; and a large amount of unlabeled data for unsupervised or semi-supervised learning.

[0082] Specifically, for domains Samples and domains For a sample, the maximum mean difference is calculated using the following formula:

[0083] ;

[0084] In the formula, m and n are the number of samples in domain P and domain Q, respectively. , , This represents the value of the kernel function.

[0085] For example, this embodiment uses a Gaussian kernel function. ,in, This represents the square of the Euclidean distance between two points. It is the standard deviation parameter, which controls the width of the kernel function.

[0086] Specifically, the mean error is calculated using the following formula:

[0087] ;

[0088] In the formula, It is the actual value; This is the predicted value; n is the sample size. The square of the prediction error for each data point.

[0089] Sb: Use initial hyperparameters to train the 2D-CNN-ECA model, narrow the distance between multiple source domains and the target domain to make the 2D-CNN-ECA model adaptable to various working conditions, and save the weight parameters and bias parameters of the 2D-CNN-ECA model to obtain the pre-trained model.

[0090] In some implementations, see Figure 5 As shown, multiple source domain data (source domain 1, source domain 2, ..., source domain k) and the target domain are input into the model's feature extraction module. A 3x3 convolution kernel is used for convolution, resulting in 30 output channels. After Conv 3x3@30, an efficient channel attention module (ECA block) is used to enhance the feature representation. Then, Max-Pool is performed to downsample and reduce the size of the feature map. After feature extraction, each source and target domain enters a domain adaptation module to align the feature distributions of the source and target domains, reducing inter-domain differences. The domain-adapted features are then fed into a fully connected layer FC-x, where x represents the number of neurons, for the final classification or regression task, outputting the result. The multi-source domain adaptation strategy is key to the pre-training stage of this invention. By learning common feature representations from different domains, the input source and target domain samples are mapped to a common space using MMD to measure the differences between different domains. Adding an MMD loss term before the fully connected layer of the model allows the model to not only optimize the task loss but also reduce the distribution gap between the source and target domains, improving the model's generalization ability.

[0091] In some implementations, see Figure 6As shown, the process of fine-tuning the main network using a fine-tuning strategy includes: setting the optimal convolutional kernel size parameters; inputting the target domain data (multi-condition time-frequency domain data) into a 2D-CNN-ECA pre-trained model (multiple convolutional layers, each followed by an ECA block and a Max-Pool layer, a flattening layer to flatten the features, and finally two fully connected layers FC-x and FC-1, outputting the prediction result). MMD (Maximum Mean Difference) and MSE (Mean Squared Error) are used as part of the loss function, with the total loss function being L. total During training, it is determined whether the loss has converged to a minimum. If it has not converged, the iteration returns; if it has converged, the weight bias parameters are saved, and the optimal hyperparameter combination obtained by Bayesian optimization and 20% of the target working condition data are used to retrain the same 2D-CNN-ECA model structure as in the pre-training stage, so that the pre-trained model can accurately adapt to the target task. The loss function used in the fine-tuning stage is the mean squared error (MSE). When the mean squared loss converges to a minimum or the maximum number of iterations is reached, training stops, and the multi-working-condition tool wear monitoring model is output.

[0092] The beneficial effects achieved by this application are as follows:

[0093] 1. The efficient channel attention (ECA) mechanism is used to improve the feature extraction capability of two-dimensional convolutional neural networks (2D-CNN), and the time-domain signal is converted into two-dimensional time-frequency domain data through short-time Fourier transform, which makes it easier for the model to extract more information related to the tool state from the signal.

[0094] 2. By using transfer learning based on multi-source domain adaptation, the generalization ability of 2D-CNN under complex and changing working conditions is improved, and a pre-training-fine-tuning strategy is introduced to improve the model construction efficiency and the accuracy of target working condition monitoring tasks.

[0095] 3. The Bayesian optimization algorithm is used to adaptively adjust the convolution kernel size and hyperparameter combination of the 2D-CNN-ECA model based on the target task data, avoiding the disadvantages of manual parameter tuning which is time-consuming and prone to missing the optimal combination, thereby improving the accuracy and construction efficiency of the tool wear monitoring model.

[0096] In one embodiment, Figure 7 The flowchart of a multi-condition tool wear monitoring method according to an embodiment of the present invention includes the following steps:

[0097] S700: Acquires cutting force signals, vibration signals, and acoustic emission signals during the turning process, and uses short-time Fourier transform to convert the force signals, vibration signals, and acoustic emission signals into two-dimensional signals in the time and frequency domain.

[0098] Specifically, the seven one-dimensional signals acquired by the sensor—force signals in the x, y, and z directions, vibration signals in the x, y, and z directions, and acoustic emission—are converted into two-dimensional signals using a short-time Fourier transform. Specifically, the force signal, vibration signal, and acoustic emission signal are converted into time-frequency domain two-dimensional signals according to the following formula:

[0099] ;

[0100] In the formula, x(t) represents the time-domain signal, w(t) is the window function, τ represents the time node, and ω represents the frequency node. It is the imaginary unit.

[0101] The long signal is segmented into multiple shorter, overlapping segments according to the above formula, and then a Fourier transform is performed on each segment. This is done to locate frequency information in time, thereby obtaining a time-frequency representation of the signal. In this embodiment, seven time-domain signals are truncated to a length of 3000, forming a 3000×7×n matrix, where n is the number of training samples for the model. Normalization is used to reduce the impact of differences in the dimensions of each signal on the results. Then, a short-time Fourier transform is used to convert the time-domain signal into a time-frequency domain dataset of shape n×7×τ×ω.

[0102] S701: Input the two-dimensional time-frequency domain signal into the two-dimensional convolutional layer of the multi-condition tool wear monitoring model to extract local features and generate a feature map.

[0103] S702: The feature map is input into the attention mechanism ECA introduced after the first convolutional layer. Spatial information is compressed by global average pooling, and then channel attention weights are generated by one-dimensional convolution and the Sigmoid function to weight the channels of the feature map to enhance the feature representation of the channels.

[0104] In this process, a ReLU activation function and a max pooling layer are introduced after every two convolutional layers to reduce the spatial dimension of the feature map.

[0105] S703: Through multi-layer convolution and pooling operations, the spatial dimension of the feature map is compressed, and the feature map is compressed into a feature vector of a preset size through an adaptive average pooling layer, integrating global spatiotemporal information;

[0106] S704: The compressed feature vector is input into the fully connected layer, which maps the features to the prediction space of the wear value and outputs the tool wear state.

[0107] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0108] In some embodiments, this application also provides a wear monitoring system for multi-condition tools applied to a wear monitoring method for multi-condition tools, comprising:

[0109] The acquisition unit is used to acquire cutting force signals, vibration signals, and acoustic emission signals during the turning process, and uses short-time Fourier transform to convert the force signals, vibration signals, and acoustic emission signals into two-dimensional signals in the time and frequency domains.

[0110] The feature extraction unit is used to input the time-frequency domain two-dimensional signal into the two-dimensional convolutional layer of the multi-condition tool wear monitoring model to extract local features and generate feature maps;

[0111] The feature processing unit is used to input the feature map into the attention mechanism ECA introduced after the first convolutional layer. It compresses spatial information through global average pooling, and then generates channel attention weights through one-dimensional convolution and the Sigmoid function to weight the channels of the feature map to enhance the feature representation of the channels. Specifically, a ReLU activation function and a max pooling layer are introduced after every two convolutional layers to reduce the spatial dimension of the feature map.

[0112] The feature compression unit is used to compress the spatial dimension of the feature map through multiple convolution and pooling operations, and to compress the feature map into a feature vector of a preset size through an adaptive average pooling layer, integrating global spatiotemporal information;

[0113] The output unit is used to input the compressed feature vector into the fully connected layer. The fully connected layer maps the features to the prediction space of the wear value and outputs the tool wear state.

[0114] Figure 8 This is a schematic diagram of the hardware structure of an electronic device that implements various embodiments of the present invention.

[0115] The method for constructing a multi-condition tool wear monitoring model provided in this application can be applied to electronic devices. Those skilled in the art will understand that the electronic device structure involved in the embodiments of this invention does not constitute a limitation on the electronic device. An electronic device may include more or fewer components than illustrated, or combine certain components, or have different component arrangements. In the embodiments of this invention, the electronic device includes, but is not limited to, laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the embodiments of this application described and / or claimed herein.

[0116] Electronic devices may include processors, external memory interfaces, internal memory, universal serial bus (USB) interfaces, charging management modules, power management modules, batteries, wireless communication modules, audio modules, speakers, microphones, sensor modules, buttons, cameras, displays, and SIM card interfaces, etc.

[0117] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device. In other embodiments of this application, the electronic device may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0118] A processor may include one or more processing units, such as: a central processing unit (CPU), an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural network processing unit (NPU). Different processing units may be independent devices or integrated into one or more processors.

[0119] The processor can serve as the nerve center and command center of an electronic device. The controller can generate operation control signals based on the instruction opcode and timing signals to control the fetching and execution of instructions.

[0120] The processor may also include memory for storing instructions and data. In some embodiments, the memory in the processor is a cache memory. This memory can store instructions or data that the processor has just used or that are used repeatedly. If the processor needs to use the instruction or data again, it can retrieve it directly from this memory. This avoids repeated accesses, reduces processor latency, and thus improves system efficiency.

[0121] An external storage interface (ESI) can be used to connect external memory cards, such as microSD cards, to expand the storage capacity of electronic devices. The external memory card communicates with the processor through the ESI to perform data storage functions, such as saving music and video files on the external memory card.

[0122] Internal memory can be used to store computer executable program code, which includes instructions. The processor executes various functional applications and data processing of electronic devices by running the instructions stored in internal memory. Internal memory can include a program storage area and a data storage area. Internal memory can include high-speed random access memory, and can also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.

[0123] Wireless communication functionality in electronic devices can be achieved through antennas, wireless communication modules, modem processors, and baseband processors.

[0124] Wireless communication modules can provide solutions for wireless communication applications in electronic devices, including wireless local area networks (WLANs) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies.

[0125] Electronic devices can implement audio functions through audio modules, speakers, receivers, microphones, headphone jacks, and application processors.

[0126] Electronic devices can achieve shooting functions through ISPs, cameras, video codecs, GPUs, displays, and application processors.

[0127] Electronic devices can achieve display functions through GPUs, displays, and application processors.

[0128] A GPU is a microprocessor for image processing, connected to the display screen and application processor. GPUs perform mathematical and geometric calculations for graphics rendering. A processor may include one or more GPUs, which execute program instructions to generate or modify display information.

[0129] A display screen is used to display images, videos, etc. A display screen includes a display panel.

[0130] The storage medium provided in this application stores a program product that enables the construction method of a multi-condition tool wear monitoring model.

[0131] The construction method of the multi-condition tool wear monitoring model includes: based on the PyTorch deep learning framework, embedding the attention mechanism ECA into the two-dimensional convolutional neural network 2D-CNN to construct a 2D-CNN-ECA model, which is used as the main network of the multi-condition tool wear monitoring model; training and fine-tuning the main network through multi-source domain transfer learning pre-training and fine-tuning strategies; and applying Bayesian optimization to the convolution kernel size in the pre-training stage and the hyperparameter optimization process in the fine-tuning stage, so that the 2D-CNN-ECA model can adjust its structure and parameters to the optimal level according to the task data, thus obtaining a multi-condition tool wear monitoring model based on BO-2D-CNN-ECA-PTFT.

[0132] In some possible implementations, the subject matter of this disclosure, "Method and System for Constructing a Multi-Condition Tool Wear Monitoring Model," can be implemented as a program product comprising program code. When the program product is run on a terminal device, the program code causes the terminal device to perform the steps described in the "Exemplary Methods" section of this specification according to various exemplary embodiments of this disclosure.

[0133] The storage medium disclosed herein may be any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of readable storage media include: an electrical connection having one or more wires, a portable disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof.

[0134] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for monitoring the wear of cutting tools under multiple working conditions, characterized in that, include: The cutting force signal, vibration signal and acoustic emission signal are collected during the turning process, and the force signal, vibration signal and acoustic emission signal are converted into two-dimensional signals in the time and frequency domain using short-time Fourier transform; The time-frequency domain two-dimensional signal is input into the two-dimensional convolutional layer of the multi-condition tool wear monitoring model to extract local features and generate a feature map. The feature map is input into the attention mechanism ECA introduced after the first convolutional layer. Spatial information is compressed by global average pooling, and then channel attention weights are generated by one-dimensional convolution and the Sigmoid function to weight the channels of the feature map to enhance the feature representation of the channels. By using multi-layer convolution and pooling operations, the spatial dimension of the feature map is compressed, and the feature map is compressed into a feature vector of a preset size through a feature flattening layer, thus integrating global spatiotemporal information. The compressed feature vector is input into the fully connected layer, which maps the features to the prediction space of wear values ​​and outputs the tool wear state. Specifically, the force signal, vibration signal, and acoustic emission signal are converted into two-dimensional signals in the time-frequency domain according to the following formula: ; In the formula, x(t) represents the time-domain signal, w(t) is the window function, τ represents the time node, ω represents the frequency node, and j is the imaginary unit; The multi-condition tool wear monitoring model is constructed in the following way, and is used to monitor the wear of tools under complex and variable conditions where multiple cutting parameters change simultaneously. Based on the PyTorch deep learning framework, the ECA attention mechanism is embedded into a two-dimensional convolutional neural network (2D-CNN) to construct a 2D-CNN-ECA model, which serves as the main network of a multi-condition tool wear monitoring model. The 2D-CNN-ECA model consists of a first convolutional layer, a ReLU activation function, an ECA attention mechanism module, a second convolutional layer, a ReLU activation function, a first max pooling layer, a third convolutional layer, a ReLU activation function, a second max pooling layer, a fourth convolutional layer, a ReLU activation function, a third max pooling layer, a feature flattening layer, a first fully connected layer, a second fully connected layer, and an output layer. The main network is trained and fine-tuned using a multi-source domain transfer learning pre-training and fine-tuning strategy; Bayesian optimization is applied to the kernel size in the pre-training stage and the hyperparameter optimization process in the fine-tuning stage, so that the 2D-CNN-ECA model can adjust its structure and parameters to the optimal level according to the task data, thus obtaining a multi-condition tool wear monitoring model based on BO-2D-CNN-ECA-PTFT. The Bayesian optimization is applied to two parts: optimizing the model's convolutional kernel size before pre-training and optimizing the hyperparameter combination before fine-tuning. The Bayesian optimization process is as follows: Definition steps: Define the kernel size, hyperparameter search range, optimizer, and loss function in the 2D-CNN-ECA model; use the Adam optimizer and MSE as the loss to evaluate the performance of the surrogate model in each search; Initialize the surrogate model and search for samples: Based on historical observation data, divide the input space into a first region and a second region, and use kernel density estimation to model the two regions respectively. Select the convolutional kernel size and hyperparameter combination with the highest probability of occurrence in the first region as the next search point. The first region is characterized as the region with good performance, and the second region is characterized as the region with poor performance. The formulas for calculating the probability density of the first region and the probability density of the second region are as follows: ; ; In the formula, Represents historical sample data. and For kernel function, As weight, This indicates historical sample data that performed well. This indicates historical sample data that represents poor performance; Sample point evaluation steps: Each sample point is iterated using the 2D-CNN-ECA model, and the defined loss function is used as the sample evaluation. If the number of iterations is reached or the loss does not decrease after multiple iterations, the iteration of the current sample is stopped, and the iteration of the next sample is carried out. Among them, the kernel size and hyperparameter combination that maximizes the probability of good sample / probability of bad sample is used as the next sample. Output steps: Set the number of searches. If the set number of searches is not reached, return to the initialization of the surrogate model and the search for samples to continue the search. If the set number of searches is reached, end the optimization and output the current best convolution kernel size and hyperparameter combination. The process of training the main network using a multi-source domain transfer learning pre-training strategy includes: Multiple source domain data and historical operating condition data of the target domain are acquired and input into a 2D-CNN-ECA model with Bayesian optimization of the convolutional kernel size. The maximum mean difference (MMD) is used to measure the distance between the multiple source domain data and the target domain data. The weighted sum of the MMD and the mean squared error (MSE) of the 2D-CNN-ECA model output is normalized and used as the total loss L. total , The MMD loss term is added before the fully connected layers of the model. Specifically, the source domain data comes from machining conditions or environments that are related to but different from the target working condition. It is used to pre-train the model to extract general features. It contains sensor signals under multiple working conditions: cutting force signals, vibration signals, and acoustic emission signals. The annotation information is tool wear value or wear status label. The target domain data comes from the specific working condition that needs to be monitored. It is used to fine-tune the model to adapt to the new environment. It contains sensor signals of the current working condition, that is, cutting force, vibration, and acoustic emission signals of the same type as those in the source domain, but collected from the target machine tool or machining task. Some labeled data is a small amount of data with wear labels, which is used for supervised fine-tuning. The unlabeled data is a large amount of unlabeled data, which is used for unsupervised or semi-supervised learning. The 2D-CNN-ECA model is trained to narrow the distance between multiple source domains and the target domain, making the 2D-CNN-ECA model adaptable to various working conditions. The weight parameters and bias parameters of the 2D-CNN-ECA model are saved to obtain the pre-trained model. During training, it is determined whether the loss has converged to the minimum. If it has not converged, the iteration is returned. If it has converged, the weight bias parameters are saved, the pre-training is ended, the pre-trained model is saved, and the fine-tuning stage is entered. The process of fine-tuning the main network using fine-tuning strategies includes: The target domain data is input into the pre-trained model, and the optimal hyperparameter combination obtained by Bayesian optimization and 20% of the target working condition data are used to retrain the pre-trained model. The loss function used in the fine-tuning stage is the mean square error. When the mean square loss converges to the minimum or reaches the target number of iterations, the training stops and the multi-working-condition tool wear monitoring model is output.

2. The multi-condition tool wear monitoring method according to claim 1, characterized in that, Calculate the maximum mean difference using the following formula: ; In the formula, m and n are the number of samples in domain P and domain Q, respectively. , , This represents the value of the kernel function.

3. A wear monitoring system for multi-condition cutting tools applied to the wear monitoring method for multi-condition cutting tools as described in claim 1, characterized in that, include: The acquisition unit is used to acquire cutting force signals, vibration signals, and acoustic emission signals during the turning process, and uses short-time Fourier transform to convert the force signals, vibration signals, and acoustic emission signals into two-dimensional signals in the time and frequency domains. The feature extraction unit is used to input the time-frequency domain two-dimensional signal into the two-dimensional convolutional layer of the multi-condition tool wear monitoring model to extract local features and generate feature maps; The feature processing unit is used to input the feature map into the attention mechanism ECA introduced after the first convolutional layer, compress spatial information through global average pooling, and then generate channel attention weights through one-dimensional convolution and the Sigmoid function to weight the channels of the feature map to enhance the feature representation of the channels. The feature compression unit is used to compress the spatial dimension of the feature map through multi-layer convolution and pooling operations, and to compress the feature map into a feature vector of a preset size through the feature flattening layer, integrating global spatiotemporal information; The output unit is used to input the compressed feature vector into the fully connected layer. The fully connected layer maps the features to the prediction space of the wear value and outputs the tool wear state.

4. An electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the multi-condition tool wear monitoring method as described in any one of claims 1 to 2.

5. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the multi-condition tool wear monitoring method as described in any one of claims 1 to 2.

Citation Information

Patent Citations

  • Photovoltaic power prediction method and system based on Bayesian parameter optimization

    CN118630744A