Software design of rotating machinery fault diagnosis system based on deep learning

. With the development of Industry 4.0, in order to meet the needs of intelligent fault diagnosis of rotating machinery in the industrial field, this paper developed a fault diagnosis system for rotating machinery based on deep learning and wavelet transform methods. The system is based on the Python language and mainly combines the PyQt graphical interface framework and the TensorFlow machine learning framework to complete the training requirements for historical or online fault data, and perform online monitoring and diagnosis of equipment operating conditions. The diagnostic accuracy of the system test results is more than 95%, the software interface is friendly, the algorithm generalization ability is good, and the reliability is strong. It provides guidance for the diagnosis of rotating machinery.


Introduction
Large-scale rotating machinery is a key equipment in industrial production, which is widely used in power, metallurgy, and transportation. With the development of large-scale integration of modern industry, the technical complexity of rotating machinery is also increasing, and its failure will cause huge economic losses and safety accidents. Statistics show that when equipment fails, the fault diagnosis judgment time accounts for 70% to 90% of the total time, while the repair time only accounts for 10% to 30%. Therefore, efficient and accurate fault diagnosis methods are particularly important to ensure the safety and economy of the unit [1]. Industry 4.0 requires production managers to be able to grasp the operating status and health of the equipment in real time, which requires more and more intelligent diagnosis of rotating machinery. With the popularization of online monitoring systems, a large amount of online monitoring data has been accumulated in the industry, among which vibration signals are widely used in fault diagnosis of rotating machinery [2]. Deep learning, as an advanced intelligent algorithm, can identify high-dimensional complex inputs, get rid of the dependence of manually extracting features to identify and diagnose the operating state of the equipment [3].
At present, there are many literatures on the application of deep learning to fault diagnosis methods of rotating machinery, most of which are based on methods, and there is no mature diagnosis system based on deep learning. Xiong et al. [4] proposed a deep belief network (DBN) and particle swarming support vector machine (PSO-SVM) rotating machinery fault diagnosis method, which improves the diagnosis accuracy and shortens the training time. Zhang J H et al. [5] proposed a new method of deep learning fault diagnosis based on clustering and stacked autoencoder, which makes the diagnosis more intelligent. Zhang L et al. [6] based on the rolling bearing fault diagnosis method combining convolutional noise reduction autoencoder and deep convolutional network (CNN), processing low signal-tonoise ratio and high-dimensional signals. Most of the literature optimizes the algorithm from the aspects of improving the diagnosis accuracy and filtering signal processing. At present, there is no set of relatively complete and comprehensive deep learning intelligent industrial rotating machinery fault diagnosis system.
In order to solve the needs of intelligent fault diagnosis of rotating machinery in the industrial field, this paper is based on the Python language, mainly combines the PyQt graphical interface framework and the TensorFlow2.0 machine learning framework to build a fault diagnosis system, realizes the training of the historical operation data of the equipment, and carries out the operation status of the equipment. Timely and accurate diagnosis, providing data pre-processing, multiple depth model selection, manual adjustment of training parameters, multiple diagnosis methods and other functions.
2 Software functional structure

Main functional structure
The functional structure of the rotating machinery fault diagnosis system based on deep learning designed according to the characteristics of the rotating machinery fault diagnosis system is shown in Figure 1:  In the figure, the data pre-processing part realizes the following functions on the field data: data filtering, data labelling, data normalization, and data wavelet transformation. The purpose is to format the field data and input it into a deep neural network.
The data training part provides functions such as custom models, custom adjustment of model parameters, selection of training optimization algorithms, and preservation of models. Its function is to ensure the stability of the training process and improve the generalization ability of the training model.
Part of the fault diagnosis functions include model loading, real-time monitoring and diagnosis, diagnosis results display and save functions. The software also provides detailed instructions and help files to help and guide the smooth progress of the software training data and fault diagnosis process.

Data pre-processing function
The fault diagnosis system based on deep learning is a black box model system, the core of which is to use data-driven algorithms to identify and classify faults [7]. The quality of the pre-processing process will determine the effect of the data training process. In order to enhance the model's ability to automatically extract features, the data pre-processing part will perform automatic wavelet transformation in addition to the original data filtering, labelling, and normalization. Wavelet analysis is widely used in signal processing, image analysis, speech analysis and other fields. It can transform the spectrum vibration signal in the amplitude frequency domain to extract useful features [8]. This method uses the wavelet transform method to increase the dimension of the data, converts 2-D vibration waveform data into 3-D wavelet grayscale image, convert data to time domain and frequency domain information, and prepares for input deep network training after format conversion.

Data training and fault diagnosis function
The data training process determines the model's generalization ability and excellent diagnostic performance. Model selection and optimization algorithms are particularly important during the training process. The software provides three model selection methods: constant speed wavelet transforms deep neural network, variable speed based on SPP wavelet transform deep network, and custom deep neural network.
The basic diagnosis process of constant speed wavelet transform deep neural network is shown in the following figure 2: The main process of this method is data collection, vibration data pre-processing, wavelet grayscale image acquisition, wavelet grayscale image interception, CNN training and CNN fault diagnosis.
The convolutional deep neural network requires that the input parameter size of its last layer of fully connected is fixed, which results in the size of its input graph being fixed. In the industry, the rotational speeds of rotating machinery are not the same, that is to say, the matrix scales after wavelet transformation are not the same. In order to solve the contradiction problem on the input size, the software provides an algorithm based on SPP-CNN convolutional neural network to optimize the algorithm, and this optimization algorithm is more suitable for variable speed data.
The software also supports custom model functions, which can artificially change the number of network layers and network structure, which can better meet the scope of application of the system to rotating machinery.

Software design process
The software is mainly designed according to the flow of data and models. The design process is: After obtaining the historical operation data of the equipment on the spot, the data is preprocessed to obtain a data structure that meets the input of the deep network, and then the processed data is saved. Then select the model structure and training parameters, load the data into the model for training, save the trained model, load the pre-trained model file during the fault diagnosis process, and import the online monitoring operating data to be in the running state Do fault diagnosis. The design flowchart of a rotating machinery fault diagnosis system based on deep learning is shown in flow figure 3. The software process shown in Figure 3 contains a large amount of data processing, data operation, and data diagnosis. When designing the software, first use the Python data processing framework to design the data pre-processing part, and then use the TensorFlow framework to perform the deep network Build, and finally use the Pyqt framework to design a graphical interface to visualize these functions.

Software design and implementation
According to the general software design method, combined with the actual functions and processes of the software shown in Figure 1 and Figure 3, the software design mainly includes the following aspects.

Data access management design
The fault diagnosis of rotating machinery based on deep learning mainly includes four types of data access work such as operating data, model files, training parameters and simulation graphics. In different working stages, the types of data accessed are also different, so design is required Reasonable data access interface. In addition, storing data for different purposes into related fixed folders can facilitate subsequent work and data query and use.
The access to the running data is mainly to access the test data in data formats such as CSV, TXT and MAT from the corresponding folder; after the software is trained, it will generate a ".h5" type files. The software can load and modify its files; model parameter access is mainly used in conjunction with the model file reading process. For custom models, the training parameters will be determined after the model is determined, so the model reads will also be loaded with the parameters; Software running will produce a lot of result display graphics, these simulation graphics are directly saved as graphics files in ".fig" format through the Python tool.

Application module design
The application module is the structure that realizes the function operation, as shown in the function structure in Figure 1, there are three main application modules: data pre-processing module, data training module, fault diagnosis module and so on. These categories are composed of different sub-modules, which can realize the monitoring of the equipment operating status and real-time fault diagnosis.
The data pre-processing module mainly includes data filtering module, data labelling module, data normalization and data wavelet transform and other sub-modules. The application data pre-processing module can automatically perform a series of data processing operations on the input data to realize the online format of the data Conversion.
The data training module, users can customize the optimization algorithm to calculate the gradient descent to speed up the gradient descent speed. Make the objective function converge faster. The optimization algorithms provided by the software include SGD and Adam, etc. The built-in models of the software include constant speed wavelet transform deep neural network, variable speed based on SPP wavelet transform deep network, and custom deep neural network, the built-in activation function is SELU function. The specific parameters are shown in the table below: In the fault diagnosis module, software can display the sampling information of the data and the original fault waveform, perform fast Fourier transform and display it, and display the complete and reasonable diagnosis result on the interactive interface. In order to make the system stable, the methods of offline diagnosis and real-time diagnosis are adopted.

Interactive interface
The system is based on the Python language, uses the Pyqt5 interface framework, and is built using the TensorFlow2.0 neural network framework. Realize neural network construction and interface realization, and use interface interaction to realize its specific functions. Network training main menu. The software provides an interface for training data, integrates calling data, selects and creates a new deep neural network, saves the network and other interfaces. The main interface will display network information, network structure, errors and accuracy in the training process.  The main menu of fault diagnosis, the trained network for fault diagnosis is an important part of the system. The software provides interfaces for real-time diagnosis and loading data, and displays the vibration waveform and frequency spectrum of the loaded data and the diagnosis results on the interface.

Diagnostic performance test
Take a collision and unbalance and normal working condition data from the historical operating data, use the constant speed wavelet transform deep learning model for training, and use the trained model to obtain the following results for fault diagnosis.
It can be seen from the figure that the rotating machinery fault diagnosis system based on deep learning has an accuracy rate of more than 90% for both types of faults, with good diagnostic performance and strong network generalization ability, which can be used as a guide for diagnosis. Fig. 6. Diagnostic accuracy

Conclusions
The development of computer and artificial intelligence technology has promoted the application of fault diagnosis technology. Based on deep learning and wavelet transform, this paper designs a fault diagnosis system for rotating machinery. The system integrates data training and fault diagnosis modules, which can train historical fault data and perform fault diagnosis on operating data, so that faults can be identified and classified. The diagnostic accuracy of the system test results is more than 95%, with strong generalization ability and good stability, which provides guidance for the operation and maintenance of rotating machinery.