Anomaly Detection Method Combining Deep Contrastive Learning and Density Clustering
By combining deep contrast learning and density clustering methods, the vibration signals of mechanical equipment are monitored in real time, self-supervised learning and projected into low-dimensional space, and clustered using the minimum mutation distance and DBSCAN algorithm, the problem of low accuracy of mechanical fault detection and relying on manual experience in the existing technology is solved, and efficient and accurate fault detection is achieved.
Patent Information
- Application Number
- CN202310676113.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-08
- Publication Date
- 2025-07-08
- Estimated Expiration
- 2043-06-08
AI Technical Summary
The existing data-driven mechanical fault detection methods have problems such as low accuracy, over-reliance on manual experience, high misjudgment rate and misjudgment rate in equipment operating status monitoring, and how to effectively combine deep comparison learning and density clustering methods have not yet been solved.
The method of combining deep contrast learning and density clustering is adopted to monitor the vibration signals of mechanical equipment in real time, and self-supervised learning is used to extract high-dimensional feature information, and T-distributed random neighbor embedding is used to project it into low-dimensional space. The clustering radius is calculated based on the minimum mutation distance, and the clustering process is used to automatically detect fault categories.
It improves the accuracy and real-timeness of fault detection, avoids the tedious process of traditional methods, and realizes efficient fault detection. The parameter setting method is efficient and effective, giving full play to the advantages of their respective algorithms.
Smart Images

Figure CN116680643B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of mechanical fault detection, and relates to an anomaly detection method combining deep contrast learning and density clustering. Background Art
[0002] In recent years, the automation and integration levels of mechanical equipment have been continuously improved. Characteristics such as large scale, long time, and high frequency have led to a significant increase in the amount of data available for monitoring the operating state of the equipment, providing a basis for the application of data-driven anomaly detection methods and gradually becoming a new trend. Data-driven anomaly detection methods can effectively avoid problems such as low accuracy, excessive dependence on manual experience, and high false positive and false negative rates existing in traditional anomaly detection methods.
[0003] The industrial field environment is variable, and the composition of mechanical equipment is complex, resulting in a variety of possible fault types. Any data-driven condition monitoring method cannot master the characteristic information of all fault types. Therefore, improving the accuracy of fault detection by the model when only normal samples are known and reducing the complexity of the fault detection process are still of great significance in the field of fault detection.
[0004] The Density-Based Spatial Clustering of Applications with Noise (DBSCAN) method with noise is an unsupervised clustering method. When using DBSCAN for clustering, the number of clusters does not need to be input, nor is the label information of the samples required. The category is only divided according to the density size and is not affected by the shape of the sample distribution in space. Contrast learning is a self-supervised deep learning algorithm, and its advantage is that the labels of the samples do not need to be used during the training of the network. Both have certain advantages for fault detection, but there are still many defects in the two technologies themselves that need to be improved, and how to effectively combine the two is also an urgent problem for those skilled in the art to solve. Summary of the Invention
[0005] In view of this, the purpose of the present invention is to provide an anomaly detection method combining deep contrast learning and density clustering.
[0006] To achieve the above purpose, the present invention provides the following technical solutions:
[0007] An anomaly detection method combining deep contrast learning and density clustering, the method comprising the following steps:
[0008] S1: Real-time monitor the working condition information during the operation of the mechanical equipment, and collect the vibration signal data of the equipment by using an acceleration sensor. The vibration signal data is the vibration signal in one or more directions among the x-axis, y-axis, and z-axis directions of the equipment;
[0009] S2: Simultaneously perform self-supervised learning on the collected real-time vibration signal data and the vibration signal data in the normal state using a contrastive learning network, and respectively extract the high-dimensional feature information contained in the vibration signal data samples;
[0010] S3: Use t-distributed stochastic neighbor embedding to project the high-dimensional feature information into a low-dimensional feature space;
[0011] S4: Calculate the clustering radius using a method based on the minimum mutation distance, and perform clustering processing on the vibration signal data samples in the low-dimensional feature space using a density-based clustering algorithm;
[0012] S5: If there are multiple clusters in the low-dimensional feature space, it indicates that the device has a fault; otherwise, it indicates that the device is normal.
[0013] The beneficial effects of the present invention are as follows: The fault detection method proposed by the present invention effectively avoids problems such as the over-reliance on manual experience and the cumbersome process of traditional fault detection methods, and can achieve efficient fault detection. And the parameter setting method based on the minimum mutation distance included in the invention can automatically set the parameters used in the clustering process according to the data characteristics, and this parameter setting method is efficient and effective; it gives full play to the respective advantages of the contrastive learning algorithm and the DBSCAN algorithm, and improves the accuracy and real-time performance of fault detection.
[0014] Other advantages, objectives and features of the present invention will be described to some extent in the subsequent description, and to some extent, will be obvious to those skilled in the art based on the study of the following text, or can be taught from the practice of the present invention. The objectives and other advantages of the present invention can be realized and obtained through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be described in detail with preference in conjunction with the accompanying drawings, where:
[0016] Figure 1 is the framework diagram of the anomaly detection method combining deep contrastive learning and density clustering according to the present invention;
[0017] Figure 2 is the flow chart of the anomaly detection method combining deep contrastive learning and density clustering according to the present invention; DETAILED DESCRIPTION OF THE EMBODIMENTS
[0018] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0019] The following uses specific specific examples to illustrate the implementation manners of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific implementation manners. Various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the drawings provided in the following embodiments only illustrate the basic concept of the present invention in a schematic manner. Without conflict, the following embodiments and the features in the embodiments can be combined with each other.
[0020] Among them, the drawings are only for illustrative purposes, showing only schematic diagrams, rather than physical diagrams, and should not be construed as a limitation to the present invention; in order to better illustrate the embodiments of the present invention, some components in the drawings will be omitted, enlarged or reduced, which do not represent the sizes of actual products; for those skilled in the art, it is understandable that some well-known structures and their descriptions in the drawings may be omitted.
[0021] The present invention is an anomaly detection method combining deep contrast learning and density clustering. The overall framework is as Figure 1 shown. First, contrast learning is used to extract features from the collected mechanical state monitoring signals and normal samples, and (t-Distributed Stochastic Neighbor Embedding, t-SNE) is used to retain these higher-dimensional features to the low-dimensional space to the greatest extent; then the DBSCAN algorithm is used for fault detection. After the low-dimensional features are used for DBSCAN, the present invention can automatically detect clustering clusters and can effectively detect sample of fault categories other than normal. In the process of using the DBSCAN algorithm, the present invention also includes a parameter setting method based on the minimum mutation distance, which can automatically set the parameters used in the clustering process according to the data characteristics.
[0022] Figure 2 is the flow chart of the anomaly detection method combining deep contrast learning and density clustering in the embodiments of the present invention, as Figure 2 shown. The fault detection method includes the following steps:
[0023] S1: Monitor the working condition information during the operation of mechanical equipment in real time, and collect the vibration signal data of the equipment using an acceleration sensor. The vibration signal data is the vibration signal in one or more directions among the x-axis, y-axis, and z-axis directions of the equipment.
[0024] In the embodiment of the present invention, five kinds of fault vibration signals in a certain gearbox fault data can be collected in real time, including: outer ring fault, inner ring fault, combined fault, tooth root corrosion fault, and tooth root fracture fault.
[0025] S2: Use a contrastive learning network to perform self-supervised learning on the collected real-time vibration signal data and the vibration signal data in the normal state at the same time, and extract the high-dimensional feature information contained in the vibration signal data samples respectively.
[0026] In the embodiment of the present invention, it is necessary to perform self-supervised learning on the real-time collected vibration signal data and the vibration signal data in the normal state at the same time. If these data have different types, it means that the type of the real-time collected vibration signal data is different from that of the vibration signal data in the normal state, that is, the real-time collected vibration signal data is not the vibration signal data in the normal state, and it can be concluded that the equipment has failed at this time.
[0027] In the embodiment of the present invention, the step S2 includes:
[0028] S21: Perform data augmentation on the vibration signal data by amplitude scaling and noise addition, adjust the amplitude ratio, and change the size of the vibration signal data in the window by multiplying by a random scalar.
[0029] In the embodiment of the present invention, make full use of the Gaussian distribution of the vibration signal data to expand these data, enhance the generalization ability of the network model, and learn more robust feature information; specifically, it can include the following:
[0030] Determine the proportionality coefficient according to the Gaussian distribution of the vibration signal data, and obtain the enhanced vibration signal data by multiplying the proportionality coefficient by the vibration signal data in the window, which can be expressed as:
[0031]
[0032] Determine the Gaussian noise according to the Gaussian distribution of the vibration signal data, and obtain the enhanced vibration signal data by summing the Gaussian noise and the vibration signal data in the window, which can be expressed as:
[0033]
[0034] Among them, is the enhanced vibration signal data, X is the original vibration signal data, and the proportionality coefficient s follows a Gaussian distribution s ~ N(1,σs ) is generated, and the Gaussian noise G is generated according to the Gaussian distribution G~N(0,σ n ).
[0035] S22: Encode the enhanced vibration signal data, and map the encoded vibration signal data to a high-dimensional feature space through a projection head;
[0036] In the embodiment of the present invention, the projection head may include a two-layer perceptron; use an encoding network to encode the enhanced vibration signal data, and use the first-layer perceptron W (1) Perform perceptual processing on the encoded vibration signal data h k , and output a preliminary feature vector; perform non-linear processing on the preliminary feature vector using a ReLU non-linear layer, and output an intermediate feature vector; use the second-layer perceptron W (2) Perform perceptual processing on the intermediate feature vector, and output a high-dimensional feature vector of the vibration signal data; specifically, it can be expressed as:
[0037] h k =f(x k )
[0038] z k =g(h k )=W (2) σ(W (1) h k )
[0039] Among them, x k represents the enhanced vibration signal data, f(·) is a ResNet50 encoding network, h k represents the encoded vibration signal data, g(·) is a neural network projection head, its structure is a two-layer perceptron, where σ is a ReLU non-linear layer, and W is a multi-layer perceptron.
[0040] S23: Input the vibration signal data in the high-dimensional feature space into the contrast learning network, and optimize the contrast learning network using a contrast loss function.
[0041] In the embodiment of the present invention, the loss function in step S23 includes:
[0042]
[0043] Among them, l i,j represents the loss between the i-th high-dimensional feature information z i and the j-th high-dimensional feature information z j , 1 [k≠i]∈{0,1} is the indicator function, which is 1 when k≠i, N represents the total number of high-dimensional feature information in the high-dimensional feature space; τ is an adjustable parameter, sim(·,·) represents the cosine similarity, z j is the i-th high-dimensional feature information z i The positive sample, z w is the i-th high-dimensional feature information z i Negative samples.
[0044] In this embodiment, based on the above loss function, the representations of the encoder and the projection head will change over time, and the obtained representation will place similar samples closer in space. After the training is completed, the projection head will be discarded and only the encoder will be retained to obtain the high-dimensional feature information contained in the sample.
[0045] S3: Projecting the high-dimensional feature information into a low-dimensional feature space using T-distributed random neighbor embedding;
[0046] In the embodiment of the present invention, t-SNE will perform multiple iterative operations on the data to preserve the feature information of the data in the low-dimensional space to the high-dimensional space as much as possible. Finally, through the combination of contrastive learning and t-SNE, the feature information contained in the original data is preserved in the low-dimensional space to the greatest extent; wherein, the cost function used in step S3 to project the high-dimensional feature information into the low-dimensional feature space using T-distributed random neighbor embedding is expressed as:
[0047]
[0048] Among them, C represents the cost function; KL represents the divergence loss; P||Q represents the high-dimensional feature space and the low-dimensional feature space respectively; p ij Represents i high-dimensional feature information z i and the jth high-dimensional feature information z j The joint density probability in the high-dimensional feature space, q ij Represents i high-dimensional feature information z i and the jth high-dimensional feature information z j Joint density probability in low-dimensional feature space.
[0049] S4: Calculate the cluster radius using a method based on minimum mutation distance, and cluster the vibration signal data samples in the low-dimensional feature space using a density-based clustering algorithm;
[0050] In the embodiment of the present invention, the step S4 of calculating the cluster radius using the method based on the minimum mutation distance includes:
[0051] S41: Calculate the Euclidean distance from each sample point in the sample data set X in the low-dimensional feature space to other sample points, and obtain the sample distance set DIST(X); where, the sample distance set DIST(X) can be specifically expressed as:
[0052] DIST(X) = {dist(A i , A j )|1 ≤ i ≤ n, 1 ≤ j ≤ n, i ≠ j}
[0053] In the formula, n is the number of samples included in the data set X; DIST(X) is the sample distance set of the data set X, and its dimension is n×(n - 1); dist(A i , A j ) is the Euclidean distance from sample A i to sample A j .
[0054] It can be understood that the sample data set X here is the data set composed of vibration signal data samples, and the vibration sample data samples include the vibration signal data collected in real time, the vibration signal data in the normal state, and the data obtained by enhancing these vibration signal data; each vibration sample data is a sample, and each sample exists in the low-dimensional sample space in the form of a sample point.
[0055] S42: Arrange the Euclidean distances from each sample point in the sample distance set DIST(X) to other sample points in ascending order to obtain the sample ascending set RDIST(X);
[0056] S43: Detect the mutation points for each sample distance set corresponding to the sample points in the sample ascending set RDIST(X), record the corresponding mutation distance length when mutation occurs, and obtain the sample distance set chang(X); where, the sample distance set chang(X) = {x1, x2,....x w}}, assuming there are w mutation samples here, corresponding to w mutation distances. In the actual application process of the embodiment of the present invention, when dist(A i , A j+1 ) - dist(A i , A j ) ≥ 1 in the sample ascending set RDIST(X), it is determined that point A j+1 is a mutation sample point, and its corresponding distance dist(A i , A j+1 ) is the mutation distance length.
[0057] In the preferred embodiment of the present invention, this embodiment further includes removing the data generated by the noise points in the sample data set X from the sample distance set chang(X).
[0058] S44: Select the minimum value x from the sample distance set chang(X). min Set it as the clustering radius, which is the neighborhood radius Eps of the density-based clustering algorithm.
[0059] In the embodiment of the present invention, the clustering process of the vibration signal data samples in the low-dimensional feature space by using the density-based clustering algorithm includes:
[0060] S45: Detect the sample point object p in the database that has not been checked. If the sample point object p has not been processed, that is, it has not been classified into a certain cluster or marked as noise, then check the sample point objects within its neighborhood radius Eps. If the number of neighborhood sample objects is not less than the minimum number of included sample points minPts, then establish a new cluster C and add all the sample point objects therein to the candidate set N;
[0061] S46: For all the sample point objects q in the candidate set N that have not been processed, check the sample point objects within its neighborhood radius Eps. If it contains at least minPts sample point objects, then add these neighborhood sample point objects to the candidate set N; if the sample point object q has not been classified into any cluster, then add the sample point object q to the new cluster C;
[0062] S47: Repeat step S46, continue to check the unprocessed sample point objects in the candidate set N, and set the current candidate set N to be empty;
[0063] S48: Repeat steps S45 - S47 until all sample point objects are classified into a certain cluster or marked as noise.
[0064] S5: If there are multiple clusters in the low-dimensional feature space, it indicates that the device has a fault; otherwise, it indicates that the device is normal.
[0065] In the embodiment of the present invention, by judging the number of clusters of the vibration sample data in the low-dimensional sample space to determine whether there are clusters other than the normal state. If there are multiple clusters, it can indicate that there are abnormal vibration signal data in these data, indicating that the device has a fault.
[0066] The present invention effectively avoids problems such as the traditional fault detection method relying too much on manual experience and the process being cumbersome. Contrast learning and t-SNE map the original data to the low-dimensional feature space. The combination of the two can enable high-dimensional data to still retain the feature information contained in the high-dimensional space in the low-dimensional space. The parameter setting method of the minimum mutation distance can automatically set parameters according to data features, and DBSCAN can automatically detect abnormal samples in the space.
[0067] Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing relevant hardware through a program, and the program can be stored in a computer-readable storage medium. The storage medium can include: ROM, RAM, magnetic disk, optical disk, etc.
[0068] Although the embodiments of the present invention have been shown and described, those of ordinary skill in the art can understand that various changes, modifications, substitutions, and variations can be made to these embodiments without departing from the principles and spirit of the present invention. The scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. An anomaly detection method combining deep contrast learning and density clustering, characterized in that The method includes the following steps: S1: Monitor the working condition information during the operation of mechanical equipment in real time, and collect equipment vibration signal data using an acceleration sensor. The vibration signal data is the vibration signal in one or more directions among the x-axis, y-axis, and z-axis directions of the equipment. S2: Use a contrastive learning network to perform self-supervised learning on the collected real-time vibration signal data and the vibration signal data in the normal state simultaneously, and extract the high-dimensional feature information contained in the vibration signal data samples respectively. The step S2 includes: S21: Perform data augmentation on the vibration signal data by amplitude scaling and noise addition, adjust the amplitude ratio, and change the size of the vibration signal data in the window by multiplying by a random scalar. S22: Encode the augmented vibration signal data, and map the encoded vibration signal data to a high-dimensional feature space through a projection head. S23: Input the vibration signal data in the high-dimensional feature space into the contrastive learning network, and optimize the contrastive learning network using a contrastive loss function. S3: Use t-distributed stochastic neighbor embedding to project the high-dimensional feature information into a low-dimensional feature space. S4: Calculate the clustering radius using a method based on the minimum mutation distance, and perform clustering processing on the vibration signal data samples in the low-dimensional feature space using a density-based clustering algorithm. The step of calculating the clustering radius using the method based on the minimum mutation distance in S4 includes: S41: Calculate the Euclidean distance from each sample point in the sample data set X in the low-dimensional feature space to other sample points, and obtain a sample distance set DIST(X). S42: Sort the Euclidean distances from each sample point to other sample points in the sample distance set DIST(X) in ascending order to obtain a sample ascending set RDIST(X). S43: Detect mutation points for the sample distance set corresponding to each sample point in the sample ascending set RDIST(X), record the corresponding mutation distance length when mutation occurs, and obtain a sample distance set chang(X). S44: Select the minimum value in the sample distance set chang(X) and set it as the clustering radius, which is the neighborhood radius Eps of the density-based clustering algorithm. S5: If there are multiple clusters in the low-dimensional feature space, it indicates that the equipment has a fault; otherwise, it indicates that the equipment is normal.
2. The anomaly detection method combining deep contrast learning and density clustering according to claim 1, wherein: The step S21 includes: Determine a proportionality coefficient according to the Gaussian distribution of the vibration signal data, and obtain the augmented vibration signal data by multiplying the proportionality coefficient by the vibration signal data in the window. Determine Gaussian noise according to the Gaussian distribution of the vibration signal data, and obtain the augmented vibration signal data by summing the Gaussian noise and the vibration signal data in the window.
3. The anomaly detection method combining deep contrast learning and density clustering according to claim 1, characterized in that: The step S22 includes: Use an encoding network to encode the augmented vibration signal data, perform perception processing on the encoded vibration signal data using a first-layer perceptron, and output a preliminary feature vector; perform non-linear processing on the preliminary feature vector using a ReLU non-linear layer, and output an intermediate feature vector; perform perception processing on the intermediate feature vector using a second-layer perceptron, and output a high-dimensional feature vector of the vibration signal data.
4. The anomaly detection method combining deep contrast learning and density clustering according to claim 1, characterized in that: The loss function in the step S23 includes: where, l i,j represents the loss between the i-th high-dimensional feature information z i and the j-th high-dimensional feature information z j . 1 [k≠i] ∈{0,1} is an indicator function that has a value of 1 when k≠i. N represents the total number of high-dimensional feature information in the high-dimensional feature space; τ is an adjustable parameter, sim(·,·) represents the cosine similarity, z j is the positive sample of the i-th high-dimensional feature information z i , and z w is the negative sample of the i-th high-dimensional feature information z i .
5. The anomaly detection method combining deep contrast learning and density clustering according to claim 1, characterized in that: The cost function adopted in the step S3 to project the high-dimensional feature information into the low-dimensional feature space by using the t-distributed stochastic neighbor embedding includes: Among them, C represents the cost function; p ij represents the joint density probability of the i-th high-dimensional feature information z i and the j-th high-dimensional feature information z j in the high-dimensional feature space, and q ij represents the joint density probability of the i-th high-dimensional feature information z i and the j-th high-dimensional feature information z j in the low-dimensional feature space.
6. The anomaly detection method combining deep contrast learning and density clustering according to claim 1, characterized in that: The step S4 further includes the data generated by removing the noise points in the sample data set X from the sample distance set.
7. An anomaly detection method combining deep contrast learning and density clustering according to claim 1 or 6, characterized in that: The clustering process of the vibration signal data samples in the low-dimensional feature space by using the density-based clustering algorithm includes: S45: Detect the sample point object p that has not been checked in the database. If the sample point object p has not been processed, that is, it has not been classified into a certain cluster or marked as noise, then check the sample point objects within its neighborhood radius Eps. If the number of neighborhood sample objects is not less than the minimum number of included sample points minPts, a new cluster C is established, and all the sample point objects therein are added to the candidate set N; S46: For all the sample point objects q that have not been processed in the candidate set N, check the sample point objects within its neighborhood radius Eps. If there are at least minPts sample point objects, these neighborhood sample point objects are added to the candidate set N; if the sample point object q has not been classified into any cluster, the sample point object q is added to the new cluster C; S47: Repeat the step S46, continue to check the unprocessed sample point objects in the candidate set N, and set the current candidate set N to be empty; S48: Repeat the steps S45 to S47 until all the sample point objects are classified into a certain cluster or marked as noise.