CN113869194A - Variable parameter milling process signal marking method and system based on deep learning - Google Patents

Variable parameter milling process signal marking method and system based on deep learning Download PDF

Info

Publication number
CN113869194A
CN113869194A CN202111131299.0A CN202111131299A CN113869194A CN 113869194 A CN113869194 A CN 113869194A CN 202111131299 A CN202111131299 A CN 202111131299A CN 113869194 A CN113869194 A CN 113869194A
Authority
CN
China
Prior art keywords
boundary
loss
signal
marking
sequence
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111131299.0A
Other languages
Chinese (zh)
Inventor
贺松平
赵尊元
裘超超
周焮钊
李斌
李伟业
余凡
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huazhong University of Science and Technology
Original Assignee
Huazhong University of Science and Technology
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huazhong University of Science and Technology filed Critical Huazhong University of Science and Technology
Priority to CN202111131299.0A priority Critical patent/CN113869194A/en
Publication of CN113869194A publication Critical patent/CN113869194A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2218/00Aspects of pattern recognition specially adapted for signal processing
    • G06F2218/12Classification; Matching
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • G06F18/2415Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on parametric or probabilistic models, e.g. based on likelihood ratio or false acceptance rate versus a false rejection rate
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/044Recurrent networks, e.g. Hopfield networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/084Backpropagation, e.g. using gradient descent
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2218/00Aspects of pattern recognition specially adapted for signal processing
    • G06F2218/08Feature extraction

Abstract

The invention discloses a variable parameter milling process signal marking method and system based on deep learning, and belongs to the technical field of monitoring of a numerical control machining center machining process. The method comprises the following steps: the method comprises the steps of collecting a main shaft vibration signal during milling, inputting shallow features obtained after short-time Fourier transform of the vibration signal into a stacked bidirectional long-time and short-time memory network model, extracting deep features, introducing a conditional random field and a multilayer perceptron, optimizing a loss function, solving the problem of over-classification, establishing a model evaluation index aiming at time sequence signal interception and marking, performing iterative training on the model, and finally achieving automatic marking of the time sequence signal during milling. The invention can realize automatic marking of high-frequency time sequence signals, provides data support for scenes such as state monitoring, fault diagnosis and maintenance of mechanical equipment, and has the advantages of low marking cost, high automation degree, good generalization capability and the like.

Description

Variable parameter milling process signal marking method and system based on deep learning
Technical Field
The invention belongs to the technical field of monitoring of a machining process of a numerical control machining center, and particularly relates to a variable parameter milling machining process signal marking method and system based on deep learning.
Background
A large amount of high-frequency time sequence signals can be generated in the machining process, and the high-frequency time sequence signals contain rich mechanical equipment state information and can be used in the fields of mechanical equipment state monitoring, fault diagnosis, predictive maintenance and the like. However, the unmarked signals have low value density and are difficult to be effectively utilized, the signals need to be intercepted and marked according to different scenes during actual analysis, most of the signals are artificially marked and intercepted at present, and the problems in the following two aspects mainly exist:
(1) the manual marking cost is high: when the amount of data is large, the time cost of manual marking as well as the money cost will increase greatly.
(2) The marking quality is more dispersive, and the uncertainty is large: due to the fact that professional levels of marking personnel are different and knowledge of related professional fields is lacked, certain error marking inevitably exists when a marking task in the professional fields is completed, marking quality of data cannot be well guaranteed, a large amount of noise may still exist in marked data, and reliability and stability of marking cannot be effectively guaranteed.
The vibration signal is one of important signals for representing mechanical equipment such as a machine tool, an industrial robot and the like, contains a great deal of value information about the mechanical equipment, and can fully reflect the running state of the equipment from time domain and frequency domain. The vibration signals are automatically marked according to different marking criteria, such as different processing stages (rough processing, finish processing and semi-finish processing) or different states of a machine tool (cutting processing, idle running, standing or stopping), so that the marking cost of industrial data can be reduced, the marking precision can be improved, and the value density of the vibration signals can be greatly improved, thereby providing more valuable and targeted data for subsequent research and industrial practical application.
In recent years, the expression learning is rapidly developed along with the development of neural networks and deep learning, and is gradually applied to the industry to perform automatic feature extraction work.
Therefore, a method for marking a signal in a variable parameter milling process based on deep learning is urgently needed to be provided in the field, so as to realize marking and intercepting of a high-frequency time sequence signal, thereby reducing marking cost and improving marking automation degree, so as to provide data support for a relevant scene.
Disclosure of Invention
Aiming at the defects or improvement requirements of the prior art, the invention provides a variable parameter milling process signal marking method and system based on deep learning, and aims to solve the technical problems that most of high-frequency time sequence signal marks depend on manpower, the cost is high, the quality is dispersed, the uncertainty is large and the like in the processing process at the present stage.
In order to achieve the above object, the present invention provides a method for marking a signal in a variable parameter milling process based on deep learning, which includes the following steps:
s1, collecting a main shaft time sequence signal during milling of a numerical control machining center, and performing sliding framing processing on the signal;
s2, extracting shallow layer characteristics of the vibration signals by adopting short-time Fourier transform;
s3, receiving shallow features of the signals by adopting a stacked bidirectional long-time memory network (BilSTM), outputting an automatically extracted feature sequence, and capturing a dependency relationship before and after the time sequence;
s4, in a modeling stage, a Conditional Random Field (CRF) is adopted to receive a sequence output by a stacked bidirectional long-and-short time memory network model, conditional random field loss is obtained according to a tag result of an observation sequence and a tag sequence, a multilayer perceptron (MLP) is adopted to receive the sequence output by the stacked bidirectional long-and-short time memory network model, the probability that each frame is a boundary is output, the output boundary probability is subjected to power n to calculate the optimized boundary loss, and a smooth loss is introduced, wherein the conditional random field loss, the boundary loss and the smooth loss are combined into a total loss function;
and S5, performing iterative training on the models from the step S2 to the step S4, observing a loss curve, determining a proper hyper-parameter, and improving the signal marking effect of the models by taking the model evaluation indexes facing the signal boundary as evaluation standards.
S6, after the spindle vibration signal in the machining process is preprocessed in the step S1, inputting the trained S2-S5 models, different from the training stage, in the prediction stage, the conditional random field is directly decoded through a Viterbi algorithm to obtain a label sequence, and therefore automatic marking of the vibration signal in the milling process of the numerical control machining center is achieved.
Further preferably, step S1 specifically includes the following steps:
s11, mounting a data acquisition instrument on a main shaft of the numerical control machining center, acquiring a three-way vibration signal, a milling force signal and a three-phase current signal of the main shaft, and storing the three-way vibration signal, the milling force signal and the three-phase current signal into a storage medium;
s12, selecting proper window length and frame shift parameters, and performing sliding frame division processing on the time sequence signal under the condition of meeting the requirement of short-time stationarity;
s13, the time domain amplitude of the milling force signal reflects the time period of cutting, the current signal amplitude distinguishes the acceleration and deceleration processes of the spindle, and the vibration signal is marked by means of the milling force signal and the current signal to obtain label data;
further preferably, in step S2, the shallow feature of the spindle vibration signal is extracted using a short-time fourier transform.
Preferably, in step S3, the depth feature of the vibration signal is extracted by using a stacked bidirectional long-and-short term memory network model, which is composed of three layers of BiLSTM model and one fully-connected layer, wherein each layer output has the same sequence length as the input, i.e. the sequence length of each layer output is T, and each layer output has a sequence length of TThe sequences may not be the same, and the characteristic dimensions of the output of the three layers of BiLSTM are N respectively1=500,N2=100,N3The feature dimension ratio of the next layer to the previous layer is kept to be 1:5, and the output features of the last fully-connected layer are input into a conditional random field model as the state features of the model and are also input into a multi-layer perceptron to classify the boundary frames. Dimension N thereofcAnd C +3, wherein C is the number of the categories of the actual states of the machine tool, and the model is used for extracting the depth features of the time sequence data to finally obtain the features with obvious differences among different states.
Further preferably, step S4 specifically includes the following steps:
s41, adopting a conditional random field model to receive the extracted depth features without manually specifying a state feature function, and obtaining a state transition matrix by utilizing a corresponding conditional random field loss function through forward propagation and reverse update training;
and S42, adopting a multilayer perceptron model to receive the extracted depth features, obtaining the probability that each frame is a boundary under a time sequence, calculating the optimized boundary loss by performing n-th power on the output boundary probability for balancing the uneven classification of the boundary frame and the non-boundary frame, and introducing a smooth loss term aiming at the over-segmentation problem.
As a further preference, the total loss function of step S4 is:
L=LCRF+LBoundary+LT-MSE
the first term of the total loss function is conditional random field loss LCRFThe features extracted by the stack model BilSTM are
Figure BDA0003280629070000041
The label sequence output by the CRF layer is Y ═ Y (Y)0,y1,y2,…,yT),ytThe state transition matrix belonging to the labelset model is
Figure BDA0003280629070000042
The Score function is:
Figure BDA0003280629070000043
wherein the content of the first and second substances,
Figure BDA0003280629070000044
representative label ytTransfer to yt+1The probability of (a) of (b) being,
Figure BDA0003280629070000045
representing the feature of the input sequence at t mapped to the label y at that timetIs measured. A probability value can be defined for the correct tag sequence y using the softmax function:
Figure BDA0003280629070000046
wherein Y isallAll tag sequences are represented, including sequences that are not likely to occur. The training can be done by maximizing P (y).
Figure BDA0003280629070000047
Defining a loss function L for a CRF modelCRFComprises the following steps:
Figure BDA0003280629070000051
wherein the first term can be solved by dynamic programming, and the second term is directly calculated according to the definition.
The second term of the total loss function is the boundary loss LBoundaryIs a two-class cross-entropy loss function which focuses on the classification accuracy of boundary frames and non-boundary frames. The label y of each frame is e {0,1}, the loss L of the tth frametCan be written as:
Lt=-yt logpt-(1-yt)log(1-pt)
however, the occupation ratio of the boundary frame in all time frames is very small, almost 1:400, i.e. there is a serious class imbalance problem between the boundary frame and the non-boundary frame. In order to balance the class proportion between the boundary frame and the non-boundary frame and solve the class unbalance problem, the probability value p labeled as 1 is usedtTo the power of n, at this time
Figure BDA0003280629070000052
Is closer to 0, when LtCan be written as:
Figure BDA0003280629070000053
as can be seen from the above equation, when the label is 1, the loss term is multiplied by n times on the first term of the original binary cross-entropy loss function, which is equivalent to amplifying the weight of the loss; similarly, a label of 0 has a smaller gradient when compared to a reduction in the weight of the second term loss term. Wherein n can be determined according to the loss value (-log p) labeled 1 under different n valuesn) And a loss value (-log (1-p) with a label of 0n) Is selected due to LCRFThe loss is calculated for each sequence, so that L is the same for maintaining the overall loss function scaleBoundarySumming according to a sequence:
Figure BDA0003280629070000054
third term L in the loss functionT-MSEThe loss term is a loss term proposed for the over-segmentation problem, and mainly makes the prediction of the boundary frame smoother, so as to reduce the error of over-segmentation. It is defined as follows:
Figure BDA0003280629070000061
Figure BDA0003280629070000062
Δt,c=|logyt,c-logyt-1,c|
where e is the truncation threshold.
Further preferably, the model evaluation index for the signal boundary in step S5 is:
assuming that the real value set of each type of boundary is G, and the predicted boundary set is P; an allowable error τ is introduced, which means how many samples at most the distance between the true boundary G e G and the predicted boundary P e P. If a certain predicted boundary p is an actually detected real boundary, it satisfies the following two conditions:
Figure BDA0003280629070000063
|p-g|<τ
i.e. p is the predicted boundary closest to the actual boundary g and its distance from the actual boundary g is smaller than the tolerance τ. Wherein the tolerance τ generally satisfies the following condition:
Figure BDA0003280629070000064
wherein D (g)1,g2) Representing the real boundary g1And g2The distance between the two indexes is the absolute value of the difference between the two indexes.
If the above condition is satisfied, the prediction boundary p is a true positive case (true positive), otherwise, the prediction boundary p is a false positive case (false positive). The set of true-positive cases is TP, the number of the predicted boundaries is P, the number of the true boundaries is G, the number of the false-positive cases is P-TP, and the Precision is PrecisionBoundaryRecall ratio RecallBoundaryCan be written as:
Figure BDA0003280629070000065
Figure BDA0003280629070000066
these are abbreviated to Pr and Re, respectively. F1 focusing on boundary accuracyBThe metric can be written as:
Figure BDA0003280629070000071
true Positive Rate (TPR)BAnd False Positive Rate (False Positive Rate) FPRBCan be written as:
Figure BDA0003280629070000072
Figure BDA0003280629070000073
after the calculation formulas of the true normal rate and the false normal rate are obtained, an ROC curve under a marking scene can be drawn, and the area AUC under the ROC curve can be calculated to evaluate the performance of different marking models.
In addition, when there are multiple types of boundaries in the marked signal (generally, multiple types), the macro-precision (macro-p) can be obtained by calculating the above evaluation index for each type and then averagingB) Macro-r (macro-r)B) And macro F1 metric (macro-F1)B) (ii) a Or averaging each type of corresponding TP, G and P, and calculating the indexes according to the above method to obtain micro-precision (micro-P)B) Micro-rB) And micro F1 metric (micro-F1)B)。
The invention will use mainly Pr, Re and F1BAs an evaluation index of the model labeling effect.
As a further preference, the hyperparameters stated in step S5 are:
neural network learning rate lr, conditional random fieldModel learning rate lrcrfBatch sample number BatchSize and LT-MSEThe truncation threshold e in (1).
When the learning rate of the conditional random field is 100-1000 times of that of the deep learning network, the trained CRF state transition probability matrix is more reasonable. Where the computational resources allow, the largest BatchSize can be set to try to utilize the computational resources to reduce the model iteration and training time.
Further preferably, step S6 specifically includes the following steps:
s61, inputting a spindle vibration signal of the pretreated milling process of the numerical control machining center into the stacked bidirectional long-time memory network model-conditional random field BiLSTM-CRF model;
s62, decoding the depth characteristics output by the BilSTM by the CRF through a Viterbi algorithm to obtain a label sequence, and realizing automatic marking of the time sequence signal in the milling process.
In another aspect, the present invention provides a system for marking signals in a variable parameter milling process based on deep learning, including: a computer-readable storage medium and a processor;
the computer-readable storage medium is used for storing executable instructions;
the processor is configured to read executable instructions stored in the computer-readable storage medium, and execute the method for marking a signal of a variable parameter milling process based on deep learning according to the first aspect of the present invention.
Generally, compared with the prior art, the above technical solution conceived by the present invention mainly has the following technical advantages:
1. the invention provides an end-to-end method for intercepting and marking time sequence signals based on a deep learning network model for the first time, establishes a signal marking model consisting of a stacked bidirectional long-time and short-time memory network model, a conditional random field and a multilayer perceptron, provides evaluation indexes aiming at the problems of interception and marking of time sequence data, can realize automatic marking of high-frequency time sequence signals in the milling process of a numerical control machining center under the condition of variable parameter machining, greatly reduces marking cost, has high automation degree and good generalization capability, and can provide technical support for the scenes of state monitoring, fault diagnosis, predictive maintenance and the like of mechanical equipment.
2. In order to relieve the problem of serious class imbalance between the boundary frame and the non-boundary frame, a multilayer perceptron model is added after a network model is memorized in a stacked bidirectional long-term and short-term mode in the model training stage, the first term of the original binary cross entropy loss function is multiplied by n times, the weight of loss is amplified equivalently, the loss function is optimized, the total loss function is composed of three parts, and the iterative training of the model is facilitated.
3. Because the time sequence data marking and intercepting tasks pay attention to the accuracy and the number of the marked boundaries, the method of the invention innovates and reforms common evaluation indexes under the traditional classification tasks and the target detection tasks, obtains the evaluation indexes more suitable for the signal marking tasks, and is convenient for more intuitively evaluating the marking effect of the model.
Drawings
FIG. 1 is a flow chart of a method for marking a signal in a variable parameter milling process based on deep learning according to an embodiment of the present invention;
FIG. 2 is a deep neural network and conditional random field based automated tagging model framework according to embodiments of the present invention;
FIG. 3 is a stacked BilSTM model according to an embodiment of the present invention;
fig. 4 (a), (b), (c), and (d) are respectively a learning rate curve of the stacked BiLSTM model, a total loss curve of the training and testing process, an evaluation index curve of the training process, and an evaluation index curve of the testing process;
in fig. 5, (a), (b), (c), and (d) are respectively a learning rate curve of the stacked BiLSTM-CRF model, a total loss curve of the training and testing process, an evaluation index curve of the training process, and an evaluation index curve of the testing process;
in fig. 6, (a), (b), (c), and (d) are respectively a learning rate curve, a total loss curve of a training and testing process, an evaluation index curve of a training process, and an evaluation index curve of a testing process of the stacked BiLSTM-CRF-P6 model;
FIG. 7 is a sequence of labels predicted by the BilSTM model for milling with a 4mm diameter tool;
FIG. 8 shows predicted tag sequences and true tag sequences of different models according to the present invention for the same signal, where (a) is true tag sequence, (b) is BiLSTM predicted tag sequence, (c) is BiLSTM-P6 predicted tag sequence, (d) is BiLSTM-CRF predicted tag sequence, (e) is BiLSTM-CRF-P6 predicted tag sequence, and (f) is major axis X-direction vibration signal.
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.
As shown in figure 1, the invention discloses a variable parameter milling process signal marking method based on deep learning, which comprises the steps of collecting a three-way vibration model of a main shaft during milling of a numerical control machining center, inputting shallow features obtained by short-time Fourier transform of a vibration signal into a BilSTM, extracting deep features of a time sequence signal, introducing CRF to perform explicit modeling on a dependence relation between signal labels, introducing MLP to obtain the probability that each frame belongs to a boundary, balancing the problem of class unevenness of the boundary frame and a non-boundary frame by making the classification probability of the boundary frame into n power, optimizing a loss function, improving the problem of over classification, establishing a model evaluation index aiming at interception and marking of the time sequence signal, performing iterative training on the model, and finally realizing automatic marking of the time sequence signal during milling of the numerical control machining center. In order to verify the method, the vibration signal of the small and medium-sized vertical numerical control machining center for cutting machining in the actual machining process is collected, and after the vibration signal is processed, the result shows that the vibration signal of the small and medium-sized vertical numerical control machining center for cutting machining can be effectively and automatically marked by the method. In addition, the method has high accuracy and good generalization capability in the actual implementation process, thereby providing technical support for the fields of mechanical equipment state monitoring, health maintenance and the like.
The method specifically comprises the following steps:
(1) acquiring a signal:
and a data acquisition instrument is arranged on the main shaft of the numerical control machining center, acquires a three-way vibration signal, a milling force signal and a three-phase current signal of the main shaft, and stores the three-way vibration signal, the milling force signal and the three-phase current signal into a storage medium.
(2) Signal preprocessing and data set production:
selecting proper window length and frame shift parameters, and performing sliding frame division processing on the time sequence signal under the condition of meeting the requirement of short-time stationarity; the cutting force signal and the current signal are used for assisting in manually marking the vibration signal so as to obtain label data, and therefore time for manually marking time sequence data is greatly saved.
(3) Establishing a model and designing a loss function:
the method comprises the steps of extracting shallow layer characteristics of vibration signals by adopting short-time Fourier transform, inputting the shallow layer characteristics into a stacked BilSTM network model, wherein the stacked BilSTM network model is composed of three layers of BilSTM models and a full-connection layer, the output of each layer is the same as the input sequence length, namely the output sequence length of each layer is T, each sequence is possibly different, and the characteristic dimensions of the output of the three layers of BilSTM are N1=500,N2=100,N3The feature dimension ratio of the next layer to the previous layer is kept to be 1:5, and the output features of the last fully-connected layer are input into a conditional random field model as the state features of the model and are also input into a multi-layer perceptron to classify the boundary frames. Dimension N thereofcAnd C +3, wherein C is the number of the categories of the actual states of the machine tool, and the model is used for extracting the depth features of the time sequence data to finally obtain the features with obvious differences among different states.
As shown in fig. 3, the stacked BiLSTM is followed by CRF and MLP, the inputs of which are extracted depth features, when CRF is used in the deep learning post-processing method, the sequence features obtained by the deep learning model learning will be used as part of the input of the calculated state scores of CRF, no state feature function needs to be specified artificially, and the state transition matrix is obtained by forward propagation and reverse update training using corresponding loss functions.
The other way of connecting the MLP to the stack-type BilSTM is to obtain the probability that each frame is a boundary under a time sequence, and when the correlation between the learned characteristics of the stack-type BilSTM and the boundary information is high, the probability of the MLP output is more reliable, namely the probability at the boundary frame is higher than that at the non-boundary frame; under the condition of over-segmentation, the signal frame which is not in the state is judged from a section of continuous frames which are originally in the same state; if there are fewer over-segmented frames, the boundary frame probability of the output of the MLP will be more accurate.
The specific process of designing the loss function is as follows:
(3.1) the total loss function is:
L=LCRF+LBoundary+LT-MSE
(3.2) the first term of the Total loss function is the conditional random field loss LCRFThe features extracted by the stack model BilSTM are
Figure BDA0003280629070000111
The label sequence output by the CRF layer is Y ═ Y (Y)0,y1,y2,…,yT),ytThe state transition matrix belonging to the labelset model is
Figure BDA0003280629070000112
The Score function is:
Figure BDA0003280629070000121
wherein the content of the first and second substances,
Figure BDA0003280629070000122
representative label ytTransfer to yt+1The probability of (a) of (b) being,
Figure BDA0003280629070000123
representing the feature of the input sequence at t mapped to the label y at that timetIs measured. A probability value can be defined for the correct tag sequence y using the softmax function:
Figure BDA0003280629070000124
wherein Y isallAll tag sequences are represented, including sequences that are not likely to occur. The training can be done by maximizing P (y).
Figure BDA0003280629070000125
Defining a loss function L for a CRF modelCRFComprises the following steps:
Figure BDA0003280629070000126
wherein the first term can be solved by dynamic programming, and the second term is directly calculated according to the definition.
(3.3) the second term of the Total loss function is the boundary loss LBoundaryIs a two-class cross-entropy loss function which focuses on the classification accuracy of boundary frames and non-boundary frames. The label y of each frame is e {0,1}, the loss L of the tth frametCan be written as:
Lt=-yt logpt-(1-yt)log(1-pt)
however, the occupation ratio of the boundary frame in all time frames is very small, almost 1:400, i.e. there is a serious class imbalance problem between the boundary frame and the non-boundary frame. In order to balance the class proportion between the boundary frame and the non-boundary frame and solve the class unbalance problem, the probability value p labeled as 1 is usedtTo the power of n, at this time
Figure BDA0003280629070000131
Is closer to0, at this time LtCan be written as:
Figure BDA0003280629070000132
as can be seen from the above equation, when the label is 1, the loss term is multiplied by n times on the first term of the original binary cross-entropy loss function, which is equivalent to amplifying the weight of the loss; similarly, a label of 0 has a smaller gradient when compared to a reduction in the weight of the second term loss term. Wherein n can be determined according to the loss value (-log p) labeled 1 under different n valuesn) And a loss value (-log (1-p) with a label of 0n) Is selected due to LCRFThe loss is calculated for each sequence, so that L is the same for maintaining the overall loss function scaleBoundarySumming according to a sequence:
Figure BDA0003280629070000133
(3.4) third term L in the loss functionT-MSEThe loss term is a loss term proposed for the over-segmentation problem, and mainly makes the prediction of the boundary frame smoother, so as to reduce the error of over-segmentation. It is defined as follows:
Figure BDA0003280629070000134
Figure BDA0003280629070000135
Δt,c=|logyt,c-logyt-1,c|
where e is the truncation threshold.
(4) Establishing an evaluation index:
the method provided by the invention innovates and reforms common evaluation indexes under the traditional classification task and the target detection task, obtains the evaluation indexes more suitable for the signal marking task, and is convenient for more intuitively evaluating the marking effect of the model.
The specific process of designing the evaluation index is as follows:
assuming that the real value set of each type of boundary is G, and the predicted boundary set is P; an allowable error τ is introduced, which means how many samples at most the distance between the true boundary G e G and the predicted boundary P e P. If a certain predicted boundary p is an actually detected real boundary, it satisfies the following two conditions:
Figure BDA0003280629070000141
|p-g|<τ
i.e. p is the predicted boundary closest to the actual boundary g and its distance from the actual boundary g is smaller than the tolerance τ. Wherein the tolerance τ generally satisfies the following condition:
Figure BDA0003280629070000142
wherein D (g)1,g2) Representing the real boundary g1And g2The distance between the two indexes is the absolute value of the difference between the two indexes.
If the above condition is satisfied, the prediction boundary p is a true positive case (true positive), otherwise, the prediction boundary p is a false positive case (false positive). The set of true-positive cases is TP, the number of the predicted boundaries is P, the number of the true boundaries is G, the number of the false-positive cases is P-TP, and the Precision is PrecisionBoundaryRecall ratio RecallBoundaryCan be written as:
Figure BDA0003280629070000143
Figure BDA0003280629070000144
these are abbreviated to Pr and Re, respectively. F1 focusing on boundary accuracyBThe metric can be written as:
Figure BDA0003280629070000145
true Positive Rate (TPR)BAnd False Positive Rate (False Positive Rate) FPRBCan be written as:
Figure BDA0003280629070000146
Figure BDA0003280629070000147
after the calculation formulas of the true normal rate and the false normal rate are obtained, an ROC curve under a marking scene can be drawn, and the area AUC under the ROC curve can be calculated to evaluate the performance of different marking models.
In addition, when there are multiple types of boundaries in the marked signal (generally, multiple types), the macro-precision (macro-p) can be obtained by calculating the above evaluation index for each type and then averagingB) Macro-r (macro-r)B) And macro F1 metric (macro-F1)B) (ii) a Or averaging each type of corresponding TP, G and P, and calculating the indexes according to the above method to obtain micro-precision (micro-P)B) Micro-rB) And micro F1 metric (micro-F1)B)。
The invention will use mainly Pr, Re and F1BAs an evaluation index of the model labeling effect.
(5) Contrast and establish the final model
Constructing a stack-based BilSTM model, a stack-based BilSTM-CRF model and a stack-based BilSTM-CRF-P6 model, wherein compared with the stack-based BilSTM model, the stack-based BilSTM model has less CRF for post-processing, the label of the stack-based BilSTM model is obtained according to argmax after being directly operated by softmax, and the L _ CRF is replaced by a multi-classification cross entropy function in the loss function; the stacked BilSTM-CRF-P6 model is based on the stacked BilSTM-CRF model, and the boundary probability of MLP is given as n power.
As shown in fig. 4, 5, and 6, for the vibration signal under the same processing parameter, the batch size is selected to be 64, the optimizer is Adam, the initial learning rate lr =0.0001, and lr is set to becrfAnd (5) artificially adjusting the learning rate according to the training process curve to carry out model training, so as to obtain training process curves of the three models in different learning rate adjustment modes.
F1 at the time of final convergence of the comparative modelBoundaryIt can be found that CRF is effective for this task, and it is noted that, after CRF is added, the Recall _ Boundary during training and testing is lower than the Precision _ Boundary, which indicates that the number of predicted boundaries of the model is reduced accordingly, and the over-segmentation problem is improved. This is because CRF can explicitly model the context dependency between tag sequences and optimize model parameters in the form of losses and gradients. Introducing a strategy of making the boundary probability into a model stack BilSTM-CRF by an n-th power for retraining and testing to obtain a model stack BilSTM-CRF-P6, and finally testing the model F1 during convergenceBoundary91.99%, which is 0.78% higher than model stack-type BilSTM-CRF. Therefore, the boundary probability is made to be n-th power so as to balance the non-uniform classification of the boundary frame and the non-boundary frame and improve the signal marking accuracy, and the method has certain effect; but CRF is relatively more effective in boosting the overall signal signature.
Preprocessing milling data with the cutter diameter of 4mm, marking signals by using the different models, calculating evaluation indexes of each predicted label sequence and each real label sequence, and obtaining the final result shown in table 1:
TABLE 1
Figure BDA0003280629070000161
On the brand-new same type of data, the classification Recall ratio Recall of the model BilSTM is high, but the labeled (segmented) related indexes of the model BilSTM are the worst of the three models, the predicted label sequence of the model is shown in FIG. 7, and labelset is {1: stationary, 2: idle, 3: acceleration, 4: deceleration, 5: processing from the graph, many of the boundaries found on the model are redundant, creating a serious over-segmentation problem. The stack of BilSTM-CRF-POW6 was best in most of the indices, especially the marker (segmentation) index, and was therefore determined to be the final model.
The method of the present invention will be described below by taking as an example a milling process performed in a small vertical nc machining center with a variable cutting depth.
In the variable parameter milling process, two cutters with different diameters are used for cutting. The combinations of machining parameters in which a tool having a diameter of 8mm was used are shown in Table 2.
One segment of the real label sequence containing signals of all machine tool states and the label sequence predicted by each model are shown in fig. 8, and the signals originally in the cutting section in the label sequence predicted by the stacked BilSTM model have serious over-segmentation, wherein the label sequence is segmented into a plurality of signal segments containing main shaft cutting, main shaft idling and main shaft deceleration; in the label sequence obtained by the prediction of the stacked BilSTM-P6 model, the signal of the cutting processing section still has over segmentation, but is better than the label sequence predicted by the stacked BilSTM model; the stacked BilSTM-CRF model also has over-segmentation, but the number is minimum, and the over-segmentation signal segment is longer; in the label sequence predicted by the stack-type BilSTM-CRF-P6 model, the number of boundaries is consistent with that of a real label sequence, the labeling effect is best, and the over-segmentation problem does not exist in the signal. It is difficult to distinguish the boundaries of the idle, machining and spindle acceleration and deceleration signal segments from the original signal alone.
TABLE 2
Figure BDA0003280629070000171
In conclusion, based on the method provided by the invention, the main shaft vibration signal in the machining process of the numerical control machining center is subjected to signal preprocessing, a loss function is designed, an evaluation index is established, and finally a deep learning model consisting of three modules is determined.
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.

Claims (10)

1. The variable parameter milling process signal marking method based on deep learning is characterized by comprising the following steps of:
s1, sliding framing processing is carried out on collected spindle vibration signals during milling processing;
s2, extracting the characteristics of the spindle vibration signal after the sliding framing processing;
s3, receiving the characteristics by adopting a stacked bidirectional long-time and short-time memory network model, and outputting an extracted characteristic sequence;
s4, receiving the characteristic sequence by adopting a conditional random field, and obtaining the conditional random field loss according to the output observation sequence and the label result of the preset label sequence; meanwhile, a multilayer perceptron is adopted to receive the characteristic sequence, the boundary loss is calculated by taking the output boundary probability as the power of n, and the smooth loss is introduced, and the conditional random field loss, the boundary loss and the smooth loss are combined into a total loss function;
s5, repeating S2-S4 to carry out iterative training until the total loss function is not changed and the evaluation index reaches a preset evaluation standard, ending the iteration, and determining the hyper-parameter;
s6, preprocessing a spindle vibration signal in the milling process in the step S1, inputting the preprocessed spindle vibration signal into a trained model, wherein the trained model comprises the hyperparameter determined in the step S5, and decoding the conditional random field to obtain a label sequence, so that the spindle vibration signal in the milling process is automatically labeled.
2. The method for marking the signal of the deep learning-based variable parameter milling process according to claim 1, wherein the step S1 specifically comprises the following steps:
s11, collecting a spindle vibration signal, a milling force signal and a three-phase current signal during milling;
s12, selecting window length and frame shift parameters, and performing sliding frame division processing on the main shaft vibration signal under the condition of meeting the requirement of short-time stability;
and S13, the time domain amplitude of the milling force signal reflects the time period of cutting, the current signal amplitude distinguishes the acceleration and deceleration processes of the spindle, and the spindle vibration signal is marked by means of the milling force signal and the current signal to obtain a label sequence.
3. The method for marking signals in the process of variable parameter milling based on deep learning of claim 1, wherein in step S2, the sliding framed spindle vibration signals are extracted by short-time fourier transform.
4. The method as claimed in claim 1, wherein in step S3, the stacked bidirectional long-and-short term memory network model is used to extract the characteristic sequence of the spindle vibration signal, the model is composed of three layers of BilsTM networks and a fully-connected layer, the output of each layer is the same as the input sequence, and the characteristic dimensions of the output of the three layers of BilsTM networks are N1,N2,N3Wherein N is1∶N2∶N3The output features of the fully-connected layer are input into the conditional random field as state features and are also input into the multi-layer perceptron for boundary frame classification, namely 25:5: 1.
5. The method for marking the signal of the deep learning-based variable parameter milling process according to claim 1, wherein the step S4 specifically comprises the following steps:
s41, adopting a conditional random field to receive the characteristic sequence, and obtaining the loss of the conditional random field according to the output observation sequence and the label result of the preset label sequence;
s42, receiving the characteristic sequence by adopting a multilayer perceptron to obtain the probability of taking each frame as a boundary under a time sequence, calculating the optimized boundary loss by performing n-th power on the output boundary probability, and introducing a smooth loss item;
and S43, combining the conditional random field loss, the boundary loss and the smooth loss into a total loss function.
6. The method for marking signals in the process of variable parameter milling based on deep learning of claim 5, wherein the total loss function L in step S4 is as follows:
L=LCRF+LBoundary+LT-MSE
Figure FDA0003280629060000021
Figure FDA0003280629060000022
Figure FDA0003280629060000023
wherein L isCRFFor conditional random field loss, LBoundaryIs a two-class cross entropy loss, LT-MSETo smooth the loss, YallAll label sequences are represented, y represents the correct label sequence, and C is the number of machine states;
in the case of conditional random field loss,
Figure FDA0003280629060000031
t isThe length of the sequence is such that,
Figure FDA0003280629060000032
representative label ytTransfer to yt+1The probability of (a) of (b) being,
Figure FDA0003280629060000033
representing the feature of the input sequence at t mapped to the label y at that timetNon-normalized probability of (d);
in the cross-entropy loss of the two classes, the label y of each frame belongs to {0,1}, and the loss L of the tth frametIs composed of
Figure FDA0003280629060000034
PtIs the probability value of the label being 1, n is a positive integer;
in the smoothing of the loss,
Figure FDA0003280629060000035
Δt,c=|logyt,c-logyt-1,c|
where e is the truncation threshold, yt,cIs the probability of the c machine state at time t.
7. The method for marking signals of the deep learning-based variable parameter milling process as claimed in claim 1, wherein the evaluation indexes of step S5 are precision ratio Pr, recall ratio Re and accuracy of attention boundary F1B
Figure FDA0003280629060000036
Figure FDA0003280629060000037
Figure FDA0003280629060000038
Wherein, | TP | is the number of sets TP of true examples, | P | is the number of predicted boundaries, | G | is the number of true boundaries; the true example satisfies:
Figure FDA0003280629060000039
|p-g|<τ
Figure FDA0003280629060000041
wherein G is a real boundary set, P is a predicted boundary set, and tau is an introduced tolerance error, and the meaning of tau is how many samples the distance between the real boundary G belonging to G and the predicted boundary P belonging to P is at most; d (g)1,g2) Representing the real boundary g1And g2The distance between them.
8. The method for marking signals in the process of variable parameter milling based on deep learning of claim 1, wherein the hyper-parameters in step S5 are:
neural network learning rate lr and conditional random field model learning rate lrcrfBatch sample number Batch Size and LT-MSEThe truncation threshold e in (1).
9. The method for marking the signal of the variable parameter milling process based on the deep learning as claimed in claim 1, wherein the step S6 specifically comprises the following steps:
s61, inputting a spindle vibration signal of the milling process after sliding framing into a trained stacked bidirectional long-time memory network-conditional random field model;
s62, decoding the characteristic sequence output by the stacked bidirectional long-time memory network through a Viterbi algorithm by the conditional random field to obtain a label sequence, and realizing automatic marking of the spindle vibration signal in the milling process.
10. Variable parameter milling process signal mark system based on degree of depth study, its characterized in that includes: a computer-readable storage medium and a processor;
the computer-readable storage medium is used for storing executable instructions;
the processor is used for reading executable instructions stored in the computer readable storage medium and executing the deep learning based variable parameter milling process signal marking method of any one of claims 1 to 9.
CN202111131299.0A 2021-09-26 2021-09-26 Variable parameter milling process signal marking method and system based on deep learning Pending CN113869194A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111131299.0A CN113869194A (en) 2021-09-26 2021-09-26 Variable parameter milling process signal marking method and system based on deep learning

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111131299.0A CN113869194A (en) 2021-09-26 2021-09-26 Variable parameter milling process signal marking method and system based on deep learning

Publications (1)

Publication Number Publication Date
CN113869194A true CN113869194A (en) 2021-12-31

Family

ID=78990773

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111131299.0A Pending CN113869194A (en) 2021-09-26 2021-09-26 Variable parameter milling process signal marking method and system based on deep learning

Country Status (1)

Country Link
CN (1) CN113869194A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114925596A (en) * 2022-04-20 2022-08-19 永得利科技(无锡)有限公司 Method for optimizing casting platform finish milling parameters based on wafer test equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114925596A (en) * 2022-04-20 2022-08-19 永得利科技(无锡)有限公司 Method for optimizing casting platform finish milling parameters based on wafer test equipment
CN114925596B (en) * 2022-04-20 2023-10-20 永得利科技(无锡)有限公司 Optimization method for finish milling machining parameters of casting platform based on wafer test equipment

Similar Documents

Publication Publication Date Title
CN108073568B (en) Keyword extraction method and device
CN110188047B (en) Double-channel convolutional neural network-based repeated defect report detection method
CN111914090B (en) Method and device for enterprise industry classification identification and characteristic pollutant identification
CN114970605A (en) Multi-mode feature fusion neural network refrigeration equipment fault diagnosis method
CN112100377B (en) Text classification method, apparatus, computer device and storage medium
JP2020512651A (en) Search method, device, and non-transitory computer-readable storage medium
CN109543693A (en) Weak labeling data noise reduction method based on regularization label propagation
CN112395382A (en) Ship abnormal track data detection method and device based on variational self-encoder
CN111814728A (en) Method for recognizing wear state of cutting tool of numerical control machine tool and storage medium
CN113537609A (en) Policy hotspot prediction method based on text intelligent mining
CN111160959A (en) User click conversion estimation method and device
CN112818162A (en) Image retrieval method, image retrieval device, storage medium and electronic equipment
CN112199559A (en) Data feature screening method and device and computer equipment
CN116702076A (en) Small sample migration learning fault diagnosis method, system, computer and storage medium based on CNN feature fusion
CN115063664A (en) Model learning method, training method and system for industrial vision detection
CN113869194A (en) Variable parameter milling process signal marking method and system based on deep learning
CN114331238A (en) Intelligent model algorithm optimization method, system, storage medium and computer equipment
CN116522912B (en) Training method, device, medium and equipment for package design language model
CN116450848B (en) Method, device and medium for evaluating computing thinking level based on event map
CN116720079A (en) Wind driven generator fault mode identification method and system based on multi-feature fusion
CN117009518A (en) Similar event judging method integrating basic attribute and text content and application thereof
CN114218487B (en) Video recommendation method, system, device and storage medium
CN115858763A (en) Urban management event analysis method based on multi-modal data fusion and application thereof
CN115617689A (en) Software defect positioning method based on CNN model and domain features
CN114971375A (en) Examination data processing method, device, equipment and medium based on artificial intelligence

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination