Mechanical fault diagnosis method based on multi-scheme preprocessing and integrated learning
By employing a multi-scheme preprocessing and ensemble learning approach, this study addresses the problems of low data quality, imbalanced samples, feature redundancy, and insufficient model generalization ability in existing mechanical fault diagnosis methods. It achieves high accuracy and reliability in mechanical fault diagnosis, and demonstrates excellent generalization performance, particularly in the identification of complex faults.
Patent Information
- Application Number
- CN202511758006.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-27
- Publication Date
- 2026-03-31
AI Technical Summary
Existing machine learning-based mechanical fault diagnosis methods face problems in actual industrial deployments, such as low data quality, imbalanced sample distribution, feature redundancy and high dimensionality, insufficient model generalization ability, and black box decision-making process. These problems result in low diagnostic accuracy and poor reliability, especially in the identification of complex faults.
A multi-scheme preprocessing and ensemble learning approach is adopted. Data preprocessing is performed through a parallel preprocessing module, including anomaly detection, feature selection, and sample balancing. A stacked ensemble fault diagnosis model is constructed by combining a heterogeneous machine learning model pool and a stacked ensemble model. The optimal scheme is selected by using cross-validation and hyperparameter optimization techniques, and a multi-output stacked framework is used to handle complex faults.
It significantly improves the accuracy and reliability of mechanical fault diagnosis, enhances the generalization ability of the model, effectively diagnoses complex faults, provides clear parameter optimization combinations, reduces parameter tuning randomness, and improves the stability and reproducibility of the method.
Smart Images

Figure CN121765510A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent diagnostic technology for industrial equipment, and in particular to a mechanical fault diagnosis method based on multi-scheme preprocessing and integrated learning. Background Technology
[0002] Rotating machinery, such as gearboxes in wind turbines, joint reducers in industrial robots, bearings in aircraft engines, and transmission systems in parallel mechanisms (such as Delta 3D printers), are key equipment in modern industrial systems. Their operational reliability and safety directly impact production efficiency and personnel safety. Collecting data through sensors such as vibration, acceleration, and current sensors, and utilizing data-driven methods for fault diagnosis, is a core technological means for achieving predictive maintenance.
[0003] However, existing machine learning-based fault diagnosis methods still face a series of severe challenges in practical industrial deployments: 1. Low data quality: The raw signals collected by sensors are easily affected by environmental noise, electromagnetic interference, and transmission loss, resulting in the submergence of effective fault features; 2. Extremely imbalanced sample distribution: Mechanical equipment is in a healthy state most of the time, and fault samples, especially severe and compound fault samples, are extremely scarce, causing the diagnostic model to be severely biased towards the majority class, resulting in a low recognition rate of key faults; 3. Feature redundancy and high dimensionality: In order to comprehensively capture state information, multiple sensors are usually deployed and a large amount of time-domain data is extracted. 1. Frequency domain features lead to high feature space dimensionality and a large amount of redundancy and collinearity, which not only increases the computational burden but may also cause the "curse of dimensionality" and model overfitting; 2. Insufficient model generalization ability: Single diagnostic models often perform well under specific operating conditions and known fault types, but they are difficult to adapt to complex changes in operating conditions such as load and speed. For new composite fault modes that have not appeared in the training set, their diagnostic performance drops sharply; 3. Black box decision-making process: High-performance models such as deep learning lack interpretability, making it difficult for operation and maintenance personnel to understand their diagnostic basis, reducing the credibility of diagnostic results and their usability in key decisions. Summary of the Invention
[0004] The purpose of this invention is to provide a mechanical fault diagnosis method based on multi-scheme preprocessing and ensemble learning to address the shortcomings of existing technologies, which significantly improves the diagnostic accuracy and reliability, and uses composite fault data to verify the generalization performance of the model.
[0005] To achieve the above objectives, the technical solution adopted by this invention is: a mechanical fault diagnosis method based on multi-scheme preprocessing and ensemble learning, comprising the following steps: S1. Data Acquisition and Labeling: Collect multi-dimensional time-series sensor data of the target mechanical equipment in operation, and label the data with fault categories according to the equipment status; S2. Parallel preprocessing with multiple schemes: The labeled dataset collected in S1 is input into the multi-scheme preprocessing module in parallel. The multi-scheme preprocessing module is pre-set with N preprocessing schemes, where N≥8. Each preprocessing scheme includes at least one of anomaly detection operation, feature selection operation, and sample balancing operation. S3. Optimal Solution and Model Selection: Using the data processed by each preprocessing solution in S2, train a model pool containing M heterogeneous machine learning models, where M≥3; use cross-validation and hyperparameter optimization techniques to optimize and evaluate the performance of each model in the model pool; based on the preset comprehensive performance evaluation index, select the preprocessing solution with the best global performance and the two base models with the top two performance under the best preprocessing solution from all N×M "preprocessing solution-model" combinations. S4. Stacked ensemble model construction: Using the two best-performing base models selected in S3 as base learners, K-fold cross-validation is used to generate out-of-sample prediction probability features of the base learners; the out-of-sample prediction probability features are concatenated and used as meta-features to be input into a meta-learner for training, thereby constructing a stacked ensemble fault diagnosis model. S5. Fault Diagnosis Execution: For the sensor data of the mechanical equipment to be diagnosed, the optimal preprocessing scheme selected in S3 is first used to perform preprocessing operations consistent with the training phase. Then, the processed feature data is input into the stacked integrated fault diagnosis model constructed in S4, and the final fault diagnosis result is output.
[0006] A further improvement to the above scheme is that the multi-scheme preprocessing module in step S2 has the following eight preprocessing schemes preset: Preprocessing scheme one: First, perform isolated forest anomaly detection, then perform ReliefF feature selection, and then perform SMOTE oversampling; Preprocessing scheme 2: First, perform isolated forest anomaly detection, then perform SMOTE oversampling, and finally perform ReliefF feature selection; Preprocessing Option 3: Perform isolated forest anomaly detection only; Preprocessing scheme four: First perform SMOTE oversampling, then perform ReliefF feature selection; Preprocessing scheme five: First perform ReliefF feature selection, then perform SMOTE oversampling; Preprocessing Option 6: Perform SMOTE oversampling followed by normalization only; Preprocessing scheme seven: First, perform mixed anomaly detection of isolated forest and local outlier factors, then perform ReliefF feature selection, and then perform SMOTE oversampling; Preprocessing scheme eight: First, perform mixed anomaly detection of isolated forest and local outlier factors, then perform time-domain and frequency-domain statistical feature enhancement, then perform ReliefF feature selection, and finally perform SMOTE oversampling.
[0007] A further improvement to the above scheme is that the anomaly detection operation in step S2 adopts a hybrid anomaly detection strategy that combines isolated forests and local outliers, wherein the pollution rate parameter of isolated forests is set to 0.03 to 0.1, and the nearest neighbor number k of local outliers is set to 5 to 10. In step S2, the feature selection operation uses the ReliefF algorithm to sort the features by importance and retains the top-K features, where K=10; and / or, after selecting the optimal preprocessing scheme in S3, when building the stacked ensemble model in S4, a two-stage feature selection method combining ReliefF and recursive feature elimination cross-validation based on random forest is used to reduce the dimensionality of features. The sample balancing operation in step S2 employs synthetic minority oversampling; and / or, after selecting the optimal preprocessing scheme in S3, when constructing the stacked ensemble model in S4, the SMOTE-Tomek algorithm, which combines synthetic minority oversampling with Tomek Links, is employed.
[0008] A further improvement to the above scheme is that the judgment rule of the hybrid anomaly detection strategy in step S2 is defined by the following formula: ; The anomaly score of the isolated forest is calculated by the following formula: ; The local outlier factor is calculated by the following formula: ; Where Nk(p) is the set of k nearest neighbors of point p, and lrdk(p) is the local reachability density of point p, calculated by the following formula: .
[0009] A further improvement to the above scheme is that, in the two-stage feature selection method, the ReliefF algorithm updates the feature weights W[A] using the following formula: ]; Its objective function, finding the optimal feature subset s*, is defined by the following formula: .
[0010] A further improvement to the above scheme is that the SMOTE oversampling technique generates new minority class samples x' using the following interpolation formula: x'=x+λ·(x_nn-x),λ~U(0,1).
[0011] A further improvement to the above scheme is that, in step S4, the cascaded and stacked posterior probabilities of the out-of-sample prediction probability features generated by the base learner are calculated as follows: For a sample xi, its meta-feature vector zi is constructed by the following formula: ; The logistic regression meta-learner calculates the stacked posterior probability using the following formula: .
[0012] A further improvement to the above scheme is that the training of the logistic regression meta-learner is achieved by minimizing the following L2-regularized weighted cross-entropy loss function:
[0013] A further improvement to the above scheme is that the performance evaluation metrics used in steps S3 and S5 include Hamming Loss, the calculation formula of which is: .
[0014] A further improvement to the above scheme is that the model pool in S3 includes at least three models from random forest, support vector machine, K-nearest neighbor algorithm, XGBoost, and deep neural network; the hyperparameter optimization adopts grid search method or Bayesian optimization method based on tree structure Parzen estimator. The meta-learner in S4 is a logistic regression model; K=5 in the K-fold cross-validation. When the fault is a complex fault involving multiple components, the fault diagnosis result in S5 is in the form of multiple outputs. The stacked integration model establishes a sub-stacked model in parallel for each output path, with the two optimal base models as base learners and logistic regression as meta learner, so as to realize the synchronous and independent prediction of the fault status of multiple components.
[0015] The beneficial effects of this invention are as follows: 1. Overcoming the limitations of a single preprocessing workflow: By experimenting with multiple preprocessing combinations in parallel, the system can adaptively find the most suitable preprocessing pipeline for the current data characteristics, improving data quality from the source. Experiments show that the optimal solution (e.g., IF→ReliefF→SMOTE) can improve accuracy by more than 12.7% compared to the baseline; 2. Significantly improved model generalization ability: By adopting a heterogeneous model ensemble and stacking strategy, the advantages of different models are combined, effectively overcoming the performance degradation problem of single models under complex working conditions and unknown fault modes. Experiments show that the F1-score of the ensemble model can reach 0.981, which is significantly higher than that of the single model; 3. Provides clear parameter optimization combinations: Experimental verification was conducted on key preprocessing and model parameters (such as ReliefF with 10 fixed features and IF contamination rate of 10%), providing effective parameter settings, reducing the randomness of parameter tuning, and improving the stability and reproducibility of the method; 4. Particularly adept at handling complex faults: Through a multi-output stacking framework, it can effectively diagnose multiple faults occurring simultaneously and exhibits good generalization performance on unseen complex fault modes, providing a reliable solution for complex fault situations in industrial fields. Attached Figure Description
[0016] Figure 1 This is a schematic diagram of the overall process of the present invention.
[0017] Figure 2 This is a schematic diagram showing the experimental results of the accuracy of each model in the multiple preprocessing schemes of the present invention.
[0018] Figure 3 This is a schematic diagram of the F1 experimental results for each model of the multiple preprocessing schemes of the present invention.
[0019] Figure 4 This is a representation of the inference delay comparison of all models in stage 2 of the present invention. Detailed Implementation
[0020] This invention includes the following steps: S1. Data Acquisition and Labeling: Collect multi-dimensional time-series sensor data of the target mechanical equipment in operation, and label the data with fault categories according to the equipment status; S2. Parallel preprocessing with multiple schemes: The labeled dataset collected in S1 is input into the multi-scheme preprocessing module in parallel. The multi-scheme preprocessing module is pre-set with N preprocessing schemes, where N≥8. Each preprocessing scheme includes at least one of anomaly detection operation, feature selection operation, and sample balancing operation. S3. Optimal Solution and Model Selection: Using the data processed by each preprocessing solution in S2, train a model pool containing M heterogeneous machine learning models, where M≥3; use cross-validation and hyperparameter optimization techniques to optimize and evaluate the performance of each model in the model pool; based on the preset comprehensive performance evaluation index, select the preprocessing solution with the best global performance and the two base models with the top two performance under the best preprocessing solution from all N×M "preprocessing solution-model" combinations. S4. Stacked ensemble model construction: Using the two best-performing base models selected in S3 as base learners, K-fold cross-validation is used to generate out-of-sample prediction probability features of the base learners; the out-of-sample prediction probability features are concatenated and used as meta-features to be input into a meta-learner for training, thereby constructing a stacked ensemble fault diagnosis model. S5. Fault Diagnosis Execution: For the sensor data of the mechanical equipment to be diagnosed, the optimal preprocessing scheme selected in S3 is first used to perform preprocessing operations consistent with the training phase. Then, the processed feature data is input into the stacked integrated fault diagnosis model constructed in S4, and the final fault diagnosis result is output.
[0021] The present invention has the following beneficial effects: 1. Overcoming the limitations of a single preprocessing workflow: By experimenting with multiple preprocessing combinations in parallel, the system can adaptively find the most suitable preprocessing pipeline for the current data characteristics, improving data quality from the source. Experiments show that the optimal solution (e.g., IF→ReliefF→SMOTE) can improve accuracy by more than 12.7% compared to the baseline; 2. Significantly improved model generalization ability: By adopting a heterogeneous model ensemble and stacking strategy, the advantages of different models are combined, effectively overcoming the performance degradation problem of single models under complex working conditions and unknown fault modes. Experiments show that the F1-score of the ensemble model can reach 0.981, which is significantly higher than that of the single model; 3. Provides clear parameter optimization combinations: Experimental verification was conducted on key preprocessing and model parameters (such as ReliefF with 10 fixed features and IF contamination rate of 10%), providing effective parameter settings, reducing the randomness of parameter tuning, and improving the stability and reproducibility of the method; 4. Particularly adept at handling complex faults: Through a multi-output stacking framework, it can effectively diagnose multiple faults occurring simultaneously and exhibits good generalization performance on unseen complex fault modes, providing a reliable solution for complex fault situations in industrial fields.
[0022] The multi-scheme preprocessing module in step S2 has the following 8 preprocessing schemes: Preprocessing scheme one: First, perform isolated forest anomaly detection, then perform ReliefF feature selection, and then perform SMOTE oversampling; Preprocessing scheme 2: First, perform isolated forest anomaly detection, then perform SMOTE oversampling, and finally perform ReliefF feature selection; Preprocessing Option 3: Perform isolated forest anomaly detection only; Preprocessing scheme four: First perform SMOTE oversampling, then perform ReliefF feature selection; Preprocessing scheme five: First perform ReliefF feature selection, then perform SMOTE oversampling; Preprocessing Option 6: Perform SMOTE oversampling followed by normalization only; Preprocessing scheme seven: First, perform mixed anomaly detection of isolated forest and local outlier factors, then perform ReliefF feature selection, and then perform SMOTE oversampling; Preprocessing scheme eight: First, perform mixed anomaly detection of isolated forest and local outlier factors, then perform time-domain and frequency-domain statistical feature enhancement, then perform ReliefF feature selection, and finally perform SMOTE oversampling.
[0023] The anomaly detection operation in step S2 adopts a hybrid anomaly detection strategy that combines isolated forests and local outliers. The pollution rate parameter of the isolated forest is set to 0.03 to 0.1, and the nearest neighbor number k of the local outlier is set to 5 to 10. In step S2, the feature selection operation uses the ReliefF algorithm to sort the features by importance and retains the top-K features, where K=10; and / or, after selecting the optimal preprocessing scheme in S3, when building the stacked ensemble model in S4, a two-stage feature selection method combining ReliefF and recursive feature elimination cross-validation based on random forest is used to reduce the dimensionality of features. The sample balancing operation in step S2 employs synthetic minority oversampling; and / or, after selecting the optimal preprocessing scheme in S3, when constructing the stacked ensemble model in S4, the SMOTE-Tomek algorithm, which combines synthetic minority oversampling with Tomek Links, is employed.
[0024] The hybrid anomaly detection strategy in step S2 is defined by the following formula: ; The anomaly score of the isolated forest is calculated by the following formula: ; The local outlier factor is calculated by the following formula: ; Where Nk(p) is the set of k nearest neighbors of point p, and lrdk(p) is the local reachability density of point p, calculated by the following formula: .
[0025] In the two-stage feature selection method, the ReliefF algorithm updates the feature weights W[A] using the following formula: ]; Its objective function, finding the optimal feature subset s*, is defined by the following formula: .
[0026] The SMOTE oversampling technique generates new minority class samples x' using the following interpolation formula: x'=x+λ·(x_nn-x),λ~U(0,1).
[0027] In step S4, the cascaded and stacked posterior probabilities of the out-of-sample prediction probability features generated by the base learner are calculated as follows: For a sample xi, its meta-feature vector zi is constructed by the following formula: ; The logistic regression meta-learner calculates the stacked posterior probability using the following formula: .
[0028] The logistic regression meta-learner is trained by minimizing the following L2-regularized weighted cross-entropy loss function: .
[0029] The performance evaluation metrics used in steps S3 and S5 include Hamming Loss, which is calculated using the following formula: .
[0030] The model pool in S3 includes at least three models from random forest, support vector machine, K-nearest neighbor algorithm, XGBoost, and deep neural network; the hyperparameter optimization adopts grid search method or Bayesian optimization method based on tree structure Parzen estimator; The meta-learner in S4 is a logistic regression model; K=5 in the K-fold cross-validation. When the fault is a complex fault involving multiple components, the fault diagnosis result in S5 is in the form of multiple outputs. The stacked integration model establishes a sub-stacked model in parallel for each output path, with the two optimal base models as base learners and logistic regression as meta learner, so as to realize the synchronous and independent prediction of the fault status of multiple components.
[0031] Through the modular and systematic design described above, this invention achieves full-process optimization from data preprocessing to model integration. It is particularly suitable for solving the diagnostic challenges of complex and compound faults in industrial equipment and has high practical value and promising prospects for promotion.
[0032] To better illustrate the present invention, this embodiment uses the fault diagnosis of loose three belts in a Delta parallel 3D printer as an example: 3.1 Dataset and Partitioning The experiment was conducted on a Delta 3D printer (arm length 315 mm, platform radius 130 mm, build height 330 mm). An IMU (WT901SDCL-BT50) was installed on the end effector to acquire 12 channels of data at 200 Hz—three-axis acceleration, angular velocity, angular position, and magnetic field. A belt slack fault was injected by controlled rotation of the tension bolts of belts A, B, and C. A total of 25 single fault categories and 9 compound fault categories were defined; each condition was performed with a standardized R25 cylindrical operation for 30 seconds, repeated three times.
[0033] Ultimately, 7,328 single-fault samples and 9,177 composite-fault samples were obtained. Labels 1–25 represent single faults, and 31–39 represent composite faults. To avoid information leakage, an 80 / 20 stratification was performed before any preprocessing or resampling; this principle was also followed when evaluating the generalization of composite labels in Phase 3. Figure 3-1 shows the platform and loose-band settings.
[0034] 3.2 Pipeline Overview and Safeguards While maintaining computational friendliness, high-precision single-fault diagnosis is achieved, and the ability to generalize to complex faults is guaranteed. The three stages are interdependent: the output of the previous stage serves as the input of the next stage (see...). Figure 1 ).
[0035] Phase 1 – Selection (Lightweight). Eight preprocessing schemes × 5 model families were evaluated using stratified 5-fold CV (Weighted-F1 scoring). Only lightweight temporal features {Mean, Std, Range} were used. Outputs: Best preprocessing; Top-2 model families; ablation evidence.
[0036] Phase 2 – Optimization (Heavyweight). Expand to time and frequency domain feature sets {Mean, Std, Range, Skew, Kurtosis, Freq_Max, Freq_Energy, Freq_Kurtosis}; employ ReliefF → RFECV, SMOTE–Tomek, and TPE-based hyperparameter tuning; construct a stacked ensemble (RF + XGB, logistic regression meta-learner). Perform external validation on the CWRU (Case Western Reserve University) dataset to check cross-domain transferability.
[0037] Phase 3 – Generalization (Complex Faults). Freeze the preprocessing and model configuration from Phase 2; evaluate model performance under distribution drift conditions based on multiple output labels. Report Macro-F1, Hamming loss, accuracy, and latency.
[0038] Protocols and leakage prevention constraints. (i) Fit scaling / selection / sampling operators only on the training fold (leakage-free preprocessing); (ii) Layered 5-fold CV, with Weighted-F1 as the primary score (Accuracy / AUC as secondary); (iii) Computational constraint awareness: Stage 1 uses lightweight features + SMOTE, Stage 2 uses boundary cleaning + stacking; (iv) Cross-domain consistency checks are performed on CWRU. Table 3-1 summarizes the objectives, features, models, optimizations, and metrics for each stage.
[0039] 3.3 Stage 1: Preprocessing and Multi-model Screening The differences between the eight processes are: anomaly filtering (IF vs IF+LOF), lightweight temporal features, ReliefF ranking, and resampling order. GridSearchCV (hierarchical 5-fold, Weighted-F1) is used for filtering. Lightweight features limit computational overhead and suppress early overfitting; after identifying strong baselines, stage 2 introduces even stronger selection and rebalancing.
[0040] The differences between the eight processes are: anomaly filtering (IF vs IF+LOF), lightweight temporal features, ReliefF ranking, and resampling order. GridSearchCV (hierarchical 5-fold, Weighted-F1) is used for filtering. Lightweight features limit computational overhead and suppress early overfitting; after identifying strong baselines, stage 2 introduces stronger selection and rebalancing. Table 1 shows the preprocessing scheme.
[0041] Table 1 Comparison of the processes of the 8 solutions
[0042] 3.3.1 Hybrid Anomaly Filtering (IF + LOF) To improve the quality of clustered high-dimensional telemetry data, Isolation Forest (IF) and Local Outlier Factor (LOF) were used in pairs, and fitted only on the training fold. The normalization and anomaly score of IF are shown in Equations (3-1)–(3-2); the local reachability density and definition of LOF are shown in Equations (3-3)–(3-4). The IF contamination rate was set to approximately 3–5%, and the number of nearest neighbors k for LOF was set to 5–10 to balance sensitivity and false alarms.
[0043] The expected path length E[h(x)] is used to score the instance s(x,n): (3-1) (x,n): represents the anomaly score of sample x, with a value range of [0, 1]; E(h(x)): The average path length when sample x is isolated (mean across all trees); c(n): The standardization factor for the average path length of normal samples, calculated as follows: H(i)≈ln(i)+Y (3-2) H(n): the nth harmonic constant, Y≈0.5772 is the Euler-Marcheroni constant; n: the number of samples in the training set. The Local Outlier Factor (LOF) is supplemented by comparing the local reachability density (lrd) of a point with its k nearest neighbors.
[0044] (3-3) Where, Nk(p): the set of k nearest neighbors of point p, lrdk(p): Local reachability density at point p, given by the formula: (3-4)
[0045] The LOF score is explained as follows: ≈1: The density of point p is similar to the density of its neighboring points and is considered a normal point.
[0046] >1: Point p has a density that is significantly lower than that of its neighboring points and is considered a potential outlier. <1: The region where point p is located has a higher density than the regions of its neighboring points. This situation is relatively rare and is usually still considered a normal point.
[0047]
[0048] 3.3.2 Lightweight Time-Domain Features For each channel, Mean(μ), Std(σ), and Range(max−min) are calculated. These three parameters have low computational cost and are robust to the window; they also maintain stable discriminative power when dealing with composite pulse ambiguity in the frequency domain. Standardization uses only training set statistics.
[0049] 3.3.3 ReliefF Ranking ReliefF ranks features by comparing "near hit / near mismatch" across classes; weight updates for multi-class cases are shown in Equation (3-5). The top ddd features are retained (default d=min{{10,M}), and the selected indices are applied to the validation / test set; parameters are estimated only on the training fold. Let represent the training matrix and y represent the class label. ReliefF updates the feature weights W[A] by comparing the near-hit and near-miss neighborhoods around each instance x_i: (3-5) Where: m—samples extracted by ReliefF; k—neighbors (k=10 here); H_j—the j-th nearest hit from class y_i; Mj(c)—the j-th nearest miss from class c; P(c)—prior to class c. diff(A, x_i,x_j) measures the difference for each feature: for numerical A, |x_{iA}−x_{jA}| is normalized to [0,1]; for class A, [x_{iA}≠x_{jA}].
[0050] 3.3.4 Rebalancing and Normalization Phase 1 employs SMOTE (k=5) to enhance minority class support with low overhead; all features are normalized using the training set μ and σ and then applied to validation / testing to avoid leakage. Phase 1 concludes with ablation analysis, quantifying the contribution of each module and determining the optimal solution and the Top-2 model family for Phase 2.
[0051] 3.4 Phase 2: Stacked Integration with TPE Tuning Building on Phase 1, Phase 2 further strengthens both the feature system and data governance.
[0052] 3.4.1 Time-domain and frequency-domain enhancement Skew and (excess) Kurtosis are added in the time domain, and Freq_Max, Freq_Energy, and Freq_Kurtosis are added in the frequency domain (DFT amplitude spectrum). Statistics follow SciPy defaults; features are normalized with training set parameters.
[0053] 3.4.2 Two-stage feature selection (ReliefF → RFECV) ReliefF (k=10) performs a local-sensitive initial screening, retaining a maximum of 15 items; then RFECV (Random-Forest base learner, step size 1, hierarchical 5-fold, score 'f1_weighted') prunes redundancy with the goal of maximizing cross-validation performance (see Equation (3-6)), resulting in a compact and task-relevant subset.
[0054] (3-6) In the table: S: subset of candidate features; p: total number of features; CV(⋅): hierarchical 5-fold cross-validation; ,in This represents the category's weighting.
[0055] 3.4.3 Upgrading from SMOTE to SMOTE–Tomek To mitigate boundary overlap caused by pure oversampling, stage 2 employs SMOTE–Tomek. The SMOTE interpolation and Tomek pair determination are shown in equations (3-7)–(3-8), respectively; this combination maintains minority class support while clearing boundary pairs. x'=x+λ·(x_nn-x),λ~U(0,1) (3-7) If sample pairs (a,b) are nearest neighbors and ya≠yb, then (a,b) is a Tomek pair (3-8). 3.4.4 Model Structure and Optimization We construct a stacked framework consisting of two base learners: Random Forest (RF, n_estimators=200, max_depth=10) and XGBoost (XGB). During training, 5-fold cross-validation is used to generate out-of-fold (OOF) class posterior probabilities, which are then used as input to the logistic regression meta-learner. During inference, both base learners are refitted on the entire training set to produce the final posterior. Preprocessing (normalization and SMOTE–Tomek) is encapsulated in `imblearn.Pipeline` to avoid information leakage.
[0056] OOF generation and meta-input (see equations (3-9a) and (3-9b)) (3-9a) (3-9b) Wherein: The training set is divided into T=5 folds. At the t-th fold, the base model... (Training on the remaining T-1 folds after removing the t-th fold) Output the class posterior probability for the t-th fold sample; concatenate across folds to obtain the OOF vector. The meta-input zi concatenates the OOF posterior of RF and XGB, thus its dimension is 2K.
[0057] Stacked posterior (logistic regression meta-learner; Equation 3-9) , (3-9)
[0058] Where: βk With bk∈ Let be the meta-learner parameters for the k-th class; the definition of zi is given in equation (3-9b).
[0059] Meta-learner objective function (class weighted + L2L_2L2 regularization; Equation 3-9c) (3-9c) Where: B = [β1,…,βK], b = [b1,…,bK]; λ represents the class weights (consistent with Weighted-F1 evaluation); λ is the regularization coefficient; and 1[·] is the indicator function.
[0060] Inference (the base learner refitted on the full training set; Equation 3-9d) (3-9d) Where: The posterior vector output by the RF / XGB refitted on the entire training set; The optimal solution comes from equation (3-9c).
[0061] Bayesian optimization (TPE; Equation 3-10) Under hierarchical 5-fold cross-validation, using Weighted-F1 as the primary evaluation metric, the tree-structured Parzen estimator (TPE) is employed to search for hyperparameters of RF / XGB. The selection criteria are as follows: (3-10) Baseline + , (3-11) Where α is chosen on the validation set; 3.5 Third Stage: Multi-output Stacking and In-depth Comparison under Complex Fault Scenarios Objectives and Connections. While continuing the data governance and stacking paradigm of Stage-2 (RF / XGB base learner, 5-fold OOF, LR meta learner; see equations (3-9), (3-10)), Stage-3 expands the prediction target from a single label to three-way multi-output (A / B / C, each with 5 levels: 0, ¼, ½, ¾, ≥1 cycle) and introduces a certain proportion of composite samples into the training set to quantify the gain of "composite label supervision"; at the same time, a structured deep neural network (MTNN) is provided.
[0062] Label representation. The original single label y is mapped as (y(A),y(B),y(C))∈{0,…,4}3.
[0063] Method—Multi-output stacking (main line). Three-way parallel modeling: For the q-th path (q∈{A,B,C}), concatenate the OOF class posteriors of RF and XGB as the meta-input. with =5, the meta-learner uses multi-class logistic regression: (3-12) Symbol explanation: =[ ] represents the OOF probability cascade of the q-th path; , The parameters are those of the meta-learner; the inference time-base learner refits the entire training set to generate the posterior, and then outputs the three-way prediction via Equation (3-13). The preprocessing and features (IF+LOF → time / frequency domain statistics → standardization → ReliefF → RFECV → SMOTE–Tomek) are completely consistent with Stage-2, except that fitting is performed only during training, and only transformation is performed during validation / testing.
[0064] Comparison – Multi-Task Neural Network (MTNN). A "shared backbone + three task heads" approach is used to model the three paths simultaneously, and the average of the three heads' equally weighted cross-entropy is optimized for structured comparison with multi-output stacking.
[0065] Evaluation Protocol and Metrics. Using the same hierarchical splitting and leakage prevention process as Stage-2, the three-way macro average F1 and Hamming loss are reported for the complete set, single-fault subset, and composite subset, respectively; in addition, exact-match accuracy and inference latency (batch=1 / 10 / 50) are given.
[0066] (3-13) Where: N is the number of test samples, Q=3 is the number of outputs (A / B / C channels); and Let {x} be the true and predicted classes of sample i on the q-th path ({0, 1, 2, 3, 4} represent "normal, ¼, ½, ¾, ≥1 cycle" respectively) (obtained by taking arg max after softmax of the stacked meta-learner, or by classifying according to a set threshold); 1[⋅] is the indicator function, 1 for true and 0 for false. Hamming loss (HL) represents the average error rate per sample and per output, with a value range of [0, 1], and a smaller value is better.
[0067] Experiments and Results 4.1 Experimental Setup To validate the proposed multi-stage intelligent fault diagnosis framework, we conducted a series of comprehensive experiments across three stages. The experimental setup is summarized below: Datasets and Splits. The single-fault dataset (7328 samples) was used for preprocessing scheme evaluation and model optimization in the first and second stages, while the composite fault dataset (9177 samples) was specifically used for generalization evaluation in the third stage. For each dataset, an 80 / 20 hierarchical split was employed before feature engineering or resampling to avoid data leakage.
[0068] All experiments were conducted on a custom Delta 3D printer platform. Faults were introduced by gradually loosening the bolts on the A / B / C belts. A total of 25 single fault categories and 9 combined fault scenarios were configured.
[0069] The fault experiment setup for the dataset is as follows (Table 2): Table 2 Detla 3D Printer Fault Experiment Setup
[0070] All experiments were conducted in Python 3.10, using libraries including Scikit-learn, XGBoost, LightGBM, and PyTorch. Training and inference were performed on a single workstation configured with an AMD Ryzen 74800H processor with Radeon Graphics 2.90 GHz and 16 GB of memory. This configuration provided ample computational resources for large-scale feature engineering, hyperparameter optimization, and deep model training.
[0071] (3) Evaluation indicators To ensure the rigor and reproducibility of the assessment, we used three standard metrics: accuracy (ACC), macro-mean F1 (F1), and area under the receiver operating characteristic curve (AUC).
[0072] 4.2 Results of Phase One Figure 2 and Figure 3 We compared the performance of eight preprocessing pipelines with five classifiers (Random Forest, Support Vector Machine, K-Nearest Neighbors, XGBoost, and Deep Neural Network) under hierarchical five-fold cross-validation. Classification performance was primarily measured by accuracy (ACC) and macro-average F1 score (F1), supplemented by AUC and inference latency.
[0073] The results show that the preprocessing pipeline, consisting of "hybrid anomaly detection → temporal feature enhancement → ReliefF → SMOTE" combined with XGBoost, achieves the best overall performance, reaching an accuracy of 72.99%, a macro-average F1 score of 72.84%, and an AUC of 0.9798. Furthermore, the inference latency is only 0.01 ms / sample, making the computational overhead negligible. In addition, RF and XGBoost rank among the top performers in multiple metrics, demonstrating good robustness and reliability in handling class imbalance and feature-enhanced fault diagnosis tasks. Based on these findings, we selected this preprocessing pipeline in the second stage and used RF and XGBoost as the base model for subsequent optimizations.
[0074] 4.2.2 Phase Two: Model Optimization and Implementation Protocol Building upon the optimal preprocessing pipeline established in Phase One, Phase Two focuses on improving classification performance through ensemble learning strategies, systematic evaluation protocols, and inference efficiency analysis. The goal of this phase is to further enhance prediction accuracy while maintaining reproducibility and computational feasibility.
[0075] (1) Base learners and ensemble strategies Under 5-fold cross-validation, Bayesian optimization was used to tune the parameters of Random Forest (RF) and XGBoost (XGB). The feature flow was ReliefF → RFECV, and SMOTE was replaced with SMOTETomek to refine class boundaries. Two ensembles were implemented: ① Weighted fusion (linear weighting of the RF / XGB posterior, with weights selected by the inner CV layer); ② Stacked ensemble (RF+XGB as base learners, logistic regression as meta-learner, using OOF posterior). All transformers and samplers were fitted only on the training fold, and only transformed on the validation / test folds to avoid information leakage.
[0076] (2) Importance of features The importance of impurities based on radiometric analysis showed that Mag_X, Mag_Y, and Angle_Z were the main contributing features (approximately 0.13–0.19); Time_Kurtosis and Time_Range also ranked highly. This is consistent with the findings of Phase 1, supporting the effectiveness of the "time-frequency enhancement + ReliefF-guided screening" approach.
[0077] (3) Inference delay Figure 4 The report presents the single-sample latency (batch=1) of each model under the same hardware and implementation conditions. XGB is the fastest (approximately 0.13–0.23 ms / sample), RF is in the middle (approximately 0.45–0.62 ms / sample), while stacked integration exceeds 1.1 ms / sample, suggesting that a trade-off between performance and latency is necessary in edge deployment scenarios.
[0078] In three independent replicate experiments, RF was the strongest single model (mean accuracy approximately 89.9–91.0%, mean F1 score approximately 0.90, AUC > 0.996). XGB had slightly lower accuracy (approximately 83–85%), but its AUC remained high (>0.993). The best result for stacked ensembles was accuracy = 0.9114, F1 = 0.9115, slightly outperforming RF in some runs, but with greater variance. Weighted fusion performed comparably to RF, but was more sensitive to the learned fusion coefficients. Table 3 summarizes the mean ± standard deviation (Accuracy is expressed as a percentage, F1 / AUC is dimensionless; SD is absolute). Table 3. Performance comparison of different integration strategies in three independent repetitions.
[0079]
[0080] In three independent replicates (Table 4-3), RF was the most stable single model (Accuracy 89.9% ± 0.6%, F1 0.899 ± 0.006); the average accuracy of stacked ensembles was similar (89.8% ± 1.0%), but the variance was higher; the average performance of weighted ensembles was on par with RF, but it was more sensitive to the weights learned from cross-validation.
[0081] Therefore, XGB is preferred under strict real-time constraints; RF / stack is competitive when accuracy is more important. The optimal model from Phase 2 will be used in Phase 3 to evaluate its generalization ability under combined conditions of distributed drift and rare faults on composite fault data.
[0082] In summary, RF is the most stable and effective single model; stacking can bring marginal gains but reduces stability; weighted fusion is competitive but highly sensitive to weight tuning. Feature importance analysis verifies the key roles of magnetic field and angular features as well as time-domain statistics; inference analysis emphasizes that XGBoost is more suitable for real-time deployment, while RF / stacking is more suitable for accuracy-first offline diagnostics.
[0083] 4.3.3 Phase Three: Composite Fault Testing and Model Generalization To further evaluate the generalization ability of the Stage 2 model, we extended our experiments on a composite fault dataset containing more complex multi-fault coupling. Following the preprocessing workflow of Stage 2, we trained and tested the model under three conditions: single fault, composite fault, and a combination of both.
[0084] As shown in Table 4, the stacked ensemble achieves an overall accuracy of 85% and a Macro-F1 score of 0.79, representing improvements of +7% and +6% respectively compared to the best single classifier (Random Forest) (RF: Accuracy 78%, Macro-F1 0.73). In the multi-output setting with compound faults, we provide a unified comparison within the same leak-free protocol: evaluating independent output methods (MultiOutput, with / without stacking) against multi-task learning with shared representations (MTL / MTNN).
[0085] Table 4 Overall / Single / Combined Results
[0086] Table 5 further highlights the performance of the stacked model under different composite fault evaluation scenarios. For composite faults on the test set, the model achieved Macro-F1 = 0.746 and Accuracy = 0.739; for independent composite faults, it further improved to Macro-F1 = 0.760 and Accuracy = 0.753. Notably, belt A had the highest recognition accuracy (F1 ≈ 0.81), followed by belt C (F1 ≈ 0.75), while belt B had relatively lower accuracy (F1 ≈ 0.68–0.71), suggesting that differences in signal strength or noise contamination among different belts led to inconsistent sensitivity.
[0087] Further analysis showed that the accuracy for single faults remained above 90%, while the F1 score dropped to about 75% for combined faults. This performance decline was mainly attributed to feature interference, sparsity of rare combination samples, and label ambiguity—common challenges in multi-fault diagnosis.
[0088] Table 5. Diagnostic performance of the stacked model under different complex fault assessment scenarios.
[0089] The results of the third stage show that stacking has both high accuracy and certain cross-distribution generalization in complex combined fault environments, but it is still a task for future research. Future research will focus on: reducing inter-feature interference through feature enhancement; improving the identification of rare combined faults using transfer learning; and employing domain adaptation to address distribution drift in real-world scenarios.
[0090] This paper addresses the complex fault diagnosis of parallel 3D printers. To overcome the limitations of traditional methods in generalization, a unified framework combining multi-scheme preprocessing and stacked integration is proposed (using RF and XGBoost as base learners and logistic regression as a meta-learner). This pipeline integrates anomaly detection, time-frequency domain feature enhancement, feature selection, and resampling, effectively mitigating problems such as noise, redundancy, and class imbalance.
[0091] Experimental results show that the accuracy of single fault identification is close to 0.90; the Macro-F1 score for compound faults is 0.746 on the test set, and improves to 0.760 on the completely independent dataset, verifying the model's robust generalization ability to unknown fault modes. Analysis by belt type shows that belt A has the best detection performance, while belt B performs worse, reflecting the inherent differences in sensor responses.
[0092] Of course, the above description is only a preferred embodiment of the present invention. Therefore, all equivalent changes or modifications made to the structure, features and principles described in the claims of this patent application are included in the scope of this patent application.
Claims
1. A mechanical fault diagnosis method based on multi-scheme pre-processing and ensemble learning, characterized in that, The method comprises the following steps: S1, data acquisition and labeling: acquiring multi-dimensional time sequence sensor data of a target mechanical equipment in a running state, and labeling the data according to equipment states; S2, parallel pre-processing of multiple schemes: inputting the labeled data set acquired in S1 into a multi-scheme pre-processing module in parallel, the multi-scheme pre-processing module being pre-provisioned with N pre-processing schemes, wherein N is greater than or equal to 8, and each pre-processing scheme comprises at least one of an anomaly detection operation, a feature selection operation, and a sample balancing operation; S3, optimal scheme and model screening: using the data processed by each pre-processing scheme in S2, training a model pool comprising M heterogeneous machine learning models, wherein M is greater than or equal to 3; using cross-validation and hyperparameter optimization techniques to optimize and evaluate the performance of each model in the model pool; Based on the preset comprehensive performance evaluation index, one pre-processing scheme with the best global performance and two base models with the best performance under the optimal pre-processing scheme are selected from all N x M "pre-processing scheme-model" combinations; S4, stacked ensemble model construction: using the two base models with the best performance selected in S3 as base learners, generating out-of-sample prediction probability features of the base learners using K-fold cross-validation; concatenating the out-of-sample prediction probability features as meta-features and inputting them into a meta-learner for training, thereby constructing a stacked ensemble fault diagnosis model; S5, fault diagnosis execution: for sensor data of a mechanical equipment to be diagnosed, first, the optimal pre-processing scheme selected in S3 is used for pre-processing operation consistent with the training stage, and then the processed feature data is input into the stacked ensemble fault diagnosis model constructed in S4 to output the final fault diagnosis result. 2.The mechanical fault diagnosis method based on multi-scheme pre-processing and ensemble learning according to claim 1, characterized in that: The multi-scheme pre-processing module in step S2 is pre-provisioned with the following eight pre-processing schemes: Pre-processing scheme one: first, isolated forest anomaly detection, then ReliefF feature selection, and then SMOTE oversampling; Pre-processing scheme two: first, isolated forest anomaly detection, then SMOTE oversampling, and then ReliefF feature selection; Pre-processing scheme three: only isolated forest anomaly detection; Pre-processing scheme four: first, SMOTE oversampling, then ReliefF feature selection; Pre-processing scheme five: first, ReliefF feature selection, then SMOTE oversampling; Pre-processing scheme six: only SMOTE oversampling followed by standardization; Pre-processing scheme seven: first, isolated forest and local outlier factor hybrid anomaly detection, then ReliefF feature selection, and then SMOTE oversampling; Pre-processing scheme eight: first, isolated forest and local outlier factor hybrid anomaly detection, then time domain and frequency domain statistical feature enhancement, then ReliefF feature selection, and finally, SMOTE oversampling.
3. The method according to claim 2, wherein the method is characterized in that: The anomaly detection operation in the step S2 adopts a hybrid anomaly detection strategy combining Isolation Forest and Local Outlier Factor, wherein the contamination parameter of the Isolation Forest is set to 0.03-0.1, and the number of neighbors k of the Local Outlier Factor is set to 5-10; The feature selection operation in the step S2 adopts the ReliefF algorithm to perform feature importance sorting and fix the top-K features, wherein K=10; and / or, after the optimal preprocessing scheme is screened out in S3, a two-stage feature selection method combining ReliefF and recursive feature elimination cross-validation based on random forest is adopted to perform feature dimension reduction when the stacked ensemble model is constructed in S4; The sample balancing operation in the step S2 adopts the SMOTE over-sampling technique; and / or, after the optimal preprocessing scheme is screened out in S3, the SMOTE over-sampling technique is combined with the Tomek Links algorithm to perform the SMOTE-Tomek algorithm when the stacked ensemble model is constructed in S4.
4. The method according to claim 2, characterized in that: The determination rule of the hybrid anomaly detection strategy in the step S2 is defined by the following formula: ; The anomaly score of the Isolation Forest is calculated by the following formula: ; The Local Outlier Factor is calculated by the following formula: ; Wherein, Nk(p) is the set of k nearest neighbors of point p, and lrdk(p) is the local reachable density of point p, and the calculation formula is: 。 5. The method according to claim 2, wherein the method is characterized by: In the two-stage feature selection method, the feature weight W[A] is updated by the ReliefF algorithm through the following formula: ]; The objective function for finding the optimal feature subset s* is defined by the following formula: 。 6. The method according to claim 2, wherein the method is characterized in that: The SMOTE over-sampling technique generates new minority class samples x' through the following interpolation formula: x'=x+λ·(x_nn-x), λ~U(0,1).
7. The method of claim 1, wherein the method is characterized by: In the step S4, the cascade of the out-of-sample prediction probability features generated by the base learners and the stacked posterior probability calculation mode are as follows: For a sample xi, the meta-feature vector zi is constructed by the following formula: ; The stacked posterior probability of the logistic regression meta-learner is calculated by the following formula: 。 8. The method of claim 1, wherein the method is characterized by: The training of the logistic regression meta-learner is realized by minimizing the following weighted cross-entropy loss function with L2 regularization: 。 9. The method of claim 1, wherein the method is characterized by: The performance evaluation index adopted in the steps S3 and S5 includes the Hamming Loss, and the calculation formula is as follows: 。 10. The method of claim 1, wherein the method is characterized by: The model pool in the S3 contains at least three models in random forest, support vector machine, K nearest neighbor algorithm, XGBoost and deep neural network; and the hyperparameter optimization adopts the grid search method or the Bayesian optimization method based on the tree structure Parzen estimator; The meta-learner in the S4 is a logistic regression model; and K=5 in the K-fold cross-validation; When the fault is a complex fault involving multiple components, the fault diagnosis result in the S5 is in the form of multiple outputs, and the stacked ensemble model establishes a sub-stacked model for each output path in parallel, which takes the two optimal base models as base learners and the logistic regression as a meta-learner, to realize the synchronous independent prediction of the fault states of multiple components.