Disclosure of Invention
The invention provides an Attention CNN model-based bearing fault real-time intelligent diagnosis method and system, which aim to overcome the defects in the prior art.
In one aspect, the invention provides a bearing fault real-time intelligent diagnosis method based on an Attention CNN model, which comprises the following steps:
s1: collecting a vibration signal of a fault bearing by using a vibration sensor, and then segmenting the vibration signal of the fault bearing by adopting a fixed-length random segmentation method to obtain a data sample;
s2: after labels corresponding to all types are attached to the data sample according to the state type of the rolling bearing, the data sample is divided into a training set, a verification set and a test set according to a certain proportion;
s3: respectively manufacturing a plurality of bearing fault data sets in an unbalanced state according to the training set and the verification set, and forming an unbalanced data set by all the manufactured bearing fault data sets;
s4: constructing an Attention CNN model, respectively training the Attention CNN model by using different bearing fault data sets, and simultaneously carrying out model test by using the test set to finally obtain an Attention CNN training model;
s5: and carrying out real-time fault detection on the rolling bearing by utilizing the Attention CNN training model.
The method firstly adopts fixed-length random segmentation to enhance the randomness of data, thereby enhancing the robustness of the model; secondly, when the model is constructed, the overfitting of the model is relieved by batch normalization, Dropout and L2 regularization, so that the detection efficiency of the model is improved; then, the importance degree of the features to the final output is calculated through an attention mechanism, so that the method still has excellent fault diagnosis capability under the condition of no multilayer neural network, and has excellent stability under the condition of unbalanced data; in the model training stage, an exponential decay learning rate and a callback function are adopted to prevent the model from being over-fitted and store the optimal model in the training process; finally, the stored model is applied to real-time fault detection of the rotary machine; the Attention CNN model network structure comprises: a convolutional layer, a pooling layer, a Batch Normalization (BN) layer, an Attention module, a full link layer, and a classification layer. The convolution layer carries out feature extraction on the original vibration signal; the pooling layer performs down-sampling on the characteristics of the convolution layer to reduce model parameters; the BN layer accelerates the fitting speed of the network, and the calculation efficiency is accelerated; the Attention module calculates the importance degree of the features to the final output; the full connection layer maps the features; the classification layer classifies features. The invention can accurately and automatically identify the running state of the bearing in real time, thereby effectively maintaining the normal running of mechanical equipment.
In a specific embodiment, the state types of the rolling bearing are divided into a normal state and a single-point defect with different diameters is respectively manufactured on the outer ring, the inner ring and the rolling body of the bearing by using an electric discharge machining technology.
In a specific embodiment, the creating a plurality of bearing fault data sets in an unbalanced state according to the data in the training set and the verification set respectively specifically includes:
performing the following operations on the training set and the validation set, respectively:
under the condition that the number of normal data samples is fixed, simulating the conditions under different unbalanced states according to the ratio of normal data to fault data in various different proportions;
and obtaining a plurality of corresponding bearing fault data sets in an unbalanced state for the training set and the verification set respectively.
In a specific embodiment, the segmenting the vibration signal of the faulty bearing by using a fixed-length random segmentation method to obtain a data sample specifically includes:
when the total Length of the sampling data of the data sample of the faulty bearing vibration signal is Length, and the sampling window is W, and a random number index is taken in the (0, Length-W) section, the Length of the data sample is index + W. This is done to enhance the randomness of the data, thereby increasing the robustness of the model.
In a specific embodiment, the specific steps of constructing the Attention CNN model include:
t1: constructing a first layer of convolution, wherein the first convolution layer is a one-dimensional convolution neural network, the size of convolution kernels is set to be 64, the number of the convolution kernels is set to be 32, the step length is 2, and Same filling is adopted;
t2: adding Batch Normalization (BN) after the T1 to improve the calculation speed of the model;
t3: adding a Relu activation function after the T2, and accelerating convergence and relieving gradient disappearance by using the Relu activation function;
t4: introducing a maximum pooling layer after the T3, and performing down-sampling by using the maximum pooling layer to reduce the parameter number of the model;
t5: dropout is introduced after the T4, and is utilized to make a part of neurons inactive, so that the number of model neurons is reduced, and the model complexity is reduced;
t6: introducing a second layer of convolutional neural network after the T5, wherein the second convolutional layer is a one-dimensional convolutional neural network, setting the size of convolutional kernels and the number of convolutional kernels, and adopting Same filling;
t7: adding Batch Normalization (BN) after the T6 to improve the calculation speed of the model;
t8 addition of Relu activation function after the T7 accelerates convergence and relieves gradient disappearance;
t9 introducing a Flatten layer after the T8, wherein the Flatten layer tiles high-dimensional features into a one-dimensional space;
t10, adding an Attention mechanism after the T9 to focus Attention on the part with fault information, thereby improving the classification accuracy and the detection efficiency;
t11: mapping the characteristics output by the full connection layer mechanism by using the full connection layer;
t12: and the number of the neurons of the classification layer is equal to the total number of bearing fault classes, and a Softmax activation function is adopted.
In a specific embodiment, the step of constructing the Attention CNN model includes:
taking characteristic information in Source as a plurality of Key, Value data pairs, obtaining a weight coefficient of Value corresponding to each Key by calculating the correlation between Query and each Key, and then carrying out weighted summation on Value according to the weight coefficient so as to obtain a final Attention Value;
the method specifically comprises the following steps:
a1 computing Query sum by dot product
The dot product model can better utilize the matrix product in the aspect of realization, so that the calculation efficiency is higher, and the requirements of real-time fault detection are met;
a2: and numerically converting the score of the first stage by introducing a calculation mode of Softmax, wherein the numerical conversion comprises the following steps: normalizing and sorting the originally calculated values into probability distribution with the sum of element weights being 1; the weight of the important features is more prominent through the intrinsic mechanism of Softmax; obtaining the weight coefficient after the numerical value conversion
A3: wherein
To represent
And weighting and summing the corresponding weight coefficients to obtain an Attention value, wherein the Attention value is as follows:
in a specific embodiment, the training the Attention CNN model with the different bearing fault data sets respectively specifically includes:
in order to prevent overfitting of the model during training, L2 regularization was used at the convolutional layer;
the exponential decay learning rate is adopted in the process of training the Attention CNN model, the efficiency of model training can be greatly improved, a better solution is quickly obtained by using a larger learning rate, then the learning rate is gradually reduced along with the continuation of iteration, so that the model is more stable in the later training period, and the method can avoid a loss platform (loss platform) and is an effective strategy for jumping out a local optimal solution.
Wherein
In order to be the initial learning rate,
in order to achieve the final learning rate,
for the attenuation rate, decay _ step is the attenuation speed, global _ step is the current iteration number;
using a callback function (callback) in training the Attention CNN model; the callback function can interrupt the training when overfitting is just started, thereby avoiding using fewer rounds to train the model from the beginning, and simultaneously directly saving the optimal model appearing in the training process.
And using an Adma optimizer and a cross entropy loss function in the training process of the Attention CNN model, and updating the network weight by using a gradient descent algorithm until a callback function is triggered to terminate the training to obtain the Attention CNN training model.
In a specific embodiment, the performing real-time fault detection on the rolling bearing by using the Attention CNN training model specifically includes:
deploying the Attention CNN training model offline and testing the fault diagnosis accuracy rate in various unbalanced states by using the bearing fault data set;
and respectively recording the bearing fault data set used for testing and the time used for testing the corresponding fault data for the Attention CNN training model which is deployed off line.
According to a second aspect of the present invention, a computer-readable storage medium is proposed, on which a computer program is stored, which computer program, when being executed by a computer processor, carries out the above-mentioned method.
According to a third aspect of the present invention, a real-time intelligent diagnosis system for bearing faults based on an Attention CNN model is provided, which comprises:
a data sample acquisition module: the method comprises the steps that a vibration sensor is used for collecting a vibration signal of a fault bearing, and then the vibration signal of the fault bearing is divided by adopting a fixed-length random dividing method to obtain a data sample;
a data sample division module: after the data sample is configured and used for attaching labels corresponding to all types to the data sample according to the state type of the rolling bearing, the data sample is divided into a training set, a verification set and a test set according to a certain proportion;
an unbalanced data set construction module: the system is configured and used for respectively manufacturing a plurality of bearing fault data sets in an unbalanced state according to the training set and the verification set and forming an unbalanced data set by all the manufactured bearing fault data sets;
attention CNN model training module: configuring and constructing an Attention CNN model, respectively training the Attention CNN model by using different bearing fault data sets, and simultaneously carrying out model test by using the test set to finally obtain an Attention CNN training model;
a real-time fault detection module: and the real-time fault detection device is configured for utilizing the Attention CNN training model to detect the fault of the rolling bearing in real time.
Firstly, fixed-length random segmentation is adopted to enhance the randomness of data, so that the robustness of a model is enhanced; secondly, when the model is constructed, the overfitting of the model is relieved by batch normalization, Dropout and L2 regularization, so that the detection efficiency of the model is improved; then, the importance degree of the features to the final output is calculated through an attention mechanism, so that the method still has excellent fault diagnosis capability under the condition of no multilayer neural network, and has excellent stability under the condition of unbalanced data; in the model training stage, an exponential decay learning rate and a callback function are adopted to prevent the model from being over-fitted and store the optimal model in the training process; finally, the stored model is applied to real-time fault detection of the rotary machine; the Attention CNN model network structure comprises: a convolutional layer, a pooling layer, a Batch Normalization (BN) layer, an Attention module, a full link layer, and a classification layer. The convolution layer carries out feature extraction on the original vibration signal; the pooling layer performs down-sampling on the characteristics of the convolution layer to reduce model parameters; the BN layer accelerates the fitting speed of the network, and the calculation efficiency is accelerated; the Attention module calculates the importance degree of the features to the final output; the full connection layer maps the features; the classification layer classifies features. The invention can accurately and automatically identify the running state of the bearing in real time, thereby effectively maintaining the normal running of mechanical equipment.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
Fig. 1 shows an exemplary system architecture 100 to which an Attention CNN model-based bearing fault real-time intelligent diagnosis method according to an embodiment of the present application may be applied.
As shown in fig. 1, the system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like. Various applications, such as a data processing application, a data visualization application, a web browser application, etc., may be installed on the terminal devices 101, 102, 103.
The terminal apparatuses 101, 102, and 103 may be hardware or software. When the terminal devices 101, 102, 103 are hardware, they may be various electronic devices including, but not limited to, smart phones, tablet computers, laptop portable computers, desktop computers, and the like. When the terminal apparatuses 101, 102, 103 are software, they can be installed in the electronic apparatuses listed above. It may be implemented as multiple pieces of software or software modules (e.g., software or software modules used to provide distributed services) or as a single piece of software or software module. And is not particularly limited herein.
The server 105 may be a server providing various services, such as a background information processing server providing support for data samples presented on the terminal devices 101, 102, 103. The backend information processing server may process the acquired unbalanced data set and generate a processing result (e.g., the Attention CNN training model).
It should be noted that the method provided in the embodiment of the present application may be executed by the server 105, or may be executed by the terminal devices 101, 102, and 103, and the corresponding apparatus is generally disposed in the server 105, or may be disposed in the terminal devices 101, 102, and 103.
The server may be hardware or software. When the server is hardware, it may be implemented as a distributed server cluster formed by multiple servers, or may be implemented as a single server. When the server is software, it may be implemented as multiple pieces of software or software modules (e.g., software or software modules used to provide distributed services), or as a single piece of software or software module. And is not particularly limited herein.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Fig. 2 shows a flowchart of a bearing fault real-time intelligent diagnosis method based on an Attention CNN model according to an embodiment of the present invention. As shown in fig. 2, the method comprises the steps of:
s1: collecting a vibration signal of a fault bearing by using a vibration sensor, and then segmenting the vibration signal of the fault bearing by adopting a fixed-length random segmentation method to obtain a data sample;
s2: after labels corresponding to all types are attached to the data sample according to the state type of the rolling bearing, the data sample is divided into a training set, a verification set and a test set according to a certain proportion;
s3: respectively manufacturing a plurality of bearing fault data sets in an unbalanced state according to the training set and the verification set, and forming an unbalanced data set by all the manufactured bearing fault data sets;
s4: constructing an Attention CNN model, respectively training the Attention CNN model by using different bearing fault data sets, and simultaneously carrying out model test by using the test set to finally obtain an Attention CNN training model;
s5: and carrying out real-time fault detection on the rolling bearing by utilizing the Attention CNN training model.
In a specific embodiment, the state types of the rolling bearing are divided into a normal state and a single-point defect of which the diameters are different from 0.007 inches, 0.014 inches and 0.021 inches is respectively manufactured on the outer ring, the inner ring and the rolling body of the bearing by using an electric discharge machining technology.
In a specific embodiment, the creating a plurality of bearing fault data sets in an unbalanced state according to the data in the training set and the verification set respectively specifically includes:
performing the following operations on the training set and the validation set, respectively:
under the condition that the number of normal data samples is fixed, the ratio of the normal data to the fault data is as follows: 10: 10; 10: 9; 10: 8; 10: 7; 10: 6; 10: 5; 10: 4; 10: 3; 10: 2; 10:1 to simulate different imbalance conditions;
and obtaining a plurality of corresponding bearing fault data sets in an unbalanced state for the training set and the verification set respectively.
In a specific embodiment, the segmenting the vibration signal of the faulty bearing by using a fixed-length random segmentation method to obtain a data sample specifically includes:
when the total Length of the sampling data of the data sample of the faulty bearing vibration signal is Length, and the sampling window is W, and a random number index is taken in the (0, Length-W) section, the Length of the data sample is index + W. This is done to enhance the randomness of the data, thereby increasing the robustness of the model.
In a specific embodiment, the specific steps of constructing the Attention CNN model include:
t1: constructing a first layer of convolution, wherein the first convolution layer is a one-dimensional convolution neural network, the size of convolution kernels is set to be 64, the number of the convolution kernels is set to be 32, the step length is 2, and Same filling is adopted;
t2: adding Batch Normalization (BN) after the T1 to improve the calculation speed of the model;
t3: adding a Relu activation function after the T2, and accelerating convergence and relieving gradient disappearance by using the Relu activation function;
t4: introducing a maximum pooling layer after the T3, and performing down-sampling by using the maximum pooling layer to reduce the parameter number of the model;
t5: dropout is introduced after the T4, and is utilized to make a part of neurons inactive, so that the number of model neurons is reduced, and the model complexity is reduced;
t6: introducing a second layer of convolutional neural network after the T5, wherein the second layer of convolutional neural network is a one-dimensional convolutional neural network, setting the size of convolutional kernels and the number of convolutional kernels, and adopting Same filling, wherein the size of the convolutional kernels is set to be 128, the number of convolutional kernels is set to be 64, and the step size is 8;
t7: adding Batch Normalization (BN) after the T6 to improve the calculation speed of the model;
t8 addition of Relu activation function after the T7 accelerates convergence and relieves gradient disappearance;
t9 introducing a Flatten layer after the T8, wherein the Flatten layer tiles high-dimensional features into a one-dimensional space;
t10, adding an Attention mechanism after the T9 to focus Attention on the part with fault information, thereby improving the classification accuracy and the detection efficiency;
t11: mapping the characteristics output by the full-connection layer mechanism by using the full-connection layer, wherein the number of the neurons of the full-connection layer is set to be 100;
t12: and the number of the neurons of the classification layer is equal to the total number of bearing fault classes, and a Softmax activation function is adopted.
In a specific embodiment, the step of constructing the Attention CNN model includes:
the method comprises the steps that characteristic information in Source is regarded as being composed of a plurality of Key and Value data pairs, the correlation between Query and each Key is calculated to obtain the weight coefficient of Value corresponding to each Key, and then the Value is subjected to weighted summation according to the weight coefficient, so that the final Attention Value is obtained;
the method specifically comprises the following steps:
a1 computing Query sum by dot product
The dot product model can better utilize the matrix product in the aspect of realization, so that the calculation efficiency is higher, and the requirements of real-time fault detection are met;
a2: and numerically converting the score of the first stage by introducing a calculation mode of Softmax, wherein the numerical conversion comprises the following steps: normalizing and sorting the originally calculated values into probability distribution with the sum of element weights being 1; the weight of the important features is more prominent through the intrinsic mechanism of Softmax; obtaining the weight coefficient after the numerical value conversion
A3: wherein
To represent
And weighting and summing the corresponding weight coefficients to obtain an Attention value, wherein the Attention value is as follows:
in a specific embodiment, the training the Attention CNN model with the different bearing fault data sets respectively specifically includes:
to prevent overfitting of the model during training, L2 regularization was used at the convolutional layer, with the L2 regularization factor set to 0.0004;
the exponential decay learning rate is adopted in the process of training the Attention CNN model, the efficiency of model training can be greatly improved, a better solution is quickly obtained by using a larger learning rate, then the learning rate is gradually reduced along with the continuation of iteration, so that the model is more stable in the later training stage, and the final learning rate is obtained:
wherein
In order to be the initial learning rate,
in order to achieve the final learning rate,
for the decay rate, decay _ step is the decay rate, global _ step is the current iteration number. The initial learning rate of index attenuation in the Attention CNN model is set to be 0.05, and the attenuation rate is set to be 0.05
Set to 0.96;
using a callback function (callback) in training the Attention CNN model; the callback function can interrupt the training when overfitting is just started, thereby avoiding using fewer rounds to train the model from the beginning, and simultaneously directly saving the optimal model appearing in the training process. And setting the parameter of the Attention CNN model callback function to be 5, namely terminating the training if the verification precision of the model in 5 rounds is not improved, and saving the optimal model.
And using an Adma optimizer and a cross entropy loss function in the training process of the Attention CNN model, and updating the network weight by using a gradient descent algorithm until a callback function is triggered to terminate the training to obtain the Attention CNN training model.
In a specific embodiment, the performing real-time fault detection on the rolling bearing by using the Attention CNN training model specifically includes:
deploying the Attention CNN training model offline and testing the fault diagnosis accuracy rate in various unbalanced states by using the bearing fault data set;
and respectively recording the bearing fault data set used for testing and the time used for testing the corresponding fault data for the Attention CNN training model which is deployed off line.
To illustrate and verify the method of the present invention, the following test is performed by using test data of normal bearings and faulty bearings in a laboratory as a sample data set, fig. 3 is a flowchart of a real-time intelligent fault diagnosis method for bearings based on an Attention CNN model under a data imbalance condition according to an embodiment of the present invention, and fig. 13 is a data division table of an imbalance condition according to an embodiment of the present invention, and the training and the testing are performed by using bearing data. The test bench for testing comprises a motor, a torque sensor, a power meter and a controller, wherein the sample data set acquires data of a normal bearing, a single-point driving end and a fan end under the motor load of 0hp, 1hp, 2hp and 3 hp. The experimental data was completed with an accelerometer motor driven mechanical system with 12000 samples per second. For the failed bearing, single-point defects with the diameters of 0.007 inches, 0.014 inches and 0.021 inches are manufactured on the outer ring, the inner ring and the rolling body of the bearing by using an electric spark machining technology.
In the following experiment, ten different state signal data under 0ph are selected as experimental data:
fig. 4 is an explanatory diagram of fixed-length sampling of data according to a specific embodiment of the present invention, as shown in fig. 4, a fixed-length random sample is extracted from a signal to be tested, for example, sample data is randomly extracted from the signal to be tested with a data length of 1024, and the sample data is divided into a training sample and a test set, and the training sample may be further divided into a training set and a verification set;
FIG. 5 is a schematic diagram of vibration signals of a normal bearing according to an embodiment of the present invention, and as shown in FIG. 5, the vibration signals of the normal bearing are distributed regularly;
FIG. 6 is a graph showing rolling element fault bearing vibration signals at 0.007 (601), 0.014 (602) and 0.021 (603) inch damage diameters for a specific embodiment of the present invention, as shown in FIG. 6, showing different transitions for different sized damage defects;
FIG. 7 is a graph showing the vibration signals of a failed inner race bearing at 0.007 (701), 0.014 (702) and 0.021 (703) inch damage diameters for a specific embodiment of the present invention, as shown in FIG. 7, showing different transitions in the vibration signals of a failed inner race bearing at different sized damage defects;
FIG. 8 is a graph showing the outer ring fault bearing vibration signals at 0.007 (801), 0.014 (802) and 0.021 (803) inch damage diameters for one embodiment of the present invention, as shown in FIG. 8, showing different transitions for the outer ring fault bearing vibration signals at different sized damage defects.
The diagrams of the vibration signals in the ten different states are shown in fig. 5, 601-603 in fig. 6, 701-702 in fig. 7, and 801-803 in fig. 8, and a subsequent required data set is obtained based on performing fixed-length data sampling on the vibration signals in the different states as measured signals.
The frequency and the rotating speed of data collection are obtained from the description of the bearing data set of the embodiment, and the quantity of data collected by each circle of the bearing is deduced, wherein the formula is that the sampling count/circle number is 60 sampling frequency/rotating speed is 12000 and 60/1797 is 400. Thus to ensure that each sample has a faulty signal, the length of each sample is set to 1024.
The experimental environment of the invention is a software environment: windows 1064, Keras 2.3.1, TensorFlow 1.15.0, Python 3.6.13; the hardware environment is CPU AMD Ryzen 74800H, RAM 32.0.0 GB, GPU RTX2060.
The accuracy of the test under different unbalanced data scenes is shown in fig. 14.
Although it has been successfully applied to fault diagnosis, it is a black box model, and fault diagnosis based on what the neural network is a problem to be solved. The effectiveness of the invention is illustrated by using a characteristic visualization t-SNE (t-distributed stored probabilistic Neighbor Embedding) algorithm, wherein the t-SNE characteristic visualization of the original data distribution situation is shown in FIG. 9, and the t-SNE characteristic visualization of the data distribution situation after model processing is shown in FIG. 10.
FIG. 11 is a graph illustrating accuracy curves and loss function curves of a training set and a validation set of a bearing data set Attention CNN model according to an embodiment of the present invention; FIG. 12 is a confusion matrix of a balanced data set (1201), a normal data set to failure data set (1202) and a normal data set to failure data set 10:1 data set (1203) of a particular embodiment of the present invention.
According to the experiment in the embodiment, the time for testing 10 pieces of fault data is 20.27 milliseconds, and the time for testing 100 pieces of data is 45 milliseconds under the current experimental environment. According to the data sampling frequency, 12000 sampling points are acquired every second, but the invention only needs 20.27 milliseconds to test 10240 sampling points.
From the accuracy and detection speed of the test set in various unbalanced data set states, the diagnosis accuracy of the method under balanced data set conditions and slightly unbalanced data sets is close to 100%, and the diagnosis accuracy under extreme unbalanced conditions is over 97%.
The invention has the beneficial effects that:
the invention designs a new model with low structural complexity aiming at the bearing real-time intelligent fault diagnosis scene in the data unbalance state, and obtains excellent performance in the aspect of real-time diagnosis under the condition of not using any data enhancement means.
Aiming at real-time fault diagnosis, the invention obtains excellent diagnosis performance by using the characteristics of attention mechanism automatic learning and calculation of the contribution of input characteristics to output data under the condition of not overlapping convolution and pooling layers, greatly shortens the model detection time and meets the real-time fault detection.
The Attention CNN model provided by the invention can be used for real-time fault detection and can effectively solve the problem of data imbalance.
The invention focuses more on real-time fault diagnosis of a real scene, directly adopts original signals for input, does not carry out any data signal preprocessing, and adopts fixed-length random sampling to eliminate sampling contingency. The original signal input is directly adopted, so that the dependence on a manual signal processing method is avoided.
Fig. 15 shows a frame diagram of a real-time intelligent diagnosis system for bearing faults based on the Attention CNN model according to an embodiment of the present invention. The system comprises a data sample acquisition module 1501, a data sample partitioning module 1502, an unbalanced data set construction module 1503, an Attention CNN model training module 1504 and a real-time fault detection module 1505.
In a specific embodiment, the data sample acquisition module 1501 is configured to acquire a vibration signal of a faulty bearing by using a vibration sensor, and then segment the vibration signal of the faulty bearing by using a fixed-length random segmentation method to obtain a data sample;
the data sample dividing module 1502 is configured to, after attaching labels corresponding to each type to the data samples according to the state types of the rolling bearings, divide the data samples into a training set, a verification set and a test set according to a certain proportion;
the unbalanced data set construction module 1503 is configured to make a plurality of bearing fault data sets in an unbalanced state according to the data in the training set and the verification set, and configure all the made bearing fault data sets into an unbalanced data set;
the Attention CNN model training module 1504 is configured to construct an Attention CNN model, respectively train the Attention CNN model with different bearing fault data sets, and simultaneously perform model testing with the test set to finally obtain the Attention CNN training model;
the real-time fault detection module 1505 is configured for real-time fault detection of the rolling bearing using the Attention CNN training model.
The system firstly adopts fixed-length random segmentation to enhance the randomness of data, thereby enhancing the robustness of the model; secondly, when the model is constructed, the overfitting of the model is relieved by batch normalization, Dropout and L2 regularization, so that the detection efficiency of the model is improved; then, the importance degree of the features to the final output is calculated through an attention mechanism, so that the method still has excellent fault diagnosis capability under the condition of no multilayer neural network, and has excellent stability under the condition of unbalanced data; in the model training stage, an exponential decay learning rate and a callback function are adopted to prevent the model from being over-fitted and store the optimal model in the training process; finally, the stored model is applied to real-time fault detection of the rotary machine; the Attention CNN model network structure comprises: a convolutional layer, a pooling layer, a Batch Normalization (BN) layer, an Attention module, a full link layer, and a classification layer. The convolution layer carries out feature extraction on the original vibration signal; the pooling layer performs down-sampling on the characteristics of the convolution layer to reduce model parameters; the BN layer accelerates the fitting speed of the network, and the calculation efficiency is accelerated; the Attention module calculates the importance degree of the features to the final output; the full connection layer maps the features; the classification layer classifies features. The invention can accurately and automatically identify the running state of the bearing in real time, thereby effectively maintaining the normal running of mechanical equipment.
Referring now to FIG. 16, shown is a block diagram of a computer system 1600 suitable for use in implementing an electronic device of an embodiment of the present application. The electronic device shown in fig. 16 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 16, the computer system 1600 includes a Central Processing Unit (CPU) 1601 which can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM) 1602 or a program loaded from a storage portion 1608 into a Random Access Memory (RAM) 1603. In the RAM 1603, various programs and data necessary for the operation of the system 1600 are also stored. The CPU 1601, ROM 1602, and RAM 1603 are connected to each other via a bus 1604. An input/output (I/O) interface 1605 is also connected to the bus 1604.
The following components are connected to the I/O interface 1605: an input portion 1606 including a keyboard, a mouse, and the like; an output portion 1607 including a display such as a Liquid Crystal Display (LCD) and a speaker; a storage portion 1608 including a hard disk and the like; and a communication section 1609 including a network interface card such as a LAN card, a modem, or the like. The communication section 1609 performs communication processing via a network such as the internet. The driver 1610 is also connected to the I/O interface 1605 as needed. A removable medium 1611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 1610 as necessary, so that a computer program read out therefrom is mounted in the storage portion 1608 as necessary.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable storage medium, the computer program containing program code for performing the method illustrated by the flow chart. In such embodiments, the computer program may be downloaded and installed from a network via the communication portion 1609, and/or installed from the removable media 1611. The above-described functions defined in the method of the present application are executed when the computer program is executed by the Central Processing Unit (CPU) 1601. It should be noted that the computer readable storage medium described herein can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable storage medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable storage medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present application may be implemented by software or hardware. The units described may also be provided in a processor, and the names of the units do not in some cases constitute a limitation of the unit itself.
Embodiments of the present invention also relate to a computer-readable storage medium having stored thereon a computer program which, when executed by a computer processor, implements the method above. The computer program comprises program code for performing the method illustrated in the flow chart. It should be noted that the computer readable medium of the present application can be a computer readable signal medium or a computer readable medium or any combination of the two.
Firstly, fixed-length random segmentation is adopted to enhance the randomness of data, so that the robustness of a model is enhanced; secondly, when the model is constructed, the overfitting of the model is relieved by batch normalization, Dropout and L2 regularization, so that the detection efficiency of the model is improved; then, the importance degree of the features to the final output is calculated through an attention mechanism, so that the method still has excellent fault diagnosis capability under the condition of no multilayer neural network, and has excellent stability under the condition of unbalanced data; in the model training stage, an exponential decay learning rate and a callback function are adopted to prevent the model from being over-fitted and store the optimal model in the training process; finally, the stored model is applied to real-time fault detection of the rotary machine; the Attention CNN model network structure comprises: a convolutional layer, a pooling layer, a Batch Normalization (BN) layer, an Attention module, a full link layer, and a classification layer. The convolution layer carries out feature extraction on the original vibration signal; the pooling layer performs down-sampling on the characteristics of the convolution layer to reduce model parameters; the BN layer accelerates the fitting speed of the network, and the calculation efficiency is accelerated; the Attention module calculates the importance degree of the features to the final output; the full connection layer maps the features; the classification layer classifies features. The invention can accurately and automatically identify the running state of the bearing in real time, thereby effectively maintaining the normal running of mechanical equipment.
The above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention herein disclosed is not limited to the particular combination of features described above, but also encompasses other arrangements formed by any combination of the above features or their equivalents without departing from the spirit of the invention. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.