An unsupervised tool anomaly detection method based on spatiotemporal feature extraction
By building an autoencoder network based on spatiotemporal feature extraction, the problem of low detection accuracy of the existing tool unsupervised anomaly detection method in the shortage of tag data is solved, and the synchronous extraction of multi-dimensional spatiotemporal features is realized, and the detection accuracy is improved.
Patent Information
- Application Number
- CN202311212762.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-20
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2043-09-20
AI Technical Summary
Existing tool unsupervised abnormality detection methods cannot effectively extract multi-dimensional spatiotemporal features when tag data is short, resulting in low detection accuracy.
The autoencoder network based on spatiotemporal feature extraction is adopted to collect tool vibration data through acceleration sensors, and a coding module including a time convolution network, a convolution layer, a pooling layer and a fully connected layer is built. The autoencoder network is trained and adjusted to determine the threshold to realize the synchronous extraction of multi-dimensional spatiotemporal features.
In the case of shortage of tag data, the accuracy of tool unsupervised abnormality detection is significantly improved.
Smart Images

Figure CN117272008B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a tool unsupervised anomaly detection method, in particular to a tool unsupervised anomaly detection method based on spatiotemporal feature extraction. Background Art
[0002] As a key cutting component of CNC machine tools, the performance of cutting tools directly restricts the development of machine tools towards high speed, high efficiency and high precision. Due to the harsh working environment, quite complex structure and highly automated operation, cutting tools are prone to various faults. Any undetectable fault may quickly trigger a chain reaction, thereby seriously affecting the quality of machine tool products, causing huge economic losses and even threatening personal safety. Therefore, there is a great need to develop and improve unsupervised anomaly detection methods for cutting tools. However, practice has shown that due to the limitations of their own principles, existing unsupervised anomaly detection methods for cutting tools cannot synchronously extract multi-dimensional spatiotemporal features in the absence of label data, resulting in low detection accuracy. Based on this, it is necessary to invent an unsupervised anomaly detection method for cutting tools based on spatiotemporal feature extraction to solve the problem of low detection accuracy of existing unsupervised anomaly detection methods for cutting tools. Summary of the Invention
[0003] In order to solve the problem of low detection accuracy of existing unsupervised tool anomaly detection methods, the present invention provides an unsupervised tool anomaly detection method based on spatiotemporal feature extraction.
[0004] The present invention is achieved by adopting the following technical solutions:
[0005] An unsupervised tool anomaly detection method based on spatiotemporal feature extraction is implemented using the following steps:
[0006] Step 1: Use an acceleration sensor to collect tool vibration data and normalize the tool vibration data to form a data set; the data set is represented as:
[0007]
[0008] M=L / T;
[0009]
[0010]
[0011]
[0012]
[0013]
[0014] Where: X mrepresents the mth data sample in the data set; M represents the number of data samples in the data set; L represents the length of the tool vibration data; T represents the number of sampling points in a single data sample, and T = 512; represents a T×3-dimensional time series, where the 3 in T×3 represents the number of acceleration sensors; Represents X tx 、X ty 、X tz Normalized value of X tx 、X ty 、X tz Represents the tool vibration data in the x-axis, y-axis, and z-axis directions respectively; and Respectively represent the maximum and minimum values of tool vibration data;
[0015] The data set contains data samples with different degrees of wear. Data samples with a wear degree less than 0.1 mm are defined as normal samples, and data samples with a wear degree greater than or equal to 0.1 mm are defined as abnormal samples.
[0016] 1200 normal samples are randomly selected as the training data set, and 1200 normal samples and 1400 abnormal samples are randomly selected as the test data set;
[0017] Step 2: Construct an autoencoder network and a loss function, input the training data set into the autoencoder network, and then use the optimization algorithm to adjust the parameters of the entire network to minimize the loss function, thereby completing the training of the autoencoder network. After the training is completed, the loss function determines the threshold for classifying normal samples and abnormal samples.
[0018] Step 3: Input the test data set into the trained autoencoder network to output the detection results.
[0019] In step 2, the autoencoder network includes five parts: input layer, encoding module, latent space, decoding module, and output layer;
[0020] The input layer receives data samples in the training dataset, which is represented as:
[0021]
[0022] The encoding module includes a temporal convolutional network, a convolutional layer, a pooling layer, and a fully connected layer;
[0023] The temporal convolutional network includes a first layer of dilated causal convolution C1, a first weight normalization layer N1, a second layer of dilated causal convolution C2, and a second weight normalization layer N2;
[0024] The first layer of dilated causal convolution C1 extracts temporal and spatial features of data samples in the training dataset simultaneously, which is expressed as:
[0025]
[0026]
[0027]
[0028]
[0029] Where: d represents the expansion coefficient; f(·) represents the filter function; t-(ki)d represents a time before time t; Represents the element-wise multiplication operator; and Represent the output values of the first hidden layer and the second hidden layer at time t, X m,C1 Represents the output features of the first layer of dilated causal convolution C1;
[0030] The first weight normalization layer N1 normalizes the weight parameters of the output of the first layer of dilated causal convolution C1 to speed up the training of the network, which is expressed as:
[0031]
[0032]
[0033] Where: ω N1 and b N1 Represent the weight and bias of the neuron connection respectively; σ represents the ReLU activation function; g is a scalar whose size is equal to ω N1 The modulus length, v / ||v|| represents the difference with ω N1 Unit vectors in the same direction; X m,N1 Represents the output features of the first weight normalization layer N1;
[0034] The second layer of dilated causal convolution C2 extracts temporal and spatial features synchronously from the output of the first weight normalization layer N1, which can be expressed as:
[0035]
[0036]
[0037]
[0038]
[0039] Where: d represents the expansion coefficient; f(·) represents the filter function; t-(ki)d represents a time before time t; Represents the element-wise multiplication operator; and Represent the output values of the first hidden layer and the second hidden layer at time t, X m,C2 Represents the output features of the second layer of dilated causal convolution C2;
[0040] The second weight normalization layer N2 normalizes the weight parameters of the output of the second layer of dilated causal convolution C2 to further speed up the training speed of the network, which is expressed as:
[0041]
[0042]
[0043] Where: ω N2 and b N2 Represent the weight and bias of the neuron connection respectively; σ represents the ReLU activation function; g is a scalar whose size is equal to ω N2 The modulus length, v / ||v|| represents the difference with ω N2 Unit vectors in the same direction; X m,N2 Represents the output features of the second weight normalization layer N2;
[0044] The complete output of the temporal convolutional network is represented as:
[0045]
[0046] The convolution layer further extracts spatial features from the output of the temporal convolutional network, which is expressed as:
[0047]
[0048] Where: ω C3 and b C3 Represent the weight and bias of neuron connections respectively; represents the element-wise multiplication operator of the convolution operation; σ represents the ReLU activation function;
[0049] The pooling layer reduces the feature dimension of the output of the convolutional layer, which is expressed as:
[0050]
[0051] N P1 =T / s;
[0052] Where: down(·) represents the downsampling function; s represents the pooling size, and s = 2;
[0053] The fully connected layer converts the multidimensional vector output of the pooling layer into one dimension, which is expressed as:
[0054]
[0055]
[0056]
[0057] Where: flatten(·) represents the function of converting a multidimensional vector into one dimension; σ represents the ReLU activation function; ω F2 represents the weight parameter; b F2 represents the bias parameter;
[0058] The latent space constructs the latent variables of the output of the encoding module, which is expressed as:
[0059]
[0060]
[0061] Z m =μ m +ε m ⊙σ 2,(m) ;
[0062] Where: μ m and σ 2,(m) Respectively represent the mean and variance of the mth data sample; ε m represents a random variable sampled from N(0,I); Z m represents the latent variable;
[0063] The decoding module includes two cascaded fully connected layers and a deconvolution operation;
[0064] The two cascaded fully connected layers increase the dimension of the output latent variable of the latent space, which is expressed as:
[0065]
[0066]
[0067] Where: ω F4 and b F4 Represent the weight and bias of neuron connections respectively; σ represents the ReLU activation function;
[0068] The deconvolution operation performs a variational network reconstruction on the output of the fully connected layer, which is expressed as:
[0069]
[0070]
[0071]
[0072]
[0073] Where: reshape(·) represents the function of multidimensionalizing a one-dimensional vector; ups(·) represents the upsampling function for feature amplification; σ represents the ReLU activation function; ω C4 and b C4 Represent the weight and bias of neuron connections respectively; represents the element-wise multiplication operator of the deconvolution operation; TCN(·) represents the same operation as the temporal convolutional network; Indicates the data returned after decoding;
[0074] The output layer receives the data samples reconstructed by the variational network, which is expressed as:
[0075]
[0076] In step 2, the loss function consists of two parts: one is the input data sample X m and reconstructed data samples The reconstruction error loss1 is between the two, and the other part is the latent variable Z m and its distribution (μ m ,σ 2,(m) ), the probability distribution error loss2 between them is expressed as:
[0077]
[0078]
[0079]
[0080] Where: Loss represents the loss function;
[0081] In the step 2, after the training is completed, the reconstruction error loss1 is used as the threshold THr for dividing normal samples and abnormal samples.
[0082] In step 3, when the loss function Loss of the data sample of the test data set is greater than or equal to the threshold THr, the data sample is judged as an abnormal sample, otherwise it is judged as a normal sample, which is expressed as:
[0083]
[0084] Where: c(X m ) represents the detection result of the mth data sample.
[0085] Compared with the existing unsupervised anomaly detection method for tools, the unsupervised anomaly detection method for tools based on spatiotemporal feature extraction described in the present invention is based on a new principle and realizes the synchronous extraction of multi-dimensional spatiotemporal features in the case of a shortage of label data, thereby greatly improving the detection accuracy.
[0086] The present invention effectively solves the problem of low detection accuracy of existing unsupervised anomaly detection methods for cutting tools, and is suitable for unsupervised anomaly detection of cutting tools. BRIEF DESCRIPTION OF THE DRAWINGS
[0087] Figure 1 It is a schematic diagram of the principle of the present invention.
[0088] Figure 2 Schematic diagram of the temporal convolutional network in the present invention.
[0089] Figure 3 Schematic diagram of the autoencoder network in the present invention. DETAILED DESCRIPTION
[0090] An unsupervised tool anomaly detection method based on spatiotemporal feature extraction is implemented using the following steps:
[0091] Step 1: Use an acceleration sensor to collect tool vibration data and normalize the tool vibration data to form a data set; the data set is represented as:
[0092]
[0093] M=L / T;
[0094]
[0095]
[0096]
[0097]
[0098]
[0099] Where: X m represents the mth data sample in the data set; M represents the number of data samples in the data set; L represents the length of the tool vibration data; T represents the number of sampling points in a single data sample, and T = 512; represents a T×3-dimensional time series, where the 3 in T×3 represents the number of acceleration sensors; Represents X tx 、X ty 、Xtz Normalized value of X tx 、X ty 、X tz Represents the tool vibration data in the x-axis, y-axis, and z-axis directions respectively; and Respectively represent the maximum and minimum values of tool vibration data;
[0100] The data set contains data samples with different degrees of wear. Data samples with a wear degree less than 0.1 mm are defined as normal samples, and data samples with a wear degree greater than or equal to 0.1 mm are defined as abnormal samples.
[0101] 1200 normal samples are randomly selected as the training data set, and 1200 normal samples and 1400 abnormal samples are randomly selected as the test data set;
[0102] Step 2: Construct an autoencoder network and a loss function, input the training data set into the autoencoder network, and then use the optimization algorithm to adjust the parameters of the entire network to minimize the loss function, thereby completing the training of the autoencoder network. After the training is completed, the loss function determines the threshold for classifying normal samples and abnormal samples.
[0103] Step 3: Input the test data set into the trained autoencoder network to output the detection results.
[0104] In step 2, the autoencoder network includes five parts: input layer, encoding module, latent space, decoding module, and output layer;
[0105] The input layer receives data samples in the training dataset, which is represented as:
[0106]
[0107] The encoding module includes a temporal convolutional network, a convolutional layer, a pooling layer, and a fully connected layer;
[0108] The temporal convolutional network includes a first layer of dilated causal convolution C1, a first weight normalization layer N1, a second layer of dilated causal convolution C2, and a second weight normalization layer N2;
[0109] The first layer of dilated causal convolution C1 extracts temporal and spatial features of data samples in the training dataset simultaneously, which is expressed as:
[0110]
[0111]
[0112]
[0113]
[0114] Where: d represents the expansion coefficient; f(·) represents the filter function; t-(ki)d represents a time before time t; Represents the element-wise multiplication operator; and Represent the output values of the first hidden layer and the second hidden layer at time t, X m,C1 Represents the output features of the first layer of dilated causal convolution C1;
[0115] The first weight normalization layer N1 normalizes the weight parameters of the output of the first layer of dilated causal convolution C1 to speed up the training of the network, which is expressed as:
[0116]
[0117]
[0118] Where: ω N1 and b N1 Represent the weight and bias of the neuron connection respectively; σ represents the ReLU activation function; g is a scalar whose size is equal to ω N1 The modulus length, v / ||v|| represents the difference with ω N1 Unit vectors in the same direction; X m,N1 Represents the output features of the first weight normalization layer N1;
[0119] The second layer of dilated causal convolution C2 extracts temporal and spatial features synchronously from the output of the first weight normalization layer N1, which can be expressed as:
[0120]
[0121]
[0122]
[0123]
[0124] Where: d represents the expansion coefficient; f(·) represents the filter function; t-(ki)d represents a time before time t; Represents the element-wise multiplication operator; and Represent the output values of the first hidden layer and the second hidden layer at time t, X m,C2 Represents the output features of the second layer of dilated causal convolution C2;
[0125] The second weight normalization layer N2 normalizes the weight parameters of the output of the second layer of dilated causal convolution C2 to further speed up the training speed of the network, which is expressed as:
[0126]
[0127]
[0128] Where: ω N2 and b N2 Represent the weight and bias of the neuron connection respectively; σ represents the ReLU activation function; g is a scalar whose size is equal to ω N2 The modulus length, v / ||v|| represents the difference with ω N2 Unit vectors in the same direction; X m,N2 Represents the output features of the second weight normalization layer N2;
[0129] The complete output of the temporal convolutional network is represented as:
[0130]
[0131] The convolution layer further extracts spatial features from the output of the temporal convolutional network, which is expressed as:
[0132]
[0133] Where: ω C3 and b C3 Represent the weight and bias of neuron connections respectively; represents the element-wise multiplication operator of the convolution operation; σ represents the ReLU activation function;
[0134] The pooling layer reduces the feature dimension of the output of the convolutional layer, which is expressed as:
[0135]
[0136] N P1 =T / s;
[0137] Where: down(·) represents the downsampling function; s represents the pooling size, and s = 2;
[0138] The fully connected layer converts the multidimensional vector output of the pooling layer into one dimension, which is expressed as:
[0139]
[0140]
[0141]
[0142] Where: flatten(·) represents the function of converting a multidimensional vector into one dimension; σ represents the ReLU activation function; ω F2 represents the weight parameter; b F2 represents the bias parameter;
[0143] The latent space constructs the latent variables of the output of the encoding module, which is expressed as:
[0144]
[0145]
[0146] Z m =μ m +ε m ⊙σ 2,(m) ;
[0147] Where: μ m and σ 2,(m) Respectively represent the mean and variance of the mth data sample; ε m represents a random variable sampled from N(0,I); Z m represents the latent variable;
[0148] The decoding module includes two cascaded fully connected layers and a deconvolution operation;
[0149] The two cascaded fully connected layers increase the dimension of the output latent variable of the latent space, which is expressed as:
[0150]
[0151]
[0152] Where: ω F4 and b F4 Represent the weight and bias of neuron connections respectively; σ represents the ReLU activation function;
[0153] The deconvolution operation performs a variational network reconstruction on the output of the fully connected layer, which is expressed as:
[0154]
[0155]
[0156]
[0157]
[0158] Where: reshape(·) represents the function of multidimensionalizing a one-dimensional vector; ups(·) represents the upsampling function for feature amplification; σ represents the ReLU activation function; ω C4 and b C4 Represent the weight and bias of neuron connections respectively; represents the element-wise multiplication operator of the deconvolution operation; TCN(·) represents the same operation as the temporal convolutional network; Indicates the data returned after decoding;
[0159] The output layer receives the data samples reconstructed by the variational network, which is expressed as:
[0160]
[0161] In step 2, the loss function consists of two parts: one is the input data sample X m and reconstructed data samples The reconstruction error loss1 is between the two, and the other part is the latent variable Z m and its distribution (μ m ,σ 2,(m) ), the probability distribution error loss2 between them is expressed as:
[0162]
[0163]
[0164]
[0165] Where: Loss represents the loss function;
[0166] In the step 2, after the training is completed, the reconstruction error loss1 is used as the threshold THr for dividing normal samples and abnormal samples.
[0167] In step 3, when the loss function Loss of the data sample of the test data set is greater than or equal to the threshold THr, the data sample is judged as an abnormal sample, otherwise it is judged as a normal sample, which is expressed as:
[0168]
[0169] Where: c(X m ) represents the detection result of the mth data sample.
[0170] Although specific embodiments of the present invention have been described above, those skilled in the art will appreciate that these are merely illustrative and that the scope of the present invention is defined by the appended claims. Those skilled in the art may make various changes or modifications to these embodiments without departing from the principles and essence of the present invention, and such changes and modifications are intended to fall within the scope of the present invention.
Claims
1. A tool unsupervised anomaly detection method based on spatiotemporal feature extraction, characterized by: This method is implemented using the following steps: Step 1: Use an acceleration sensor to collect tool vibration data and normalize the tool vibration data to form a data set; the data set is represented as: ; ; ; ; ; ; ; Where: Indicates the first data samples; Indicates the number of data samples in the dataset; Indicates the length of tool vibration data; represents the number of sampling points in a single data sample, and ; express dimensional time series, The 3 in the number represents the number of acceleration sensors; 、 、 Respectively 、 、 The normalized value of 、 、 Respectively axis, axis, Tool vibration data in the axial direction; and Respectively represent the maximum and minimum values of tool vibration data; The data set contains data samples with different degrees of wear. Data samples with a wear degree less than 0.1 mm are defined as normal samples, and data samples with a wear degree greater than or equal to 0.1 mm are defined as abnormal samples. 1200 normal samples are randomly selected as the training data set, and 1200 normal samples and 1400 abnormal samples are randomly selected as the test data set; Step 2: Construct an autoencoder network and a loss function, input the training data set into the autoencoder network, and then use the optimization algorithm to adjust the parameters of the entire network to minimize the loss function, thereby completing the training of the autoencoder network. After the training is completed, the loss function determines the threshold for classifying normal samples and abnormal samples. The autoencoder network consists of five parts: input layer, encoding module, latent space, decoding module, and output layer; The input layer receives data samples in the training data set; The encoding module includes a temporal convolutional network, a convolutional layer, a pooling layer, and a fully connected layer; The temporal convolutional network includes a first layer of dilated causal convolution C1, a first weight normalization layer N1, a second layer of dilated causal convolution C2, and a second weight normalization layer N2; The first layer of dilated causal convolution C1 extracts temporal and spatial features of data samples in the training dataset simultaneously; The first weight normalization layer N1 normalizes the weight parameters of the output of the first layer of dilated causal convolution C1 to speed up the training of the network; The second layer of dilated causal convolution C2 extracts temporal and spatial features synchronously from the output of the first weight normalization layer N1; The second weight normalization layer N2 normalizes the weight parameters of the output of the second layer of dilated causal convolution C2 to further speed up the training of the network; The convolution layer further extracts spatial features from the output of the temporal convolutional network; The pooling layer reduces the feature dimension of the output of the convolutional layer; The fully connected layer converts the multidimensional vector output of the pooling layer into one dimension; The latent space constructs latent variables for the output of the encoding module; The decoding module includes two cascaded fully connected layers and a deconvolution operation; The two cascaded fully connected layers increase the dimension of the output latent variables of the latent space; The deconvolution operation performs a variational network reconstruction on the output of the fully connected layer; The output layer receives data samples reconstructed by the variational network; Step 3: Input the test data set into the trained autoencoder network to output the detection results.
2. The unsupervised tool anomaly detection method based on spatiotemporal feature extraction according to claim 1 is characterized in that: In the step 2, the input layer is represented as: ; The first layer of dilated causal convolution C1 is expressed as: , ; , ; , ; ; Where: represents the expansion coefficient; Represents a filter function; Indicates time At some point before; Represents the element-wise multiplication operator; and Respectively represent the first hidden layer and the second hidden layer at time The output value of , ; Represents the output features of the first layer of dilated causal convolution C1; The first weight normalization layer N1 is expressed as: ; ; Where: and Represent the weight and bias of neuron connections respectively; Represents the ReLU activation function; is a scalar whose magnitude is equal to The module length, Represents Unit vectors in the same direction; Represents the output features of the first weight normalization layer N1; The second layer of dilated causal convolution C2 is expressed as: , ; , ; , ; ; Where: represents the expansion coefficient; Represents a filter function; Indicates time At some point before; Represents the element-wise multiplication operator; and Respectively represent the first hidden layer and the second hidden layer at time The output value of , ; Represents the output features of the second layer of dilated causal convolution C2; The second weight normalization layer N2 is expressed as: ; ; Where: and Represent the weight and bias of neuron connections respectively; Represents the ReLU activation function; is a scalar whose magnitude is equal to The module length, Represents Unit vectors in the same direction; Represents the output features of the second weight normalization layer N2; The complete output of the temporal convolutional network is represented as: ; The convolutional layer is expressed as: ; Where: and Represent the weight and bias of neuron connections respectively; An element-wise multiplication operator representing a convolution operation; Represents the ReLU activation function; The pooling layer is expressed as: ; ; Where: represents the downsampling function; represents the pooling size, and ; The fully connected layer is expressed as: ; ; ; Where: A function that represents the dimensionalization of a multidimensional vector; Represents the ReLU activation function; represents the weight parameter; represents the bias parameter; The latent space is represented as: ; ; ; Where: and Respectively represent The mean and variance of the data samples; Indicates from Random variables sampled from ; represents the latent variable; The two cascaded fully connected layers are expressed as: ; ; Where: and Represent the weight and bias of neuron connections respectively; Represents the ReLU activation function; The deconvolution operation is expressed as: ; ; ; ; Where: Function representing the multidimensionalization of a one-dimensional vector; Represents the upsampling function for feature amplification; Represents the ReLU activation function; and Represent the weight and bias of neuron connections respectively; An element-wise multiplication operator representing the deconvolution operation; Represents the same operation as the temporal convolutional network; Indicates the data returned after decoding; The output layer is represented as: ; In step 2, the loss function consists of two parts: one is the input data sample and reconstructed data samples The reconstruction error between , and the other part is the latent variable and its distribution The probability distribution error between , which is expressed as: ; ; ; Where: represents the loss function; In the step 2, after the training is completed, the reconstruction error As the threshold for dividing normal samples and abnormal samples .
3. The unsupervised tool anomaly detection method based on spatiotemporal feature extraction according to claim 2 is characterized by: In step 3, when the loss function of the data sample of the test dataset is Greater than or equal to the threshold When , the data sample is judged as an abnormal sample, otherwise it is judged as a normal sample, which is expressed as: ; Where: Indicates the The test results of the data samples.
Citation Information
Patent Citations
Unsupervised adversarial learning electromagnetic spectrum abnormal signal detection method
CN112924749A
Unsupervised anomaly detection method under multi-modal data missing
CN113255733A