Bearing fault diagnosis method and system based on digital twinborn model
By combining digital twin models and deep learning algorithms with 3D modeling and multi-source sensor data, a CNN-LSTM-Transformer feature layer fusion diagnostic model is constructed. This model addresses the shortcomings of traditional bearing fault diagnosis methods, enabling accurate real-time monitoring and diagnosis of bearing faults and improving the operational stability and safety of equipment.
Patent Information
- Application Number
- CN202511656541.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-12
- Publication Date
- 2026-03-06
AI Technical Summary
Traditional bearing fault diagnosis methods based on vibration and sound signals are easily affected by subjective factors, making it difficult to detect hidden faults. Furthermore, new equipment has limitations in diagnosis, and existing technologies struggle to achieve accurate bearing fault monitoring and diagnosis.
By combining a digital twin model with deep learning algorithms, and through 3D modeling, multi-source sensor data acquisition, data cleaning and fusion, a CNN-LSTM-Transformer feature layer fusion diagnostic model is constructed to achieve real-time visualization and accurate diagnosis of bearing faults.
It achieves a high degree of integration between the physical world and virtual space, improves the intuitiveness of monitoring and the accuracy of fault diagnosis, can identify early weak faults and high-concurrency complex faults, has lifelong evolution capability, and reduces operation and maintenance costs.
Smart Images

Figure CN121614973A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a bearing fault diagnosis method and system based on a digital twin model, belonging to the field of digital twin technology. Background Technology
[0002] Bearings, as core components of rotating machinery, are widely used in industrial production. From aircraft engines and gas turbines to modern equipment such as industrial robots, their normal operation highly depends on the reliable performance of bearings. Due to the long-term bearing of equipment weight and impact forces, defects such as localized spalling can easily occur on the surface of the bearing outer ring raceway, leading to abnormal equipment operation and, in severe cases, even major accidents. This not only reduces production efficiency and affects product quality but may also pose safety hazards and significantly increase maintenance costs. Therefore, accurate monitoring and fault diagnosis of bearing operating conditions are crucial for ensuring stable equipment operation, improving economic efficiency, and ensuring safe production.
[0003] Traditional fault diagnosis methods based on vibration and sound signal analysis and manual feature extraction are susceptible to subjective interference, resulting in unstable diagnostic results and difficulty in detecting hidden faults. They also have limitations in diagnosing new equipment. Digital twin technology, emerging with the development of the Industrial Internet of Things (IIoT), can simulate operating conditions and generate fault simulation data by constructing high-fidelity digital models. Combined with deep learning neural networks, this opens up new avenues for bearing fault diagnosis.
[0004] In view of this, the present invention is hereby proposed. Summary of the Invention
[0005] This invention provides a bearing fault diagnosis method and system based on a digital twin model. By integrating 3D modeling, deep learning algorithms, advanced data processing technology and efficient data transmission mechanism, it successfully realizes real-time visualization of the operating status of the bearing fault test bench and accurate diagnosis of rolling bearing faults, providing a new approach to improving equipment maintenance efficiency and production safety.
[0006] The technical solution of this invention is:
[0007] According to a first aspect of the present invention, a bearing fault diagnosis method based on a digital twin model is provided, comprising: performing a three-dimensional modeling of the test bench according to the shape and size of the physical test bench; performing polygon reduction and rendering on the three-dimensional modeling to construct a three-dimensional model of the test bench; collecting data in different states of the physical test bench through multi-source sensors to obtain multi-source sensor measured time-series data in different states; importing the three-dimensional model of the test bench into a virtual 3D platform for scene construction to construct a digital twin model; the virtual 3D platform is accessed via OPC. The UA protocol receives and stores measured time-series data from multi-source sensors under different states, and drives the digital twin model to move synchronously with the physical experimental platform. After the digital twin model is built, the stored measured time-series data from multi-source sensors under different states is cleaned, and then the cleaned time-series data is uniformly transformed and encapsulated to obtain preprocessed time-series data under different states. The three types of preprocessed time-series data are fused to obtain mixed sample datasets under each state. The mixed sample datasets under each state are divided according to a preset ratio based on the time sequence to form training set, validation set, and test set. The training set, validation set, and test set are imported into the feature layer fusion diagnostic model based on CNN-LSTM-Transformer for training, hyperparameter tuning, and performance evaluation. The trained feature layer fusion diagnostic model based on CNN-LSTM-Transformer performs real-time fault diagnosis based on the preprocessed time-series data provided by the virtual 3D platform, and feeds back the fault information to the virtual 3D platform to achieve fault visualization.
[0008] Furthermore, the step of acquiring data from the physical test bench under different states using multi-source sensors to obtain multi-source sensor measured time-series data under different states includes: using vibration acceleration sensors, speed sensors, and temperature sensors as multi-source sensors; acquiring data from the physical test bench under different loads for corresponding outer ring faults, inner ring faults, ball faults, combined faults, and normal states using multi-source sensors to obtain multi-source sensor measured time-series data under different loads; wherein, the multi-source sensor measured time-series data includes measured time-series data acquired by speed sensors, temperature sensors, and vibration acceleration sensors.
[0009] Furthermore, the experimental platform is a high-speed machine tool spindle experimental platform. The speed sensor is non-contactly installed at a parallel position equal to the height of the spindle. The temperature sensor is placed around the experimental platform, and the vibration acceleration sensor is installed on the bearing support of the experimental platform. The speed sensor and temperature sensor are connected to the host computer through an RS485 data acquisition module, and the vibration acceleration sensor is connected to the host computer through a data acquisition card.
[0010] Furthermore, the load range is 0 N·m to 2 N·m.
[0011] Furthermore, the process involves cleaning the stored multi-source sensor measured time-series data under different states, then uniformly converting and encapsulating the cleaned time-series data to obtain preprocessed time-series data under different states. The three types of preprocessed time-series data are then fused to obtain a mixed sample dataset under each state. This includes cleaning the measured time-series data collected by the speed sensor, temperature sensor, and vibration acceleration sensor separately to obtain cleaned speed time-series data, cleaned temperature time-series data, and cleaned vibration time-series data. Finally, the cleaned speed time-series data, cleaned temperature time-series data, and cleaned vibration time-series data are converted into a unified numerical range and encapsulated. Preprocessed rotational speed time-series data, preprocessed temperature time-series data, and preprocessed vibration time-series data are obtained. These data are then converted to a unified numerical range. Based on time alignment principles, the three types of preprocessed time-series data under a fixed time window are fused to obtain mixed samples for each state, and labels are created to obtain a mixed sample dataset for each state. The preprocessed time-series data includes preprocessed rotational speed time-series data, preprocessed temperature time-series data, and preprocessed vibration time-series data.
[0012] Furthermore, the feature layer fusion diagnostic model based on CNN-LSTM-Transformer includes parallel CNN sub-models, LSTM sub-models, and Transformer sub-models, and also includes a concatenation operation and a fully connected layer. The inputs to the parallel CNN sub-models, LSTM sub-models, and Transformer sub-models are the preprocessed vibration time-series data, preprocessed rotational speed time-series data, and preprocessed temperature time-series data from the mixed sample dataset, respectively. The 64-dimensional vibration local features output by the CNN sub-model, the 32-dimensional rotational speed time-series trend features output by the LSTM sub-model, and the 32-dimensional temperature long-distance correlation features output by the Transformer sub-model are concatenated into a 128-dimensional fusion feature vector. The concatenated 128-dimensional fusion feature vector is input to the fully connected layer, which has a "hidden layer + output layer" structure. The hidden layer further refines the 128-dimensional fusion features using the non-linear activation function ReLU to uncover the cross-correlation between "vibration-rotational speed-temperature." The number of neurons in the output layer is consistent with the number of categories, and the output of the hidden layer is converted into a probability distribution using the softmax activation function.
[0013] Furthermore, the CNN sub-model includes two sequentially connected 1D convolutional layers, a max pooling layer, and a global average pooling layer; the LSTM sub-model includes two LSTM network layers; and the Transformer sub-model includes position encoding, dimension mapping, a multi-head self-attention layer, a feedforward network and residual connections, and a global average pooling layer.
[0014] According to a second aspect of the present invention, a bearing fault diagnosis system based on a digital twin model is provided, comprising: a virtual layer for performing three-dimensional modeling of the test bench according to the shape and size of the physical test bench; performing polygon reduction and rendering on the three-dimensional model to construct a three-dimensional model of the test bench; and importing the three-dimensional model of the test bench into a virtual 3D platform for scene construction to construct a digital twin model; the virtual 3D platform is accessed via OPC. The UA protocol communication receives and stores multi-source sensor measured time-series data under different states, and drives the digital twin model to move synchronously with the physical experimental platform. The physical layer is used to collect data from the physical experimental platform under different states via multi-source sensors to obtain multi-source sensor measured time-series data under different states. The data layer is used to clean the stored multi-source sensor measured time-series data under different states, then uniformly transform and encapsulate the cleaned time-series data to obtain pre-processed time-series data under different states. The three types of pre-processed time-series data are fused to obtain a mixed sample dataset under each state. The mixed sample dataset under each state is divided according to a preset ratio based on time sequence to form a training set, a validation set, and a test set. The training set, validation set, and test set are imported into a CNN-LSTM-Transformer-based feature layer fusion diagnostic model for training, hyperparameter tuning, and performance evaluation. The fault diagnosis module is used by the trained CNN-LSTM-Transformer-based feature layer fusion diagnostic model to perform real-time fault diagnosis based on the pre-processed time-series data provided by the virtual 3D platform, and feeds the fault information back to the virtual 3D platform for fault visualization.
[0015] The beneficial effects of this invention are:
[0016] This invention first achieves a high degree of integration and bidirectional mapping between the physical world and virtual space. Through 1:1 high-precision 3D modeling and Unity3D visualization rendering, a digital twin completely identical to the physical experimental platform is constructed. Real-time data interaction and synchronous mapping are then achieved using the OPCUA protocol. This deep integration allows for a panoramic and transparent presentation of equipment status, greatly enhancing the intuitiveness of monitoring and the ability to perceive system status. Secondly, this invention significantly improves the data foundation quality for fault diagnosis through the deep fusion and collaboration of multi-source heterogeneous data. This fusion mechanism generates a more complete and higher signal-to-noise ratio "enhanced" dataset, laying a solid foundation for subsequent accurate diagnosis. Furthermore, this invention proposes a feature layer fusion diagnostic model based on CNN-LSTM-Transformer. This model fully leverages the advantages of multiple deep learning architectures. This combined model possesses powerful feature extraction and temporal pattern recognition capabilities, enabling the extraction of deep and subtle fault symptoms from complex fused data. This allows for accurate identification and classification of early, weak faults and high-concurrency complex faults, with diagnostic accuracy and robustness far exceeding traditional single-model methods. Finally, this method achieves a closed loop, allowing diagnostic results to be fed back to the virtual 3D platform in real time for model correction and optimization. This enables the platform to continuously adapt to new operating states and unknown fault types, possessing the capability for lifelong evolution. This not only significantly improves the decision-making level of predictive maintenance and reduces the risk of unplanned downtime and maintenance costs, but also provides a replicable and scalable complete solution for the intelligent operation and maintenance of experimental platforms, possessing significant engineering application value and promising prospects for widespread adoption. Attached Figure Description
[0017] Figure 1 This is a flowchart illustrating the process structure of the method of the present invention.
[0018] Figure 2 This is a three-dimensional simulation model of the experimental platform of the present invention.
[0019] Figure 3 This is a schematic diagram of the neural network structure of the present invention.
[0020] Figure 4 This is a schematic diagram of the confusion matrix of the present invention.
[0021] Figure 5 This is a training and validation loss curve for the present invention.
[0022] Figure 6 This is a scatter plot of the faults of the present invention.
[0023] Figure 7 This is a scatter plot of fault classification for the present invention.
[0024] Figure 8 This is a flowchart of the system of the present invention. Detailed Implementation
[0025] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention. It should be noted that, unless otherwise specified, the embodiments and features in the embodiments of this application can be arbitrarily combined with each other.
[0026] Example 1: Reference Figures 1-7 According to a first aspect of the present invention, a bearing fault diagnosis method based on a digital twin model is provided, comprising the following steps:
[0027] S1. Based on the shape and size of the physical experimental platform, create a 3D model of the experimental platform at a 1:1 scale; reduce the number of faces in the 3D model and render it to construct a 3D model of the experimental platform.
[0028] For example, taking a physical high-speed machine tool spindle test bench as an example, the physical high-speed machine tool spindle test bench mainly includes a motor, spindle box, bearing support, and spindle. The motor provides power, the spindle is installed in the spindle box, the support is used to support the bearing, the bearing is used to cooperate with the end of the spindle that extends out of the spindle box, and the support is also used to install the pressure-applying operating lever. Based on the shape and size of the physical high-speed machine tool spindle test bench, the test bench is 3D modeled at a 1:1 scale using the Solidworks platform. The spindle box is reduced in polygon count (using Blender to simplify the model's polygon count; non-critical details of the test bench (such as screws and textured grooves) can be deleted, retaining the key parts of the spindle and bearings) and the entire test bench is rendered to construct a 3D model of the test bench, such as... Figure 2 The image shows the visualization result of the 3D model.
[0029] S2. Install multi-source sensors on the physical test bench and collect data on corresponding outer ring faults, inner ring faults, ball faults, combined faults, and normal conditions in the physical test bench through the multi-source sensors to obtain multi-source sensor measured time series data under different conditions (current load is 0 N·m); among which, the multi-source sensor measured time series data includes measured time series data collected by speed sensor, temperature sensor, and vibration acceleration sensor.
[0030] Specifically: Vibration acceleration sensor, speed sensor, and temperature sensor are used as multi-source sensors; among them, the speed sensor is installed non-contactly at a parallel position equal to the height of the spindle, and the temperature sensor is placed around the perimeter of the experimental platform; the vibration acceleration sensor is installed on the bearing support, the speed sensor and temperature sensor are connected to the RS485 data acquisition module, and the vibration acceleration sensor is connected to the data acquisition card, and the connection is confirmed to be firm to avoid data loss due to poor contact.
[0031] The RS485 data acquisition module serves as a communication bridge between the computer and the sensors. It automatically controls signal transmission and reception, with a communication distance exceeding 100 meters. The entire RS485 data acquisition module includes the RS485 module, a repeater, a power supply, and a USB interface. Specific wiring instructions: Connect the RS485 module's "VCC" to the 12V power supply. Connect the RS485 module's "GND" to the power supply's "GND" plus the "GND" of both sensors for common grounding. The A / B lines of the RS485 module must be connected to the corresponding A / B lines of the sensors. Finally, connect the RS485 module to the repeater and then to the computer via the USB interface to obtain the measured timing data from the speed and temperature sensors.
[0032] The core of vibration signal acquisition is the signal matching between the vibration accelerometer and the data acquisition card. A piezoelectric IEPE sensor is used to convert mechanical vibration into an electrical signal. A DAQ card is used to convert the sensor's electrical signal into a digital signal. The data acquisition card is then powered by a power adapter and connected via sensor cables. The sensor cable "IEPE+" (red) is connected to the data acquisition card's "IEPE Power+" interface, the sensor cable "IEPE-" (black) is connected to the data acquisition card's "IEPE Power-" interface, the sensor cable "Signal+" (white) is connected to the data acquisition card's "AI 0+" interface, and the sensor cable "Signal-" (green) is connected to the data acquisition card's "AI 0-" interface. The cable shielding is grounded. A 12V power adapter is plugged into the data acquisition card's "Power" interface, and the data acquisition card's USB interface is connected to the computer to obtain the measured timing data from the vibration accelerometer.
[0033] S3. Import the 3D model of the experimental platform into the virtual 3D platform (Unity3D) to build the scene and construct the digital twin model. The virtual 3D platform receives and stores the measured time series data of multi-source sensors under different states through OPC UA protocol communication, and drives the digital twin model to move synchronously with the physical experimental platform.
[0034] S3 includes: changing the SolidWorks source file of the experimental platform's 3D model to the Unity-supported FBX format and then importing it into the virtual 3D platform (Unity3D) to build a digital twin model, and adding basic lighting to optimize the scene and enhance realism. The Python for Unity plugin is imported in advance during scene building, and the Python interpreter is configured. The Python OPC UA library is installed to implement OPC UA protocol communication, as shown in the following program:
[0035] pip install opcua # OPC UA core library
[0036] pip install pyserial # Sensors communicate via serial port (RS485)
[0037] pip install pymodbus # Sensors support Modbus protocol
[0038] The Python OPC UA library uses an OPC UA server script (multi_sensor_opc_server.py) to configure the OPC UA server, creating a three-level node tree on it. The root node is SensorData, and the child node Batch stores batch data. Each child node contains three array nodes: Vibration (g), Speed (rpm), and Temperature (°C). Each sample consists of 1024 data points at a sampling rate of 10240Hz, with a duration of 0.1 seconds. The data type is FloatArray. 5000 samples are populated at a time, and the node is published and stored. Unity executes this asynchronously in a background thread using Task.Run, reading 5000 samples in batches to avoid blocking the Unity main thread, reducing OPC communication, and storing the data locally in CSV format. Simultaneously, a driver script is written to extract data step-by-step according to the time sequence of the 5000 samples, at sampling intervals (97 microseconds / data point), driving the digital twin model to move synchronously with the physical experimental platform. Create a UI text display to visualize sensor data (temperature, speed, vibration), such as... Figure 2 As shown.
[0039] S4. After the digital twin model is constructed, the measured time series data of multi-source sensors under different states are imported into Python for data cleaning. Then, the cleaned time series data is uniformly transformed and encapsulated to obtain preprocessed rotational speed time series data, preprocessed temperature time series data, and preprocessed vibration time series data under different states. The three types of preprocessed time series data are fused to obtain a mixed sample dataset under each state.
[0040] Specifically, the time-series data collected by the speed sensor, temperature sensor, and vibration acceleration sensor are cleaned to obtain cleaned speed time-series data, cleaned temperature time-series data, and cleaned vibration time-series data. This involves locating the CSV file and exporting it to a directory accessible to Python, installing the pandas library for data processing and the numpy library for numerical computation, and writing a Python script to remove invalid values and outliers (speed less than 200 rpm, vibration acceleration not within 0~10g) caused by transmission errors in the CSV file, retaining valid data that conforms to the sensor characteristics, thus achieving data cleaning.
[0041] The cleaned rotational speed time series data, cleaned temperature time series data, and cleaned vibration time series data are converted into a unified numerical range and encapsulated to obtain preprocessed rotational speed time series data, preprocessed temperature time series data, and preprocessed vibration time series data. By converting the preprocessed rotational speed time series data, preprocessed temperature time series data, and preprocessed vibration time series data into a unified numerical range, the influence of dimensional and range differences on subsequent data fusion and analysis can be eliminated. The data is then mapped to the [0,1] interval according to the minimum-maximum normalization formula.
[0042] .
[0043] In the formula, This is the original data. and These are the minimum and maximum values of the data, respectively.
[0044] The process involves obtaining a mixed sample dataset for each state based on preprocessed rotational speed time-series data, preprocessed temperature time-series data, and preprocessed vibration time-series data under different states. Specifically, the three types of preprocessed time-series data under each state are fused within a fixed time window (0.1s) according to the time alignment principle to obtain mixed samples for each state and create labels, resulting in a mixed sample dataset for each state. The mixed sample dataset has the format (5000, 1024, 1). The preprocessed time-series data includes preprocessed rotational speed time-series data, preprocessed temperature time-series data, and preprocessed vibration time-series data.
[0045] For example, taking the normal state as an example, the preprocessed rotational speed time series data, preprocessed temperature time series data, and preprocessed vibration time series data are fused together within a fixed time window (0.1s) according to the time alignment principle to obtain mixed samples of each state. That is, each mixed sample contains preprocessed rotational speed time series data, preprocessed temperature time series data, and preprocessed vibration time series data within the same time window, and a label is made for each mixed sample. In this embodiment of the invention, the labels involved are outer ring fault label, inner ring fault label, ball bearing fault label, composite fault label, and normal label, so that the subsequent model can learn the mapping relationship of "time series features → fault mode".
[0046] S5. Divide the mixed sample datasets under each state into training set, validation set and test set according to the time sequence of the preset ratio.
[0047] For example: The mixed sample dataset for each state is divided into training, validation, and test sets according to a preset ratio based on time sequence. That is, the training, validation, and test sets correspond to the past, recent, and future times, respectively, simulating the logic of "training with historical data to predict future states" in real-world scenarios. It is ensured that the proportion of each fault label in the training, validation, and test sets is consistent with the original data to avoid missing specific fault types in any set. The preset ratio of the training, validation, and test sets is 75%, 15%, and 15% respectively (i.e., the training set has 3500 samples, and both the validation and test sets have 750 samples each). This data is then saved in .npz format for easy loading by subsequent deep learning models.
[0048] S6. Import the training set, validation set, and test set into the feature layer fusion diagnostic model based on CNN-LSTM-Transformer for training, hyperparameter tuning, and performance evaluation, laying the foundation for subsequent practical fault diagnosis. The model structure is as follows: Figure 3 As shown;
[0049] The CNN-LSTM-Transformer-based feature layer fusion diagnostic model includes parallel CNN, LSTM, and Transformer sub-models, as well as a concatenation operation and a fully connected layer. The inputs to the parallel CNN, LSTM, and Transformer sub-models are preprocessed vibration time-series data, preprocessed rotational speed time-series data, and preprocessed temperature time-series data from the mixed sample dataset, respectively. The 64-dimensional vibration local features output by the CNN sub-model, the 32-dimensional rotational speed time-series trend features output by the LSTM sub-model, and the 32-dimensional temperature long-distance correlation features output by the Transformer sub-model are concatenated into a 128-dimensional fusion feature vector. This 128-dimensional fusion feature vector is then input into a fully connected layer, which has a "hidden layer + output layer" structure. The hidden layer further refines the 128-dimensional fusion features using the ReLU nonlinear activation function to uncover the cross-correlation between "vibration-rotational speed-temperature." The number of neurons in the output layer is consistent with the number of categories, and the output of the hidden layer is converted into a probability distribution using the softmax activation function.
[0050] The CNN sub-model consists of two 1D convolutional layers, a max pooling layer, and a global average pooling layer connected in sequence; the CNN sub-model mainly processes preprocessed vibration time series data in the mixed sample dataset. First, the training set in the mixed sample dataset is used as input to extract local impact features through two 1D convolutional layers. The first layer uses 32 convolutional kernels of size 7 (stride 1) to slide and scan the preprocessed vibration time series data in the mixed sample dataset, capturing basic local features such as fault pulse peaks and rapid decay, with an output of (3500, 1018, 32). The second layer uses 64 convolutional kernels of size 5 to further abstract the features from the first layer and mine the periodicity of the fault pulses, with an output of (3500, 1014, 64). Next, a max pooling layer (pooling size 4) is used to take the maximum value of the local window of each channel, retaining the pulse peak and compressing the time step to 254 steps, with an output of (3500, 254, 64). Finally, a global average pooling layer is used to average the 254 time steps, outputting a 64-dimensional feature vector (3500, 64), integrating the fault-related local instantaneous features in the vibration signal, providing "instantaneous fault features" for subsequent feature fusion and splicing. During training, the number of convolutional kernels was adjusted using 750 validation set samples to avoid overfitting.
[0051] The LSTM sub-model consists of two LSTM layers, each containing an input gate, a forget gate, and an output gate. The LSTM sub-model primarily processes preprocessed rotational speed time-series data from the mixed sample dataset. The first layer contains 64 hidden units with `return_sequences=True`. The training set from the mixed sample dataset is used as input, passing sequentially through the input gate, forget gate, and output gate. The input gate controls the entry of new rotational speed information, the forget gate discards irrelevant history, and the output gate filters the current state, finally outputting the hidden state (3500, 1024, 64) for each time step. The second layer contains 32 hidden units with `return_sequences=False`, outputting only the state of the last time step, aggregating and refining the overall trend within a 0.1-second window (corresponding to 1024 time steps ÷ 10240Hz = 0.1 seconds), ultimately outputting a 32-dimensional feature vector (3500, 32), providing "trend-based fault features" for subsequent feature fusion and concatenation. During training, the number of LSTM units is optimized using 750 validation set samples to balance temporal modeling capability and generalization capability.
[0052] The Transformer sub-model consists of five parts: position encoding, dimension mapping, multi-head self-attention layer, feedforward network and residual connection, and global average pooling layer. The Transformer sub-model mainly processes preprocessed temperature time series data in mixed sample datasets. First, the training set in the mixed sample dataset is used as input, and positional information is injected into 1024 time steps through sine / cosine functions for positional encoding. This enables the model to distinguish "the same temperature value at different time points," ensuring that the temporal trend of temperature changes is correctly captured. The 1D temperature time series data is transformed into a 128-dimensional matrix through linear mapping, refining the subtle differences in temperature features in high-dimensional space. A multi-head self-attention layer captures long-distance correlations and complex dependencies in the temperature time series data. The feedforward network consists of two layers of 1D convolutions to capture the coupling relationship between temperature and other factors. Then, the input and output of the multi-head attention layer are added together and residual connections are made to avoid feature loss. Then, the feature dimension of each sample is normalized layer by layer to stabilize the distribution of temperature features during training. After the above processing, the temperature features are high-dimensional temporal features. The global average pooling layer averages the 1024 time steps and compresses them into a 32-dimensional feature vector (3500, 32), integrating the global temperature patterns within the entire 0.1-second window, providing "long-distance correlation features" for subsequent feature fusion and splicing. During training, the number of attention heads was adjusted using 750 validation set samples to optimize the ability to capture long-distance dependencies.
[0053] Next, the 64-dimensional vibration local features output by the CNN sub-model, the 32-dimensional rotational speed temporal trend features output by the LSTM sub-model, and the 32-dimensional temperature long-distance correlation features output by the Transformer sub-model are concatenated into a 128-dimensional fusion feature vector F, forming a unified global feature space. Then, the concatenated 128-dimensional fusion feature vector is input into a fully connected layer, which has a "hidden layer + output layer" structure. The hidden layer (containing 64 neurons) further refines the 128-dimensional fusion features through the non-linear activation function ReLU to explore the cross-correlation between "vibration-rotational speed-temperature". The number of neurons in the output layer is consistent with the number of categories (5 neurons for 4 types of faults + normal). The output is a 5-dimensional vector. The output of the hidden layer is converted into a probability distribution through the softmax activation function. For example, the probability distribution is "outer circle fault probability 0.95, inner circle fault probability 0.05", which can directly determine the fault type.
[0054] Finally, the performance of the CNN-LSTM-Transformer feature layer fusion diagnostic model was evaluated. 750 test set samples not used in training and validation were input into the model, and the category corresponding to the highest value in the output probability distribution was taken as the prediction result, which was then compared one by one with the actual fault labels of the samples. Model performance was evaluated by calculating core metrics: accuracy reflects the overall percentage of correctly predicted samples, demonstrating the model's overall fault identification ability; recall calculates the percentage of correctly identified samples in each fault class, measuring the model's ability to control missed detections for specific faults; and F1-Score (the harmonic average of accuracy and recall) is used to balance "false positives" and "missed detections." These metrics verify the model's generalization ability on new data, determine its suitability for complex fault scenarios involving multi-sensor fusion, and provide quantitative basis for model optimization or practical applications.
[0055] To verify the model's performance, another set of data was introduced under different loads (2 N·m), with all other conditions remaining the same. Specific labels are shown in Table 1 below.
[0056] Table 1
[0057]
[0058] like Figure 4This is a percentage confusion matrix for categories 0-9 (rows represent True labels, columns represent Predicted labels). The matrix shows that the classification performance for most categories is near perfect: True labels 0-8 are all correctly classified (100.0% across the diagonal cells corresponding to their predicted labels), and these cells are darker (matching the rule on the right that "darker colors correspond to higher percentages"), indicating that these categories are correctly classified. The only classification bias occurs with True label 9: 99.8% of samples are correctly predicted as label 9 (corresponding to darker cells), while 0.2% are incorrectly predicted as label 3 (corresponding to lighter cells, consistent with the low percentage visual characteristic). The remaining cells without displayed values have a percentage of 0, representing no corresponding classification result. The color bar on the right visually illustrates the relationship between percentages and color intensity, with the color gradually increasing from light to dark from bottom to top, corresponding to percentages increasing from 0 to 100.
[0059] like Figure 5 As shown, the left subplot, titled "Training and Testing Accuracy," illustrates the changes in training and testing accuracy during model training. The horizontal axis represents the number of training iterations (range 0 to 50), and the vertical axis represents accuracy (range 0 to 1). The Training Accuracy curve represents training accuracy, and the Testing Accuracy curve represents testing accuracy. Both curves rapidly increase in the early stages of iteration, gradually stabilizing after about 10 iterations, eventually approaching 1.0 (i.e., 100% accuracy), and the two curves show a high degree of correlation. The right subplot, titled "Training and Testing Loss," presents the changes in training and testing loss. The horizontal axis also represents the number of iterations (0 to 50), and the vertical axis represents the loss value (range 0 to 3.5). The Training Loss curve corresponds to training loss, and the Testing Loss curve corresponds to testing loss. Both curves decrease sharply in the early stages of iteration, dropping to near 0 after about 10 iterations and remaining stable. The curves also show a high degree of correlation. Overall, the curve characteristics of these two subplots indicate that the model has good training convergence, with similar performance on the training and test sets, showing neither overfitting nor underfitting, and demonstrating strong generalization ability.
[0060] like Figure 6 , Figure 7 As shown, these two figures are the t-SNE two-dimensional projection results of different feature layers of the CNN-LSTM-Transformer feature layer fusion diagnostic model in the bearing fault diagnosis task, used to present the feature distribution of bearing states from 0 to 9, covering various fault states. Figure 6The features output from the shallower layers of the corresponding model show a large number of mixed and overlapping sample points representing different bearing states, failing to form independent cluster structures. This indicates that the features at this layer have a weak ability to distinguish between different bearing states. Figure 7 The deep features of the corresponding model are now aggregated into relatively independent and compact clusters, with clear boundaries between the clusters. This comparison clearly demonstrates that the fusion model can abstract and integrate the effective information of the bearing layer by layer, greatly improving the feature discrimination of different bearing fault states, and laying a reliable feature foundation for subsequent accurate fault classification and diagnosis.
[0061] S7. The trained feature layer fusion diagnostic model based on CNN-LSTM-Transformer performs real-time fault diagnosis based on the preprocessed time series data provided by the virtual 3D platform, and feeds back the fault information to the virtual 3D platform to realize fault visualization.
[0062] Unity collects multi-source sensor data (vibration, rotational speed, temperature) from the physical test bench in real time and saves it as a CSV file. A preprocessing program is then initiated to remove invalid values and outliers, converting the data into "time window samples" and storing them in NumPy .npz format. This preprocessed NumPy .npz format is then sent to the feature layer fusion diagnostic model via Socket communication. The feature layer fusion diagnostic model diagnoses and identifies the fault type and then feeds back the diagnostic results to the virtual 3D platform (Unity) via Socket communication. The virtual 3D platform (Unity) displays the fault type (outer ring fault, inner ring fault, ball bearing fault, compound fault, normal) in the form of an alarm, thus achieving fault visualization.
[0063] Furthermore, based on the test set, the CNN-LSTM-Transformer model of the present invention, as well as the CNN, CNN-LSTM, and CNN-Transformer models, were validated, and the results are shown in Table 2.
[0064] Table 2
[0065]
[0066] As shown in Table 2, under the same sample size (750 samples), the fault diagnosis performance of the four models—CNN, CNN-Transformer, CNN-LSTM, and CNN-LSTM-Transformer—shows a significant stepwise improvement trend: the precision, recall, and F1-score of the CNN model are 83.22%, 81.74%, and 82.44%, respectively, which is limited by its ability to extract only local features; the parallel CNN-Transformer model, by incorporating the capture of long-distance correlation features, improves the three metrics to 87.56%, 86.48%, and 87.22%, clearly demonstrating the effective value of the Transformer sub-model in capturing long-distance temperature correlation features. The parallel CNN-LSTM model, by incorporating temporal dependency modeling, improved the three metrics to 90.23%, 89.78%, and 89.60%, effectively reducing noise interference and progressive fault missed detections. The CNN-LSTM-Transformer model, with its division of labor and feature complementarity in extracting "vibration local features (CNN), short-term rotational speed time series (LSTM), and long-distance temperature correlation (Transformer)," further significantly improved the three metrics to 97.36%, 96.95%, and 97.38%, achieving the best performance in balancing "false positives" and "false negatives." It is more suitable for the high-precision diagnostic needs of multi-sensor fusion and complex fault scenarios, while the first two models are more suitable for simple scenarios with single features and lower accuracy requirements.
[0067] refer to Figure 8According to a second aspect of the present invention, a bearing fault diagnosis system based on a digital twin model is provided, comprising: a virtual layer for performing three-dimensional modeling of the test bench according to the shape and size of the physical test bench; performing polygon reduction and rendering on the three-dimensional model to construct a three-dimensional model of the test bench; and importing the three-dimensional model of the test bench into a virtual 3D platform for scene construction to construct a digital twin model; the virtual 3D platform is accessed via OPC. The UA protocol communication receives and stores multi-source sensor measured time-series data under different states, and drives the digital twin model to move synchronously with the physical experimental platform. The physical layer is used to collect data from the physical experimental platform under different states via multi-source sensors to obtain multi-source sensor measured time-series data under different states. The data layer is used to clean the stored multi-source sensor measured time-series data under different states, then uniformly transform and encapsulate the cleaned time-series data to obtain pre-processed time-series data under different states. The three types of pre-processed time-series data are fused to obtain a mixed sample dataset under each state. The mixed sample dataset under each state is divided according to a preset ratio based on time sequence to form a training set, a validation set, and a test set. The training set, validation set, and test set are imported into a CNN-LSTM-Transformer-based feature layer fusion diagnostic model for training, hyperparameter tuning, and performance evaluation. The fault diagnosis module is used by the trained CNN-LSTM-Transformer-based feature layer fusion diagnostic model to perform real-time fault diagnosis based on the pre-processed time-series data provided by the virtual 3D platform, and feeds the fault information back to the virtual 3D platform for fault visualization. For any parts of the modules not described in detail above, please refer to the relevant descriptions in the embodiments.
[0068] The specific embodiments of the present invention have been described in detail above with reference to the accompanying drawings. However, the present invention is not limited to the above embodiments. Within the scope of knowledge possessed by those skilled in the art, various changes can be made without departing from the spirit of the present invention.
Claims
1. A bearing fault diagnosis method based on a digital twin model, characterized in that, The application relates to a method for real-time fault diagnosis of a high-speed machine tool spindle experiment platform. Three-dimensional modeling of the experiment platform is carried out according to the shape and size of the entity experiment platform; The three-dimensional modeling is reduced and rendered to construct a three-dimensional model of the experiment platform; Data in different states of the entity experiment platform are collected by using multiple source sensors to obtain measured time sequence data of the multiple source sensors in different states; The three-dimensional model of the experiment platform is imported into a virtual 3D platform to build a digital twin model; the virtual 3D platform receives and stores the measured time sequence data of the multiple source sensors in different states through OPC UA protocol communication, and drives the digital twin model to move synchronously with the entity experiment platform; The stored measured time sequence data of the multiple source sensors in different states are cleaned, and then the cleaned time sequence data are uniformly converted and packaged to obtain pretreated time sequence data in different states; The three kinds of pretreated time sequence data are fused to obtain mixed sample data sets in different states; The mixed sample data sets in different states are divided into a training set, a verification set and a test set according to a preset proportion in chronological order; The training set, the verification set and the test set are imported into a CNN-LSTM-Transformer-based feature layer fusion diagnosis model for training, hyperparameter optimization and performance evaluation; The trained CNN-LSTM-Transformer-based feature layer fusion diagnosis model carries out real-time fault diagnosis according to the pretreated time sequence data provided by the virtual 3D platform, and feeds back fault information to the virtual 3D platform to realize fault visualization.
2. The bearing fault diagnosis method based on digital twin model according to claim 1, characterized in that, The multiple source sensors include vibration acceleration sensors, speed sensors and temperature sensors; data of the entity experiment platform in different load states, such as outer ring fault, inner ring fault, ball fault, composite fault and normal state, are collected by using the multiple source sensors to obtain measured time sequence data of the multiple source sensors in different states under different loads; wherein the measured time sequence data of the multiple source sensors include measured time sequence data collected by the speed sensors, the temperature sensors and the vibration acceleration sensors.
3. The bearing fault diagnosis method based on digital twin model according to claim 2, characterized in that, The experiment platform is a high-speed machine tool spindle experiment platform; the non-contact speed sensor is installed in a parallel position with the same height as the spindle; the temperature sensor is arranged on the periphery of the experiment platform; and the vibration acceleration sensor is installed on a bearing support of the experiment platform; the speed sensor and the temperature sensor are connected with an upper computer through an RS485 data acquisition module; and the vibration acceleration sensor is connected with the upper computer through a data acquisition card.
4. The bearing fault diagnosis method based on digital twin model according to claim 2, characterized in that, The load range is 0N.m-2N.m.
5. The bearing fault diagnosis method based on digital twin model according to claim 1, characterized in that, The measured time sequence data of the multiple source sensors in different states are cleaned, and then the cleaned time sequence data are uniformly converted and packaged to obtain pretreated time sequence data in different states; The three kinds of pretreated time sequence data are fused to obtain mixed sample data sets in different states, including: The measured time sequence data collected by the speed sensors, the temperature sensors and the vibration acceleration sensors are cleaned respectively to obtain cleaned speed time sequence data, cleaned temperature time sequence data and cleaned vibration time sequence data; The pre-processed rotation speed time series data, the pre-processed temperature time series data and the pre-processed vibration time series data are converted into a unified numerical range; The pre-processed rotation speed time series data, the pre-processed temperature time series data and the pre-processed vibration time series data in each state converted into the unified numerical range are fused according to a time alignment principle to obtain mixed samples in each state and make labels, thereby obtaining a mixed sample data set in each state; wherein the pre-processed time series data includes the pre-processed rotation speed time series data, the pre-processed temperature time series data and the pre-processed vibration time series data.
6. The bearing fault diagnosis method based on digital twin model according to claim 1, characterized in that, The CNN-LSTM-Transformer-based feature layer fusion diagnosis model includes parallel CNN sub-models, LSTM sub-models and Transformer sub-models, and further includes splicing operations and a full connection layer; wherein the inputs of the parallel CNN sub-models, the LSTM sub-models and the Transformer sub-models are the pre-processed vibration time series data, the pre-processed rotation speed time series data and the pre-processed temperature time series data in the mixed sample data set; 64-dimensional vibration local features output by the CNN sub-models, 32-dimensional rotation speed time series trend features output by the LSTM sub-models and 32-dimensional temperature long-distance correlation features output by the Transformer sub-models are spliced into a 128-dimensional fusion feature vector; the 128-dimensional fusion feature vector after splicing is input into the full connection layer, the full connection layer has a "hidden layer + output layer" structure, the hidden layer further refines the 128-dimensional fusion feature through a nonlinear activation function ReLU and mines cross correlations of "vibration-rotation speed-temperature", the number of neurons of the output layer is consistent with the number of categories, and the hidden layer output is converted into a probability distribution through a softmax activation function.
7. The bearing fault diagnosis method based on digital twin model according to claim 6, characterized in that, The CNN sub-models include two layers of 1D convolution layers, a maximum pooling layer and a global average pooling layer connected in sequence; the LSTM sub-models include two layers of LSTM networks; and the Transformer sub-models include position encoding, dimension mapping, a multi-head self-attention layer, a feedforward network with residual connection, and a global average pooling layer. 8.A bearing fault diagnosis system based on a digital twin model, characterized in that, The virtual layer is configured to perform three-dimensional modeling on the experimental platform according to the shape and size of the entity experimental platform; The three-dimensional modeling is reduced and rendered to construct a three-dimensional model of the experimental platform; The three-dimensional model of the experimental platform is imported into a virtual 3D platform to build a scene and construct a digital twin model; the virtual 3D platform receives and stores multi-source sensor measured time series data in different states through OPC UA protocol communication and drives the digital twin model to move synchronously with the entity experimental platform; The physical layer is configured to collect data in different states of the entity experimental platform through multi-source sensors to obtain multi-source sensor measured time series data in different states. The data layer is used for data cleaning of stored multi-source sensor measured time series data in different states, and then unified conversion and packaging of the cleaned time series data are performed to obtain preprocessed time series data in different states. The three kinds of preprocessed time series data are fused to obtain a mixed sample data set in each state; the mixed sample data set in each state is divided according to time sequence in a preset proportion to form a training set, a verification set and a test set; and the training set, the verification set and the test set are imported into a CNN-LSTM-Transformer-based feature layer fusion diagnosis model for training, hyperparameter tuning and performance evaluation. The fault diagnosis module is used for real-time fault diagnosis of the trained CNN-LSTM-Transformer-based feature layer fusion diagnosis model according to the preprocessed time series data provided by the virtual 3D platform, and the fault information is fed back to the virtual 3D platform to realize fault visualization.