Mechanical fault detection method and system based on time sequence fragment comparison self-supervision
Through the method based on time-sequence segment comparison self-supervision, high-dimensional characterization of rotary machinery equipment is extracted, which solves the problems of early fault detection and unlabeled data learning, and realizes accurate abnormal detection of rotary machinery, improving the accuracy of fault detection and stability.
Patent Information
- Application Number
- CN202411279300.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-12
- Publication Date
- 2024-11-15
AI Technical Summary
The prior art has difficulty in detecting early faults in rotary mechanical fault detection, especially under unlabeled data conditions, and traditional methods have limited ability to process time sequence data, resulting in limited detection accuracy and efficiency.
Using a mechanical fault detection method based on time-series segment comparison self-supervised, the mechanical equipment signal data is obtained, and enhanced sample pairs are generated through mask processing. High-dimensional characterization is extracted using a time-series segment encoder, combined with The linear decoder is reconstructed and sets a dynamic threshold for fault detection.
This method does not require a large amount of labeling data, improves sensitivity to early failures and detection accuracy, is suitable for scenarios with sparse data or missing tags, reduces calculation complexity, enhances the universality and robustness of the model, and can be discovered in a timely manner The initial state of failure of mechanical equipment.
Smart Images

Figure CN118961174A_ABST
Abstract
Description
Background Art
[0002] In modern industrial production, the stability and reliability of rotating machinery and equipment are crucial to ensuring production safety and efficiency. During operation, these equipment may experience various failures due to factors such as wear, corrosion, and load changes. Therefore, real-time monitoring and timely fault diagnosis of rotating machinery and equipment are of great significance for preventing unexpected downtime, reducing maintenance costs, and extending the service life of equipment.
[0003] Traditional methods for detecting rotating machinery faults mainly rely on signal processing methods such as time domain and frequency domain. By analyzing time series data such as vibration signals and acoustic emission signals of mechanical equipment, technicians can identify signs of abnormalities. However, these methods have certain limitations: first, they usually require a high level of expertise and rich experience accumulation, and the threshold is high; second, the accuracy and efficiency of traditional methods may be limited when processing complex or changeable signals; in addition, the signals of early faults are often weak and hidden, and it is still difficult to directly judge them through existing mainstream methods.
[0004] With the development of sensor technology and data acquisition technology, the amount of monitoring data of mechanical equipment has increased dramatically, which provides a richer source of information for fault detection. However, the processing and analysis of this data also brings new challenges. Abnormal data is often scarce in practical applications, resulting in an unbalanced distribution of data types and insufficient number of samples. In addition, due to the lack of early fault data, these data are often not labeled, making traditional supervised learning methods difficult to apply.
[0005] In recent years, deep learning has been introduced into the field of fault detection, aiming to improve the accuracy and automation of detection by building data-driven models. Deep learning methods, especially convolutional neural networks (CNNs) and recurrent neural networks (RNNs), have shown powerful feature extraction and pattern recognition capabilities in many fields. However, these methods also face some challenges when processing time series data. For example, deep learning models usually require a large amount of labeled data for training, while in practical applications, the acquisition cost of labeled data is high and it is difficult to cover all fault types and working conditions. In addition, the deep model has a complex structure and many parameters, which leads to long model training time and high demand for computing resources.
[0006] To overcome the above challenges, researchers have begun to explore self-supervised learning and semi-supervised learning methods to use unlabeled data for model training. At the same time, in order to improve the model's ability to process time series data, some studies have proposed methods that combine time domain and frequency domain analysis, as well as strategies that use autoencoders for feature extraction and dimensionality reduction. These methods have improved the performance of fault detection to a certain extent, but there are still some problems, such as insufficient sensitivity to abnormal data and poor adaptability to non-steady-state conditions.
[0007] Therefore, developing a rotating machinery anomaly detection method that can effectively process time series data, especially with advantages in early fault detection and unlabeled data learning, is of great practical significance for improving the safety and efficiency of industrial production. Summary of the invention
[0008] The technical problem to be solved by the present invention is to provide a mechanical fault detection method and system based on time series segment comparison self-supervision in response to the above-mentioned deficiencies in the prior art, so as to solve the technical problem of the lack of early fault detection methods for industrial machinery, realize self-supervised fault detection under unlabeled data, and adapt to the actual situation where fault samples in industrial field data are scarce or labels are missing.
[0009] The present invention adopts the following technical solutions:
[0010] A mechanical fault detection method based on time series segment comparison self-supervision includes the following steps:
[0011] S1. Obtain signal data collected by mechanical equipment sensors;
[0012] S2, converting the signal data obtained in step S1 into multiple segments of equal length, and generating enhanced sample pairs by selecting two different segments through mask processing;
[0013] S3, comparing the enhanced sample pair obtained in step S2 to the input time series segment in the self-supervised fault detection model, and extracting a high-dimensional representation of the data through a time series segment encoder;
[0014] S4, inputting the high-dimensional representation obtained in step S3 into a linear decoder to obtain reconstructed data;
[0015] S5. Set a threshold for abnormality determination based on the statistical value of the reconstruction loss of historical data; mark the segment of the reconstructed data obtained in step S4 that exceeds the set threshold as a fault state segment, and output the fault detection result.
[0016] Preferably, in step S1, the signal data is time series data, including vibration signals, acoustic emission signals, and current signals.
[0017] Preferably, the time series data includes the number of data batches, the number of data variables, the number of segments into which the data is divided, and the length of the segments.
[0018] Preferably, in step S2, the segment division divides the data into n unit time lengths in total, and the length l of the segment is determined according to the working frequency of the rotating machinery. The segment length is more than twice the observation frequency, and the step length is s. The step length is set to s=l, that is, the segments are divided without overlapping, and the part of the time series segment that is less than l is supplemented into segments of equal length through a one-dimensional pooling layer, or the redundant part at the beginning or end of the sample is discarded, and the number of divided segments is p; two overlapping subsequences of random length are selected on each sample, and the overlapping part is set to half of the number of segments p, and the part outside the length is selected for zero masking operation, that is, the original value at the specified position of the data is covered with 0 to obtain two different masked samples.
[0019] Preferably, the segments are normalized, and the process includes normalizing each time segment using zero mean and unit standard deviation, specifically:
[0020]
[0021] Among them, x (i) is the input time series fragment, is the mean of each variable in the time series segment, is the standard deviation of each variable in the time series segment, ∈ is the residual term, β k and γ k are learnable mapping parameters.
[0022] Preferably, in step S3, the temporal segment contrast self-supervised fault detection model includes a temporal segment encoder and a segment level contrast learning strategy;
[0023] In the temporal segment encoder, the embedding extraction layer is used to convert the input data from the segment length l to the hidden layer dimension d. The backbone of the temporal segment encoder contains n transformer blocks, including a multi-head attention mechanism layer, the first residual connection and normalization layer, a feedforward network layer, a second residual connection and normalization layer. The transformer block is used to extract high-dimensional representation features of the mechanical equipment sensor signal data;
[0024] The fragment-level contrastive learning strategy is used to input the enhanced sample pairs obtained by mask processing into the temporal fragment encoder to learn their respective feature representations. The temporal similarity and fragment similarity are set as the loss function, so that each sample realizes two feature extractions through different incomplete subsequences to train the model.
[0025] Preferably, the transformer block uses a common self-attention mechanism, including the query matrix Key Matrix Sum Matrix Use scaled attention to get the output Right now:
[0026]
[0027] Among them, d k is the dimension of the key matrix.
[0028] Preferably, the segment similarity and time series similarity Specifically:
[0029]
[0030] in, is the anchor of fragment i at position j, To compare the representation of samples at the same location, are the representations of different fragments and positions of the same sample and the comparison sample, respectively, and sim(·) is the similarity calculation method.
[0031] Preferably, in step S5, the threshold value n is:
[0032] η=μ+k*σ
[0033] Here, μ is the mean, σ is the standard deviation, and k is a constant that controls the strictness of anomaly detection.
[0034] In a second aspect, an embodiment of the present invention provides a mechanical fault detection system based on time series segment comparison self-supervision, comprising:
[0035] Data module, to obtain signal data collected by mechanical equipment sensors;
[0036] The conversion module converts the signal data into multiple segments of equal length and generates enhanced sample pairs by selecting different segments through mask processing twice;
[0037] The extraction module compares the augmented sample pairs to the input time series segments in the self-supervised fault detection model and extracts the high-dimensional representation of the data through the time series segment encoder;
[0038] The reconstruction module inputs the high-dimensional representation into the linear decoder to obtain the reconstructed data;
[0039] The detection module sets a threshold for abnormal judgment based on the statistical value of the reconstruction loss of historical data; marks the fragments of the reconstructed data that exceed the set threshold as fault state fragments, and outputs the fault detection results.
[0040] In a third aspect, a computer device comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned mechanical fault detection method based on time sequence segment comparison and self-supervision when executing the computer program.
[0041] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, including a computer program, which, when executed by a processor, implements the steps of the above-mentioned mechanical fault detection method based on time sequence segment comparison and self-supervision.
[0042] Compared with the prior art, the present invention has at least the following beneficial effects:
[0043] A mechanical fault detection method based on time series segment comparison self-supervision does not rely on a large amount of labeled data (i.e., clear labels of fault samples and normal samples), but uses the time series characteristics and structural information of the signal data itself to automatically extract fault features through self-supervised learning. This greatly reduces the dependence on manual annotation, improves the flexibility and scalability of the method, and is especially suitable for scenarios where it is difficult to obtain a large amount of labeled data; by generating enhanced sample pairs through mask processing of selecting different segments twice, this method not only increases the amount of training data for the model, but also promotes the sensitivity of the model to small changes in signal data. This data enhancement technology helps the model learn more generalized and robust feature representations, improving the accuracy and stability of fault detection; using the time series segment encoder to extract high-dimensional representations of signal segments, fully considering the time series characteristics of the data. This processing method can capture the dynamic change information and implicit time series patterns in the signal, providing a richer and more effective feature basis for subsequent fault detection; reconstructing the original signal through a linear decoder not only reduces the computational complexity of the model compared to complex nonlinear decoders, but also makes the model easier to train and optimize. At the same time, the linear decoder also helps to maintain the original structural information of the data, so that the reconstruction loss can more directly reflect the abnormal changes in the signal; the threshold for abnormal judgment is set according to the statistical value of the reconstruction loss of historical data. This method fully considers the distribution characteristics and change laws of the data itself, making the setting of the threshold more scientific and reasonable. The dynamic threshold can adapt to the changes in signal data under different working conditions and environments, and improves the accuracy and real-time performance of fault detection; since the method of the present invention can capture the slight changes in the signal, it can also be discovered and reported in time when the mechanical equipment is in the early stage of failure or potential failure state, which helps to prevent major accidents and reduce economic losses and personal injuries; it is not only suitable for a single type of mechanical equipment, but also can be applied to a variety of different types of mechanical equipment and complex systems, with strong versatility and portability. At the same time, by adjusting the model parameters and training strategies, the detection performance can be further optimized to meet the needs of different application scenarios; finally, the present invention can input a small amount of unlabeled data into the model by dividing it into time series segments, and fully extract the universal health representation of the machinery by the segment comparison learning strategy, and give accurate and timely fault detection results for abnormal fluctuations in subsequent input data.
[0044] Furthermore, the proposed method has no special requirements on the input data type and can directly use signal data collected by various sensors (such as typical vibration signals, acoustic emission signals, and current signals).
[0045] Furthermore, for the common shapes of the original input data, such as the number of batches, the number of variables, and the number of data points, segmentation can be achieved by simply reconstructing the shape into the number of batches, the number of variables, the number of segments, and the length of the segments. Segmentation can effectively reduce the computational complexity of the model and maintain the performance of the model. For the setting of the segment length, considering that a single segment should contain sufficient local information, it can be set to more than twice the operating frequency of the rotating machinery according to the sampling theorem to ensure that the characteristic information at the working frequency is not lost.
[0046] Furthermore, by selecting random-length subsequences to mask some fragments, the model's ability to reconstruct missing fragments can be improved. By selecting two overlapping subsequences, enhanced sample pairs are provided for implementing the contrastive learning strategy, while reducing the model's over-reliance on fragment positions when extracting features.
[0047] Furthermore, standardizing each time segment and optimizing it using learnable parameters can eliminate the impact of time series distribution drift on model learning and ensure the robustness of the proposed method for non-stationary signal analysis.
[0048] Furthermore, the enhanced sample pairs after segmentation and masking are input into the model. The main architecture of the model is transformer, which is the classic architecture of the current mainstream sequence analysis deep learning model. After learning through transformer, a pair of sample feature representations are obtained. The segment level comparison learning strategy can provide a self-supervised learning method for the model. The segment similarity and temporal similarity calculate the loss of representation from different directions. The segment similarity calculates the representation difference at different segment positions, and the temporal similarity calculates the representation difference at the same segment position in the sequence at different time steps. By calculating the two similarities at different levels, the optimization direction can be effectively provided for model learning.
[0049] Furthermore, the threshold setting method determines that the anomaly score conforms to the normal distribution. The anomaly scores of normal samples are often concentrated in the interval centered on the mean value, while abnormal samples cannot be analyzed normally by the model and are given anomaly scores exceeding the threshold, thereby triggering an abnormal alarm.
[0050] It can be understood that the beneficial effects of the second aspect mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here.
[0051] In summary, the present invention achieves accurate anomaly detection of rotating mechanical equipment by combining advanced self-supervised contrastive learning technology and deep learning models.
[0052] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] Figure 1 It is a main flow chart of the time sequence segment comparison self-supervision fault detection method of the present invention;
[0054] Figure 2 It is a diagram of the fragment division and masking process in the present invention;
[0055] Figure 3 is a diagram of the architecture of a temporal segment encoder network of the present invention;
[0056] Figure 4 It is a schematic diagram of the fragment level contrast loss strategy of the present invention;
[0057] Figure 5 A schematic diagram of a computer device provided by an embodiment of the present invention.
[0058] Figure 6 The present invention is a block diagram of an electronic device provided according to an embodiment. DETAILED DESCRIPTION
[0059] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0060] In the description of the present invention, it should be understood that the terms “include” and “comprises” indicate the presence of described features, wholes, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or collections thereof.
[0061] It should also be understood that the terms used in the present specification are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the present specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0062] It should be further understood that the term "and / or" used in the present specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes these combinations. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in the present invention generally indicates that the associated objects are in an "or" relationship.
[0063] It should be understood that, although the terms first, second, third, etc. may be used to describe preset ranges, etc. in the embodiments of the present invention, these preset ranges should not be limited to these terms. These terms are only used to distinguish preset ranges from each other. For example, without departing from the scope of the embodiments of the present invention, the first preset range may also be referred to as the second preset range, and similarly, the second preset range may also be referred to as the first preset range.
[0064] The word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrases "if it is determined" or "if (stated condition or event) is detected" may be interpreted as "when it is determined" or "in response to determining" or "when detecting (stated condition or event)" or "in response to detecting (stated condition or event)", depending on the context.
[0065] Various structural schematic diagrams of the embodiments disclosed in the present invention are shown in the accompanying drawings. These figures are not drawn to scale, and some details are magnified and some details may be omitted for the purpose of clear expression. The shapes of various regions and layers shown in the figures and the relative sizes and positional relationships therebetween are only exemplary, and may deviate in practice due to manufacturing tolerances or technical limitations, and those skilled in the art may additionally design regions / layers with different shapes, sizes, and relative positions according to actual needs.
[0066] The present invention provides a mechanical fault detection method based on time series segment comparison self-supervision, which can use unlabeled samples as training data for learning, thereby completing the mechanical fault detection task in an unsupervised situation.
[0067] See also Figure 1 The present invention provides a mechanical fault detection method based on time series segment comparison self-supervision, comprising the following steps:
[0068] S1. Obtain signal data collected by mechanical equipment sensors;
[0069] Signal data is time series data, which usually includes but is not limited to vibration signals, acoustic emission signals, and current signals.
[0070] Time series data usually includes four dimensions, namely (B, N, P, L), which are the number of data batches, the number of data variables, the number of data segments, and the length of the segments.
[0071] S2, converting the signal data obtained in step S1 into multiple segments of equal length, and generating enhanced sample pairs by selecting two different segments through mask processing;
[0072] Specifically, the fragment division and masking process is as follows: Figure 2 As shown in the figure, it is divided into overlapping segments of enhanced sample pairs, segments of enhanced sample pairs with differences, and masked segments. The masking method is to set some data values outside the selected subsequence to 0.
[0073] The segmentation divides the data into n units of time length. According to the power frequency of the rotating machinery, the length l of the segment is determined. In order to ensure that the segment does not lose the information of the power frequency and its multiples, the segment length should be more than twice the observed frequency. The step length is s, and the step length is usually set to s = l, that is, the segments are divided without overlapping. For the part of the time series segment that is less than l, it can be supplemented into segments of equal length through a one-dimensional pooling layer, or the redundant part at the beginning or end of the sample can be discarded. The segmentation helps to reduce the calculation amount and complexity of the model. The number of segment divisions is p, and the calculation method is:
[0074]
[0075] The segments need to be standardized to reduce the impact of the distribution shift between the time series in the training and testing phases on the model's predictive ability. The process involves standardizing each time segment with zero mean and unit standard deviation, as follows:
[0076]
[0077] Among them, x (i) is the input time series fragment, is the mean of each variable in the time series segment, is the standard deviation of each variable in the time series segment;
[0078] The preprocessed fragments are masked. Masking is to select two overlapping subsequences of random length on each sample. The overlapping part is set to half of the number of fragments p by default, and the part outside the length is selected for zero masking operation, that is, the original value at the specified position of the data is covered with 0, thereby obtaining two different masked samples without changing the original length of the sample. The purpose of masking is to provide enhanced sample pairs for subsequent self-supervised contrastive learning, and overcome the potential problem of small number of training samples for mechanical equipment fault detection.
[0079] S3, comparing the enhanced sample pair obtained in step S2 to the input time series segment in the self-supervised fault detection model, and extracting a high-dimensional representation of the data through a time series segment encoder;
[0080] The temporal segment contrastive self-supervised fault detection model consists of a temporal segment encoder and a segment-level contrastive learning strategy.
[0081] See also Figure 3In the time series segment encoder, the embedding extraction layer is used to convert the input data from the segment length l to the hidden layer dimension d. In this embodiment, it is a 1-layer linear connection layer, and the temporary retreat method is used to avoid overfitting problems. When adding position coding, this embodiment adds the position coding generated by the uniform distribution U(-0.2,0.2). The encoder backbone includes n transformer blocks, which are composed of a multi-head attention mechanism layer, the first residual connection and normalization layer, a feedforward network layer, a second residual connection and a normalization layer. In this embodiment, n is 1. As a specific embodiment of the present invention, the transformer model is used to extract high-dimensional representation features of mechanical equipment sensor signal data. In theory, mainstream deep learning models and their variant models can achieve approximate effects through training.
[0082] The backbone of the temporal segment encoder is a transformer block that transforms the high-dimensional features of the masked samples Embedding is extracted as a hidden layer representation by adding positional encoding Maintaining the temporal consistency of the fragment and representation, expressed as Fault detection decisions are made by reconstructing the representation input into a simple decoder.
[0083] The transformer block uses a common self-attention mechanism, including the query matrix Key Matrix Sum Matrix Use scaled attention to get the output Right now
[0084]
[0085] in, is the output transposed matrix, d k is the dimension of the key matrix.
[0086] See also Figure 4 The fragment-level contrastive learning strategy is to input the enhanced sample pairs obtained by mask processing into the temporal fragment encoder to learn their respective feature representations, so that each sample can achieve two feature extractions through different incomplete subsequences to train the model.
[0087] The maximum pooling operation is repeated on the high-dimensional representation extracted by the time series segment encoder. Because it is time series data, one-dimensional maximum pooling with a kernel size of 2 is used in this embodiment to obtain representations at different levels, and the segment contrast loss and batch contrast loss are calculated for the representation of each layer. The cumulative sum of the two parts of the loss of each layer is used as the loss function for training and optimizing the parameters of the time series segment encoder.
[0088] The two representations extracted by the input model of two partially overlapping fragments constitute the concept of positive and negative sample pairs in contrastive learning. Two similarity metrics (batch similarity and fragment similarity) are set as loss functions to train the model. For positive sample pairs, the model learns to extract similar representations, and for negative sample pairs, the model learns to extract significantly different representations, that is, the larger the similarity metric result of the positive pair, the better, and the smaller the similarity metric result of the negative pair, the better. The calculation is as follows:
[0089]
[0090] in, is the anchor of segment i at position j, To compare the representation of samples at the same location, are the representations of different fragments and positions of the same sample and the comparison sample, respectively, and sim(·) is the similarity calculation method.
[0091] The fragment contrast loss identifies the representation results of two samples at the same time step and the same fragment position as a positive sample pair, and the representation results at the same time step and different fragment positions as a negative sample pair; the temporal contrast loss identifies the representation results of two samples at the same time step and the same fragment position as a positive sample pair, and uses the representation results of two samples at different time steps and the same fragment position, and the representation results of the same sample at different time steps and the same fragment position as a negative sample pair;
[0092] The fragment-level optimization method performs multi-level joint optimization on the representation results. The representation is changed to a coarse-grained level through pooling operations. Each pooling operation is performed to obtain a new level until the sample representation dimension becomes 1. The contrast loss is calculated at each level and summed up to obtain the final fragment-level contrast loss.
[0093] The final loss function contains two parts of loss. The reconstruction loss is determined by taking the mean square error between the reconstruction result and the non-masked original fragment. As a measure of the difference between the predicted value and the true value, the fragment-level joint optimization adopts the above-mentioned fragment-level contrast loss.
[0094] S4, inputting the high-dimensional representation obtained in step S3 into a linear decoder to obtain reconstructed data;
[0095] The reconstruction method uses a linear flattening layer to reconstruct the extracted representations into signal fragments. The loss function in the training phase is a specific signal and fragment level joint optimization method, and the loss function in the verification phase is the reconstruction loss.
[0096] Preferably, the linear decoder converts the high-dimensional representation from the hidden layer dimension d to a segment length l, which is one linear connection layer in this embodiment, and uses a temporary backoff method to avoid overfitting problems.
[0097] S5. Set a threshold for abnormality determination based on the statistical value of the reconstruction loss of historical data; mark the segment of the reconstructed data obtained in step S4 that exceeds the set threshold as a fault state segment, and output the fault detection result.
[0098] In the test phase, whether the difference in the reconstruction loss of the input test data exceeds the abnormal judgment threshold is used to determine whether the rotating machinery is currently faulty. The setting of the threshold η is based on statistics and follows the 3σ principle. The formula is:
[0099] η=μ+k*σ
[0100] Where μ is the mean, σ is the standard deviation, and k is a constant that controls the strictness of anomaly detection and is set to 3.
[0101] It will be appreciated by those skilled in the art that various aspects of the present invention may be implemented as systems, methods or program products. Therefore, various aspects of the present invention may be specifically implemented in the following forms, namely: complete hardware implementation, complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software implementations, which may be collectively referred to herein as "circuits", "modules" or "platforms".
[0102] In yet another embodiment of the present invention, a mechanical fault detection system based on time sequence segment comparison and self-supervision is provided. The system can be used to implement the above-mentioned mechanical fault detection method based on time sequence segment comparison and self-supervision. Specifically, the mechanical fault detection system based on time sequence segment comparison and self-supervision includes a data module, a conversion module, an extraction module, a reconstruction module and a detection module.
[0103] Among them, the data module obtains the signal data collected by the mechanical equipment sensor;
[0104] The conversion module converts the signal data into multiple segments of equal length and generates enhanced sample pairs by selecting different segments through mask processing twice;
[0105] The extraction module compares the augmented sample pairs to the input time series segments in the self-supervised fault detection model and extracts the high-dimensional representation of the data through the time series segment encoder;
[0106] The reconstruction module inputs the high-dimensional representation into the linear decoder to obtain the reconstructed data;
[0107] The detection module sets a threshold for abnormal judgment based on the statistical value of the reconstruction loss of historical data; marks the fragments of the reconstructed data that exceed the set threshold as fault state fragments, and outputs the fault detection results.
[0108] In another embodiment of the present invention, a terminal device is provided, which includes a processor and a memory, wherein the memory is used to store a computer program, the computer program includes program instructions, and the processor is used to execute the program instructions stored in the computer storage medium. The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. It is the computing core and control core of the terminal, which is suitable for implementing one or more instructions, and is specifically suitable for loading and executing one or more instructions to implement the corresponding method flow or corresponding function; the processor described in the embodiment of the present invention can be used for the operation of the mechanical fault detection method based on time sequence segment comparison self-supervision, including:
[0109] Acquire the signal data collected by the mechanical equipment sensor; convert the signal data into multiple segments of equal length, and generate enhanced sample pairs by selecting different segments through mask processing twice; input the enhanced sample pairs into the time series segment for comparison in the self-supervised fault detection model, and extract the high-dimensional representation of the data through the time series segment encoder; input the high-dimensional representation into the linear decoder to obtain reconstructed data; set the threshold for abnormal judgment according to the statistical value of the reconstruction loss of historical data; mark the segments of the reconstructed data that exceed the set threshold as fault state segments, and output the fault detection results.
[0110] In another embodiment of the present invention, the present invention also provides a storage medium, specifically a computer-readable storage medium (Memory), which is a memory device in a terminal device for storing programs and data. It is understandable that the computer-readable storage medium here can include both the built-in storage medium in the terminal device and the extended storage medium supported by the terminal device, and can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it. The computer-readable storage medium provides a storage space, which stores the operating system of the terminal. In addition, one or more instructions suitable for being loaded and executed by the processor are also stored in the storage space, and these instructions can be one or more computer programs (including program codes). It should be noted that more specific examples (non-exhaustive list) of the computer-readable storage medium here include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0111] Computer readable storage media also include data signals propagated in baseband or as part of a carrier wave, which carry readable program codes. Such propagated data signals can take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The readable storage medium can also be any readable medium other than a readable storage medium, which can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, device, or device. The program code contained on the readable storage medium can be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the above.
[0112] Program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).
[0113] The processor may load and execute one or more instructions stored in a computer-readable storage medium to implement the corresponding steps of the mechanical fault detection method based on time sequence segment comparison self-supervision in the above embodiment; the processor may load and execute the following steps of one or more instructions in the computer-readable storage medium:
[0114] Acquire the signal data collected by the mechanical equipment sensor; convert the signal data into multiple segments of equal length, and generate enhanced sample pairs by selecting different segments through mask processing twice; input the enhanced sample pairs into the time series segment for comparison in the self-supervised fault detection model, and extract the high-dimensional representation of the data through the time series segment encoder; input the high-dimensional representation into the linear decoder to obtain reconstructed data; set the threshold for abnormal judgment according to the statistical value of the reconstruction loss of historical data; mark the segments of the reconstructed data that exceed the set threshold as fault state segments, and output the fault detection results.
[0115] See also Figure 5 , the terminal device is a computer device, and the computer device 60 of this embodiment includes: a processor 61, a memory 62, and a computer program 63 stored in the memory 62 and executable on the processor 61. When the computer program 63 is executed by the processor 61, the mechanical fault detection method based on time sequence segment comparison and self-supervision in the embodiment is implemented. To avoid repetition, it is not described one by one here. Alternatively, when the computer program 63 is executed by the processor 61, the functions of each model / unit in the mechanical fault detection system based on time sequence segment comparison and self-supervision in the embodiment are implemented. To avoid repetition, it is not described one by one here.
[0116] The computer device 60 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The computer device 60 may include, but is not limited to, a processor 61 and a memory 62. Those skilled in the art will appreciate that Figure 5 This is only an example of the computer device 60 and does not constitute a limitation of the computer device 60. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the computer device may also include input and output devices, network access devices, buses, etc.
[0117] The processor 61 may be a central processing unit (CPU), or other general-purpose processors, central processing units, graphics processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, data processing logic based on quantum computing, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.
[0118] The memory 62 may be an internal storage unit of the computer device 60, such as a hard disk or memory of the computer device 60. The memory 62 may also be an external storage device of the computer device 60, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc., equipped on the computer device 60.
[0119] Furthermore, the memory 62 may include both an internal storage unit of the computer device 60 and an external storage device. The memory 62 is used to store computer programs and other programs and data required by the computer device. The memory 62 may also be used to temporarily store data that has been output or is to be output.
[0120] Any reference to memory, database or other media used in the embodiments provided in the present application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory may include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM may be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.
[0121] The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. The non-relational database may include a distributed database based on blockchain, etc., but is not limited thereto. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but is not limited thereto.
[0122] See also Figure 6 The terminal device 600 is an electronic device, and the electronic device is in the form of a general computing device. The components of the electronic device may include but are not limited to: at least one processing unit 610, at least one storage unit 620, a bus 630 connecting different platform components (including the storage unit 620 and the processing unit 610), a display unit 640, etc.
[0123] The storage unit stores program codes, which can be executed by the processing unit 610, so that the processing unit 610 performs the steps according to various exemplary embodiments of the present invention described in the above method section of this specification. For example, the processing unit 610 can perform the following steps: Figure 1 Follow the steps shown in .
[0124] The storage unit 620 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 6201 and / or a cache memory unit 6202 , and may further include a read-only memory unit (ROM) 6203 .
[0125] The storage unit 620 may also include a program / utility 6204 having a set (at least one) of program modules 6205, such program modules 6205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0126] Bus 630 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0127] The electronic device 600 may also communicate with one or more external devices 700 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 600, and / or communicate with any device that enables the electronic device 600 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 650. Furthermore, the electronic device 600 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 660. The network adapter 660 may communicate with other modules of the electronic device 600 via a bus 630. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 600, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage platforms, etc.
[0128] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. The components of the embodiments of the present invention described and shown in the drawings here can usually be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the present invention. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0129] In order to further discuss the advantages of the present invention, the method of the present invention is compared with the mainstream existing anomaly detection methods, and the single-class support vector machine OCSVM, isolation forest IF, long short-term memory network LSTM and Transformer are selected respectively. The selected public dataset is the XJTU-SY dataset, which contains vibration data collected from rotating machinery. The dataset contains the full life data of 15 rolling bearings under three different operating conditions, including different speeds and radial forces. The fault types include multiple categories such as inner ring wear, cage fracture and outer ring wear.
[0130] Taking precision, recall and F1 score as comparison indicators, the experimental results of the proposed method and the comparison method on the XJTU-SY dataset are shown in the following table.
[0131]
[0132]
[0133] The results show that the proposed method achieves the best performance on the above metrics on each dataset with a limited number of normal training samples. Among the comparison methods, LSTM and Transformer have comparable recall scores to the proposed method, but significantly lower precision, resulting in a large number of false positives at the beginning of the testing phase. In addition, there is a significant difference between the anomaly scores and the scores observed during training, indicating overfitting. IF triggers the alarm only after the fault occurs, and although there will be no false positives, there will be significant false negatives, resulting in high precision and low recall. In summary, when evaluating a model, it is important to consider both precision and recall to prevent misjudgment based on a single metric. Compared with IF, OCSVM reduces underreporting. Although OCSVM does reduce false negatives, its anomaly starting point is still lagging behind, and the anomaly detection effect is not stable enough on all datasets.
[0134] In summary, the present invention provides a mechanical fault detection method and system based on time series segment comparison self-supervision, which can accurately identify and detect early faults occurring in mechanical equipment. Compared with the prior art, the alarm is triggered in a timely manner, and there are very few missed alarms and false alarms, and the system can be effectively applied in industrial machinery fault detection tasks.
[0135] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0136] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0137] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in the present invention can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0138] In the embodiments provided by the present invention, it should be understood that the disclosed devices / terminals and methods can be implemented in other ways. For example, the device / terminal embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0139] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0140] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0141] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0142] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0143] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0144] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0145] The above contents are only for explaining the technical idea of the present invention and cannot be used to limit the protection scope of the present invention. Any changes made on the basis of the technical solution in accordance with the technical idea proposed by the present invention shall fall within the protection scope of the claims of the present invention.
Claims
1. A mechanical fault detection method based on time series segment comparison self-supervision, characterized in that: The following steps are involved: S1. Obtain signal data collected by mechanical equipment sensors; S2, converting the signal data obtained in step S1 into multiple segments of equal length, and generating enhanced sample pairs by selecting two different segments through mask processing; S3, comparing the enhanced sample pair obtained in step S2 to the input time series segment in the self-supervised fault detection model, and extracting a high-dimensional representation of the data through a time series segment encoder; S4, inputting the high-dimensional representation obtained in step S3 into a linear decoder to obtain reconstructed data; S5. Set a threshold for abnormality determination based on the statistical value of the reconstruction loss of historical data; mark the segment of the reconstructed data obtained in step S4 that exceeds the set threshold as a fault state segment, and output the fault detection result.
2. The mechanical fault detection method based on time series segment comparison self-supervision according to claim 1 is characterized in that: In step S1, the signal data is time series data, including vibration signals, acoustic emission signals, and current signals.
3. The mechanical fault detection method based on time series segment comparison self-supervision according to claim 2 is characterized in that: Time series data includes the number of data batches, the number of data variables, the number of segments into which the data is divided, and the length of the segments.
4. The mechanical fault detection method based on time series segment comparison self-supervision according to claim 1, characterized in that: In step S2, the segment division divides the data into n unit time lengths in total. According to the working frequency of the rotating machinery, the length l of the segment is determined. The segment length is more than twice the observation frequency, and the step length is s. The step length is set to s=l, that is, the segments are divided without overlapping. For the part of the time series segment that is less than l, it is supplemented into segments of equal length through a one-dimensional pooling layer, or the redundant part at the beginning or end of the sample is discarded, and the number of divided segments is p; two overlapping subsequences of random length are selected on each sample, and the overlapping part is set to half of the number of segments p. The part outside the length is selected for zero masking operation, that is, the original value at the specified position of the data is covered with 0 to obtain two different masked samples.
5. The mechanical fault detection method based on time series segment comparison self-supervision according to claim 4 is characterized in that: The segments are normalized by normalizing each time segment to zero mean and unit standard deviation, as follows: Among them, x (i) is the input time series fragment, is the mean of each variable in the time series segment, is the standard deviation of each variable in the time series segment, ∈ is the residual term, β k and γ k are learnable mapping parameters.
6. The mechanical fault detection method based on time series segment comparison self-supervision according to claim 1, characterized in that: In step S3, the temporal segment contrast self-supervised fault detection model includes a temporal segment encoder and a segment level contrast learning strategy; In the temporal segment encoder, the embedding extraction layer is used to convert the input data from the segment length l to the hidden layer dimension d. The backbone of the temporal segment encoder contains n transformer blocks, including a multi-head attention mechanism layer, the first residual connection and normalization layer, a feedforward network layer, a second residual connection and normalization layer. The transformer block is used to extract high-dimensional representation features of the mechanical equipment sensor signal data; The fragment-level contrastive learning strategy is used to input the enhanced sample pairs obtained by mask processing into the temporal fragment encoder to learn their respective feature representations. The temporal similarity and fragment similarity are set as the loss function, so that each sample realizes two feature extractions through different incomplete subsequences to train the model.
7. The mechanical fault detection method based on time series segment comparison self-supervision according to claim 6 is characterized in that: The transformer block uses a common self-attention mechanism, including the query matrix Key Matrix Sum Matrix Use scaled attention to get the output Right now: Among them, d k is the dimension of the key matrix.
8. The mechanical fault detection method based on time series segment comparison self-supervision according to claim 6, characterized in that: Fragment Similarity and time series similarity Specifically: in, is the anchor of segment i at position j, To compare the representation of samples at the same location, are the representations of different fragments and positions of the same sample and the comparison sample, respectively, and sim(·) is the similarity calculation method.
9. The mechanical fault detection method based on time series segment comparison self-supervision according to claim 1, characterized in that: In step S5, the threshold value n is: η=μ+k*σ Here, μ is the mean, σ is the standard deviation, and k is a constant that controls the strictness of anomaly detection.
10. A mechanical fault detection system based on time series segment comparison self-supervision, characterized in that: include: Data module, to obtain signal data collected by mechanical equipment sensors; The conversion module converts the signal data into multiple segments of equal length and generates enhanced sample pairs by selecting different segments through mask processing twice; The extraction module compares the augmented sample pairs to the input time series segments in the self-supervised fault detection model and extracts the high-dimensional representation of the data through the time series segment encoder; The reconstruction module inputs the high-dimensional representation into the linear decoder to obtain the reconstructed data; The detection module sets a threshold for abnormal judgment based on the statistical value of the reconstruction loss of historical data; marks the fragments of the reconstructed data that exceed the set threshold as fault state fragments, and outputs the fault detection results.
Citation Information
Cited By
Combination switch detection method and system based on neural network, equipment and medium
CN121327663A
