Manufacturing workshop time sequence anomaly detection method based on dual-channel feature fusion
Through the dual-channel feature fusion method, the fast Fourier transform and temporal convolutional network are used to extract the spatial and temporal features of the manufacturing workshop time series, and the GRU and autoencoder are combined for anomaly detection. This solves the problems of feature relationship processing and dynamic changes in multivariate time series data, and improves the accuracy and adaptability of anomaly detection.
Patent Information
- Application Number
- CN202510966783.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-14
- Publication Date
- 2025-10-17
AI Technical Summary
Existing technologies have difficulty effectively processing the complex relationships between features in multivariate time series data, and have difficulty capturing anomalies caused by dynamic changes in data.
A method based on dual-channel feature fusion is adopted. Fast Fourier transform is used to extract spatial features. Temporal convolutional network is combined to extract time-oriented features. Gated recurrent unit (GRU) is used for temporal association modeling. An autoencoder is constructed for anomaly detection and dynamic thresholds are set for judgment.
It achieves more comprehensive mining of data information, adapts to dynamic changes in data, improves the accuracy and reliability of anomaly detection, and reduces misjudgments and missed judgments.
Smart Images

Figure BDA0005498252390000021 
Figure BDA0005498252390000031 
Figure BDA0005498252390000032
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of manufacturing workshop equipment anomaly detection, and particularly relates to a manufacturing workshop time series anomaly detection method based on double-channel feature fusion. BACKGROUND
[0002] Time series anomaly detection is an important research topic in the field of data mining, and has a wide range of applications in industry. Efficient and accurate anomaly detection can help production personnel continuously monitor key indicators and promptly issue potential event alerts. In practical applications, multiple time series indicators are collected to reflect the health status of the system. With the advancement of the Internet of Things, many manufacturing workshops now contain multiple sensors. During operation, these sensors generate a large amount of time series data, which are often interrelated. An abnormal change in data from one sensor can affect data from other sensors, making it increasingly difficult to detect anomalies in the growing amount and dimension of data. Therefore, in a multivariate time series anomaly detection system, the correlation between different time series must be considered.
[0003] Currently, there are invention patents in the field of time series anomaly detection. A Chinese patent discloses a multivariate time series anomaly detection method and system based on a graph neural network. The sensors in the physical system are used as the nodes of the probabilistic graph model, and the monitoring data is modeled as a time series to obtain a dynamic graph neural network model. The next time point value of each node is predicted and an adjacency matrix is generated. According to the predicted value and the true value, a loss function is constructed by introducing the reconstruction error of the adjacency matrix to train and update the model, and the abnormal value of the node is determined. A Chinese patent discloses an industrial time series anomaly detection method and device and computer equipment. After the industrial time series data is converted into graph structure data, it is input into a reconstruction model. The reconstruction model includes a number of composite graph attention networks. According to the difference between the reconstructed data and the original data, it is determined whether it is abnormal. A Chinese patent discloses a multivariate time series anomaly detection method based on Transformer. After feature dimension normalization processing is performed on the multivariate time series data set, the sliding window is divided into multiple sliding window time series data. Then, time stamp encoding and data encoding are performed. The anomaly detection method based on the Transformer model is used to solve the reconstruction value. According to the reconstruction error and historical error factors, a dynamic anomaly threshold is determined, and then an anomaly detection result is obtained.
[0004] Although the above invention promotes the detection of anomalies of manufacturing workshop equipment, there is still a need to make breakthroughs on the following issues: first, there are multiple features in the multivariate time series data, and there is a complex relationship between the multiple features, so it is difficult for traditional detection methods to handle the correlation between the features; second, the production process of the manufacturing workshop is a dynamic system, and the running equipment, production parameters, etc. will change with time, and the current detection method is difficult to capture abnormal situations caused by dynamic changes in data. SUMMARY
[0005] In order to solve the problems existing in the prior art, the present application provides a manufacturing workshop time series anomaly detection method based on double-channel feature fusion, which can effectively solve the problems of incomplete feature extraction and insufficient sensitivity to data dynamic changes in existing anomaly detection methods.
[0006] The technical scheme adopted by the present application is as follows:
[0007] A manufacturing workshop time series anomaly detection method based on double-channel feature fusion, comprising the following steps:
[0008] Step 1: Obtain multiple sensor data of equipment in the manufacturing workshop to form a multivariate time series data set, and pre-process the data;
[0009] Step 2: Double-channel feature extraction is performed on the pre-processed data, one channel is to extract spatial-oriented features using fast Fourier transform, and the other channel is to extract time-oriented features using time convolution network;
[0010] Step 3: Adopt a Gated Recurrent Unit (GRU) to model the time sequence correlation of the extracted double-channel features, and perform fusion processing on the extracted features to obtain a fusion feature representation;
[0011] Step 4: Construct an autoencoder for the fused feature representation, perform anomaly detection using the autoencoder, and set a dynamic threshold based on the reconstruction error distribution; samples exceeding the dynamic threshold in the detection are determined as abnormal.
[0012] Further, the method for extracting spatial-oriented features using fast Fourier transform in step 2 is as follows:
[0013] Step 2.1.1: The pre-processed time series data is divided into overlapping frames in a sliding window manner, and a Hanning window is applied to each frame of data, and the windowed data is x seg (k,t);
[0014] Step 2.1.2: Fast Fourier transform is performed on the windowed data x seg (k,t) to obtain complex amplitude X(k,f) and amplitude;
[0015] Step 2.1.3: Calculate the spectral entropy H based on the complex amplitude to quantify the complexity of the signal;
[0016] Step 2.1.4: Input the extracted frequency amplitude vector into the 1D convolution layer to obtain the output feature vector C out (i) Apply the ReLU activation function to the convolution output; input the activated features into the fully connected layer to obtain the output result H after the fully connected layer. fc ; Generate normalized frequency band attention weights through Sigmoid function;
[0017] Step 2.1.5: Fuse the spectral entropy to the weighted features with a fixed weight λ = 0.2, denoted as:
[0018]
[0019] Then the fusion to weighted features is processed through the fully connected layer to obtain F' space ∈R B×D ;
[0020] Among them, F space is the spatial eigenvector, α i is the frequency band attention weight, is the amplitude of the i-th frequency point, H(k) is the spectral entropy of the current signal segment; B is the batch size, and D is the feature dimension.
[0021] Furthermore, the method for extracting time-oriented features using the temporal convolutional network in step 2 is:
[0022] Step 2.2.1: For the preprocessed sensor data X, construct a three-dimensional tensor X' through a sliding window;
[0023] Step 2.2.2: Use a one-dimensional convolution kernel with causal constraints to extract time dimension features. The causal convolution operation is expressed as:
[0024]
[0025] Among them, W (1) (τ) is the weight matrix of the first layer convolution kernel at the offset τ, b (1) is the bias term, τ is the offset index of the convolution kernel sliding window, t represents the current time position, X'(t-τ) is the slice of the input tensor at time step t-τ, H (1) (t) is the output feature of the first layer of causal convolution at time step t, and k is the convolution kernel size;
[0026] Step 2.2.3: Construct a multi-layer dilated convolution structure. The output of the m-th layer dilated convolution is calculated as:
[0027]
[0028] where H (m) (t) is the output feature of the m-th layer causal convolution at time step t, τ is the shift index of the convolution kernel sliding window, W (m) (τ) is the weight matrix of the m-th layer convolution kernel at shift τ, 2 m-1 is the dilation factor of the m-th layer, H (m-1) (t-τ·2 m-1 ) is the output feature of the m-1-th layer at time t-τ·2 m-1 , b (m) is the bias term of the m-th layer;
[0029] Step 2.2.4: Introduce a residual block in the adjacent dilated convolution layer, and the residual connection structure calculation process is to generate the intermediate feature Z after layer normalization and random inactivation on the dilated convolution output F m) , and then pass it through the ReLU activation function:
[0030]
[0031] F out = Conv1D
[0032] where Z is the intermediate feature generated by the residual connection structure, H m) is the output feature of the m-th layer dilated convolution, Conv1D is the 1 × 1 convolution operation, F out is the final output of the residual module, Dropout is the random inactivation of part of the neurons, and LayerNorm is the layer normalization operation;
[0033] Step 2.2.5: Finally output high-order time feature representation by cascading multiple layers of dilated causal convolution and residual connection:
[0034]
[0035] where TCN(X') represents the overall processing process of the input tensor X' by the time convolution network, represents cascading along the feature channel dimension, represents the output feature of the i-th residual module, M is the total number of network layers, F time is the fused high-order time feature tensor, F time .
[0036] Further, step 3 includes the following steps:
[0037] Step 3.1: Copy the spatial feature F' space mapped by the fully connected layer along the time dimension to form a spatial tensor with the same dimension as the time feature:
[0038] F space = Reapeat(F space , T)
[0039] The same dimension frequency domain feature F space and time domain feature F time are spliced to form a fusion feature vector, denoted as:
[0040] F = [F space ; F time ]
[0041] Step 3.2: input the spliced feature F into the GRU network, process F through the gating mechanism, and output the hidden state sequence h t ;
[0042] Step 3.3: average pooling the hidden state sequence output by the GRU to capture the global features of the entire sequence as the final fusion feature representation:
[0043]
[0044] wherein T is the time step, F final is the final fusion feature.
[0045] Further, step 4 includes the following steps:
[0046] Step 4.1: input the final fusion feature F final generated in step 3 as input to build an encoder;
[0047] Step 4.2: build a decoder to reconstruct the latent space representation z back to the original fusion feature space;
[0048] Step 4.3: from the preprocessed multivariate time series data, filter out the data samples marked as normal state to form a normal data set; take the fusion feature vector F final of the normal data set as input to train the autoencoder, and use mean square error as the loss function to measure the difference between the reconstructed feature and the original feature F final ;
[0049] Step 4.4: after completing the training of the autoencoder, use the normal data set to pass through the autoencoder again for forward propagation to calculate the reconstruction error of each normal sample; collect the reconstruction errors of all normal samples to calculate their mean μ and standard deviation σ;
[0050] Step 4.5: based on the statistical characteristics of the normal numerical reconstruction error, set a dynamic threshold θ, when the reconstruction error of a new test sample is less than θ, it is determined that the test sample is normal, otherwise it is determined that the test sample is abnormal. When the sample exceeds the dynamic threshold value θ, the sample is determined as abnormal data; otherwise, the sample is determined as normal data.
[0051] Further, the dynamic threshold value θ is:
[0052] θ = μ + k·σ
[0053] wherein k is an adjustable coefficient.
[0054] Further, the loss function formula is:
[0055]
[0056] wherein D is the dimension of the fusion feature vector, i is an index variable, is the true value of the i th data point, is the predicted value of the i th data point.
[0057] Further, the adjustable coefficient k has a value range of [2, 3].
[0058] Further, the pre-processing in step 1 includes cleaning and normalizing the data.
[0059] Further, the median filter method is used to clean the data to remove noise interference.
[0060] Advantages of the present application:
[0061] 1. The present application simultaneously uses fast Fourier transform (FFT) and time convolution network (TCN) to process data, FFT can extract spatial-oriented features, that is, analyze the frequency components and energy distribution of signals from the frequency domain; TCN focuses on extracting time-oriented features to capture time series information and dynamic changes in time series. This dual-channel method can more comprehensively mine information in the data and avoid information omission that may be caused by a single feature extraction method.
[0062] 2. The present application also sets a dynamic threshold value, which is dynamically set based on the statistical characteristics of normal data, can more accurately divide the normal and abnormal boundaries. Compared with the fixed threshold value, it can better adapt to the subtle changes and fluctuations of data, reduces the misjudgment and omission caused by unreasonable threshold setting, and improves the reliability of the abnormal detection result. BRIEF DESCRIPTION OF DRAWINGS
[0063] Figure 1 is the overall operation logic diagram of the method of the present application.
[0064] Figure 2 is the flowchart of the fast Fourier transform for extracting time series spatial features.
[0065] Figure 3is a flow chart of extracting time series sequence time-oriented features by the time convolution network described in the present application, wherein, Figure 3 a is a total flow chart, Figure 3 b is a causal convolution module, Figure 3 c is a residual module. DETAILED DESCRIPTION
[0066] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is further described in detail below in combination with the drawings and examples. It should be understood that the specific examples described herein are only used to explain the present application and do not limit the present application.
[0067] Referring to Figure 1 , the present application designs a manufacturing plant time series anomaly detection method based on dual-channel feature fusion, which can effectively solve the problems of incomplete feature extraction and insufficient sensitivity to dynamic data changes in existing anomaly detection methods. The specific implementation steps of the method are as follows:
[0068] Step 1: There are various devices in the manufacturing plant, and various sensor data (such as temperature sensors, pressure sensors, etc.) of the manufacturing plant devices are obtained to form a time series data set. The data is cleaned to remove noise interference, and the cleaned data is normalized to map the data values of multiple variables to the same scale.
[0069] Step 1.1: Real-time collection of sensor data during device operation from multiple sensors of the manufacturing plant device, such as temperature sensors, pressure sensors, speed sensors, etc. Let the time series data be x(1), x(2), …, x(N), N is the number of sensors. The data obtained by multiple sensors forms a multivariate time series data set.
[0070] Step 1.2: Clean the collected data to remove noise interference and improve data quality. In this embodiment, the median filtering method is used to remove noise interference, and the specific processing process is as follows:
[0071] Step 1.2.1: Select a filter window with a length of D, D is usually an odd number. Move the window to each position of the data point by point, take out the data points of the window and sort them in ascending order.
[0072] Step 1.2.2: Replace the value of the original data at the corresponding position with the sorted median. If the window length L is odd, the median is the number of the sorted data. Perform the above operation on each position of the data collected by each sensor in turn, and finally obtain the filtered result.
[0073] Step 1.3: In order to facilitate the calculation of the mapping of data values of multiple variables to the same scale, the multivariate time series is normalized. After normalization, the data values of all variables are mapped to the interval [0, 1], and the specific processing process is as follows:
[0074] Step 1.3.1: Normalize the maximum and minimum values of each sensor data:
[0075]
[0076] where x max and x min are the maximum and minimum values of the variable time series, x nk is the value of the kth sensor at timestamp t n , is the normalized data value.
[0077] Step 2: Perform dual-channel feature extraction on the normalized data. One channel uses fast Fourier transform to extract spatial-oriented features, and the other channel uses a time convolution network to extract time-oriented features.
[0078] Step 2.1: The flow chart for extracting spatial-oriented features using fast Fourier transform is shown in Figure 2 . For each normalized variable time series data, treat it as a time domain signal, and use fast Fourier transform (FFT) to convert the time domain signal to a frequency domain signal.
[0079] Step 2.1.1: Divide the normalized time series data into overlapping frames in a sliding window manner. Let the time series data x(t) ∈ R T , the total length T = 1024, and divide it into K = 8 segments, each with a length L = 256. In order to reduce spectral leakage, apply a Hanning window to each frame of data. The windowed data is:
[0080]
[0081] where x seg (k, t) is the kth windowed signal, t is the time index within the subsegment, L is the subsegment length, and x() is the original time series signal.
[0082] Step 2.1.2: Perform fast Fourier transform on the windowed data x seg (k, t) to obtain X(k, f), and calculate the amplitude |X(k, f)| of each segment of the spectrum. X(k, f) is denoted as:
[0083]
[0084] Wherein, X(k,f) is the complex amplitude of the k-th signal at frequency f, f is the frequency index, f = 0, 1, 2, …, L / 2, and j is the imaginary unit.
[0085] Step 2.1.3: Calculate the spectral entropy (i.e., H value) to quantify the complexity of the signal. The larger the H value, the more dispersed the energy distribution, and the higher the complexity. The formula for calculating the spectral entropy is:
[0086]
[0087] Wherein, H is the spectral entropy, P(f) is the energy proportion of frequency f, and X(f) is the FFT complex amplitude (at frequency f).
[0088] Step 2.1.4: Arrange the frequency point amplitudes in order from small to large, and extract the top 64 frequency point amplitudes F frep ∈R 64 . Input the 64-dimensional frequency point amplitude vector into the 1D convolution layer, with a convolution kernel size of 3, an output channel number of 32, and symmetric padding to keep the vector dimension unchanged, so that D space =D time =D, as follows:
[0089]
[0090] Wherein, C out (i) is the i-th dimensional output feature vector in C out , i = 1, 2, …, 64, W(j) is the learnable convolution kernel weight, j = 0, 1, 2, F freq is the input frequency point amplitude vector, and b is the bias term.
[0091] Apply the ReLU activation function to the convolution output result:
[0092] H relu =max(0, C out )
[0093] Wherein, H relu is the ReLU-activated frequency band feature, and C out is the overall output vector.
[0094] Input the activated features into the fully connected layer and map them to a 64-dimensional space:
[0095] H fc =W fc ·H relu +b fc
[0096] Wherein, W fc is the frequency band association weight matrix, W fc ∈R 64×32 , and bfc b is the band energy bias fc ∈R 64 , H fc is the output result after the full connection layer.
[0097] The normalized band attention weight is generated by the Sigmoid function, which ensures The weight generation formula is:
[0098]
[0099] where, a i is the attention weight of the i-th frequency point, H fc (i) is the i-dimensional output feature of the full connection layer output.
[0100] Step 2.1.5: The spectral entropy is fused into the weighted feature with a fixed weight λ = 0.2, and the formula is as follows:
[0101]
[0102] where, F space is the spatial feature vector, a i is the band attention weight, is the amplitude of the i-th frequency point, and H(k) is the spectral entropy of the current signal segment.
[0103] The 64-dimensional spatial feature is mapped to 128-dimensional by the full connection layer for subsequent cross-modal fusion, i.e., F' space ∈R B×D , B is the batch size, and D is the feature dimension.
[0104] Step 2.2: The flow chart of extracting time-oriented features using time convolution network is as follows Figure 3 a. The normalized data is input into the time convolution network (TCN) module to extract time-oriented features, and the specific steps are as follows:
[0105] Step 2.2.1: The normalized sensor data X ∈ R N×T , where N is the number of sensors and T is the time step. In order to adapt to the input requirements of the convolution layer, a three-dimensional tensor X' ∈ R B×N×L is constructed by sliding window, where B is the batch size and L is the local time window length.
[0106] Step 2.2.2: Reference Figure 3 b, a one-dimensional convolution kernel with causal constraint is used to extract time dimension features, which ensures that the output only depends on the current and historical time input. The causal convolution operation is represented as:
[0107]
[0108] where W (1) (τ)∈R d×k is the weight matrix of the 1st layer convolution kernel at offset τ, d is the hidden layer dimension, k is the convolution kernel size, b (1) is the bias term, τ is the offset index of the convolution kernel sliding window, τ ∈ {0, 1, 2, …, k-1}, t represents the current time position, X'(t-τ) is the slice of the input tensor at time step t-τ, H (1) (t) is the output feature of the 1st layer causal convolution at time step t.
[0109] Step 2.2.3: In order to enable the network to effectively capture long-distance dependencies in time series without increasing too many parameters, a multi-layer dilated convolution structure is constructed to expand the receptive field. The output calculation of the mth layer dilated convolution is:
[0110]
[0111] where H (m) (t) is the output feature of the mth layer causal convolution at time step t, τ is the offset index of the convolution kernel sliding window, τ ∈ {0, 1, 2, …, k-1}, k is the convolution kernel size, W (m) (τ) is the weight matrix of the mth layer convolution kernel at offset τ, 2 m-1 is the dilation factor of the mth layer, H (m-1) (t-τ·2 m-1 ) is the output feature of the (m-1)th layer at time t-τ·2 m-1 , b (m) is the bias term of the mth layer.
[0112] Step 2.2.4: Referring to Figure 3 c, a residual block is introduced between adjacent dilated convolution layers to enhance gradient propagation efficiency. The calculation process of the residual connection structure is to perform layer normalization and random inactivation on the dilated convolution output H( m) , then generate intermediate features Z through ReLU activation function, and then pass through 1×1 convolution and input features. The calculation process of a single residual unit is represented as:
[0113] Z = ReLU(H (m) + Dropout(LayerNorm(H (m) )))
[0114] F out = Conv1D
[0115] where Z is the intermediate feature generated by the residual connection structure, H (m) is the output feature of the mth layer dilated convolution, Conv1D is the 1×1 convolution operation, F outDropout randomly inactivates some neurons for the final output of the residual module, and LayerNorm is a layer normalization operation.
[0116] Step 2.2.5: The final output high-order time feature representation is obtained by cascading multi-layer dilated causal convolution and residual connection:
[0117]
[0118] where TCN(X') is the overall processing of the input tensor X' by the temporal convolution network, represents cascading along the feature channel dimension, represents the output feature of the i-th residual module, M is the total number of network layers, F time is the fused high-order time feature tensor, F time ∈R B×T×D , B is the batch size, T is the time step, and D is the feature dimension.
[0119] Step 3: In order to effectively fuse the dual-channel features and capture the long-term dependencies of the sequence data, a Gated Recurrent Unit (GRU) is used to model the temporal association of the dual-channel features extracted in Step 2. The specific steps are as follows:
[0120] Step 3.1: Map the spatial features F' space ∈R B×D after the fully connected layer along the time dimension to form a tensor with the same dimension as the time feature:
[0121] F'' space = Repeat(F' space , T) ∈R B×T×D
[0122] where F'' space is a spatial tensor with the same dimension as the time feature, B is the batch size, T is the time step, and D is the feature dimension.
[0123] The frequency domain feature F'' space and the time domain feature F time with the same dimension are concatenated to form a fusion feature vector, denoted as:
[0124] F = [F'' space ; F time ] ∈R B×T×D
[0125] where F'' space is the frequency domain feature vector, F time is the time domain feature vector, and F is the fused feature vector.
[0126] Step 3.2: The fusion features are processed using a gated recurrent unit (GRU) to capture long-term dependencies in the sequence. The concatenated features F are input into the GRU network, which processes F through a gating mechanism.
[0127] For each time step t, the input features F are combined with the previous hidden state h t-1 Concatenation, the update gate z t and the reset gate γ t are calculated through the sigmoid activation function.
[0128] Update gate: z t = σ(W z · [h t-1 , F] + b z )
[0129] Reset gate: γ t = σ(W γ · [h t-1 , F] + b γ )
[0130] where W z , W γ are the weight matrices of the update gate and the reset gate, respectively, b z , b γ are the bias terms of the update gate and the reset gate, respectively, σ(·) is the sigmoid function, and [·, ·] is the tensor concatenation operation.
[0131] The reset gate γ t is used to selectively forget the historical hidden state, and the candidate hidden state
[0132]
[0133] where h h is the candidate hidden state, W h is the weight matrix, b t is the bias term, ⊙ represents element-wise multiplication, and [·, ·] is the tensor concatenation operation.
[0134] The update gate z t-1 controls the fusion ratio of the historical hidden state h t and the candidate hidden state to obtain the current hidden state h t :
[0135]
[0136] where h final is the current hidden state.
[0137] Step 3.3: Average pooling the hidden state sequence output by GRU to capture the global features of the entire sequence as the final fused feature representation:
[0138]
[0139] where T is the time step, F final is the final fused feature.
[0140] Step 4: For the feature representation fused in step 3, build an autoencoder (AE) model to realize anomaly detection by learning the internal pattern of normal data, and set a dynamic threshold based on the reconstruction error distribution. The specific steps are as follows:
[0141] Step 4.1: Take the final fused feature vector generated in step 3 as input to build an encoder. The encoder consists of multiple fully connected layers, which gradually reduce the feature dimension to extract the core feature representation of the data. Assuming that the encoder contains two layers, the first layer reduces the input feature dimension from D to D / 2, and the activation function uses ReLU; the second layer further reduces to the latent space dimension L, and the activation function also uses ReLU.
[0142] First layer encoding: h1 = ReLU(W enc1 ·F final +b enc1 )
[0143] Second layer encoding: z = ReLU(W enc2 ·h1+b enc2 )
[0144] where W enc1 is the first layer encoding weight matrix, b enc1 and b enc2 are bias terms, W enc2 is the second layer encoding weight matrix, and z is the latent space representation.
[0145] Step 4.2: Build a decoder to reconstruct the latent space representation z back to the original fused feature space. The decoder structure is symmetrical to the encoder, also containing two layers, the first layer restores the dimension from L to D / 2, and the activation function is ReLU; the second layer restores to the original dimension D, and the activation function uses Sigmoid to ensure that the output value is within the range [0, 1] (consistent with the data range after normalization).
[0146] First layer decoding: h2 = ReLU(W dec1 ·z+b dec1 )
[0147] Second layer decoding: F' final = Sigmoid(W dec2• h2+ b dec2 )
[0148] where W dec1 is the first layer decoding weight matrix, b dec1 , b dec2 are bias terms, W dec2 is the second layer decoding weight matrix, is the reconstructed fusion feature vector.
[0149] Step 4.3: From the normalized multivariate time series data, filter out the data samples marked as normal state to form a normal data set. Take the fusion feature vector F final of the normal data set as input, train through the autoencoder, and use mean square error (MSE) as the loss function to measure the difference between the reconstructed feature and the original feature F final . The loss function formula is:
[0150]
[0151] where D is the dimension of the fusion feature vector, i is the index variable, is the true value of the i-th data point, is the predicted value of the i-th data point.
[0152] Step 4.4: After completing the training of the autoencoder, use the normal data set to pass through the autoencoder again for forward propagation, and calculate the reconstruction error of each normal sample, i.e. the value of the loss function . Collect the reconstruction errors of all normal samples and calculate their mean μ and standard deviation σ.
[0153] Step 4.5: Based on the statistical characteristics of the normal value reconstruction error, set the dynamic threshold θ as:
[0154] θ = μ + k·σ
[0155] where k is an adjustable coefficient, which is set according to the sensitivity requirements of the actual application scenario, and generally takes a value range of [2, 3] to cover the fluctuation range of the reconstruction error of most normal data. When the reconstruction error of a new test sample exceeds the dynamic threshold θ, the sample is determined to be abnormal data; otherwise, it is determined to be normal data.
[0156] The above examples are only used to illustrate the design idea and characteristics of the present application, and the purpose is to enable those skilled in the art to understand the content of the present application and implement it, and the protection scope of the present application is not limited to the above examples. Therefore, any equivalent changes or modifications made in accordance with the principles and design ideas disclosed by the present application are within the scope of protection of the present application.
Claims
1. A manufacturing workshop time series anomaly detection method based on dual-channel feature fusion, characterized by: The steps include: Step 1: Obtain multiple sensor data from equipment in the manufacturing workshop to form a multivariate time series dataset and preprocess the data; Step 2: Perform dual-channel feature extraction on the preprocessed data. One channel uses fast Fourier transform to extract spatial features, and the other channel uses temporal convolutional network to extract temporal features. Step 3: Use the gated recurrent unit (GRU) to perform temporal correlation modeling on the extracted dual-channel features, fuse the extracted features, and obtain a fused feature representation; Step 4: Construct an autoencoder based on the fused feature representation, use the autoencoder for anomaly detection, and set a dynamic threshold based on the reconstruction error distribution; samples that exceed the dynamic threshold during detection are judged as anomalies.
2. The method for detecting anomalies in manufacturing workshop time series based on dual-channel feature fusion according to claim 1 is characterized in that: The method for extracting spatial features using fast Fourier transform in step 2 is: Step 2.1.1: Split the preprocessed time series data into overlapping frames using a sliding window method, apply a Hanning window to each frame of data, and the windowed data is x seg (k,t); Step 2.1.2: For the windowed data x seg (k, t) is fast Fourier transformed to obtain the complex amplitude X(k, f) and amplitude; Step 2.1.3: Calculate the spectral entropy H based on the complex amplitude to quantify the complexity of the signal; Step 2.1.4: Input the extracted frequency amplitude vector into the 1D convolution layer to obtain the output feature vector C out (i) Apply the ReLU activation function to the convolution output; input the activated features into the fully connected layer to obtain the output result H after the fully connected layer. fc ; Generate normalized frequency band attention weights through Sigmoid function; Step 2.1.5: Fuse the spectral entropy to the weighted features with a fixed weight λ = 0.2, denoted as: Then the fusion to weighted features is processed through the fully connected layer to obtain F' sqace ∈R B×D ; Among them, F space is the spatial eigenvector, α i is the frequency band attention weight, is the amplitude of the i-th frequency point, H(k) is the spectral entropy of the current signal segment; B is the batch size, and D is the feature dimension.
3. The method for detecting anomalies in manufacturing workshop time series based on dual-channel feature fusion according to claim 1 is characterized in that: The method of extracting time-oriented features using the temporal convolutional network in step 2 is: Step 2.2.1: For the preprocessed sensor data X, construct a three-dimensional tensor X by sliding the window ' ; Step 2.2.2: Use a one-dimensional convolution kernel with causal constraints to extract time dimension features. The causal convolution operation is expressed as: Among them, W (1) (τ) is the weight matrix of the first layer convolution kernel at the offset τ, b (1) is the bias term, τ is the offset index of the convolution kernel sliding window, t represents the current time position, X'(t-τ) is the slice of the input tensor at time step t-τ, H (1) (t) is the output feature of the first layer of causal convolution at time step t, and k is the convolution kernel size; Step 2.2.3: Construct a multi-layer dilated convolution structure. The output of the m-th layer dilated convolution is calculated as: Among them, H (m) (t) is the output feature of the m-th layer causal convolution at time step t, τ is the offset index of the convolution kernel sliding window, W (m) τ is the weight matrix of the convolution kernel of the mth layer at the offset τ, 2 m-1 is the expansion factor of the mth layer, H (m-1) (t-τ·2 m-1 ) is the m-1th layer at time t-τ·2 m-1 The output features of b (m) is the bias term of the mth layer; Step 2.2.4: Introduce residual blocks in the adjacent dilated convolution layer. The residual connection structure calculation process is to dilate the convolution output H (m) After layer normalization and random inactivation, the intermediate feature Z is generated by the ReLU activation function, which is recorded as: Z=ReLU(H (m) +Dropout(LayerNorm(H (m )))) F out =Conv1D Among them, Z is the intermediate feature generated by the residual connection structure, H (m) is the output feature of the m-th layer dilated convolution, Conv1D is a 1×1 convolution operation, F out is the final output of the residual module, Dropout is the random inactivation of some neurons, and LayerNorm is the layer normalization operation; Step 2.2.5: By cascading multiple layers of dilated causal convolution and residual connections, the final output is a high-order temporal feature representation: Among them, TCN(X') is the overall processing process of the temporal convolutional network on the input tensor X'. Represents cascade along the feature channel dimension, represents the output features of the i-th layer residual module, M is the total number of network layers, F time is the fused high-order temporal feature tensor, F time .
4. The method for detecting anomalies in manufacturing workshop time series based on dual-channel feature fusion according to claim 3 is characterized in that: Step 3 includes the following steps: Step 3.1: Pass the spatial feature F' mapped by the fully connected layer space , replicated along the time dimension to form a spatial tensor of the same dimension as the time feature: F‘’ space =Repeat(F’ space ,T) The frequency domain features F'' of the same dimension space and time domain features F time Splicing is performed to form a fusion feature vector, which is expressed as: F=[F‘’ space ;F time ] Step 3.2: Input the concatenated feature F into the GRU network, process F through the gating mechanism, and output the hidden state sequence h t ; Step 3.3: Average pool the hidden state sequence output by GRU to capture the global features of the entire sequence as the final fusion feature representation: Where T is the time step, F final is the final fusion feature.
5. The method for detecting anomalies in manufacturing workshop time series based on dual-channel feature fusion according to claim 4 is characterized in that: Step 4 includes the following steps: Step 4.1: The final fusion feature F generated in step 3 final As input, build the encoder; Step 4.2: Construct a decoder to reconstruct the latent space representation z back to the original fused feature space; Step 4.3: From the preprocessed multivariate time series data, filter out the data samples marked as normal to form a normal data set; use the fusion feature vector F of the normal data set as the final As input, the autoencoder is trained and the mean square error is used as the loss function to measure the reconstructed features. With the original feature F final the differences between; Step 4.4: After completing the training of the autoencoder, use the normal data set to propagate forward through the autoencoder again and calculate the reconstruction error of each normal sample; Collect the reconstruction errors of all normal samples and calculate their mean μ and standard deviation σ; Step 4.5: Based on the statistical characteristics of the normal numerical reconstruction error, set the dynamic threshold θ. When the reconstruction error of the new test sample is When the dynamic threshold θ is exceeded, the sample is determined to be abnormal data; otherwise, it is determined to be normal data.
6. The method for detecting anomalies in manufacturing workshop time series based on dual-channel feature fusion according to claim 5 is characterized in that: The dynamic threshold θ is: θ=μ+k·σ Wherein, k is an adjustable coefficient.
7. The method for detecting anomalies in manufacturing workshop time series based on dual-channel feature fusion according to claim 5, characterized in that: The loss function formula is: Among them, D is the dimension of the fused feature vector, i is the index variable, is the true value of the i-th data point, is the predicted value of the i-th data point.
8. The method for detecting anomalies in manufacturing workshop time series based on dual-channel feature fusion according to claim 6 is characterized in that: The adjustable coefficient k ranges from [2,3].
9. The method for detecting anomalies in manufacturing workshop time series based on dual-channel feature fusion according to claim 1, characterized in that: The preprocessing in step 1 includes cleaning and normalizing the data.
10. The method for detecting anomalies in manufacturing workshop time series based on dual-channel feature fusion according to claim 4, characterized in that: The median filter method is used to clean the data to remove noise interference.