An automated production line fault diagnosis method based on continuous balance slice sampling

By constructing an RF-XGBoost hybrid transfer learning model and continuous balanced slice sampling technology, the problems of sample imbalance, temporal feature capture, and cross-line deployment in fault diagnosis of automated production lines are solved, achieving high-precision, interpretable, and lightweight fault diagnosis, which is suitable for monitoring and maintenance of production lines with multi-process temporal characteristics.

CN121412779BActive Publication Date: 2026-04-17SOUTH CHINA UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SOUTH CHINA UNIV OF TECH
Filing Date
2025-12-29
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

Existing technologies for fault diagnosis in automated production lines suffer from problems such as sample imbalance, difficulty in capturing temporal features, and difficulty in balancing model lightweighting and interpretability. Furthermore, their generalization ability is insufficient when deployed across production lines, making it difficult to deploy and migrate models in real time on resource-constrained industrial embedded platforms.

Method used

An intelligent fault diagnosis system based on the RF-XGBoost hybrid transfer learning model is constructed. The system maintains temporal integrity and sample balance through continuous balanced slice sampling (CBSS), and achieves high-precision interpretable classification by combining differential and lag feature enhancement. Furthermore, the system addresses cross-line distribution drift through multi-stage transfer learning.

Benefits of technology

It significantly improves the practicality and rapid deployment capability of industrial site models, and is suitable for production scenarios such as continuous filling, assembly, and capping. It is applicable to production line monitoring and operation and maintenance in industries such as food and beverage, pharmaceutical packaging, and automotive parts assembly.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121412779B_ABST
    Figure CN121412779B_ABST
Patent Text Reader

Abstract

The application discloses an automatic production line fault diagnosis method based on continuous balance slice sampling, relates to the field of intelligent manufacturing, and is proposed in view of problems such as extremely unbalanced samples. An intelligent fault diagnosis system based on an RF-XGBoost hybrid transfer learning model is constructed to perform fault diagnosis on the automatic production line; a time sequence fault data set is constructed through data acquisition and preprocessing; key dynamic evolution modes are extracted and strengthened by using time sequence feature enhancement, so that the distinguishability of fault features is improved; the sampling bias problem is solved through continuous balance slice sampling; a light-weight RF-XGBoost hybrid transfer learning model is constructed in feature screening and fusion modeling to realize fault classification; and multi-stage transfer learning is performed to realize cross-line distribution self-adaption. The method has the advantages that the time sequence integrity and sample balance are maintained; the fault dynamic description is strengthened; high-precision and interpretable classification is realized; and cross-line distribution drift is solved. The practicability and rapid deployment capability of an industrial field model are significantly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent manufacturing, and in particular to a fault diagnosis method for automated production lines based on continuous balanced slice sampling. Background Technology

[0002] With the deep development of Industrial Internet of Things (IIoT) technology, automated production lines have achieved full coverage of multi-sensor networks, collecting real-time equipment operating parameters (such as speed, pressure, and temperature), process operation nodes (such as filling start and stop times and capping pressure thresholds), and environmental auxiliary variables (such as workshop temperature and humidity and power supply stability). This forms high-dimensional time-series datasets, providing a rich data foundation for intelligent fault diagnosis. However, the inherent characteristics of this type of data and the limitations of existing technologies mean that the implementation of fault diagnosis in industrial settings faces many insurmountable challenges.

[0003] Imbalanced sample size is the primary bottleneck for intelligent diagnostics—the extreme imbalance between normal and faulty samples causes a severe bias towards the majority class during model training, making it difficult to effectively learn fault features. The variability in fault timescales further exacerbates sampling difficulties; traditional fixed-window sampling methods cannot simultaneously adapt to the feature extraction requirements of both short-term, sudden faults and long-term, persistent faults. The triple conflict between model accuracy, interpretability, and lightweight design makes it difficult for existing models to meet the actual deployment requirements of industrial sites. The challenge of generalization across production lines severely restricts the large-scale application of intelligent diagnostic technology, contradicting the large-scale, standardized operation and maintenance needs of industrial production.

[0004] The specific technical issues are as follows:

[0005] (1) The contradiction between extreme sample imbalance and temporal structure preservation

[0006] The high reliability design of automated production lines typically results in normal samples accounting for over 99%, while faulty samples account for less than 1%, with some critical fault samples even falling below 0.5%. Existing solutions employ oversampling techniques such as SMOTE and ADASYN, which generate spurious samples to augment faulty samples, disrupting the continuity and dynamic dependencies of time-series data and distorting the representation of fault evolution patterns. Undersampling techniques like random undersampling and NearMiss undersampling discard a large number of normal samples, causing loss of crucial information and reducing model generalization ability. Neither approach effectively alleviates sample imbalance while preserving the core value of time-series data.

[0007] (2) Adaptability challenges in multi-scale fault feature capture

[0008] Production line failure modes exhibit significant differences in time scale: short-term sudden failures (such as filling deviations caused by instantaneous voltage fluctuations) last only a few milliseconds, while long-term continuous failures (such as abnormal rotational speed caused by accumulated bearing wear) can last for tens of seconds. Traditional fixed-window sampling methods have inherent drawbacks: excessively long windows smooth out the instantaneous impact characteristics of short-term failures, making it impossible for the model to identify sudden failures; excessively short windows truncate the evolution process of long-term failures, making it difficult to capture the gradual change pattern of failures over time, and failing to simultaneously meet the feature extraction requirements of both types of failures.

[0009] (3) The triple conflict between model accuracy, interpretability and lightweight

[0010] The core requirements for fault diagnosis models in industrial settings are "high-precision identification, interpretable traceability, and lightweight deployment." However, existing technologies struggle to achieve all three: while deep learning models (such as LSTM and GRU) can capture temporal dependencies to improve accuracy, their "black box" nature leads to poor interpretability, and training requires large-scale labeled data and high computing power, making real-time deployment on resource-constrained industrial embedded platforms difficult; traditional machine learning models (such as SVM and single decision trees) have high training efficiency and low resource consumption, but their ability to capture temporal dynamic features is weak, resulting in limited diagnostic accuracy; existing hybrid models are mostly simple structural splices that do not fully leverage the complementary advantages of different models, failing to achieve synergistic optimization of accuracy, interpretability, and lightweight design.

[0011] (4) Distribution drift and generalization bottleneck in cross-production line deployment

[0012] Due to differences in equipment models, process parameters, and operating environments across different production lines, the distribution of sensor data features for the same fault can drift significantly. Traditional transfer learning methods are mostly designed for static features and lack the ability to adapt to the dynamic dependencies of time-series data. Using only a single transfer strategy (such as MMD distribution alignment) is insufficient to fully correct inter-domain differences, resulting in a significant drop in diagnostic accuracy (typically from over 95% to below 70%) when the model trained on the source production line is transferred to the target production line. Enterprises need to train models separately for each production line, increasing the time and manpower costs of data annotation and model training, and hindering the rapid large-scale deployment of diagnostic models.

[0013] Based on the aforementioned issues, the industry urgently needs an integrated solution that can simultaneously address problems such as imbalanced samples, temporal feature capture, lightweight and interpretable models, and cross-production line generalization. This solution must achieve adaptive sample balancing while maintaining temporal continuity to avoid feature distortion caused by pseudo-sample generation; it must enhance the model's ability to identify faults at different time scales and improve the diagnostic accuracy of complex fault modes; it must construct a lightweight model structure to meet the real-time deployment requirements of industrial embedded platforms while ensuring model interpretability and supporting fault cause tracing; and it must design a transfer learning mechanism adapted to temporal data to achieve rapid model adaptation across production lines and reduce deployment costs. Summary of the Invention

[0014] The purpose of this invention is to provide an automated production line fault diagnosis method based on continuous balanced slice sampling, so as to solve the problems existing in the prior art.

[0015] The present invention describes a fault diagnosis method for automated production lines based on continuous balanced slice sampling, which constructs an intelligent fault diagnosis system based on an RF-XGBoost hybrid transfer learning model to diagnose faults in automated production lines.

[0016] The construction steps of the intelligent fault diagnosis system are as follows:

[0017] S1. First, a time-series fault dataset is constructed through data acquisition and preprocessing;

[0018] S2. Subsequently, time series features are used to enhance the extraction and reinforcement of key dynamic evolution patterns in order to improve the discriminativeness of fault features;

[0019] S3. Then, the sampling deviation problem is solved by continuous balanced slice sampling;

[0020] S4. Next, a lightweight RF-XGBoost hybrid transfer learning model is constructed in feature selection and fusion modeling to achieve fault classification;

[0021] S5. Finally, multi-stage transfer learning is used to achieve cross-production line distribution adaptation.

[0022] The automated production line fault diagnosis method based on continuous balanced slice sampling (CBSS) described in this invention has the advantage of constructing a collaborative intelligent diagnostic framework integrating "dynamic sampling, temporal feature enhancement, lightweight hybrid modeling, and adaptive transfer learning." CBSS maintains temporal integrity and sample balance, differential and hysteresis feature enhancement strengthens the dynamic characterization of faults, RF-XGBoost hybrid transfer learning model achieves high-precision interpretable classification, and multi-stage transfer learning solves cross-line distribution drift. Ultimately, it achieves synergistic optimization of sample balance, temporal structure preservation, high-precision diagnosis, and efficient cross-line transfer learning, significantly improving the practicality and rapid deployment capability of industrial site models. It is particularly suitable for production scenarios with multi-process temporal characteristics, such as continuous filling, assembly, and capping, and can be widely applied to production line monitoring and maintenance in industries such as food and beverage, pharmaceutical packaging, and automotive parts assembly, providing technical support for equipment lifecycle management. Attached Figure Description

[0023] Figure 1 This is a schematic diagram of the construction process of the intelligent fault diagnosis system described in this invention.

[0024] Figure 2 This is a flowchart illustrating the automated production line for canned products in this embodiment.

[0025] Figure 3 This is a schematic diagram illustrating the principle of continuous balanced slice sampling as described in this invention.

[0026] Figure 4 This is a bar chart comparing the performance of the RF-XGBoost hybrid transfer learning model described in this invention with mainstream models in the prior art. Detailed Implementation

[0027] The fault diagnosis method for automated production lines based on continuous balanced slice sampling described in this invention is to construct an intelligent fault diagnosis system based on the RF-XGBoost hybrid transfer learning model to diagnose faults in automated production lines.

[0028] like Figure 1 As shown, the construction steps of the intelligent fault diagnosis system are as follows:

[0029] S1. Construct a high-quality time-series fault dataset through data acquisition and preprocessing.

[0030] This step addresses core issues in existing technologies, such as the high-dimensional heterogeneity and inconsistent dimensions of multi-sensor time-series data, and the direct impact of data quality on model performance. Directly inputting data into subsequent processes can lead to feature distortion and noise interference, undermining the reliable foundation for subsequent feature enhancement and sampling, ultimately affecting diagnostic accuracy. Therefore, this step ensures the accuracy, consistency, and completeness of the input data from the source, providing a usable and reliable structured time-series dataset for subsequent feature construction and model training. The core task of this step is to construct a workflow covering data acquisition, quality control, and standardization processing, transforming raw multi-source data into high-quality, standardized input data. The specific implementation method is as follows:

[0031] Sensor Network Deployment: A distributed deployment strategy is adopted, configuring appropriate sensor types based on the process characteristics of the eight core processes of the production line (material pushing, material conveying, material detection, container placement, main conveying, filling, capping, and quality inspection). Vibration and speed sensors are deployed on moving parts (motors, conveyor belts, capping devices) to collect data such as vibration amplitude and speed fluctuations; pressure and torque sensors are deployed in the filling and capping processes to collect key parameters such as filling pressure and capping torque; infrared and position sensors are deployed along the material conveying path to collect data such as material position and conveying speed; and temperature and humidity sensors and voltage monitoring sensors are deployed in the workshop environment to collect auxiliary data such as ambient temperature and humidity and power supply stability. All sensors are uniformly set to a 100Hz sampling frequency to ensure consistent data temporal resolution, providing a foundation for multi-source data fusion.

[0032] Data preprocessing: The 3σ criterion is used to identify outliers in the raw data. Data exceeding the 3σ range are marked as outliers and removed. Data segments with no more than 5 consecutive missing sampling points are filled using linear interpolation. Data segments with more than 5 missing sampling points are marked as invalid data and removed entirely to avoid interference from missing values ​​in model training. Due to differences in the installation location and response speed of different sensors, there may be slight deviations in the timestamps of the collected data. Timestamp synchronization technology is used to map all sensor data to a unified time axis to ensure accurate correspondence of multi-source data at the same time point, with the time synchronization error controlled within ±1ms.

[0033] S2. Utilize time series features to enhance the extraction and reinforcement of key dynamic evolution patterns to improve the discriminative power of fault features.

[0034] To address the significant dimensional differences in data from different types of sensors (e.g., pressure is measured in MPa, rotational speed in r / min), the Min-Max normalization method is used to map all feature data to the [0,1] interval. The normalization formula is as follows: ;

[0035] in, The original data, and These are the minimum and maximum values ​​of the feature, respectively. The standardized data is processed to eliminate the impact of dimensional differences on model training. After preprocessing, a high-dimensional time-series dataset containing 37 feature attributes is formed, of which 9 are key fault features (including filling pressure deviation, capping torque fluctuation, motor vibration amplitude, conveyor belt speed deviation, etc.), providing structured, high-quality input data for subsequent time-series feature enhancement and continuous balanced slice sampling.

[0036] like Figure 2 As shown, after the automated production line for canned products starts, the pushing device pushes the material and conveys it to the picking area via the material conveyor belt. Simultaneously, the container placing device places the container, which is then conveyed to the filling device by the main conveyor belt. After the material detection device (infrared probe) identifies the material in the picking area, the mechanical arm grabs the material. When the infrared probe of the filling device detects the container, the positioner immediately fixes the container. Then, the mechanical arm rotates the material to directly above the container opening and lowers it into the container. It then checks if the number of filled containers is three. If not, the "grab-place material" operation is repeated. Once the target is met, the positioner releases the container. After filling, the product enters the capping stage: after the infrared probe detects the product, the pushing cylinder pushes out the cap, and the pressing cylinder presses the cap onto the product's bottle opening. During this process, the positioner fixes and releases the product. Next, the product enters the capping stage. After the infrared sensor detects the product, the positioner fixes the product, the capping head lowers to the cap and rotates to tighten it, and then the positioner releases the product to fix it. Finally, the product is transported to the quality inspection device. If it meets the quality requirements, it is transported to the qualified storage area; if it fails, it is transported to the unqualified storage area, thus ending the entire production process.

[0037] Production line failures are not instantaneous or isolated events, but are typically accompanied by two types of temporal evolution patterns: first, abnormal coordination between processes, such as delays in upstream processes potentially causing disruptions in the cycle time of subsequent processes; and second, persistent deviations in equipment state, such as vibration amplitudes continuously exceeding thresholds for a period of time. Traditional feature extraction methods often focus on static features and fail to explicitly model temporal dependencies, resulting in models that cannot effectively capture the dynamic evolution patterns of failures, struggle to identify complex failure modes, and further impact subsequent sampling strategies and modeling effectiveness.

[0038] Addressing the challenges of "difficulty in characterizing fault evolution patterns" and "significant dynamic dependencies in time-series data" in existing technologies, the core function of this step is to construct an explicit time-series dynamic feature set. This enhances the model's ability to perceive the formation and evolution of faults, achieving an upgrade from static to dynamic features. This step directly expands the structured time-series data generated in the data preprocessing step, providing a more discriminative feature foundation for CBSS dynamic sampling.

[0039] Sensor data from automated production lines exhibits a clear temporal sequence, with trends, accumulation, or periodicity often presenting between adjacent time points. Some faults also display a dynamic pattern of "continuity-accumulation-triggering," meaning that a persistently abnormal critical attribute over a period of time can lead to a fault. Therefore, fault diagnosis models must incorporate temporal dimension information and explicitly utilize temporal structures to improve the accuracy and robustness of diagnosis.

[0040] To this end, this step constructs a two-dimensional temporal feature set of "dynamic dependency-persistent state" to characterize the temporal evolution of faults from two aspects: firstly, it is used to model the correlation dependencies between processes; secondly, it is used to describe the stability and persistence shift of equipment state over time. The specific process is as follows:

[0041] Calculating the Difference Feature (Diff): There are clear process dependencies between processes on a production line (e.g., the filling process must start after the container placement process). Under normal operating conditions, the completion time difference between processes is relatively stable, while fault conditions cause abnormal fluctuations in this time difference. The difference feature explicitly characterizes the dynamic dependencies between processes by calculating the completion time difference between process-dependent processes. Its calculation formula is: ;

[0042] in, Indicate process In time Completion time, Indicate process Pre-dependent processes In time The completion time. For example, the container placement process ( ) and filling process ( This represents a predecessor-successor dependency relationship, under normal operating conditions. The time is stable at 2±0.1 seconds. When the container locator malfunctions, the container placement time is prolonged, leading to... If the time exceeds 3 seconds, this feature can be used to quickly identify locator malfunctions.

[0043] Calculating the hysteresis feature (Lag): Equipment failures are often accompanied by persistent anomalies in specific states (such as motor vibration amplitude consistently exceeding a threshold or pressure values ​​continuously decreasing). The hysteresis feature captures this persistent pattern by encoding and correlating sensor state signals at different time steps. Its calculation formula is as follows: ;

[0044] in, The state signal (e.g., vibration amplitude, pressure value) of the k-th sensor at time t, where τ is the hysteresis step size. Considering the sensor sampling frequency is 100Hz and the cycle of equipment status changes on the production line, it is adaptively set to 5 sampling points (i.e., 0.05 seconds). For example, in the capping process, under normal conditions, the capping torque sensor (k)... When the absolute value is less than 0.5 N·m, and the torque becomes unstable due to wear of the gland assembly, The absolute value is consistently greater than 1.0 N·m, and this characteristic can be used to identify wear failures in the gland assembly.

[0045] By combining differential features and hysteresis features, the model can simultaneously characterize process synergy and equipment stability, enabling it to more accurately capture feature changes when a fault occurs, improve the ability to identify complex fault modes, and provide more discriminative feature inputs for subsequent continuous balanced slice sampling, ensuring that the sampled data can retain the dynamic evolution information of the fault.

[0046] S3. Continuous Balanced Slice Sampling (CBSS) addresses the sampling bias issues caused by extreme imbalances in fault categories, differences in fault durations, and the need for multi-scale diagnostics.

[0047] This step is the core innovation, directly overcoming the two major bottlenecks in existing technologies: "extreme sample imbalance" and "heterogeneous fault time scales". Through adaptive sampling window design, it fundamentally solves the problems of traditional oversampling / undersampling destroying the temporal structure and fixed windows being unable to adapt to multi-scale faults. In the fault diagnosis scenario of automated production lines for canned products, there are two major challenges in the time-series data collected by sensors (such as motor speed, conveyor belt tension, filling pressure, capping torque, etc.): First, the sample distribution is extremely unbalanced. Fault samples (such as filling blockage, capping looseness, conveyor belt deviation, etc.) have a low probability of occurrence, usually accounting for less than 1%, while normal samples account for more than 99%. This extreme imbalance will cause the model to be biased towards learning the features of normal samples during training, resulting in a high failure rate and poor diagnostic robustness. Second, the fault time scale is significantly heterogeneous. The duration of different types of faults can vary by several orders of magnitude. Short-term faults (such as abnormal filling volume caused by instantaneous voltage fluctuations) last only a few milliseconds, while long-term faults (such as capping torque attenuation caused by wear of mechanical parts) can last for tens of seconds. If the traditional fixed window sampling method has too small a window length, it will cause the features of short-term faults to be truncated and key instantaneous information to be lost. If the window length is too large, it will cause redundancy of long-term fault features, enhanced interference from normal samples, and will not be able to meet the feature capture requirements of both types of faults. In traditional sampling schemes, random oversampling achieves balance by repeatedly copying minority class samples, but this can lead to model overfitting and disrupt the continuity of time-series data. Random undersampling reduces the amount of data by discarding majority class samples, but this can cause the loss of key evolutionary features in normal samples. Fixed window sampling cannot adapt to multi-scale faults, resulting in incomplete or redundant feature capture. All of the above methods are difficult to meet the modeling requirements for high-precision fault prediction.

[0048] To address this, this invention proposes a Continuously Balanced Slice Sampling (CBSS) technique. Through a three-stage process of "sample statistical analysis - adaptive window calculation - sliding slicing and dynamic balancing," it achieves dual optimization of temporal integrity and sample balance. Its core technology lies in: dynamically adjusting the sampling window based on the true statistical characteristics of fault samples, rather than using a fixed scale or randomly generating pseudo-samples, ensuring the integrity and temporal correlation of fault characteristics; and precisely controlling the sample proportion by dynamically adjusting the sliding step size, avoiding model bias caused by extreme imbalance. The specific implementation process is as follows:

[0049] Sample statistical analysis: A refined statistical analysis was performed on the time-series dataset after data cleaning (removing sensor outliers and filling missing values) and feature enhancement (such as time-domain feature extraction and frequency-domain transformation). For each type of fault sample (such as filling system faults, capping system faults, conveying system faults, etc.), three core statistical features were extracted: the mean fault duration... Standard deviation of fault duration and the number of times the fault occurred .

[0050] The fault duration is defined as the time interval from the fault occurrence (triggered by sensor data exceeding a preset abnormal threshold) to the fault resolution (sensor data returning to the normal threshold range). The abnormal threshold is determined by a combination of the "3σ principle" and industry experience thresholds—first, the mean is calculated based on normal sample data. with standard deviation Set the initial threshold range as Then, the accuracy of fault event classification is ensured by combining the safe operating parameters of the production line equipment (such as the allowable range of filling pressure and the standard value of capping torque). The number of faults is obtained by accurately aligning the timestamps of the production logs (such as equipment maintenance records and quality inspection failure records) with the timestamps of the sensor data. The timestamp synchronization accuracy is controlled within 10ms to avoid statistical errors caused by time deviation.

[0051] Adaptive window length calculation: Based on the statistical characteristics of the samples, the sampling window lengths for faulty samples and normal samples are calculated separately to ensure that fault features at different time scales can be completely captured.

[0052] Calculating the fault sample window length: For each type of fault with varying time scales, a statistical modeling method is used to dynamically calculate the window length, ensuring that both the instantaneous characteristics of short-term faults and the evolutionary characteristics of long-term faults are fully captured. The calculation formula is as follows: ;

[0053] in, , These are the mean and standard deviation of the fault duration for fault type i, respectively; The number of fault occurrences is denoted as . k is the expansion coefficient covering long-term fault evolution characteristics, ensuring that features of extremely long-term faults are not truncated; α is the statistical reliability coefficient corresponding to the 95% confidence interval, reducing the impact of sample statistical fluctuations; β is the small sample correction coefficient, avoiding incomplete feature capture due to excessively small window lengths when the number of fault occurrences is too low. Based on dataset analysis and fault precursor theory, the following settings are defined: =4.0、 =1.96 (95% confidence interval), and =10 (small sample correction coefficient).

[0054] Calculating the normal sample window length: To ensure that the sampling granularity of normal samples matches that of faulty samples and to avoid feature distortion caused by differences in window scale, the normal sample window length is determined based on the statistical mean of the window lengths of all faulty samples. The calculation formula is as follows: ;

[0055] Where K is the total number of common fault types on the production line (K≥5 in this embodiment).

[0056] Sliding slice sampling and sample balancing: Continuous sliding slice sampling is performed on the preprocessed time-series data along the time axis, strictly preserving the temporal continuity of the data during the sampling process; for each type of fault sample, a corresponding fault window length is adopted. Perform slicing; for normal samples, use a uniform normal sample window length. Slice the sample; uniformly set the sliding step size to 1 / 2 of the corresponding window length, i.e., the sliding step size for faulty samples. The sliding step size of normal samples This setting ensures both the temporal correlation between adjacent samples (with an overlap of 50%) and avoids data redundancy, guaranteeing that each sample captures continuous feature evolution information. For example, when the fault sample window length is 53 sampling points, the sliding step is 26 sampling points; when the normal sample window length is 100 sampling points, the sliding step is 50 sampling points. The overlap between adjacent samples effectively preserves the intermediate process features of fault evolution. After slicing, the proportion of positive and negative samples is counted in real time: if the proportion of fault samples is less than 5%, a dynamic balance adjustment mechanism is activated—the sliding step of this type of fault sample is halved (e.g., adjusted from 26 sampling points to 13 sampling points), and sliding slicing is performed again. By increasing the number of fault sample slices, its proportion in the total sample is increased. The above adjustment process is repeated until the proportion of fault samples stabilizes in the optimal balance range of 5% to 10% (this range has been verified through extensive experiments to avoid both model bias caused by too low a proportion of fault samples and overfitting caused by too high a proportion). Ultimately, the training dataset formed through this step not only fully preserves the temporal evolution characteristics of various faults (without truncation or distortion), but also achieves a balanced distribution of positive and negative samples, providing high-quality input for the subsequent training of the RF-XGBoost hybrid model and avoiding the problem of insufficient modeling accuracy caused by sample imbalance or temporal breaks from the data source.

[0057] The core innovations of the CBSS technology proposed in this invention are reflected in the following four aspects: First, the sampling window length is driven by the true statistical characteristics of the samples. It is dynamically calculated through the mean, standard deviation, and occurrence frequency of the fault duration, and can adaptively expand and contract according to the time scale of different fault types, perfectly adapting to the feature capture needs of short-term and long-term faults, and solving the technical defects of the traditional fixed window "one-size-fits-all" approach. Second, it adopts a continuous sliding slicing method to strictly preserve the continuity and correlation of time-series data, avoiding the time-series distortion problem caused by the generation of pseudo samples by traditional oversampling (such as SMOTE), and ensuring that the model can learn the true evolution law of fault occurrence and development. Third, through the iterative mechanism of dynamically adjusting the sliding step size, it achieves precise control of the sample ratio, stabilizing the proportion of fault samples in the optimal range of 5% to 10%, taking into account the balance and generalization ability of model training. Fourth, it does not require random discarding or repeated copying of the original data. Balance is achieved only through slicing and adjusting the step size of the real samples, which not only ensures the authenticity of the data, but also improves the feature representation ability of rare fault samples, significantly reducing the model's false negative and false positive rates.

[0058] The architecture diagram of CBSS is as follows: Figure 3 As shown, it constructs a sampling mechanism adapted to multi-scale faults in production lines through a closed-loop design of "statistical analysis-adaptive window-dynamic balancing". After testing and verification with actual production line data, this method improves the completeness of fault feature capture by more than 35% and the sample balance by more than 80% compared with traditional sampling methods. It provides core data support for the subsequent model to improve the fault prediction lead time from the traditional second level to the minute level.

[0059] S4. Next, a lightweight RF-XGBoost hybrid transfer learning model is constructed in feature selection and fusion modeling to achieve high-precision, interpretable and engineering-deployable fault classification.

[0060] To address the inherent contradiction in existing technologies—the difficulty of simultaneously achieving model accuracy, lightweight design, and interpretability—this step constructs a two-stage hybrid diagnostic architecture to achieve synergistic optimization of Random Forest (RF) and Extreme Gradient Boosting Tree (XGBoost), thereby balancing high-performance diagnostic capabilities with low resource consumption in industrial scenarios. In fault diagnosis of automated production line equipment, while highly complex models can achieve excellent recognition accuracy, they are typically accompanied by large parameter scales, high inference overhead, and insufficient interpretability. Lightweight models, while possessing strong deployment advantages, struggle to accurately characterize complex and multi-mode faults, failing to meet the simultaneous demands of high accuracy and traceability in industrial settings. Furthermore, although the aforementioned CBSS sampling effectively alleviates the class distribution imbalance problem, high-dimensional temporal features may still possess redundant attributes. Directly inputting these features into the classifier not only increases computational pressure but may also induce overfitting, further weakening the stable generalization ability during the transfer learning stage.

[0061] To address the aforementioned issues, this step leverages the robustness of RF in feature selection and the high accuracy of XGBoost in classification and recognition, constructing a two-stage hybrid modeling process of "feature selection – classification diagnosis." First, RF, as an ensemble learning framework, consists of multiple weak binary tree models based on bootstrap sampling. Multi-tree training is performed using randomly sampled data and randomly selected features, with node impurity minimization as the splitting criterion to quantitatively evaluate the importance of input features. This stage effectively reduces interference from noise and invalid features, significantly compressing the input dimensionality while preserving representational power, thus improving model training efficiency and stability. Subsequently, the selected subset of key features is input into the XGBoost classifier, utilizing its gradient-boosting-based forward addition strategy to achieve decision fusion and optimization for complex fault types, thereby obtaining higher classification accuracy and robustness. Thanks to this hybrid architecture design, on the one hand, the overall model complexity is significantly reduced, meeting the lightweight deployment requirements of industrial sites; on the other hand, diagnostic performance is not compromised, still enabling accurate identification of multi-mode and multi-condition faults.

[0062] Furthermore, the feature importance output generated by RF provides a foundation for model interpretability, enabling diagnostic results to pinpoint key operating condition variables and providing a basis for equipment maintenance and fault tracing. The model structure formed after the two-stage processing is stable and the feature space is refined, providing a more easily adaptable basic model for subsequent multi-stage transfer learning, thereby further enhancing the generalization ability and parameter transfer efficiency when deployed across production lines. In summary, this step, through the deep integration of RF and XGBoost, successfully achieves a comprehensive balance between diagnostic accuracy, model lightweighting, and interpretability, providing an industrial-grade fault diagnosis system with a core diagnostic architecture that is directly deployable, easy to maintain, and highly robust.

[0063] Includes the following sub-steps:

[0064] S41. Feature Filtering – Redundancy Removal and Key Feature Extraction;

[0065] The production line fault dataset contains high-dimensional feature redundancy. Directly inputting it into a classification model would increase computational complexity and introduce noise interference. The RF model, due to its ensemble nature of multiple decision trees, possesses a natural ability to assess feature importance and strong resistance to overfitting; therefore, it is used as the first-stage feature filter. The specific process of this sub-step is as follows:

[0066] Dataset partitioning and RF model training: The dataset, after CBSS sampling (to address imbalanced fault samples) and feature augmentation, is partitioned in a 7:3 ratio into a training set (for model fitting) and a validation set (to verify the selection effect) to train the RF model. Hyperparameter settings are optimized based on fault data characteristics: Number of decision trees: 100 – to balance model stability and training efficiency, avoiding excessive variance due to too few trees or resource waste due to too many trees; Single tree feature sampling ratio: 70% – randomly selecting 70% of features to construct a single tree, enhancing diversity between trees to improve overfitting resistance; Maximum decision tree depth: unlimited (automatically determined by the data) – adapting to the complex nonlinear relationships between fault features and types, avoiding underfitting; Minimum number of samples per leaf node: 1 – ensuring that a single tree fully captures local feature patterns, providing a precise basis for feature importance calculation.

[0067] Feature Importance Calculation: The importance score for each feature is calculated using the "Average Impurity Decrease" method. For each decision tree, the sum of the Gini impurity decrease values ​​brought by each feature across all node splits is calculated. Then, the results of all decision trees are averaged to obtain the feature's importance score (VIM). Based on these characteristics, random forests are particularly suitable for research on high-dimensional omics data, that is, to classify faulty data while simultaneously filtering potential data features of the faulty data through VIM values.

[0068] Calculation based on the Gini index is a common method for calculating VIM in Radioflow, and the variables... The score statistics are used Indicates. Statistic. Indicates the first The average change in node splitting impurity across all trees in a randomized controlled trial (RF). The Gini index is calculated using the following formula: ;

[0069] K is the number of categories in the self-service sample set. Let be the probability estimate of a sample belonging to class k for node m. When the sample is binary data (K=2), the Gini index of node m is: ;

[0070] This is an estimate of the probability that a sample belongs to any class at node m. Variable The importance of node m, i.e., the change in the Gini index before and after node m branches, is as follows: ;

[0071] and Let Gini exponents of the two new nodes resulting from the split from the original node be denoted as . When the variable . The importance of the i-th tree is: ;

[0072] variable In RF, Gini importance is defined as: ;

[0073] Where n is the number of classification trees in RF. This is obtained in this section. The Gini importance is measured by the decrease in the Gini coefficient of each feature as it splits across all decision trees in a random forest. A higher Gini importance indicates a greater contribution of that feature to the classification of the samples.

[0074] ;

[0075] Where T is the total number of decision trees in the RF model. Let be the decrease in Gini impurity resulting from splitting a node in the t-th decision tree using feature k. Gini impurity measures the purity of a node sample; a larger decrease indicates a greater contribution of that feature to the sample classification.

[0076] Feature subset selection: All features are sorted from highest to lowest importance score, and the cumulative contribution rate is calculated. The feature subset with a cumulative contribution rate of 90% or higher is selected as the input for the subsequent XGBoost model. This selection strategy can eliminate redundant features, reduce the dimensionality of the model input, and retain key fault features, thereby improving the model training efficiency and generalization ability, and clearing the obstacles of feature redundancy for subsequent classification modeling.

[0077] S42.XGBoost classification modeling—time-driven accurate fault diagnosis;

[0078] XGBoost, an efficient improvement to Gradient Boosting Decision Tree (GBDT) algorithm, relies on the Boosting concept of ensemble learning to construct a forward additive model. It is specifically designed for modeling classification and regression tasks, exhibiting significant advantages, particularly in time-series data-driven fault prediction scenarios. This algorithm iteratively trains multiple weak learners (CART trees, i.e., classification and regression trees). Each iteration aims to reduce the prediction error of the previous model, accumulating the predictions from multiple trees to obtain the final output. Compared to traditional GBDT, this represents a deep optimization, significantly improving model performance. Specifically, XGBoost involves multiple CART trees in decision-making, with each new tree's prediction corresponding to the difference between the target value and the predictions of all previous trees. This iterative optimization effectively captures complex patterns in the data. Therefore, this paper combines various fault indicators and the time-series characteristics of the dataset to construct an XGBoost fault prediction model driven by time-series data.

[0079] XGBoost's core advantage lies in combining gradient boosting trees with efficient optimization strategies. By iteratively training and integrating multiple decision trees, it possesses excellent generalization ability and training efficiency, making it widely used in time series data modeling. Addressing the dynamic and sequence correlation characteristics of time series data, the time-series data-driven XGBoost model further integrates differencing and lag features, enabling it to more accurately capture the inherent patterns of time series data, thereby improving modeling capabilities and prediction accuracy. From a mathematical perspective, the core of XGBoost's efficient and accurate gradient boosting tree model lies in the collaborative optimization of the gradient of the loss function, the Hessian matrix, the regularization term, and the model parameter update rules. The complete training process of this sub-step can be broken down as follows:

[0080] Initialize the model: First, initialize a weak learner (decision tree). Usually, the predicted values ​​of all samples are initialized to a constant, which can be the mean of the sample labels.

[0081] Calculate the gradient and Hessian matrix of the loss function: Using the current model to make predictions on the training data, calculate the first and second gradients (Hessian matrix) of the loss function. These gradients and Hessian matrices are used to fit the next weak learner.

[0082] The first gradient of the loss function: ;

[0083] The second gradient of the loss function: ;

[0084] in It is a loss function. It's a real label. It is the model on the sample The predicted value.

[0085] Building a tree model: A new decision tree is fitted using the gradients and Hessian matrix of the training data. The leaf nodes of this decision tree store the increments of the sample predictions.

[0086] Regularization term: A regularization term is considered before calculating the incremental predictions of the tree model to avoid overfitting.

[0087] Regularization term of the loss function: ;

[0088] Where T is the number of leaf nodes in the tree, and Y and It is a regularization parameter. It is the score of the leaf node.

[0089] Update model parameters: Combine the newly constructed tree model with the current model, and update the model's predictions using a weighted average. Update predictions: ;

[0090] in, This is the predicted value of the current model. It's the learning rate. These are the predicted values ​​from the newly added model.

[0091] Iterative optimization: Repeatedly execute the process of calculating the gradient of the loss function and the Hessian matrix to update the model parameters until the stopping condition is met (such as reaching the maximum number of iterations, the loss function converging, etc.).

[0092] This invention focuses on three core dimensions: model complexity control, optimization algorithm efficiency, and integrated algorithm advantages. A comparison with mainstream machine learning models reveals that XGBoost can precisely control model complexity by introducing regularization terms and supporting column sampling, effectively preventing overfitting. While traditional GBDT also possesses some overfitting control mechanisms, XGBoost's regularization strategy is more flexible and better avoids excessive model complexity. Furthermore, XGBoost uses second-order Taylor expansion to optimize the loss function. Compared to traditional GBDT's use of only first-order derivatives, XGBoost updates model parameters more accurately and efficiently, enabling the model to converge to the optimal solution faster, especially on large-scale datasets.

[0093] From the perspectives of flexibility and computational efficiency, XGBoost supports custom loss functions, requiring only that they meet the condition of being "second-order continuously differentiable." Furthermore, XGBoost has undergone multiple optimizations at the engineering implementation level, such as supporting column sampling and parallel computing, resulting in relatively faster training speeds. In contrast, traditional GBDT is prone to low computational efficiency when processing large-scale time-series fault data, making it difficult to adapt to the efficient modeling needs of industrial scenarios.

[0094] From the perspective of feature relationship modeling and the advantages of ensemble algorithms: XGBoost has a strong ability to model complex feature relationships and can more accurately capture the inherent dependencies between fault indicators. In contrast, Multilayer Perceptron (MLP) is easily limited by factors such as network structure design and parameter initialization methods when dealing with nonlinear relationships, resulting in insufficient modeling stability. Compared with Random Forest (a Bagging-type ensemble algorithm), XGBoost, as a gradient boosting tree algorithm, can make full use of the prediction residuals of the previous decision tree for iterative learning, thus possessing better generalization performance and prediction accuracy.

[0095] In summary, compared with traditional models such as GBDT, multilayer perceptron, random forest, and clustering, XGBoost demonstrates significant advantages in model complexity control, optimization algorithm efficiency, flexibility, computational efficiency, feature relationship modeling capabilities, and ensemble algorithm advantages. Therefore, the time-series data-driven XGBoost model is suitable for constructing the production line equipment fault prediction and automatic alarm model in this invention, and can ensure excellent model performance.

[0096] Hyperparameter optimization strategy and optimal parameters for the S43.XGBoost model;

[0097] This invention uses Python to build an XGBoost fault feature prediction model driven by time series data. In terms of parameter selection strategy, this invention adopts the strategy of "expanding parameters based on the center point of the current parameter search space" and the strategy of "expanding parameter grid search".

[0098] The strategy of "expanding parameters based on the center point of the current parameter search space" is an adaptive parameter exploration strategy. In this strategy, the combination of parameters chosen in each iteration affects the construction of the search space in the next round, making it more focused on the regions that performed well in the previous round of search. This method utilizes information from previous searches to search the parameter space more efficiently.

[0099] The strategy dynamically adjusts the parameter search space based on the current optimal parameter combination, making the search more focused on regions with better performance. Specifically, for each parameter, the selected parameter value not only includes the original candidate value, but also its left and right adjacent values ​​are added to the parameter search space to explore the parameter space more comprehensively.

[0100] For example, for the parameter 'n_estimators', assuming the current optimal parameter combination is {'n_estimators':50}, the next round of parameter search space will contain more concentrated candidate values, such as [25,50,75,100,200,225,250,275,300,400,500,600,700,1000], in order to better search for parameter combinations with better performance.

[0101] The "parameter grid search expansion" strategy is a "parameter space expansion" strategy. In this strategy, for each parameter, in addition to the initial candidate value, it is expanded into a series of adjacent parameter values ​​and step sizes to increase the breadth and diversity of the parameter search.

[0102] The strategy expands the candidate values ​​for each parameter, increasing the breadth and diversity of the parameter search to explore the parameter space more comprehensively. Specifically, for integer parameters, the current maximum value is extended by a certain step, and these new values ​​are added to the parameter search space; similarly, for floating-point parameters, the current maximum value is extended by a certain step, and new values ​​are added to the parameter search space. This helps to search more extensively in the parameter space, thereby increasing the probability of finding the optimal parameter combination. For example, for the parameter 'n_estimators', assuming the current optimal parameter combination is {'n_estimators':50}, the next round of the parameter search space will include step sizes close to that optimal parameter. If the step size is [1,5,10], then the parameters in the next round will be [50,51,55,60,100,200,225,250,275,300,400,500,600,700,1000], in order to better search for parameter combinations with better performance. Based on the above process, the optimal parameters of the time-series data-driven XGBoost model obtained by this invention are shown in Table 1.

[0103] Table 1 Optimal parameters of the XGBoost model based on time-series data

[0104]

[0105] S5. Finally, multi-stage transfer learning is used to achieve cross-production line distribution adaptation.

[0106] In the field of fault diagnosis and monitoring of automated production lines, existing technologies face a triple bottleneck in terms of accuracy, efficiency, and generalization. Addressing the characteristics of industrial scenarios, such as heterogeneous equipment models, varying process parameters, and complex and variable operating environments, as well as the resulting strong time-series dependencies and imbalanced fault samples, this invention proposes a time-series data-driven RF-XGBoost hybrid modeling technology. This solution aims to endow the model with the ability to quickly adapt to new production lines, overcoming the technical limitations of traditional methods.

[0107] Building upon the existing core framework of "data acquisition - feature enhancement - dynamic sampling - hybrid modeling," this solution innovatively and systematically addresses key issues such as sample imbalance, insufficient temporal feature capture, and the difficulty in balancing lightweight models with high-precision classification. To further overcome the challenge of feature distribution drift during cross-production line deployment and achieve rapid model adaptation and high-precision diagnosis across different production lines, this invention uniquely develops a four-stage transfer learning approach: source domain knowledge extraction and feature alignment, importance weight estimation, probability contrastive learning enhancement, and adaptive parameter adjustment. By collaboratively correcting inter-domain distribution differences, enhancing cross-domain feature discriminativeness, and dynamically adapting model parameters, a closed-loop technical system encompassing "model training - cross-production line transfer - accurate diagnosis" is constructed.

[0108] Transfer learning plays a core supporting role in this solution. By training the initial model in the source domain (already deployed production lines), the learned fault diagnosis knowledge is transferred to the target domain (newly deployed production lines), enabling rapid adaptation to fault diagnosis tasks on new production lines and avoiding the high costs of repetitive training and large-scale data annotation. Introducing this technology substantially improves the generalization ability and training efficiency of the RF-XGBoost hybrid model: on the one hand, it eliminates the need for independent training on each production line, significantly shortening the deployment cycle; on the other hand, through the inter-domain knowledge reuse mechanism, it effectively alleviates the problem of insufficient diagnostic accuracy caused by the scarcity of fault samples in the target domain, ultimately achieving a dual optimization of fault identification robustness and accuracy.

[0109] To address the core bottleneck of cross-domain knowledge transfer—domain shift caused by differences in fault frequency distribution between different production lines—this invention further proposes an RF-XGBoost domain adaptation framework based on covariate shift theory. This framework systematically mitigates the impact of inter-domain distribution differences on diagnostic accuracy through a collaborative optimization mechanism of "importance weight correction, probabilistic contrastive learning, and online adaptive adjustment." First, it corrects data distribution bias based on feature importance weights; second, it enhances the inter-class discriminative power of cross-domain features using probabilistic contrastive learning; and finally, it achieves dynamic optimization of model parameters through online adaptive adjustment. This design provides an innovative and rigorous technical solution for the efficient transfer of fault prediction models across production lines. Specifically, it includes the following sub-steps:

[0110] S51. KLIEP (Kinetic Variable Shift Correction);

[0111] Covariate drift is the main manifestation of distributional differences across production lines, i.e., marginal distribution differences of input features. This stage uses the KLIEP (Kullback-Leibler Importance Estimation Procedure) method to estimate the probability density ratio between the source and target domains, and then weights the source domain samples by importance to make the weighted source domain sample distribution closer to the target domain. The specific process is as follows:

[0112] Density ratio estimation assumption: Assume the probability density function of the source domain (trained production line) samples is... The probability density function of the target domain (the production line to be deployed) samples is: density ratio It indicates the degree of fit between the source domain samples and the target domain. The larger the weight, the more similar the distribution of the source domain samples and the target domain samples are.

[0113] This stage uses the KLIEP (Kullback-Le Leibler Importance Estimation Procedure) method to estimate the probability density ratio between the source and target domains, thereby weighting the samples by importance and mitigating covariate drift caused by differences in equipment or processes. The probability density function of the target domain samples can be expressed as:

[0114] ;

[0115] : Probability density function of samples in the target domain; : Probability density function of source domain samples; Sample weights (correcting for inter-domain differences); The lth Gaussian core center; Gaussian kernel bandwidth; : Kernel function weight parameters (obtained by minimizing KL divergence); L: Total number of kernel functions.

[0116] Weight parameter optimization: by minimizing KL divergence Optimize weight parameters This ensures the accuracy of the density ratio estimation. KL divergence is used to measure the difference between two probability distributions; minimizing KL divergence means making the weighted source domain distribution as close as possible to the target domain distribution.

[0117] Source domain sample weighting: Set the weights of the source domain training samples to the corresponding density ratios. In subsequent model training, source domain samples with larger weights contribute more to the update of model parameters, thus making the model more inclined to learn feature patterns that fit the target domain.

[0118] S52. MMD feature distribution alignment;

[0119] Building upon covariate drift correction, this stage further narrows the distribution distance between the source and target domains in the feature space through maximum mean difference (MMD), achieving fine-grained distribution alignment. The specific process is as follows:

[0120] Feature mapping: The weighted source and target domain samples are mapped to the reproducing kernel Hilbert space (RKHS). The mapping function is as follows: This space possesses excellent kernel properties, effectively characterizing the nonlinear features of samples. To further narrow the feature distribution gap between the two domains, this stage employs Maximum Mean Discrepancy (MMD) as a distribution distance metric and performs distribution alignment within the feature space. MMD is defined as follows: ;

[0121] : Maximum mean difference; : Number of samples in the source domain; Number of samples in the target domain; Feature mapping function (mapped to RKHS space); : Source domain samples; : Target domain sample.

[0122] Model optimization: MMD is incorporated as a regularization term into the XGBoost objective function, as shown in the formula: in, The MMD regularization coefficient (set to 0.1-0.5 through cross-validation) is used to minimize the objective function, enabling the model to learn domain-invariant feature representations and further reducing cross-domain distribution differences.

[0123] S53. Probability Comparative Learning (PCL);

[0124] To enhance the model's inter-class discrimination ability in the target domain, this stage introduces a probabilistic contrastive learning (PCL) mechanism. This mechanism uses weighted contrastive loss to bring similar samples closer together and push away dissimilar samples, thereby improving the model's ability to distinguish fault categories in the target domain. The specific process is as follows:

[0125] Sample pair construction: Positive and negative sample pairs are constructed from the weighted source and target domain samples: samples of the same type (same fault type or normal state) are positive sample pairs, and samples of different types are negative sample pairs. To ensure the quality of sample pairs, positive sample pairs must meet the requirements of "same fault type + similar core process parameters" (such as consistent filling pressure range and conveyor belt speed range) to avoid feature confusion caused by process differences.

[0126] Similarity Calculation and Comparison Loss Optimization: Cosine similarity is used to calculate the similarity of sample pairs, with the following formula: ;

[0127] in, The cosine similarity is a feature mapping function, and its value ranges from [-1, 1]. The larger the value, the more similar the samples are to the features.

[0128] To enhance the model's inter-class discrimination capability in the target domain, a probabilistic contrastive learning mechanism is introduced in this stage. This mechanism uses weighted contrastive loss to bring similar samples closer together and push away dissimilar samples. The loss function is defined as follows: ;

[0129] : Embedded features of sample i; : Positive samples of the same class as sample i; Candidate comparison sample j, Similarity functions (such as cosine similarity); Temperature coefficient; : The weight of sample j (from KLIEP results). This loss function enhances the model's inter-class discrimination ability by encouraging the maximization of similarity among samples of the same class and the minimization of similarity among samples of different classes.

[0130] Model fine-tuning: Incorporating contrastive loss into the overall objective function , To compare the loss weights, we set them to 0.3 and fine-tuned the XGBoost model to optimize the feature mapping function. .

[0131] S54. Parameter adaptive adjustment;

[0132] To ensure training stability and convergence efficiency during the transfer learning process, key training parameters are dynamically adjusted in this stage based on the target domain sample size and inter-domain differences. This ensures the model converges quickly and maintains high accuracy in the target domain. The specific adjustment strategy is as follows:

[0133] Learning rate and regularization term adjustment: The learning rate directly affects the convergence speed and stability of the model. It is dynamically adjusted based on the sample size ratio of the source domain to the target domain and the MMD value. The adjustment formulas for the learning rate and regularization term are as follows: ;

[0134] Original learning rate; Adjusted learning rate; Total number of samples in the source domain.

[0135] Regularization parameter adjustment: The regularization parameter is used to control model complexity and is dynamically adjusted according to inter-domain differences. The formula is: ;

[0136] This is the original regularization coefficient. When the differences between domains are large, the regularization coefficient is increased (up to a maximum of 2.0) to improve the model's generalization ability; when the differences between domains are small, the original regularization coefficient is used to ensure the model's fitting ability. Maximum mean difference between source and target domains.

[0137] Iteration termination condition adjustment: Set an upper limit on the number of iterations based on the sample size of the target domain, using the following formula: ;

[0138] When the target domain has few samples When the number of iterations is limited to 100, it is to avoid overfitting due to excessive iterations. When there are many samples in the target domain, the maximum number of iterations is 500 to ensure that the model converges fully.

[0139] The formula for controlling tree depth is: ;

[0140] The complexity control parameter γ is adjusted based on the size of the target domain sample. When the target domain sample size is small... Increase γ to limit the complexity of the tree and avoid overfitting.

[0141] The four-stage transfer learning framework systematically solves the feature distribution drift problem across production lines through four progressively optimized stages. This enables the model to quickly adapt to the target production line and achieve high-precision diagnostics without retraining, significantly reducing deployment and time costs.

[0142] The proposed covariate offset domain adaptation method effectively addresses the challenge of varying fault frequency distributions across production lines through a multi-stage domain adaptation architecture. This method combines classical importance weighting theory with modern probabilistic contrastive learning techniques, providing a theoretically rigorous yet practically efficient solution for transferring fault prediction models across production lines. By transforming the expected risk in the target domain into a weighted risk in the source domain, it achieves efficient domain adaptation under limited target domain sample conditions, making it particularly suitable for the rapid deployment requirements of smart manufacturing systems in Industry 4.0 environments.

[0143] To verify the effectiveness of the method of the present invention, a fault diagnosis experiment was conducted using an automated canning production line as the application scenario, collecting time-series data from multiple sensors. The experimental data covered core processes such as feeding, conveying, filling, and capping, and included 37 characteristic attributes. Among them, the normal sample ratio was over 99%, and the faulty sample ratio was less than 1%, truly reflecting the characteristics of extreme sample imbalance in industrial scenarios.

[0144] In line with the core requirements of industrial fault diagnosis, this experiment adopts a six-dimensional evaluation system: accuracy, precision, recall, F1 score, training time, and temporal feature retention rate. Accuracy is the percentage of correctly classified samples (Accuracy = number of correctly classified samples / total number of samples), reflecting the model's overall diagnostic capability. Precision is the proportion of samples predicted as faults that are actually faults (Precision = number of true positive samples / (number of true positive samples + number of false positive samples)), which can avoid excessive downtime caused by fault misjudgment and reduce production losses. Recall is the proportion of samples that are actually faults that are correctly identified (Recall = number of true positive samples / (number of true positive samples + number of false negative samples)), which can reduce the risk of missing rare faults and ensure production safety. The F1 score is the harmonic mean of precision and recall (F1 = 2 × Precision × Recall / (Precision + Recall)), comprehensively measuring the model's ability to identify fault categories and balancing the risks of misjudgment and missed detection. Training time is the total time (in seconds) from model initialization to convergence, reflecting the efficiency of engineering deployment.

[0145] Baseline Comparison Experiment: The proposed Hybrid RF-XGBoost-TL model was compared with four mainstream models, including Multilayer Perceptron (MLP, representing traditional neural networks), Support Vector Machine (SVM, a classic statistical learning model), LightBGM (an efficient gradient boosting decision tree algorithm), and Long Short-Term Memory (LSTM, a deep learning model adept at processing time series data). All models were trained and tested on the same dataset and hardware environment, and their key performance indicators are shown in Table 2.

[0146] Table 2 Baseline Comparison of Model Performance

[0147]

[0148] like Figure 4 As shown in the baseline comparison experiment results of various models, in terms of diagnostic accuracy, the precision (98.68%), recall (98.91%), and F1 score (98.86%) of this invention are significantly better than other models. Among them, the recall rate is 146% higher than the second-best MLP, and the F1 score is 188% higher. Especially in the diagnosis of rare faults, the F1 score for early bearing wear and slight leakage of filling valve both exceed 96%, which is much higher than other models (the highest is no more than 32%). This is due to the fact that RF feature screening eliminated 37.8% of redundant features, XGBoost accurately captured the complex nonlinear law of fault evolution, and the CBSS sampling strategy effectively solved the sample imbalance problem. In terms of training efficiency, the training time of this invention is only 62.17 seconds, which is only 11% of LSTM, 8.8% of MLP, and 3.8% of SVM, far lower than deep learning models, meeting the needs of rapid deployment in industrial settings. The core reason is that the RF-XGBoost hybrid architecture avoids the massive parameter iteration of deep learning models, and CBSS sampling significantly reduces the amount of training data (by 40% compared to the original data) while maintaining the core information of the time series data. The comparative models have obvious defects: Although LSTM has high accuracy, its recall rate for rare faults is extremely low (only 32.74%) because the "black box" model cannot capture weak fault features; SVM has an excessively long training time (1621.45 seconds) and a recall rate of less than 16%, which cannot meet the needs of real-time industrial diagnosis; LightGBM is severely affected by sample imbalance, with an accuracy of only 2.99%, and a large number of normal samples are misclassified as faults, making it unusable in industrial scenarios; MLP has low accuracy and recall, making it difficult to balance the risks of misclassification and missed detection.

[0149] CBSS sampling strategy effectiveness verification experiment: To verify the core value of the CBSS sampling strategy, the RF-XGBoost hybrid modeling architecture was fixed, and only the sampling method (CBSS, random undersampling, NearMiss undersampling, cluster center sampling) was replaced. The impact of different sampling methods on model performance was compared, and the results are shown in Table 3.

[0150] Table 3 Comparison of fault diagnosis performance of Hybrid RF-XGBoost-TL model under various sampling methods

[0151]

[0152] All sampling methods achieved 100% recall, indicating that all four methods effectively captured faulty samples. However, significant differences were observed in precision and F1 score, reflecting varying abilities of different sampling methods to retain key information from normal samples. The CBSS method of this invention achieved the best precision (92.19%) and F1 score (95.93%), representing improvements of 28.4% and 14.8% respectively compared to random undersampling, and 6.9% and 3.6% respectively compared to NearMiss undersampling. The core reason for this is that CBSS dynamically calculates the sampling window based on the mean, standard deviation, and frequency of fault durations, avoiding the loss of key information from normal samples caused by traditional undersampling. It achieves a temporal feature retention rate of 98.7%, thereby reducing the false positive rate. Traditional sampling methods have significant drawbacks: random undersampling and NearMiss undersampling, in order to balance the sample distribution, randomly or by distance discard a large number of normal samples, resulting in the loss of fault precursor information in normal samples and an accuracy of less than 87%; cluster center sampling generates representative samples through clustering, which severely disrupts the continuity of time series (retention rate of only 45.1%), transforming time series data into static samples with an accuracy of only 2.08%, making it almost useless for practical applications. Therefore, the key conclusion is that the CBSS sampling strategy resolves the inherent contradiction of "the incompatibility between sample balance and temporal integrity" in traditional sampling methods, achieving synergistic optimization of "sample balance, temporal integrity, and high accuracy," and is one of the core technologies ensuring the high performance of the model in this invention.

[0153] Cross-production line generalization capability verification: To fully verify the cross-production line generalization capability of the method of this invention, a special transfer learning experiment was designed. The model trained on production line 1 was verified on production line 2 using three strategies: model retraining, direct application of the original model, and parameter fine-tuning based on transfer learning. The results are shown in Table 4.

[0154] Table 4. Transfer learning results of the source domain model from production line 1 on production line 2.

[0155]

[0156] Table 4 shows that while directly applying the original model takes very little time, its precision and recall are both 0, indicating that the process differences between different production lines cause feature distribution drift. The fault features learned from the source domain cannot be adapted to the target domain, and the model has almost no fault identification capability. Retraining the model can achieve high performance, but it takes as long as 291.10 seconds, which is too time-consuming. After adopting the parameter fine-tuning strategy of this invention, the model maintains high accuracy (all indicators exceed 90%) while the training time is significantly reduced to 42.14 seconds, demonstrating the great advantage of this invention in quickly adapting to new production lines.

[0157] To further verify the universality of the model, the finely tuned model was also applied to production lines 3 and 4, and the results are shown in Table 5.

[0158] Table 5. Transfer learning results of the source domain model from production line 1 on production lines 3 and 4.

[0159]

[0160] Experimental results show that the direct application strategy completely fails. When the original model is directly deployed to the target domain, both precision and recall are 0. This is because the process differences between different production lines cause feature distribution drift, and the fault features learned in the source domain cannot be adapted to the target domain, resulting in the model having almost no fault identification capability. While the retraining strategy achieves high performance (F1 score of 93.15%), the training time is as long as 291.10 seconds, 6.9 times that of the fine-tuning strategy of this invention, and requires full data labeling in the target domain, which does not meet the needs of rapid industrial deployment and low-cost operation and maintenance. The transfer strategy of this invention demonstrates significant advantages. In terms of accuracy, the model's F1 score on production lines 2, 3, and 4 all exceed 93%, reaching a maximum of 94.95%, comparable to or even slightly improved compared to the retrained model (production line 2). The F1 score improved by 0.8%, indicating that multi-stage transfer learning effectively corrected the differences in distribution between domains. In terms of efficiency, the fine-tuning time was only 36.44-52.90 seconds, which is only 12.5%-18.2% of the retraining time, significantly reducing deployment time costs. In terms of generalization, even when the process difference between the target domain and the source domain reached 15% (production line 3, MMD value 0.18), it could still maintain excellent performance, verifying the synergistic effect of KLIEP drift correction, MMD distribution alignment, and PCL feature enhancement, ensuring stable adaptation of the model under different process parameters.

[0161] Through systematic comparative experiments and verification, the technical advantages and engineering value of the method of this invention have been fully demonstrated: superior overall performance; this invention's Hybrid... The RF-XGBoost-TL model significantly outperforms mainstream models in fault diagnosis accuracy (F1 score 98.86%) and training efficiency (62.17 seconds). It can effectively identify rare faults accounting for less than 0.5%, with a false negative rate of less than 1.1% and a false positive rate of less than 1.3%, meeting industrial production and maintenance standards. Its core effectiveness lies in the CBSS sampling strategy, which resolves the contradiction between imbalanced and continuous temporal data samples, achieving a temporal feature retention rate of 98.7% and improving accuracy by 6.9%-89.2% compared to traditional sampling methods. This is the core support for the high performance of this invention. It exhibits strong cross-line generalization ability; multi-stage transfer learning enables the model to quickly adapt to production lines with different process parameters, reducing fine-tuning time by more than 81.8%. High-precision diagnostic levels can be achieved without retraining, significantly reducing cross-line deployment costs. It also boasts high engineering practicality; the model's lightweight design is compatible with industrial embedded platforms, its training efficiency meets real-time deployment requirements, and it exhibits good stability and repeatability. It can be directly applied to multiple industries such as food and beverage, pharmaceutical packaging, and automotive parts assembly, demonstrating significant industrial application value.

[0162] This invention provides an intelligent fault diagnosis solution for automated production lines that is "high-precision, high-efficiency, easy to deploy, and highly generalizable," effectively solving core challenges in industrial scenarios such as sample imbalance, temporal feature capture, and model cross-line adaptation, and providing reliable technical support for the full lifecycle management of equipment.

[0163] For those skilled in the art, various other corresponding changes and modifications can be made based on the technical solutions and concepts described above, and all such changes and modifications should fall within the protection scope of the claims of this invention.

Claims

1. An automated production line fault diagnosis method based on continuous balance slice sampling, characterized in that, An intelligent fault diagnosis system based on the RF-XGBoost hybrid transfer learning model is constructed to diagnose faults in automated production lines. The construction steps of the intelligent fault diagnosis system are as follows: S1. First, a time-series fault dataset is constructed through data acquisition and preprocessing; S2. Subsequently, time series features are used to enhance the extraction and reinforcement of key dynamic evolution patterns in order to improve the discriminativeness of fault features; S3. Then, the sampling deviation problem is solved by continuous balanced slice sampling; S4. Next, a lightweight RF-XGBoost hybrid transfer learning model is constructed in feature selection and fusion modeling to achieve fault classification; S5. Finally, multi-stage transfer learning is used to achieve cross-production line distribution adaptation; In step S3, the specific process is as follows: Sample statistical analysis: A refined statistical analysis is performed on the time-series dataset after data cleaning and feature enhancement. For each type of fault sample, three core statistical features are extracted. respectively, mean of failure duration , standard deviation of failure duration , and number of failures ; The fault duration is defined as the time interval from the time the fault occurs to the time the fault is resolved; the number of fault occurrences is obtained by precisely aligning the timestamps of the production logs and sensor data. Adaptive window length calculation: Based on the statistical characteristics of the samples, the sampling window lengths for faulty samples and normal samples are calculated separately to ensure that fault features at different time scales can be completely captured. Calculate the fault sample window length: the calculation formula is ; in, , These are the mean and standard deviation of the fault duration for fault type i, respectively; α represents the number of failures; k is the expansion coefficient covering long-term failure evolution characteristics; α is the statistical reliability coefficient corresponding to the 95% confidence interval; β is the small sample correction coefficient. Calculate the normal sample window length: The calculation formula is as follows ; Where K represents the total number of common fault types on the production line; Sliding slice sampling and sample balancing adjustment: For each type of fault sample, the corresponding fault window length is used. Perform slicing; for normal samples, use a uniform normal sample window length. Perform slicing; the sliding step size is uniformly set to 1 / 2 of the corresponding window length.

2. The method according to claim 1, wherein, In step S1, a distributed deployment strategy is adopted for the sensor network. Based on the process characteristics of the eight core processes of the production line, appropriate sensor types are configured. Vibration sensors and speed sensors are deployed on moving parts; pressure sensors and torque sensors are deployed in the filling and capping processes; infrared sensors and position sensors are deployed along the material conveying path; and temperature and humidity sensors and voltage monitoring sensors are deployed in the workshop environment. All sensors are uniformly set to a specific sampling frequency. For data preprocessing, the 3σ criterion is used to identify outliers in the raw data, and data exceeding the 3σ range are marked as outliers and removed. For data segments with no more than 5 consecutive missing sampling points, linear interpolation is used to fill them in; for data segments with more than 5 missing sampling points, they are marked as invalid data and removed entirely. By using timestamp synchronization technology, all sensor data is mapped to a unified time axis, keeping the time synchronization error within ±1ms.

3. The method according to claim 2, wherein In step 2, the specific process is as follows: Calculating the difference feature (Diff): The difference feature explicitly characterizes the dynamic dependencies between processes by calculating the time difference between the completion of process-dependent steps. Its calculation formula is as follows: ; in, Indicate process In time Completion time, Indicate process Pre-dependent processes In time Completion time; Calculating the hysteresis feature (Lag): The hysteresis feature captures this persistent pattern by encoding the correlation of sensor state signals at different time steps. Its calculation formula is as follows: ; in, The state signal of the kth sensor at time t, where τ is the lag step size; By combining differential features and hysteresis features, the model can simultaneously characterize process synergy and equipment stability, enabling it to more accurately capture feature changes when a fault occurs, improve the ability to identify complex fault modes, and provide more discriminative feature inputs for subsequent continuous balanced slice sampling, ensuring that the sampled data can retain the dynamic evolution information of the fault.

4. The method according to claim 3, wherein, Step S4 includes the following sub-steps: S41. Feature Filtering; The dataset after continuous balanced slice sampling and feature enhancement is divided into training and validation sets to train the RF model; The importance score for each feature was calculated using the average impurity reduction method. For each decision tree, calculate the sum of the Gini impurity reduction values ​​brought by each feature in all node splits, and then average the results of all decision trees to obtain the importance score (VIM) of that feature; sort all features from high to low according to their importance scores, calculate the cumulative contribution rate, and select the feature subset with a cumulative contribution rate of 90% as the input of the subsequent XGBoost model; S42.XGBoost classification modeling; Initialize a weak learner; Calculate the gradient of the loss function and the Hessian matrix: The first gradient of the loss function is... The second gradient of the loss function is ;in It is a loss function. It's a real label. It is a sample The predicted value; Building a tree model: Use the gradient and Hessian matrix of the training data to fit a new decision tree. The leaf nodes of the decision tree store the increment of the sample prediction value. Calculate the regularization term: The regularization term of the loss function is Where T is the number of leaf nodes in the tree, and Y and It is a regularization parameter. It is the score of the leaf node; Update model parameters: Combine the newly constructed tree model with the current model, and update the model's predictions using a weighted average; the updated predictions are... ;in, This is the predicted value of the current model. It's the learning rate. These are the predicted values ​​from the newly added model; Iterative optimization continues until the stopping condition is met; S43. Perform hyperparameter optimization of the XGBoost model and calculate the optimal parameters.

5. The automated production line fault diagnosis method based on continuous balanced slice sampling according to claim 4, characterized in that, Step S5 specifically includes the following sub-steps: S51. Variable drift correction; Density ratio calculation: The probability density function of the source domain samples is... The probability density function of the target domain samples is density ratio It indicates the degree of fit between the source domain samples and the target domain. The larger the weight, the more similar the distribution of the source domain samples and the target domain samples are. The probability density function of the target domain samples is expressed as: ; It is the probability density function of the target domain samples; It is the probability density function of the source domain samples; These are sample weights; It is the lth Gaussian core center; It is the Gaussian kernel bandwidth; These are the kernel function weight parameters; L is the total number of kernel functions; Weight parameter optimization: by minimizing KL divergence Optimize weight parameters ; Source domain sample weighting: Set the weights of the source domain training samples to the corresponding density ratios. ; S52. Align feature distributions using the maximum mean difference; Feature mapping: This maps the weighted source and target domain samples to the reproducing kernel Hilbert space. The mapping function is... The maximum mean difference is defined as follows: ; It is the maximum mean difference; It is the number of samples in the source domain; It is the number of samples in the target domain; It is a feature mapping function; It is a source domain sample; It is a sample from the target domain; Model optimization: The maximum mean difference is incorporated as a regularization term into the XGBoost objective function, as shown in the formula. ;in, The regularization coefficient is used. S53. Probability Comparison Learning; Sample pair construction: construct positive and negative sample pairs from the weighted source domain samples and target domain samples, with samples of the same class as positive sample pairs and samples of different classes as negative sample pairs; Similarity calculation and contrast loss optimization use cosine similarity to calculate the similarity of sample pairs, with the formula as follows: ;in, It is a feature mapping function; The loss function is defined as ; These are the embedding features of sample i; It is a positive sample of the same class as sample i; It is candidate comparison sample j. It is a similarity function; It is the temperature coefficient; It is the weight of sample j; Model fine-tuning: Incorporating contrastive loss into the overall objective function , To compare the loss weights, the XGBoost model was fine-tuned to optimize the feature mapping function. ; S54. Parameter adaptive adjustment; The formula for adjusting the learning rate and regularization term is as follows: ; It is the original learning rate; It is the adjusted learning rate; It is the total number of samples in the source domain; The formula for adjusting the regularization parameter is as follows: ; The original regularization coefficient; It is the maximum mean difference between the source and target domains; The formula for adjusting the iteration termination condition is as follows: ; The formula for controlling tree depth is: ; γ is a complexity control parameter.

Citation Information

Patent Citations

  • Service fault prediction method and device based on RF-XGBOOST

    CN114202110A

  • Multi-working-condition-oriented equipment fault diagnosis method based on unbalanced learning

    CN119577603A