A Tool Wear Prediction Method and Apparatus Based on Wear Gate Element Coupled Spatial Constraints
By introducing wear gate units and feature space constraint regularization loss terms into the tool wear prediction model, the problems of insufficient generalization ability and feature space instability in existing tool wear prediction technologies are solved, achieving higher prediction accuracy and robustness.
Patent Information
- Application Number
- CN202511810472.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-03
- Publication Date
- 2026-11-10
- Estimated Expiration
- 2045-12-03
AI Technical Summary
Existing tool wear prediction methods have insufficient generalization ability when faced with changes in cutting parameters and workpiece materials, unstable feature space, systematic bias in prediction, and disconnect between model structure and physical meaning.
An improved static wear prediction model is constructed by introducing enhanced feature space constraint regularization loss terms and feature space smoothing constraint regularization loss terms, based on wear gate elements coupled with spatial constraints. The wear gate elements are used to simulate the wear accumulation process, and the model parameters are updated by gradient descent optimization algorithm.
It improves the accuracy and robustness of tool wear prediction, enhances the model's generalization ability, and makes it more stable and accurate in the face of new data or working conditions.
Smart Images

Figure CN121340034B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of intelligent manufacturing, predictive maintenance and CNC machining technology, and in particular to a tool wear prediction method and device based on wear gate unit coupled spatial constraints. Background Technology
[0002] In modern CNC machining, the wear and condition of cutting tools directly affect the surface quality, dimensional accuracy, and even the overall efficiency of the production line. Therefore, accurately predicting tool wear and its value is crucial for predictive maintenance, ensuring product quality, and preventing unexpected downtime.
[0003] Existing tool wear prediction methods are mainly divided into two categories: those based on physical models and those based on data-driven models. Physical model-based methods rely on complex cutting dynamics and material wear mechanisms, making modeling difficult and adaptable to varying real-world conditions. Data-driven methods, especially those based on machine learning and deep learning, extract signal features from sensor data and learn the mapping relationship between these features and wear, demonstrating greater flexibility and development potential.
[0004] However, existing data-driven prediction models still face the following technical challenges:
[0005] Insufficient generalization ability: Traditional data-driven methods perform reasonably well when the distribution of training and test data is consistent, but when actual machining conditions such as cutting parameters and workpiece materials change, it will lead to data distribution shift, and the prediction performance will drop sharply.
[0006] Unstable feature space: The high-dimensional feature space of data-driven model learning may be non-smooth, meaning that small perturbations in the input signal may cause drastic changes in the feature representation, making the model sensitive to noise and less robust.
[0007] The prediction has systematic bias: Most models use symmetric loss functions such as mean-square error (MSE) for optimization, which may lead to systematic overestimation or underestimation of the model, and fail to effectively control the overall distribution of the prediction residuals.
[0008] The model structure is disconnected from the physical meaning: Many data-driven models are "black box" models, lacking an intrinsic simulation of the wear accumulation process. The network structure of the model is not strongly related to the physical process of wear, which limits the interpretability and performance ceiling of the model.
[0009] Therefore, there is an urgent need for a new tool wear prediction method that can overcome data distribution drift, enhance feature space stability, and incorporate the physical laws of wear accumulation, so as to improve the accuracy, robustness and generalization ability of tool wear prediction. Summary of the Invention
[0010] In view of this, the present application provides a tool wear prediction method and apparatus based on wear gate unit coupled spatial constraints to solve the problems of insufficient prediction accuracy, insufficient generalization ability and poor interpretability of tool wear prediction models in the prior art.
[0011] A first aspect of this application provides a tool wear prediction method based on wear gate unit coupled spatial constraints, comprising:
[0012] Obtain a training dataset, a validation dataset, and a test dataset; both the training dataset and the validation dataset include the signal characteristics and tool wear values of the target tool, while the test dataset only includes the signal characteristics of the target tool; the signal characteristics include at least one of the vibration signal characteristics, cutting force signal characteristics, and acoustic signal characteristics of the target tool.
[0013] The training dataset, validation dataset, and test dataset are input into an improved static wear prediction model based on wear gate elements to obtain the wear prediction value of the target tool; the wear prediction value includes the wear prediction value of the training dataset and the wear prediction value of the validation dataset.
[0014] Construct an enhanced hybrid loss function; the enhanced hybrid loss function includes at least an error term between the wear prediction value and the tool wear value, an enhanced feature space constraint regularization loss term, and a feature space smoothing constraint regularization loss term; the enhanced feature space constraint regularization loss term is used to characterize the feature distribution difference of the prediction model on at least two feature layers, and the feature space smoothing constraint regularization loss term is used to characterize the similarity between adjacent samples in the input space of the prediction model in the feature space;
[0015] The model parameters of the prediction model are updated using the gradient descent optimization algorithm based on the enhanced hybrid loss function until the preset convergence condition is met, thus obtaining the trained prediction model.
[0016] The trained prediction model is used to predict the tool wear values for the test dataset.
[0017] A second aspect of this application provides a tool wear prediction device based on wear gate unit coupled spatial constraints, comprising:
[0018] The acquisition module is configured to acquire a training dataset, a validation dataset, and a test dataset; both the training dataset and the validation dataset include the signal characteristics and tool wear values of the target tool, while the test dataset only includes the signal characteristics of the target tool; the signal characteristics include at least one of the vibration signal characteristics, cutting force signal characteristics, and acoustic signal characteristics of the target tool;
[0019] The model inference module is configured to input the training dataset, validation dataset, and test dataset into an improved static wear prediction model based on wear gate units to obtain the wear prediction value of the target tool; the wear prediction value includes the wear prediction value of the training dataset and the wear prediction value of the validation dataset.
[0020] The regularization calculation module is configured to construct an enhanced hybrid loss function. The enhanced hybrid loss function includes at least an error term between the wear prediction value and the tool wear value, an enhanced feature space constraint regularization loss term, and a feature space smoothing constraint regularization loss term. The enhanced feature space constraint regularization loss term is used to characterize the feature distribution difference of the prediction model on at least two feature layers, and the feature space smoothing constraint regularization loss term is used to characterize the similarity between adjacent samples in the input space of the prediction model in the feature space.
[0021] The model training module is configured to update the model parameters of the prediction model using the gradient descent optimization algorithm based on the enhanced hybrid loss function until the preset convergence condition is met, thus obtaining the trained prediction model.
[0022] The prediction module is configured to use the trained prediction model to predict the tool wear values of the test dataset.
[0023] The beneficial effects of this application embodiment compared with the prior art are as follows: This application embodiment proposes a wear gate unit, which includes a feature enhancement gate, a wear accumulation gate, an adaptive time scale enhancement gate, a feature state update module, a main prediction path, and a residual correction module. Based on the wear gate unit, a tool wear prediction model called an improved static wear model is established. Furthermore, an enhanced feature space constraint regularization loss term and a feature space smoothing constraint regularization loss term are introduced into the loss function of the tool wear prediction model. The enhanced feature space constraint regularization loss term is used to minimize the feature distribution difference of the prediction model on at least two feature layers, enabling the model to learn more domain-invariant features, perform more stably when facing new data or working conditions, and have stronger generalization ability. At the same time, the feature space smoothing constraint regularization loss term is used to make adjacent samples in the input space of the prediction model have similar representations in the feature space, thereby making the feature space smoother. This not only controls large local errors but also controls the overall prediction bias, improving the prediction accuracy of the model. Attached Figure Description
[0024] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0025] Figure 1 This is a flowchart illustrating a tool wear prediction method based on wear gate unit coupled spatial constraints provided in an embodiment of this application.
[0026] Figure 2 This is a flowchart illustrating the method for determining the enhanced feature space constraint regularization loss term provided in the embodiments of this application.
[0027] Figure 3 This is a flowchart illustrating the method for determining the feature space smoothing constraint regularization loss term provided in the embodiments of this application.
[0028] Figure 4 This is a schematic diagram of a tool wear prediction device based on wear gate unit coupling space constraint provided in an embodiment of this application.
[0029] Figure 5 This is a schematic diagram of the electronic device provided in the embodiments of this application. Detailed Implementation
[0030] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.
[0031] The following will describe in detail, with reference to the accompanying drawings, a tool wear prediction method and apparatus based on wear gate unit coupling space constraints according to embodiments of this application.
[0032] As mentioned above, existing data-driven prediction models still face technical challenges such as insufficient generalization ability, unstable feature space, systematic bias in prediction, and disconnect between model structure and physical meaning.
[0033] In view of this, this application provides a tool wear prediction method based on wear gate unit coupled spatial constraints. A wear gate unit is proposed, comprising a feature enhancement gate, a wear accumulation gate, an adaptive time scale enhancement gate, a feature state update module, a main prediction path, and a residual correction module. Based on the wear gate unit, a tool wear prediction model called an improved static wear model is established. Enhanced feature space constraint regularization loss term and feature space smoothing constraint regularization loss term are introduced into the loss function of the tool wear prediction model. The enhanced feature space constraint regularization loss term minimizes the feature distribution difference of the prediction model on at least two feature layers, enabling the model to learn more domain-invariant features, resulting in more stable performance and stronger generalization ability when facing new data or working conditions. Simultaneously, the feature space smoothing constraint regularization loss term promotes similar representations of adjacent samples in the input space of the prediction model in the feature space, making the feature space smoother. This not only controls large local errors but also controls the overall prediction bias, improving the model's prediction accuracy.
[0034] Figure 1 This is a schematic flowchart illustrating a tool wear prediction method based on wear gate unit coupled spatial constraints provided in an embodiment of this application. Figure 1 As shown, the method includes the following steps:
[0035] In step S101, the training dataset, validation dataset, and test dataset are obtained.
[0036] The training and validation datasets both include the signal characteristics and tool wear values of the target tool, while the test dataset only includes the signal characteristics of the target tool. The signal characteristics include at least one of the following: vibration signal characteristics, cutting force signal characteristics, and acoustic signal characteristics of the target tool.
[0037] In step S102, the training dataset and the validation dataset are input into the improved static wear prediction model based on wear gate units to obtain the wear prediction value of the target tool.
[0038] The wear prediction values include wear prediction values for the training dataset and wear prediction values for the validation dataset.
[0039] In step S103, an enhanced hybrid loss function is constructed; the enhanced hybrid loss function includes at least the error term between the wear prediction value and the tool wear value, the enhanced feature space constraint regularization loss term, and the feature space smoothing constraint regularization loss term.
[0040] Among them, the enhanced feature space constraint regularization loss term is used to characterize the feature distribution differences of the prediction model on at least two feature layers, and the feature space smoothing constraint regularization loss term is used to characterize the similarity between adjacent samples in the input space of the prediction model in the feature space.
[0041] In step S104, the model parameters of the prediction model are updated using the gradient descent optimization algorithm based on the enhanced hybrid loss function until the preset convergence condition is met, thus obtaining the trained prediction model.
[0042] In step S105, the trained prediction model is used to predict the tool wear values of the test dataset.
[0043] In some embodiments of this application, the method may be executed by a server or by a terminal device with certain processing capabilities.
[0044] In some embodiments of this application, a training dataset, a validation dataset, and a test dataset may be obtained first. Both the training and validation datasets include the signal features of the target tool and the tool wear value. The test dataset only includes the signal features of the target tool. That is, the test dataset can be a set of signal features that need to be used to predict tool wear using the trained prediction model, which includes only the signal features of the target tool and does not include the tool wear value. The tool wear value in the test dataset can be predicted using the trained prediction model.
[0045] The target tool can be any tool for which wear prediction is required. It can be a type of tool used in CNC machining or a specific tool; there are no restrictions here. The signal characteristics of the target tool can be acquired by sensors. For example, at least one of the vibration signal characteristics, cutting force signal characteristics, and acoustic signal characteristics of the target tool can be acquired by vibration sensors, cutting force sensors, and acoustic emission sensors placed around the target tool.
[0046] In some embodiments of this application, the tool wear value is the true value of the target tool wear, which can be obtained through actual measurement, and this tool wear value can be stored in each dataset in association with the signal characteristics of the target tool at the time of measurement. In some embodiments of this application, an improved static wear prediction model based on wear gate units can be established, which can predict tool wear based on the signal characteristics of the target tool. That is, by inputting the above-mentioned training dataset, validation dataset, and test dataset into the prediction model, the predicted wear value of the target tool can be obtained. The wear gate unit can be used to simulate the physical process of nonlinear growth of the target tool wear.
[0047] In some embodiments of this application, an enhanced hybrid loss function can be constructed for the prediction model. In some embodiments, the enhanced hybrid loss function may include an error term between the wear prediction value and the tool wear value, an enhanced feature space constraint regularization loss term, and a feature space smoothing constraint regularization loss term.
[0048] The enhanced feature space constraint regularization loss term characterizes the feature distribution differences of the prediction model across at least two feature layers, while the feature space smoothing constraint regularization loss term characterizes the similarity between adjacent samples in the input space and the feature space of the prediction model. During model iterative optimization, minimizing these two regularization and smoothing loss terms reduces the feature distribution differences across different feature layers and smooths the model's feature space.
[0049] In some embodiments of this application, the model parameters of the prediction model can be updated using the gradient descent optimization algorithm based on the enhanced hybrid loss function until a preset convergence condition is met, thus obtaining the trained prediction model.
[0050] According to the technical solution provided in the embodiments of this application, by introducing an enhanced feature space constraint regularization loss term and a feature space smoothing constraint regularization loss term into the loss function of the tool wear prediction model, the enhanced feature space constraint regularization loss term is used to minimize the feature distribution difference of the prediction model on at least two feature layers, so that the model can learn more domain-invariant features, and perform more stably and have stronger generalization ability when facing new data or working conditions. At the same time, the feature space smoothing constraint regularization loss term is used to make adjacent samples in the input space of the prediction model have similar representations in the feature space, thereby making the feature space smoother. This not only controls large local errors, but also controls the overall prediction bias and improves the prediction accuracy of the model.
[0051] In some embodiments of this application, reaching the preset convergence condition may be reaching a preset maximum number of iterations; or, if the preset maximum number of iterations is not reached, but at least n loss function values in the enhanced hybrid loss function do not decrease for m consecutive iterations. Here, m and n are both positive integers.
[0052] In some embodiments of this application, the prediction model may include a feature enhancement gate, a wear accumulation gate, an adaptive time scale enhancement gate, a feature state update module, a main prediction path, and a residual correction module. The number of each type of gate or module is set according to actual needs and is not limited here.
[0053] The feature enhancement gate performs a preliminary nonlinear transformation on the input signal features to generate enhanced features; the wear accumulation gate generates an internal state variable simulating wear accumulation based on the enhanced features; the adaptive time-scale enhancement gate dynamically generates a time-scale factor based on the enhanced features and the internal state variable; the feature state update module adjusts the enhanced features through the time-scale factor to generate updated feature states; the main prediction path and residual correction modules both take the updated feature states as input and output the main prediction value and residual prediction value, respectively.
[0054] In other words, inputting the training dataset, validation dataset, and test dataset into the prediction model to obtain the wear prediction value of the target tool can include: performing a preliminary nonlinear transformation on the signal features in the training dataset, validation dataset, and test dataset through a feature enhancement gate to obtain enhanced features; generating internal state variables simulating wear accumulation based on the enhanced features through a wear accumulation gate; dynamically generating a time scale factor based on the enhanced features and internal state variables through an adaptive time scale enhancement gate; adjusting the enhanced features using the time scale factor through a feature state update module to obtain the updated feature state; inputting the updated feature state into the main prediction path and residual correction module to obtain the main prediction value and residual correction value; and fusing the main prediction value and residual correction value to obtain the wear prediction value of the target tool.
[0055] The specific implementation method for fusing the master prediction value and the residual correction value can be set according to actual needs. In one example, the wear prediction value of the target tool can be obtained by summing the master prediction value and the residual correction value. In another example, the wear prediction value of the target tool can also be obtained by weighted summing of the master prediction value and the residual correction value.
[0056] In some embodiments of this application, generating internal state variables for simulating wear accumulation based on enhanced features through a wear accumulation gate may include: performing nonlinear activation and random deactivation (Dropout) processing on the enhanced features, followed by a linear transformation to obtain the linearly transformed enhanced features; and using the Sigmoid function to compress the linearly transformed enhanced features to the range of (0,1) to obtain the internal state variables.
[0057] In other words, when generating internal state variables, the wear accumulation gate can first receive the enhancement feature, perform Rectified Linear Unit (ReLU) activation and Dropout processing on the enhancement feature, and then perform a linear transformation. The data after the linear transformation is input to the Sigmoid function to output a value in the range of (0,1), which is the value of the internal state variable, simulating the wear accumulation process.
[0058] If the internal state variable is approximately 0, the device is in a brand new state; if the internal state variable is approximately 1, the device has reached a severely worn state. During cold start, the wear accumulation gate initializes the linear layer weights with a uniform distribution, obtaining a linear transformation result under a uniform distribution. This linear transformation result is then input into the Sigmoid function, yielding a random internal state variable value close to 0.5. As training and iteration progress, this internal state variable value converges to a physically meaningful number, representing the degree of wear accumulation.
[0059] In some embodiments of this application, dynamically generating a timescale factor based on enhancement features and internal state variables using an adaptive timescale enhancement gate may include: determining a scale parameter based on the enhancement features. and bias parameters ; Calculate scale parameters Multiply by the internal state variables, and calculate the product with the bias parameters. The sum of these results yields a linear combination; the Sigmoid function is then used to compress the linear combination result to the range (0,1), thus obtaining the time scale factor.
[0060] Among them, scale parameter The scale parameter network can be determined as follows: The enhanced features are input into a scale parameter network. A linear layer of the scale parameter network maps the enhanced features to a preset dimension, which can be any dimension between 2 and 1024, for example, 64 dimensions. An activation function of the scale parameter network introduces non-linearity into the mapped enhanced features. A linear layer of the scale parameter network maps the non-linear enhanced features to 1 dimension. A smoothing activation function transforms the 1-dimensional enhanced features into positive numbers, and 1 is added to these positive numbers to obtain the scale parameter. Increasing the positive number by 1 ensures the minimum value, that is, it guarantees the scaling parameter. A positive number greater than 1. Scale parameter. It can reflect the time scaling ratio of wear accumulation under different operating conditions.
[0061] Meanwhile, bias parameters The bias parameter can be determined as follows: The enhanced features are input into a bias parameter network. The enhanced features are mapped to a preset dimension through a linear layer of the bias parameter network. This preset dimension can be any dimension between 2 and 1024, for example, 64 dimensions. The activation function of the bias parameter network introduces non-linearity into the mapped enhanced features. Finally, the non-linear enhanced features are mapped to 1 dimension through a linear layer of the bias parameter network to obtain the bias parameter. Bias parameters It can be any unconstrained real number, which provides an offset for the time scale factor.
[0062] The technical solution provided in this application, by configuring a wear accumulation gate in the prediction model, generates an internal state variable that simulates the current wear accumulation state. An adaptive time-scale enhancement gate is then used to generate a time-scale factor based at least on this internal state variable. This factor allows the model to dynamically "amplify" or "reduce" the influence of different feature dimensions according to the current degree of wear accumulation, thereby enabling the model to more flexibly learn complex wear evolution processes. In other words, the technical solution provided in this application establishes a model structure that better understands the physical process of nonlinear wear growth, improving the model's expressive power and interpretability.
[0063] Figure 2 This is a flowchart illustrating the method for determining the enhanced feature space constraint regularization loss term provided in an embodiment of this application. Figure 2 As shown, the method includes the following steps:
[0064] In step S201, the mean vector of the training set of the enhancement layer is determined based on the enhancement features of the training dataset, the mean vector of the validation set of the enhancement layer is determined based on the enhancement features of the validation dataset, and the mean difference of the enhancement layer is determined based on the difference between the mean vector of the training set of the enhancement layer and the mean vector of the validation set of the enhancement layer.
[0065] In step S202, the enhancement layer training set covariance matrix is determined based on the enhancement features of the training dataset, the enhancement layer validation set covariance matrix is determined based on the enhancement features of the validation dataset, and the enhancement layer covariance matrix difference is determined based on the difference between the enhancement layer training set covariance matrix and the enhancement layer validation set covariance matrix.
[0066] In step S203, the mean vector of the training set of the feature state update layer is determined based on the updated feature state of the training dataset, the mean vector of the validation set of the feature state update layer is determined based on the updated feature state of the validation dataset, and the mean difference of the feature state update layer is determined based on the difference between the mean vector of the training set of the feature state update layer and the mean vector of the validation set of the feature state update layer.
[0067] In step S204, the covariance matrix of the training set of the feature state update layer is determined based on the updated feature state of the training dataset, the covariance matrix of the validation set of the feature state update layer is determined based on the updated feature state of the validation dataset, and the difference of the covariance matrix of the feature state update layer is determined based on the difference between the covariance matrix of the training set of the feature state update layer and the covariance matrix of the validation set of the feature state update layer.
[0068] In step S205, the sum of the difference between the mean difference of the enhancement layer and the difference between the mean difference of the feature state update layer is determined as the first difference value component, and the sum of the difference between the covariance matrix difference of the enhancement layer and the difference between the covariance matrix difference of the feature state update layer is determined as the second difference value component.
[0069] In step S206, the enhanced feature space constraint regularization loss term is determined based on the first difference value component and the second difference value component.
[0070] In some embodiments of this application, the enhanced feature space constraint regularization loss term can be used to characterize the difference in feature distribution between the training dataset and the validation dataset across at least two feature layers. These at least two feature layers can, for example, be the enhancement layer corresponding to the feature enhancement gate and the feature state update layer corresponding to the feature state update module. The difference in feature distribution can include differences in mean and covariance matrix.
[0071] In some embodiments of this application, the mean vector of the enhancement layer training set (mean train1) can be determined based on the enhancement features of the training dataset, the mean vector of the enhancement layer validation set (mean val1) can be determined based on the enhancement features of the validation dataset, and the mean difference of the enhancement layer can be determined based on the difference between mean train1 and mean val1. The difference between mean train1 and mean val1 can be obtained by calculating the square of the L2 norm of the difference between mean train1 and mean val1.
[0072] In some embodiments of this application, the covariance matrix of the enhancement layer training set can be determined based on the enhancement features of the training dataset, the covariance matrix of the enhancement layer validation set can be determined based on the enhancement features of the validation dataset, and the difference between the enhancement layer covariance matrix and the enhancement layer validation set covariance matrix can be determined based on the difference between them. The difference between the enhancement layer training set covariance matrix and the enhancement layer validation set covariance matrix can be obtained by calculating the square of the Frobenius norm of the difference between them.
[0073] In some embodiments of this application, the mean vector of the feature state update layer training set, mean train2, can be determined based on the updated feature states of the training dataset; the mean vector of the feature state update layer validation set, mean val2, can be determined based on the updated feature states of the validation dataset; and the mean difference of the feature state update layer can be determined based on the difference between mean train1 and mean val2. Similarly, the difference between mean train2 and mean val2 can also be obtained by calculating the square of the L2 norm of the difference between mean train2 and mean val2.
[0074] In some embodiments of this application, the covariance matrix of the feature state update layer training set can be determined based on the updated feature states of the training dataset, the covariance matrix of the feature state update layer validation set can be determined based on the updated feature states of the validation dataset, and the difference in the covariance matrix of the feature state update layer can be determined based on the difference between the covariance matrix of the feature state update layer training set and the covariance matrix of the feature state update layer validation set. Similarly, the difference between the covariance matrix of the feature state update layer training set and the covariance matrix of the feature state update layer validation set can be obtained by calculating the square of the Frobenius norm of the difference between the two covariance matrices.
[0075] In some embodiments of this application, the sum of the differences between the mean difference of the enhancement layer and the mean difference of the feature state update layer can be determined as a first difference component, and the sum of the differences between the covariance matrix differences of the enhancement layer and the covariance matrix differences of the feature state update layer can be determined as a second difference component. Then, the enhanced feature space constraint regularization loss term is determined based on the first and second difference components. In one example, the sum of the first and second difference components can be determined as the enhanced feature space constraint regularization loss term.
[0076] In some embodiments of this application, in each training epoch, the enhanced features output by the feature enhancement gate and the updated feature states output by the feature state update module for the training and validation datasets are obtained respectively. At the end of each epoch, the mean difference and covariance difference of the enhanced features between the training and validation datasets, as well as the mean difference and covariance difference of the updated feature states between the training and validation datasets, are calculated. The sum of these two differences is then used as the enhanced feature space constraint regularization loss term.
[0077] In some embodiments of this application, a regularization term weight can be set for the enhanced feature space constraint regularization loss term, and the regularization term weight can be set to gradually increase with the increase of training rounds, so that the prediction model focuses on learning the basic input-output mapping in the early stage of training, and focuses more on the alignment and fine-tuning of feature distribution in the later stage of training.
[0078] The introduction of enhanced feature space constraint regularization loss term enables the model to actively align with the feature distribution of different datasets, enhancing the model's adaptability and generalization ability to new working conditions and new data.
[0079] Figure 3 This is a flowchart illustrating the method for determining the feature space smoothing constraint regularization loss term provided in an embodiment of this application. Figure 3 As shown, the method includes the following steps:
[0080] In step S301, the Euclidean distance between the feature vectors of all samples in the batch is calculated, and the k nearest neighbor samples of each sample are found based on the Euclidean distance. A k nearest neighbor graph is constructed based on each sample and its k nearest neighbor samples.
[0081] Where k is a positive integer.
[0082] In step S302, an adjacency weight matrix is constructed using Euclidean distance based on a Gaussian kernel function.
[0083] In the adjacency weight matrix, the closer the sample pairs are, the greater their weights.
[0084] In step S303, the degree matrix of the k-nearest neighbor graph is determined.
[0085] The degree matrix is used to measure the sum of the connection strengths of each node in the k-nearest neighbor graph. The connection strength of each node in the k-nearest neighbor graph is represented by the similarity weight of that node, which is the sum of the similarity weights of that node and all its neighboring nodes.
[0086] In step S304, the difference between the degree matrix and the adjacency weight matrix is determined to be the Laplacian matrix of the k-nearest neighbor graph.
[0087] In step S305, the regularization loss of the Laplacian matrix is determined to be the feature space smoothing constraint regularization loss term.
[0088] In some embodiments of this application, a feature space smoothing constraint regularization loss term can be introduced into the loss function of the model. The feature space smoothing constraint regularization mechanism is used to apply local smoothing constraints to the feature space of the model, making the model insensitive to small perturbations or noise in the input data, thereby improving the stability and reliability of the model's prediction results.
[0089] When determining the regularization loss term for feature space smoothing constraints, we can first calculate the Euclidean distance between the feature vectors of all samples within a batch. Based on the Euclidean distance, we find the k nearest neighbors for each sample and construct a k-nearest neighbor graph based on each sample and its k nearest neighbors. When determining the k nearest neighbors for each sample, we can exclude the sample itself, i.e., the nearest neighbor with a distance of 0. The feature vector of each sample consists of the signal characteristics of that sample and the tool wear value.
[0090] Then, an adjacency weight matrix is constructed using Euclidean distance and a Gaussian kernel function. The adjacency weight matrix Samples that are closer together have a higher weight.
[0091] Next, determine the degree matrix of the k-nearest neighbor graph. This degree matrix measures the sum of connection strengths for each node in the k-nearest neighbor graph, where the connection strength is represented by the node's similarity weight. Furthermore, the Laplacian matrix of the k-nearest neighbor graph can be determined. for: .
[0092] Finally, the regularization loss of the Laplacian matrix can be determined as the regularization loss term for the feature space smoothness constraint. In one example, the formula can be used... Calculate the regularization loss of the Laplacian matrix, where, The regularization loss is the Laplacian matrix. For regularization hyperparameters, The number of feature vectors, This is the adjacency weight matrix. and For different feature vectors, Indicates calculation and The square of the Euclidean distance, This represents the computation of the trace of a matrix. It is a feature matrix composed of eigenvectors.
[0093] By introducing a feature space smoothing constraint regularization loss term, the model can map data points to a locally smooth feature space. When two samples in the dataset are physically close but have large feature distances, the feature space smoothing constraint regularization loss term will be larger; conversely, when two samples are physically close and have small feature distances, the feature space smoothing constraint regularization loss term will be smaller. This ensures that even when tool conditions are similar but sensor noise is introduced, the model-learned feature representations remain almost identical, and the prediction results tend to be consistent.
[0094] In some embodiments of this application, when updating the model parameters of the prediction model using the gradient descent optimization algorithm based on the enhanced hybrid loss function, a combined optimization strategy is used to optimize the model parameters.
[0095] This combined optimization strategy may include configuring an Adaptive Moment Estimation (Adam) optimizer to integrate L2 regularization and set a learning rate decay. L2 regularization is a built-in regularization technique of the Adam optimizer.
[0096] In one example, the learning rate decay could be set to an initial learning rate of 0.01, and then reduced by 10% for each new iteration after 80% of the iterations have been completed. This approach can make later iterations more stable and convergent.
[0097] The combined optimization strategy may also include configuring a learning rate scheduler, which is used to multiply the current learning rate by a preset learning rate scheduling factor to obtain a new learning rate when the decrease in the loss function of the validation set within a preset number of rounds is greater than a preset threshold, so as to help the prediction model escape local optima in the later stages of training.
[0098] This combined optimization strategy may include configuring gradient constraints to limit the norm of the gradient to a preset maximum value after backpropagation, in order to prevent gradient explosion.
[0099] This combined optimization strategy may include configuring an early stopping mechanism to prevent the predictive model from deteriorating on the validation set, thereby saving training time.
[0100] The technical solution provided in this application proposes an enhanced feature space constraint regularization mechanism that actively reduces the distribution difference between the training set and the validation set in the multi-scale feature space during the training process, enabling the model to learn more domain-invariant features, perform more stably when facing new data or working conditions, and have stronger generalization ability.
[0101] The designed feature space smoothing constraint regularization mechanism applies local smoothing constraints to the feature space, making the model insensitive to small perturbations or noise in the input data, thereby improving the stability and reliability of the prediction results.
[0102] The proposed enhanced hybrid loss function simultaneously optimizes the mean squared error loss, residual loss, enhanced feature space constraint regularization loss, and feature space smoothing constraint regularization loss. This not only controls large local errors but also controls the overall prediction bias, resulting in more accurate and less biased predictions.
[0103] The model architecture's wear gate unit, including feature enhancement gates, wear accumulation gates, adaptive time-scale enhancement gates, residual correction modules, and dual-path prediction, largely simulates the physical process of nonlinear wear growth, making the model's predictions more in line with the physical laws of wear. The model's internal working mechanism is more logical and interpretable, rather than a purely "black box" mapping.
[0104] All of the above-mentioned optional technical solutions can be combined in any way to form the optional embodiments of this application, and will not be described in detail here.
[0105] The following are embodiments of the apparatus described in this application, which can be used to execute the embodiments of the method described in this application. For details not disclosed in the apparatus embodiments of this application, please refer to the embodiments of the method described in this application.
[0106] Figure 4 This is a schematic diagram of a tool wear prediction device based on wear gate unit coupling spatial constraints provided in an embodiment of this application. Figure 4 As shown, the device includes:
[0107] The acquisition module 401 is configured to acquire a training dataset, a validation dataset, and a test dataset; both the training dataset and the validation dataset include the signal characteristics and tool wear values of the target tool, while the test dataset only includes the signal characteristics of the target tool; the signal characteristics include at least one of the vibration signal characteristics, cutting force signal characteristics, and acoustic signal characteristics of the target tool.
[0108] The model inference module 402 is configured to input the training dataset, validation dataset, and test dataset into an improved static wear prediction model based on wear gate units to obtain wear prediction values for the target tool; the wear prediction values include wear prediction values from the training dataset and wear prediction values from the validation dataset.
[0109] The regularization calculation module 403 is configured to construct an enhanced hybrid loss function. The enhanced hybrid loss function includes at least an error term between the wear prediction value and the tool wear value, an enhanced feature space constraint regularization loss term, and a feature space smoothing constraint regularization loss term. The enhanced feature space constraint regularization loss term is used to characterize the feature distribution difference of the prediction model on at least two feature layers, and the feature space smoothing constraint regularization loss term is used to characterize the similarity between adjacent samples in the input space of the prediction model in the feature space.
[0110] The model training module 404 is configured to update the model parameters of the prediction model using the gradient descent optimization algorithm based on the enhanced hybrid loss function until the preset convergence condition is met, thus obtaining the trained prediction model.
[0111] Prediction module 405 is configured to use the trained prediction model to predict the tool wear values of the test dataset.
[0112] According to the technical solution provided in the embodiments of this application, an enhanced feature space constraint regularization loss term and a feature space smoothing constraint regularization loss term are introduced into the loss function of the tool wear prediction model. The enhanced feature space constraint regularization loss term is used to minimize the feature distribution difference of the prediction model on at least two feature layers, so that the model can learn more domain-invariant features, perform more stably when facing new data or working conditions, and have stronger generalization ability. At the same time, the feature space smoothing constraint regularization loss term is used to make adjacent samples in the input space of the prediction model have similar representations in the feature space, thereby making the feature space smoother. This not only controls large local errors but also controls the overall prediction bias and improves the prediction accuracy of the model.
[0113] In some implementations, the prediction model includes a wear gate unit, which at least includes a feature enhancement gate, a wear accumulation gate, an adaptive time-scale enhancement gate, a feature state update module, a main prediction path, and a residual correction module. The model inputs training, validation, and test datasets to obtain the wear prediction value for the target tool. This process includes: performing a preliminary nonlinear transformation on the signal features in the training, validation, and test datasets through the feature enhancement gate to obtain enhanced features; generating internal state variables simulating wear accumulation based on the enhanced features through the wear accumulation gate; dynamically generating a time-scale factor based on the enhanced features and internal state variables through the adaptive time-scale enhancement gate; adjusting the enhanced features using the time-scale factor through the feature state update module to obtain an updated feature state; inputting the updated feature state into the main prediction path and residual correction module to obtain the main prediction value and the residual correction value; and fusing the main prediction value and the residual correction value to obtain the wear prediction value for the target tool.
[0114] In some implementations, an internal state variable simulating wear accumulation is generated based on the enhanced features using a wear accumulation gate. This includes: performing nonlinear activation and random deactivation dropout processing on the enhanced features, followed by a linear transformation to obtain the linearly transformed enhanced features; and using the Sigmoid function to compress the linearly transformed enhanced features to the range of (0,1) to obtain the internal state variable.
[0115] In some implementations, an adaptive time-scale enhancement gate dynamically generates a time-scale factor based on enhancement features and internal state variables, including: determining scale parameters based on enhancement features. and bias parameters ; Calculate scale parameters Multiply by the internal state variables, and calculate the product with the bias parameters. The sum of these results yields a linear combination; the Sigmoid function is then used to compress the linear combination result to the range (0,1), thus obtaining the time scale factor.
[0116] In some implementations, scale parameters The scale parameter is determined as follows: The enhanced features are input into a scale parameter network; the enhanced features are mapped to a preset dimension through a linear layer of the scale parameter network; a non-linearity is introduced into the mapped enhanced features in this network through an activation function of the scale parameter network; the enhanced features with introduced non-linearity are mapped to 1 dimension through a linear layer of the scale parameter network; a smoothing activation function is used to transform the 1-dimensional enhanced features in this network into positive numbers, and the positive numbers are incremented by 1 to obtain the scale parameter. Bias parameters The bias parameters are determined as follows: The enhanced features are input into a bias parameter network; the enhanced features are mapped to a preset dimension through a linear layer of the bias parameter network; a non-linearity is introduced into the mapped enhanced features in this network through the activation function of the bias parameter network; the enhanced features with introduced non-linearity are mapped to 1 dimension through a linear layer of the bias parameter network to obtain the bias parameters. .
[0117] In some implementations, the enhanced feature space constraint regularization loss term is determined as follows: The enhanced layer training set mean vector is determined based on the enhanced features of the training dataset; the enhanced layer validation set mean vector is determined based on the enhanced features of the validation dataset; and the enhanced layer mean difference is determined based on the difference between the enhanced layer training set mean vector and the enhanced layer validation set mean vector. The enhanced layer training set covariance matrix is determined based on the enhanced features of the training dataset; the enhanced layer validation set covariance matrix is determined based on the enhanced features of the validation dataset; and the enhanced layer covariance matrix difference is determined based on the difference between the enhanced layer training set covariance matrix and the enhanced layer validation set covariance matrix. Finally, the updated feature state of the training dataset is used to determine the updated feature state of the enhanced layer training set mean vector; and the updated feature state of the validation dataset is used to determine the updated feature state of the enhanced layer validation set mean vector. The following steps are taken: First, the mean difference of the feature state update layer is determined based on the difference between the mean vector of the training set and the mean vector of the validation set. Second, the covariance matrix of the feature state update layer is determined based on the updated feature states of the training dataset and the validation set. Third, the covariance matrix difference of the feature state update layer is determined based on the difference between the training set and the validation set. Fourth, the sum of the mean difference of the enhancement layer and the mean difference of the feature state update layer is determined as the first difference component, and the sum of the covariance matrix difference of the enhancement layer and the covariance matrix difference of the feature state update layer is determined as the second difference component. Finally, the enhanced feature space constraint regularization loss term is determined based on the sum of the first and second difference components.
[0118] In some implementations, the enhanced feature space constraint regularization loss term includes regularization weights; the regularization weights gradually increase with the number of training epochs, so that the prediction model focuses on learning basic input-output mappings in the early stages of training, while focusing more on the alignment and fine-tuning of feature distributions in the later stages of training.
[0119] In some implementations, the feature space smoothing constraint regularization loss term is determined as follows: The Euclidean distance between the feature vectors of all samples within a batch is calculated; the k nearest neighbors of each sample are found based on the Euclidean distance; and a k-nearest neighbor graph is constructed based on each sample and its k nearest neighbors; k is a positive integer; an adjacency weight matrix is constructed using the Euclidean distance and a Gaussian kernel function; in the adjacency weight matrix, the closer the sample pairs are, the greater their weights; the degree matrix of the k-nearest neighbor graph is determined; the degree matrix is used to measure the sum of the connection strengths of each node in the k-nearest neighbor graph, and the connection strength of each node in the k-nearest neighbor graph is represented by the similarity weight of that node, which is the sum of the similarity weights of that node and all its neighboring nodes; the difference between the degree matrix and the adjacency weight matrix is determined as the Laplacian matrix of the k-nearest neighbor graph; the regularization loss of the Laplacian matrix is determined as the feature space smoothing constraint regularization loss term.
[0120] In some implementations, the regularization loss of the Laplacian matrix is determined in the following manner: ;in, The regularization loss is the Laplacian matrix. For regularization hyperparameters, The number of feature vectors, This is the adjacency weight matrix. and For different feature vectors, Indicates calculation and The square of the Euclidean distance, This represents the computation of the trace of a matrix. It is a feature matrix composed of eigenvectors.
[0121] In some implementations, when updating model parameters using gradient descent optimization based on an enhanced hybrid loss function, a combined optimization strategy is used to optimize the model parameters. This combined optimization strategy includes configuring an adaptive moment estimation Adam optimizer, which integrates L2 regularization and learning rate decay; configuring a learning rate scheduler, which multiplies the current learning rate by a preset learning rate scheduling factor to obtain a new learning rate when the decrease in the loss function on the validation set within a preset number of iterations exceeds a preset threshold, thus helping the prediction model escape local optima in the later stages of training; configuring gradient constraints, which limit the norm of the gradient to within a preset maximum value after backpropagation to prevent gradient explosion; and configuring an early stopping mechanism to prevent the prediction model from deteriorating on the validation set, thereby saving training time.
[0122] 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 this application.
[0123] Figure 5 This is a schematic diagram of the electronic device provided in an embodiment of this application. For example... Figure 5 As shown, the electronic device 5 of this embodiment includes: a processor 501, a memory 502, and a computer program 503 stored in the memory 502 and executable on the processor 501. When the processor 501 executes the computer program 503, it implements the steps in the various method embodiments described above. Alternatively, when the processor 501 executes the computer program 503, it implements the functions of each module / unit in the various device embodiments described above.
[0124] Electronic device 5 can be a desktop computer, laptop, handheld computer, cloud server, or other electronic device. Electronic device 5 may include, but is not limited to, processor 501 and memory 502. Those skilled in the art will understand that... Figure 5 This is merely an example of electronic device 5 and does not constitute a limitation on electronic device 5. It may include more or fewer components than shown, or different components.
[0125] The processor 501 can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0126] The memory 502 can be an internal storage unit of the electronic device 5, such as a hard disk or RAM of the electronic device 5. The memory 502 can also be an external storage device of the electronic device 5, such as a plug-in hard disk, Smart Media Card (SMC), Secure Digital (SD) card, Flash Card, etc., equipped on the electronic device 5. The memory 502 can also include both internal and external storage units of the electronic device 5. The memory 502 is used to store computer programs and other programs and data required by the electronic device.
[0127] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0128] If an integrated module / unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program may include computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. A computer-readable medium may include: any entity or device capable of carrying computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium, etc.
[0129] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A tool wear prediction method based on wear gate element coupled spatial constraints, characterized in that, include: Obtain a training dataset, a validation dataset, and a test dataset; both the training dataset and the validation dataset include the signal characteristics and tool wear values of the target tool, while the test dataset only includes the signal characteristics of the target tool; the signal characteristics include at least one of the vibration signal characteristics, cutting force signal characteristics, and acoustic signal characteristics of the target tool. The training dataset, validation dataset, and test dataset are input into an improved static wear prediction model based on wear gate units to obtain the wear prediction value of the target tool; the wear prediction value includes the wear prediction value of the training dataset and the wear prediction value of the validation dataset. Construct an enhanced hybrid loss function; the enhanced hybrid loss function includes at least an error term between the wear prediction value and the tool wear value, an enhanced feature space constraint regularization loss term, and a feature space smoothing constraint regularization loss term; the enhanced feature space constraint regularization loss term is used to characterize the feature distribution difference of the prediction model on at least two feature layers, and the feature space smoothing constraint regularization loss term is used to characterize the similarity between adjacent samples in the feature space of the input space of the prediction model; The model parameters of the prediction model are updated using the gradient descent optimization algorithm based on the enhanced hybrid loss function until the preset convergence condition is met, thus obtaining the trained prediction model. The trained prediction model is used to predict the tool wear values of the test dataset. The prediction model includes a wear gate unit, which includes at least a feature enhancement gate, a wear accumulation gate, an adaptive time scale enhancement gate, a feature state update module, a main prediction path, and a residual correction module. The training dataset, validation dataset, and test dataset are input into the prediction model to obtain the wear prediction value of the target tool, including: The feature enhancement gate performs a preliminary nonlinear transformation on the signal features in the training dataset, validation dataset, and test dataset to obtain enhanced features. The wear accumulation gate generates internal state variables that simulate wear accumulation based on the enhanced features; The adaptive time-scale enhancement gate dynamically generates a time-scale factor based on the enhanced features and the internal state variables. The feature state update module then uses the time-scale factor to adjust the enhanced features to obtain the updated feature state. The updated feature state is input into the main prediction path and the residual correction module to obtain the main prediction value and the residual correction value. The wear prediction value of the target tool is obtained by fusing the main prediction value and the residual correction value.
2. The method according to claim 1, characterized in that, The wear accumulation gate generates internal state variables simulating wear accumulation based on the enhanced features, including: The enhanced features are subjected to nonlinear activation and random deactivation Dropout processing, and then linear transformation is performed to obtain the linearly transformed enhanced features. The enhanced features after the linear transformation are compressed to the range of (0,1) using the Sigmoid function to obtain the internal state variables.
3. The method according to claim 1, characterized in that, The adaptive time-scale enhancement gate dynamically generates a time-scale factor based on the enhancement features and the internal state variables, including: Determine the scale parameter based on the enhanced features. and bias parameters ; Calculate the scale parameter Multiply by the internal state variable, and calculate the product of the product and the bias parameter. The sum of these yields a linear combination result; The time scale factor is obtained by compressing the linear combination result to the range of (0,1) using the Sigmoid function.
4. The method according to claim 3, characterized in that, The scale parameter The following method is used to determine: The enhanced features are input into a scale parameter network, and the enhanced features are mapped to a preset dimension through the linear layers of the scale parameter network. The activation function of the scale parameter network introduces nonlinearity into the mapped enhanced features in this network; The enhanced features introduced by nonlinearity in this network are mapped to 1 dimension through the linear layer of the scale parameter network. The enhancement features mapped to 1D in this network are transformed into positive numbers using a smooth activation function, and the scale parameter is obtained by adding 1 to the positive numbers. ; The bias parameter The following method is used to determine: The enhanced features are input into a bias parameter network, and the enhanced features are mapped to a preset dimension through the linear layer of the bias parameter network. The activation function of the bias parameter network introduces nonlinearity into the mapped enhanced features in this network; The bias parameters are obtained by mapping the enhanced features introduced into the network after nonlinearity through the linear layer of the bias parameter network to one dimension. .
5. The method according to claim 1, characterized in that, The enhanced feature space constraint regularization loss term is determined in the following manner: The enhancement layer training set mean vector is determined based on the enhancement features of the training dataset, the enhancement layer validation set mean vector is determined based on the enhancement features of the validation dataset, and the enhancement layer mean difference is determined based on the difference between the enhancement layer training set mean vector and the enhancement layer validation set mean vector. The enhancement layer training set covariance matrix is determined based on the enhancement features of the training dataset, the enhancement layer validation set covariance matrix is determined based on the enhancement features of the validation dataset, and the enhancement layer covariance matrix difference is determined based on the difference between the enhancement layer training set covariance matrix and the enhancement layer validation set covariance matrix. The mean vector of the training set of the feature state update layer is determined based on the updated feature state of the training dataset, the mean vector of the validation set of the feature state update layer is determined based on the updated feature state of the validation dataset, and the mean difference of the feature state update layer is determined based on the difference between the mean vector of the training set of the feature state update layer and the mean vector of the validation set of the feature state update layer. The covariance matrix of the feature state update layer training set is determined based on the updated feature state of the training dataset, the covariance matrix of the feature state update layer validation set is determined based on the updated feature state of the validation dataset, and the difference of the feature state update layer covariance matrix is determined based on the difference between the covariance matrix of the feature state update layer training set and the covariance matrix of the feature state update layer validation set. The sum of the mean difference of the enhancement layer and the mean difference of the feature state update layer is determined as the first difference value component, and the sum of the covariance matrix difference of the enhancement layer and the covariance matrix difference of the feature state update layer is determined as the second difference value component. The enhanced feature space constraint regularization loss term is determined based on the first difference value component and the second difference value component.
6. The method according to claim 1, characterized in that, The enhanced feature space constraint regularization loss term includes regularization term weights; The weight of the regularization term gradually increases with the number of training rounds, so that the prediction model focuses on learning the basic input-output mapping in the early stage of training, and focuses more on the alignment and fine-tuning of the feature distribution in the later stage of training.
7. The method according to claim 1, characterized in that, The feature space smoothing constraint regularization loss term is determined in the following manner: Calculate the Euclidean distance between the feature vectors of all samples in the batch, find the k nearest neighbors of each sample based on the Euclidean distance, and construct a k nearest neighbor graph based on each sample and its k nearest neighbors; k is a positive integer. The adjacency weight matrix is constructed using the Euclidean distance and a Gaussian kernel function; in the adjacency weight matrix, the closer the sample pairs are, the greater their weights. Determine the degree matrix of the k-nearest neighbor graph; the degree matrix is used to measure the sum of the connection strengths of each node in the k-nearest neighbor graph, and the connection strength of each node in the k-nearest neighbor graph is represented by the similarity weight of that node, which is the sum of the similarity weights of that node and all its neighboring nodes; The difference between the degree matrix and the adjacency weight matrix is determined to be the Laplacian matrix of the k-nearest neighbor graph; The regularization loss of the Laplacian matrix is determined to be the regularization loss term of the feature space smoothing constraint.
8. The method according to claim 7, characterized in that, The regularization loss of the Laplacian matrix is determined in the following way: ; in, The regularization loss is the value of the Laplacian matrix. For regularization hyperparameters, The number of feature vectors, This is the adjacency weight matrix. and For different feature vectors, Indicates calculation and The square of the Euclidean distance, This represents the computation of the trace of a matrix. It is a feature matrix composed of eigenvectors.
9. The method according to claim 1, characterized in that, When updating the model parameters of the prediction model using the gradient descent optimization algorithm based on the enhanced hybrid loss function, a combined optimization strategy is used to optimize the model parameters; The combined optimization strategy includes configuring an adaptive moment estimation Adam optimizer, which integrates L2 regularization and sets a learning rate decay. And configure a learning rate scheduler, which is used to multiply the current learning rate by a preset learning rate scheduling factor to obtain a new learning rate when the decrease of the loss function of the validation set in a preset number of rounds is greater than a preset threshold, so as to help the prediction model escape local optima in the later stages of training. And configure gradient constraints to limit the norm of the gradient to within a preset maximum value after backpropagation in order to prevent gradient explosion; In addition, an early stopping mechanism is configured to prevent the prediction model from deteriorating on the validation set, thereby saving training time.
10. A tool wear prediction device based on wear gate unit coupled spatial constraints, characterized in that, include: The acquisition module is configured to acquire the training dataset, validation dataset, and test dataset. Both the training dataset and the validation dataset include the signal characteristics and tool wear values of the target tool, while the test dataset only includes the signal characteristics of the target tool; the signal characteristics include at least one of the vibration signal characteristics, cutting force signal characteristics, and acoustic signal characteristics of the target tool. The model inference module is configured to input the training dataset, validation dataset, and test dataset into an improved static wear prediction model based on wear gate units to obtain wear prediction values for the target tool; the wear prediction values include wear prediction values from the training dataset and wear prediction values from the validation dataset. The regularization calculation module is configured to construct an enhanced hybrid loss function; the enhanced hybrid loss function includes at least an error term between the wear prediction value and the tool wear value, an enhanced feature space constraint regularization loss term, and a feature space smoothing constraint regularization loss term; the enhanced feature space constraint regularization loss term is used to characterize the feature distribution difference of the prediction model on at least two feature layers, and the feature space smoothing constraint regularization loss term is used to characterize the similarity between adjacent samples in the input space of the prediction model in the feature space; The model training module is configured to update the model parameters of the prediction model using the gradient descent optimization algorithm based on the enhanced hybrid loss function until a preset convergence condition is met, thereby obtaining the trained prediction model. The prediction module is configured to use the trained prediction model to predict the tool wear values of the test dataset; The prediction model includes a wear gate unit, which includes at least a feature enhancement gate, a wear accumulation gate, an adaptive time scale enhancement gate, a feature state update module, a main prediction path, and a residual correction module. The training dataset, validation dataset, and test dataset are input into the prediction model to obtain the wear prediction value of the target tool, including: The feature enhancement gate performs a preliminary nonlinear transformation on the signal features in the training dataset, validation dataset, and test dataset to obtain enhanced features. The wear accumulation gate generates internal state variables that simulate wear accumulation based on the enhanced features; The adaptive time-scale enhancement gate dynamically generates a time-scale factor based on the enhanced features and the internal state variables. The feature state update module then uses the time-scale factor to adjust the enhanced features to obtain the updated feature state. The updated feature state is input into the main prediction path and the residual correction module to obtain the main prediction value and the residual correction value. The wear prediction value of the target tool is obtained by fusing the main prediction value and the residual correction value.
Citation Information
Patent Citations
Cutter wear state monitoring method based on multi-scale space-time fusion network model
CN115828754A
Cutter wear loss prediction method based on physical information self-supervised learning under condition of few marks
CN119589494A
