Disclosure of Invention
Aiming at the defects or improvement requirements of the prior art, the invention provides a tool wear state prediction method and device based on anti-migration learning, and aims to solve the technical problem that when tool wear prediction is performed in a new scene, enough tool wear state or wear value labels corresponding to monitoring signals are difficult to obtain and are used for wear state prediction model training.
In order to achieve the above object, the present invention provides a tool wear state prediction method based on anti-migration learning, comprising the steps of:
s1, obtaining vibration signals and tool wear values of the source tool and the target tool; preprocessing the vibration signal, and corresponding the processed signal to a tool wear value to obtain a source domain data set and a target domain data set with labels;
s2, constructing an antagonistic transfer learning model comprising a feature extraction network, a label classifier, a global area discriminator and a local area discriminator; the feature extraction network is used for performing feature extraction on the source domain data set and the target domain data set to obtain sample features; the label classifier predicts the wear state of the sample according to the sample characteristics; the global area discriminator predicts the domain category of the sample according to the sample characteristics; the local area discriminator firstly predicts the wear state of the sample based on the label classifier and then judges the area type of the sample with the predicted wear state;
s3, training the anti-migration learning model based on the source domain data set and the target domain data set with the aim of minimizing the loss of the anti-migration learning model; and the target tool wear state prediction is realized by utilizing a trained antagonistic transfer learning model.
Further, the loss function of the migration-resistant learning model is:
wherein the content of the first and second substances,
network weight parameters of the feature extraction network, the label classifier, the global domain discriminator and the local domain discriminator are respectively obtained; c is the type number of the cutter wearing state, and C is the type number of the cutter wearing state; l is
cFor source domain classification loss, L
gFor global adaptive loss, L
lFor local adaptive loss, λ is a weight coefficient, and ω is a dynamic factor;
in the formula (I), the compound is shown in the specification,
in the form of a source-domain data set,
for the target domain data set, y
sA source domain data tag; x is the number of
iIs a data sample, and
n
s、n
tthe number of data set samples in source domain and target domain, G
f(x
i) For the sample features extracted by the feature extraction network, G
d(G
f(x
i) Represents the domain class predicted by the global domain arbiter,
representing the sample wear state predicted by the label classifier,
representing the domain class predicted by the local domain discriminator, d
iIs a domain category label.
Further, the dynamic factor ω is:
in the formula (I), the compound is shown in the specification,
further, in S1, acquiring vibration signals and tool wear values of the source tool and the target tool includes: arranging a vibration sensor near a machine tool spindle, and acquiring spindle vibration signals in the machining process through a Dewesoft acquisition instrument; and (4) photographing by using a microscope to mark the cutter wear value label.
Further, in S1, the preprocessing the vibration signal includes: and denoising and wavelet decomposition and reconstruction are carried out on the vibration signal.
Further, in S2, the feature extraction network is a depth feature extraction network of a residual network structure.
In order to achieve the above object, the present invention further provides a tool wear state prediction device based on anti-migration learning, including:
the data acquisition and preprocessing module is used for acquiring vibration signals and tool wear values of a source tool and a target tool; preprocessing the vibration signal, and corresponding the processed signal to a tool wear value to obtain a source domain data set and a target domain data set with labels;
the system comprises an antagonistic transfer learning model construction module, a label classification module, a global area discriminator, a local area discriminator and a local area discriminator, wherein the antagonistic transfer learning model construction module is used for constructing an antagonistic transfer learning model comprising a feature extraction network, a label classifier, the global area discriminator and the local area discriminator; the feature extraction network is used for performing feature extraction on the source domain data set and the target domain data set to obtain sample features; the label classifier predicts the wear state of the sample according to the sample characteristics; the global area discriminator predicts the domain category of the sample according to the sample characteristics; the local area discriminator firstly predicts the wear state of the sample based on the label classifier and then judges the area type of the sample with the predicted wear state;
a migration-resistant learning model training module for training the migration-resistant learning model based on the source domain data set and the target domain data set with the goal of minimizing the loss of the migration-resistant learning model; and the target tool wear state prediction is realized by utilizing a trained antagonistic transfer learning model.
Generally, by the above technical solution conceived by the present invention, the following beneficial effects can be obtained:
(1) the method combines dynamic distribution self-adaptation and anti-migration learning, and firstly obtains and processes a source domain data set and a target domain data set with labels; then, constructing an anti-migration learning model comprising a feature extraction network, a label classifier, a global area discriminator and a local area discriminator; and finally, training the anti-migration learning model based on the source domain data set and the target domain data set by taking the loss of the anti-migration learning model as a target to be minimized. Therefore, the method can assist in establishing the anti-migration learning model under other scenes by utilizing the existing labeled tool wear monitoring data (source domain data), so that the problem of wear state prediction of tools with different diameters can be solved by only needing less labeled target domain data.
(2) The method can effectively carry out source domain and target domain adaptation from condition distribution and edge distribution respectively, thereby improving the accuracy of the wear prediction of different types of cutters.
(3) When the anti-migration learning model is trained, the loss function related to domain self-adaptation is designed, a multi-stage learning rate curve adjusted according to requirements is adopted, the optimizer is a random gradient descent method, the model training speed is high, and the prediction effect on the wear states of the source cutter and the target cutter is good.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. In addition, the technical features involved in the embodiments of the present invention described below may be combined with each other as long as they do not conflict with each other.
In the present application, the terms "first," "second," and the like (if any) in the description and the drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.
Fig. 1 is a flowchart of a tool wear state prediction method based on learning against migration according to an embodiment of the present invention, where the detection method includes operations S1-S3.
Operation S1, obtaining vibration signals and tool wear values of the source tool and the target tool; and preprocessing the vibration signal, and corresponding the processed signal with a tool wear value to obtain a source domain data set and a target domain data set with labels. Specifically, the method comprises the following steps:
the source domain data set and the target domain data set are respectively obtained through the following steps:
s11, respectively building different types of cutter milling abrasion experiment platforms of the numerical control machine tool, arranging a vibration sensor near a main shaft of a machining center, and collecting main shaft vibration signals in the machining process through a Dewesoft acquisition instrument;
s12, shooting each cutting edge abrasion picture by adopting a portable microscope under the condition that the cutter is not detached, and marking the cutter abrasion value by magnification;
and S13, denoising the original vibration signal, obtaining a reconstructed signal through wavelet decomposition, and establishing a source domain data set and a target domain data set.
The source cutter is a cutter with enough labeled cutter wear monitoring data, and the target cutter is a cutter to be predicted.
Operation S2, constructing an antagonistic migration learning model including a feature extraction network, a label classifier, a global area discriminator, and a local area discriminator; the feature extraction network is used for performing feature extraction on the source domain data set and the target domain data set to obtain sample features; the label classifier predicts the wear state of the sample according to the sample characteristics; the global area discriminator predicts the domain category of the sample according to the sample characteristics; the local area discriminator predicts the wear state of the sample based on the label classifier, and then judges the area type of the sample with the predicted wear state. Specifically, the method comprises the following steps:
and establishing a transfer-resistant learning model, judging the data domain label, and realizing condition distribution and edge distribution self-adaptation of the source domain and target domain sample characteristics.
The loss function against the migration learning model is:
wherein the content of the first and second substances,
network weight parameters of the feature extraction network, the label classifier, the global domain discriminator and the local domain discriminator are respectively obtained; c is the type number of the cutter wearing state, and C is the type number of the cutter wearing state; l is
cFor source domain classification loss, L
gFor global adaptive loss, L
lFor local adaptive loss, λ is a weight coefficient, and ω is a dynamic factor;
in the formula (I), the compound is shown in the specification,
in the form of a source-domain data set,
for the target domain data set, y
sA source domain data tag; x is the number of
iIs a data sample, and
n
s、n
tthe number of data set samples in source domain and target domain, G
f(x
i) For the sample features extracted by the feature extraction network, G
d(G
f(x
i) Represents the domain class predicted by the global domain arbiter,
representing the sample wear state predicted by the label classifier,
representing the domain class predicted by the local domain discriminator, d
iIs a domain category label.
Meanwhile, the difference between the edge distribution and the condition distribution of the source domain and the target domain is different, and the importance degree of adaptation is inconsistent, so a dynamic factor omega is introduced and updated after each round of training, and the calculation method is as follows:
in the formula (I), the compound is shown in the specification,
furthermore, the feature extraction network is used for extracting deep features of the source domain data and the target domain data, and the input of the network is time domain and frequency domain components after the original vibration signal is subjected to noise reduction and time domain and frequency domain components of the wavelet decomposition reconstruction signal. The depth feature extraction network is built by adopting a residual error network structure. In the deep learning network, the depth of the network is increased to obtain better nonlinear mapping capability, so that the prediction effect of the model can be improved. However, increasing the depth of the network makes the parameters of the network more difficult to converge on one hand, and on the other hand, the gradient of the network gradually decreases during the back propagation process of a plurality of network layers, and when the network layers are too deep, the gradient may become zero, which may cause the model to fail. Therefore, the prediction effect cannot be improved by increasing the network depth without limit, the special structure of the residual error neural network enables a deeper network, and the gradient disappearance is avoided by adding the input to the output again, and the model effect is not influenced.
An operation S3 of training the anti-migration learning model based on the source domain data set and the target domain data set with a goal of minimizing a loss of the anti-migration learning model; and the target tool wear state prediction is realized by utilizing a trained antagonistic transfer learning model. Specifically, the method comprises the following steps:
and training the established anti-migration learning model on the source domain and target domain data sets by adopting a strategy of adjusting the learning rate as required to realize the prediction of the wear states of different types of cutters.
The learning rate in the training process adopts a strategy of adjusting according to requirements, which is divided into four stages, and different learning rates are respectively adopted in 0-100, 100-300, 300-600 and 600-1000 training rounds.
The model data input batch size is 64, the training iteration number (Epoch) is 1000, and the optimizer is a random gradient descent method.
The method of the present invention will be described below by taking a 8mm end mill machining tool and a 2mm injection mold finish machining tool as examples.
The embodiment of the invention comprises the following steps:
(1) experimental data acquisition and preprocessing
Acquiring spindle three-way vibration signals and tool wear values of a milling process of a 8mm end mill and a 2mm injection mold finish machining tool of a numerical control machine tool, and generating source domain and target domain data sets after performing vibration signal noise reduction and wavelet decomposition reconstruction on the two milling tools as shown in FIG. 2;
the specific data acquisition and preprocessing steps are as follows:
(1.1) building an 8mm end mill milling cutter abrasion experiment platform and a 2mm injection mold finish machining cutter abrasion experiment platform of a numerical control machine tool, arranging a vibration sensor near a main shaft of the machine tool, and acquiring a main shaft vibration signal in the machining process through a Dewesoft acquisition instrument, wherein time domain and frequency domain components of the vibration signal are shown in figure 3;
(1.2) measuring a tool wear value by adopting an automatic zooming three-dimensional measuring instrument as a data label;
and (1.3) denoising the original vibration signal, obtaining a reconstructed signal through wavelet decomposition, and establishing a source domain data set and a target domain data set.
(2) Construction of an antagonistic migration learning model
And establishing a transfer-resistant learning model, judging the data domain label, and realizing the condition distribution and edge distribution self-adaptation of the source domain and target domain signal characteristics.
The loss function against the migration learning model is:
wherein the content of the first and second substances,
network weight parameters of the feature extraction network, the label classifier, the global domain discriminator and the local domain discriminator are respectively obtained; c is the type number of the cutter wearing state, and C is the type number of the cutter wearing state; l is
cFor source domain classification loss, L
gFor global adaptive loss, L
lFor local adaptive loss, λ is a weight coefficient, and ω is a dynamic factor;
in the formula (I), the compound is shown in the specification,
in the form of a source-domain data set,
for the target domain data set, y
sA source domain data tag; x is the number of
iIs a data sample, and
n
s、n
tthe number of data set samples in source domain and target domain, G
f(x
i) For the sample features extracted by the feature extraction network, G
d(G
f(x
i) Represents the domain class predicted by the global domain arbiter,
representing the sample wear state predicted by the label classifier,
representing the domain class predicted by the local domain discriminator, d
iIs a domain category label.
Meanwhile, the difference between the edge distribution and the condition distribution of the source domain and the target domain is different, and the importance degree of adaptation is inconsistent, so a dynamic factor omega is introduced and updated after each round of training, and the calculation method is as follows:
in the formula (I), the compound is shown in the specification,
(3) model training
The structure of the constructed anti-migration learning model is shown in fig. 4, and the model consists of four parts: the first part is a model feature extraction part and adopts a residual error neural network; the second part is a classifier used for classifying the wear state of the cutter; the third and fourth parts are domain discrimination networks, and whether the input features come from domain source domain or target domain data is judged.
The learning rate in the training process adopts a strategy adjusted as required, as shown in fig. 5, which is divided into four stages, and different learning rates are respectively adopted in 0-100, 100-300, 300-600, and 600-1000 training rounds; the model data input batch size is 64, the training iteration number (Epoch) is 1000, and the optimizer is a random gradient descent method.
And training by adopting a strategy of adjusting the learning rate as required on the source domain data set and the target domain data set to realize the prediction of the wear states of different types of milling tools.
And performing model test by using the test data of the source domain, and finally reaching 94.7% of accuracy by comparing the actual label with the predicted label. The accuracy rates of the prediction of initial abrasion, normal abrasion and serious abrasion are respectively 97.1%, 92.9% and 94.0%. And outputting a prediction label of the source domain test data, and drawing a confusion matrix compared with a real label, as shown in FIG. 6.
And outputting the prediction result of the target domain, wherein the three states respectively have 600 samples and 1800 samples in total. The final accuracy was 71%. The accuracy of prediction of initial wear, normal wear and severe wear is 88.7%, 67.2% and 57.2%, respectively. And outputting a predicted label of the target domain test data, and drawing a confusion matrix by comparing the predicted label with the real label, as shown in fig. 7.
The dynamic countermeasure factor of the model, i.e., the dynamic factor ω measuring the dissimilarity of the condition distribution and the edge distribution, varies as shown in fig. 8, and eventually stabilizes at 0.66 as the model is iterated.
The source domain and target domain data are subjected to dimensionality reduction output after network feature extraction, visualization is carried out, and it can be obtained that the features of the source domain are divided into three parts and have obvious boundaries at the 100 th Epoch, but the feature distribution of the target domain is greatly different from the feature distribution of the source domain, the feature distribution of the source domain and the feature distribution of the target domain are approximately consistent at the 550 th Epoch, and the model is proved to be adaptive to the two domains.
Fig. 9 is a block diagram of a tool wear state prediction apparatus based on anti-migration learning according to an embodiment of the present invention. Referring to fig. 9, the prediction apparatus 900 includes a data acquisition and preprocessing module 910, an anti-migration learning model construction module 920, and an anti-migration learning model training module 930.
The data obtaining and preprocessing module 910, for example, performs operation S1 for obtaining vibration signals and tool wear values of the source tool and the target tool; preprocessing the vibration signal, and corresponding the processed signal to a tool wear value to obtain a source domain data set and a target domain data set with labels;
the antagonistic migration learning model building module 920 performs, for example, operation S2 for building an antagonistic migration learning model including a feature extraction network, a label classifier, a global domain discriminator, and a local domain discriminator; the feature extraction network is used for performing feature extraction on the source domain data set and the target domain data set to obtain sample features; the label classifier predicts the wear state of the sample according to the sample characteristics; the global area discriminator predicts the domain category of the sample according to the sample characteristics; the local area discriminator firstly predicts the wear state of the sample based on the label classifier and then judges the area type of the sample with the predicted wear state;
the anti-migration learning model training module 930 performs, for example, operation S3 for training the anti-migration learning model based on the source domain data set and the target domain data set with a goal of minimizing the loss of the anti-migration learning model; and the target tool wear state prediction is realized by utilizing a trained antagonistic transfer learning model.
The prediction apparatus 900 is used to perform the prediction method in the embodiment shown in fig. 1. For details that are not described in the present embodiment, please refer to the prediction method in the embodiment shown in fig. 1, which is not described herein again.
In conclusion, based on the method provided by the invention, after the noise reduction and reconstruction of the main shaft vibration signals in the milling process of different types of cutters of the numerical control machine tool, the main shaft vibration signals are input into the dynamic countermeasure migration learning model for training, and after the wear states of different types of cutters are identified, the method is found to have great significance for the research of the identification of the wear states of different types of cutters of the numerical control machine tool and the monitoring of the machine tool state no matter the method is from the accuracy of the identification of the wear states of different types of cutters or the effectiveness of the migration of different types of cutter models.
It will be understood by those skilled in the art that the foregoing is only a preferred embodiment of the present invention, and is not intended to limit the invention, and that any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the scope of the present invention.