Real-time adaptive learning bearing fault classification method and system
By using prototype alignment and parameter-wise adaptive learning rate, the problem of model drift in adaptive methods during testing is solved, achieving stable adaptation and efficient fault classification in the target domain, which is suitable for dynamic changes in industrial environments.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-15
- Publication Date
- 2026-03-31
AI Technical Summary
Existing test-time adaptive methods are prone to model drift due to catastrophic forgetting and error accumulation when learning online outside the source domain. This causes the model performance to decline rather than improve during continuous adaptation, which seriously restricts the reliability of its practical application.
We employ a prototype alignment and parameter-wise adaptive learning rate approach. We generate feature prototypes through a source domain pre-training module, smoothly update teacher parameters using the EMA Teacher module, and combine a target domain adaptive training module and a parameter-wise adaptive learning rate module to achieve continuous and stable adaptation of the model in the target domain, thereby suppressing feature space drift and model forgetting.
Without accessing source domain data, the model can achieve continuous and stable adaptation on the target domain, effectively suppressing feature space drift and model forgetting, improving the accuracy and robustness of fault classification, and adapting to dynamic changes in the industrial environment.
Smart Images

Figure CN121765477A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of industrial equipment health status monitoring technology, and specifically relates to a real-time adaptive learning bearing fault classification method and system based on prototype alignment and parameter-by-parameter adaptive learning rate. This technology focuses on solving the challenges of rapid performance degradation and stability issues in online fine-tuning when models are deployed in industrial environments and faced with continuously arriving streaming target domain data. This invention enables real-time correction of model parameters during the inference phase, which is a key supporting technology for ensuring the continuous high-precision, real-time, and stable online operation of industrial equipment monitoring systems. Background Technology
[0002] As a key component in industrial equipment health monitoring, the operating status of rolling bearings directly affects the reliability and safety of the entire production system. Accurate diagnosis of bearing faults requires effective analysis and classification of their vibration signals. However, the damage evolution process of bearings is influenced by multiple factors, including operating time, load conditions, and environmental factors, resulting in a highly nonlinear relationship between monitoring signals and fault types. This complexity makes it difficult for diagnostic systems based on traditional signal processing methods to meet the accuracy requirements of modern industry for early fault identification.
[0003] In recent years, deep learning-based intelligent diagnostic methods have demonstrated significant advantages in bearing fault classification tasks through an end-to-end feature learning model. These methods utilize well-labeled training data to build classification models and automatically extract fault-sensitive features through multi-layer neural networks, achieving automation and intelligence in the diagnostic process. However, these methods rely on a key assumption: the data in the training and testing phases follow the same probability distribution. In real-world industrial scenarios, due to factors such as equipment aging, changing operating conditions, and sensor differences, this assumption often fails to hold, leading to significant performance degradation of the trained model in practical applications.
[0004] To address the distribution shift problem, unsupervised domain adaptation (UDA) methods have been proposed and widely applied. UDA aligns the data distributions of the source and target domains in a shared feature space, enabling models trained in the source domain to adapt to the target domain environment. While these methods mitigate performance degradation caused by domain differences to some extent, their implementation requires continuous access to source domain data throughout the adaptation process. This prerequisite is often unattainable in real-world industrial environments—considering factors such as data privacy, trade secrets, and storage limitations, companies typically only provide the trained model parameters, not the original source domain dataset. This scenario, where only the model is accessible but not the source domain data, has given rise to the new technical demand for "passive domain adaptation." Passive domain adaptation refers to a learning paradigm where, during model transfer, domain alignment is achieved solely using pre-trained model parameters and target domain data, without accessing any source domain samples. It breaks through the dependence of traditional UDA on source domain data and demonstrates practical value in the "passive" scenario of industrial bearing fault diagnosis. However, bearing operating conditions in industrial settings often fluctuate suddenly, and the distribution of data in the target domain changes in real time. Existing passive methods are mostly offline static adaptations, which are difficult to respond to dynamic distribution shifts, leading to a decline in model accuracy over long-term operation. To address this issue, there is an urgent need for a technology that can achieve online dynamic adaptation based on the test data stream of the target domain during the inference phase. Test-time adaptation (TTA) diagnostic technology has thus become a key direction.
[0005] Currently, emerging diagnostic techniques based on Time-of-Touch (TTA) aim to achieve online adaptation of the model during the inference phase. They utilize only the test data stream from the target domain to optimize this pre-trained model in real time, enabling the model trained in the source domain to dynamically adapt to changes in the target domain's distribution. While current TTA methods exhibit significant advantages, they often face two key technical challenges: first, catastrophic forgetting, where the model easily loses important fault feature knowledge learned in the source domain when adapting to new conditions; and second, model drift due to error accumulation, where the model may continuously optimize in the wrong direction during self-training, ultimately leading to a significant decline in diagnostic performance. Therefore, effectively controlling error propagation during the adaptation process while maintaining convergence speed has become a crucial breakthrough for TTA technology. Practice has shown that this challenge cannot be solved by simply improving traditional adaptive methods. Novel deep learning architectures based on dynamic weight adjustment and multi-objective optimization promise to provide an effective solution to this problem.
[0006] Based on the above analysis, the problems and shortcomings of the existing technology are as follows:
[0007] When adaptive methods are tested and learn online outside the source domain, they can cause model drift due to catastrophic forgetting and error accumulation. This results in the model's performance decreasing rather than improving during continuous adaptation, which severely restricts the reliability of its practical applications. Summary of the Invention
[0008] This invention provides a real-time adaptive learning method and system for bearing fault classification based on prototype alignment and parameter-by-parameter adaptive learning rate. This invention achieves continuous and stable adaptation of the model in the target domain without accessing source domain data, and effectively suppresses feature space drift and model forgetting.
[0009] This invention is implemented as follows: a real-time adaptive learning bearing fault classification system based on prototype alignment and parameter-wise adaptive learning rate, the system comprising:
[0010] a. Source domain pre-training module, used to train a basic classification model on the source domain dataset using supervised learning, and generate initial model parameters and source domain feature prototypes for the target domain adaptation process. The source domain feature prototypes are composed of the deep feature mean of each class of training samples, which are used to describe the stable feature distribution structure of the source domain.
[0011] b. The EMA Teacher module is used to build a teacher model during target domain testing, smoothly update teacher parameters using an exponential moving average, and use the teacher model to generate relatively stable pseudo-label predictions for target domain samples;
[0012] c. Target Domain Adaptive Training Module, used to receive target domain samples during the testing phase and perform online adaptive training of the model through the following mechanisms: using the symmetric cross-entropy loss between the pseudo-labels generated by the teacher model and the output of the student model to improve the robustness of the model to noisy pseudo-labels; comparing the deep features of the target domain samples with the source domain prototypes of the corresponding categories to maintain intra-class compactness and preserve the inter-class structure of the source domain.
[0013] d. The parameter-wise adaptive learning rate module is used to maintain independent gradient statistics for each parameter of the model during adaptive training in the target domain, and adaptively adjust its update magnitude according to gradient stability. This module suppresses noisy gradients, making parameter updates in unstable directions more conservative, thereby preventing the model from drifting drastically during adaptive training at test time;
[0014] e. The reasoning and classification module is used to output the final predicted label for the target domain input sample based on the adaptively updated model, so as to achieve real-time, stable and accurate classification results during testing.
[0015] Furthermore, the target domain adaptive training module constructs a bidirectional symmetric constraint mechanism between the teacher model prediction distribution and the student model output distribution during the model update process. By minimizing the bidirectional difference, the model update is simultaneously constrained by the pseudo-label distribution generated by the teacher and the student's own prediction distribution, thereby reducing the misleading effect of noise in the one-way pseudo-label on the direction of model parameter update.
[0016] The prototype-based contrastive learning module constructs feature anchor constraints based on geometric structure during the testing phase, mapping the deep features and enhanced features of the target domain samples and the corresponding source domain category prototypes to a shared feature space; by maintaining the compactness and separation of the target domain features relative to the source domain prototypes, the geometric consistency of the source domain category discrimination structure is maintained during the target domain migration process.
[0017] The parameter-by-parameter adaptive learning rate module establishes a parameter sensitivity evaluation mechanism based on gradient energy statistics. Based on the differences in gradient energy accumulation of each parameter during the historical update process in the testing phase, it independently and dynamically decouples and adjusts the update amplitude of parameters at different levels and with different functions in the model, so that the model parameters exhibit a differentiated update rhythm that is adapted to the current noise level.
[0018] By introducing bidirectional symmetric constraints between the teacher and student models, model updates no longer rely solely on unidirectional pseudo-label supervision. Instead, mutual verification between predicted distributions suppresses the amplification effect of erroneous pseudo-labels, thus improving the robustness of the self-training process during the testing phase. Introducing the source domain category prototype as a structural reference for target domain feature alignment during the testing phase ensures that the model remains constrained by the inherent geometric structure of the source domain categories when adapting to changes in the target domain distribution. This avoids the feature space collapse or category boundary blurring problems caused by relying solely on the statistical characteristics of the target domain samples in existing technologies, thereby preserving the discriminative structure during cross-domain transfer. Through parameter-by-parameter stability evaluation and differentiated update control of model parameters, the adaptive update during testing is transformed from traditional overall coarse-grained adjustment to fine-grained controlled update, automatically reducing the update weights of highly noise-sensitive parameters and significantly mitigating the risk of local unstable gradients degrading the overall model performance.
[0019] Furthermore, a test-time adaptive learning system is also included, which is suitable for passive domain adaptation and online model updates, including:
[0020] The data processing unit is used to receive the vibration signal dataset and input it into the adaptive training process to generate pseudo-labels.
[0021] The deep learning model unit includes a source domain pre-trained model, a student model initialized by the source domain pre-trained model, and an EMA Teacher model. It is used to perform processes such as source domain supervised training, target domain online adaptive training, and pseudo-label generation. It also uses prototype alignment and parameter-wise adaptive learning rate strategies to achieve stable transfer of the model in the target domain environment.
[0022] The loss calculation unit is used to calculate the symmetric cross-entropy loss of the target domain samples to obtain the prototype-based contrastive loss, and to determine the parameter-by-parameter learning rate based on gradient statistics, thereby achieving robust updates during testing.
[0023] The prediction output unit is used to perform real-time inference on target domain samples based on an adaptively trained deep learning model, and output accurate and stable prediction results.
[0024] This invention also provides a real-time adaptive learning bearing fault classification method and system based on prototype alignment and parameter-wise adaptive learning rate. The method and system include: inputting source domain samples into a source domain pre-training module for supervised training to obtain a source domain-based classification pre-training model; extracting features for each category from this model to construct a source domain prototype; obtaining pseudo-labels for target domain samples through the pre-trained model and the EMA Teacher module; then performing an adaptive update process on the target domain samples using the pseudo-labels, aligning features according to the source domain prototype, and simultaneously updating the model parameters stably based on the parameter-wise adaptive learning rate; finally, the adaptively trained model outputs predicted labels for the target domain samples.
[0025] Furthermore, the real-time adaptive learning bearing fault classification method and system based on prototype alignment and parameter-by-parameter adaptive learning rate includes the following steps:
[0026] Step S1: Obtain the training dataset as the initial source domain dataset, which contains all samples and their corresponding labels; input the initial source domain dataset into the source domain pre-training module, and obtain the source domain classification pre-training model through supervised learning; at the same time, use the trained model to extract the deep features of each category of samples and calculate their mean to generate the source domain prototype set.
[0027] Step S2: Use the source domain pre-trained model obtained in step S1 as the initial model, and make a copy to build the EMATeacher model for subsequent generation of stable pseudo-labels; the pre-trained model carries the category discrimination ability and feature expression ability of the source domain, providing basic structural information for subsequent target domain adaptation.
[0028] Step S3: Obtain the test dataset as the initial target domain dataset, ensuring that the target domain and source domain are consistent in terms of category set; input the target domain samples into the EMA Teacher model to obtain the pseudo-labels of the corresponding target domain samples; guide the target domain samples into the adaptive training process through the pseudo-labels, providing supervision information for subsequent feature alignment and model updates.
[0029] Step S4: Input the target domain samples from Step S3 into the student model part of the source domain pre-trained model, and perform unsupervised training using the symmetric cross-entropy loss between the student output and the pseudo-labels. At the same time, the model uses the distance relationship between the deep features of the target domain samples and the source domain prototypes to perform prototype alignment constraints. By attracting similar features and dispersing dissimilar features, the model maintains the stability of its feature structure during the update process. During the above training process, the model maintains independent gradient statistics for each parameter and adaptively adjusts the learning rate of the parameters according to the gradient stability, achieving parameter-by-parameter adaptive updates and suppressing drastic parameter drift caused by noisy pseudo-labels. Through the above series of adaptive training steps, the model can stably transfer to the target domain data distribution without accessing the source domain data, and obtain stronger feature consistency and classification robustness.
[0030] Finally, the trained and updated fault classification model infers the target domain samples and outputs accurate predicted labels for the target domain samples.
[0031] Further, in step S1, a vibration signal dataset is obtained as the initial source domain dataset. The number of categories is denoted as K, and the initial source domain dataset is denoted as... ,in Represents the first sample in the initial source domain. A vibration signal, and Indicates the corresponding fault type label, This refers to the number of samples in the initial source domain. The initial source domain dataset... Input source domain pre-training module, for feature extractor With classifier Supervised learning training is performed to obtain a pre-trained classification model based on the source domain. To enhance training robustness, supervised loss based on cross-entropy can be used for training. It can be represented as:
[0032] (1)
[0033] in To supervise the loss function, the network parameters are optimized and updated using stochastic gradient descent.
[0034] After completing source domain supervised training, the trained feature extractor is used Extracting deep features from each training sample And calculate the mean of source domain category features according to category, that is, for the first category... kind:
[0035] (2)
[0036] in Indicates belonging to the first The source domain sample set of the class, Let its sample size be denoted as . Let the prototype set of all categories be denoted as . .
[0037] The above source domain pre-training and computation process results in a source domain-based classification pre-trained model. It not only has the ability to distinguish the source domain, but also can describe the stable feature structure of various types of the source domain using prototypes.
[0038] Furthermore, in step S2, the source domain pre-trained model obtained in step S1 is... As the initial student model And replicate to obtain the EMA Teacher model In the subsequent online adaptive process, the teacher model is smoothly updated along with the student model using an exponential moving average rule; that is, for the first... At the next update time, the teacher model parameter update can be expressed by the following formula:
[0039] (3)
[0040] in, This represents the smoothing coefficient, which is typically 0.99.
[0041] Furthermore, in step S3, the target domain dataset is obtained, denoted as... ,in Indicates the first The vibration signal of a sample in the target domain, and This refers to the number of samples in the target domain. The pseudo-label for the fault type in the target domain. To be predicted, the target domain dataset contains a set of categories consistent with the source domain, but its data distribution may differ from the source domain. First, to obtain the corresponding fault type pseudo-labels, we need to extract features from the target domain samples. Specifically, we input the target domain samples into a feature extractor to obtain the raw features:
[0042] (4)
[0043] in, This represents the feature dimension. Then, using these features, we measure similarity with the source domain prototype, specifically calculating the cosine similarity between each target domain sample and each prototype:
[0044] (5)
[0045] Next, we use similarity to determine the most similar class for each sample, thus obtaining the pseudo-labels for the samples:
[0046] (6)
[0047] That is, for the first For each sample, the category corresponding to the source domain prototype with the highest cosine similarity is selected as its pseudo-label. This allows it to enter the adaptive training process, providing an important basis for feature alignment and decision boundary optimization.
[0048] Furthermore, in step S4, the target domain samples obtained in step S3 are input into the student model. And perform adaptive training during testing. Training includes three key modules: symmetric cross-entropy loss, prototype-based contrastive loss, and parameter-wise learning rate update. First, record the student model's performance on samples... The softmax output is Let the softmax output of the EMATeacher model for the same sample be... Next, we adopted symmetric cross-entropy as a robust form of the self-training loss, and calculated it separately for the original samples and the augmented samples, then averaged the results. The symmetric cross-entropy operator is defined as follows: ,in Let be the cross-entropy. Then the symmetric cross-entropy loss... The loss is:
[0049] (7)
[0050] in This represents the student output after data augmentation transformation during testing. This indicates the one-dimensional signal random data augmentation transformation used during the test.
[0051] For prototype-based contrastive loss, in order to construct feature sets for contrastive learning First, we need to obtain the enhanced features of the target domain samples:
[0052] (8)
[0053] In a training batch, for samples Represent its prototype ,in Indicates sample Corresponding pseudo-labels and original feature representations and enhanced feature representation After projection mapping and normalization, a set of positive sample feature groups is obtained. Any two representations within this group are considered positive sample pairs, while the corresponding representations of all other samples in this batch are considered negative samples. Its form is:
[0054] (9)
[0055] Input the above feature set into the projection head Perform feature mapping and apply the L2 norm. After normalization, the feature vectors used for contrastive learning are obtained:
[0056] (10)
[0057] Based on this, a temperature-scaled contrast loss is constructed. For a given feature, the contrast loss is defined as:
[0058] (11)
[0059] in Indicates the temperature coefficient of comparison. Indicates the reference temperature. This represents the set of positive samples for that sample. Let represent the set of negative samples. The average loss over all samples yields the contrastive learning term:
[0060] (12)
[0061] This contrastive learning process constrains the similarity relationships between samples and their prototypes, as well as between original features and enhanced features, so that the features of the target domain move closer to the class center of the source domain while maintaining intra-class compactness.
[0062] The main loss is ultimately used for adaptive updates. for:
[0063] (13)
[0064] Next, during the adaptive update process involving target domain samples, to prevent gradient noise caused by pseudo-label errors from further amplifying the drift of model parameters, an independent gradient energy statistic is constructed for each parameter in the model, and its learning rate is dynamically adjusted accordingly. The specific implementation of this adaptive mechanism is as follows.
[0065] First, for the current target domain samples, based on the model's predicted output for the samples, a negative log-likelihood loss is constructed, and this loss is used as the basis for local gradient estimation:
[0066] (14)
[0067] Backpropagation of the above loss yields the instantaneous gradients of each parameter in the model. Subsequently, to characterize the sensitivity of each parameter to pseudo-label noise, accumulated gradient energy is maintained for each parameter. And update using the squared cumulative method:
[0068] (15)
[0069] To form adaptive weights for comparability, Perform min–max normalization to obtain the weights within the relative range of variation:
[0070] (16)
[0071] Given a base learning rate Under this premise, assign a corresponding adaptive learning rate to each parameter:
[0072] (17)
[0073] in This is a lower bound to prevent the learning rate from approaching zero.
[0074] Meanwhile, when performing online adaptive updates, the accumulated gradients are first cleared to zero, and then the overall loss is adjusted based on the aforementioned adaptive learning rate. Calculate the gradient and perform an update, with the following update rule:
[0075] (18)
[0076] After the update is complete, the new squared gradient will continue to accumulate to the energy term. This serves as a reference value for updating the next batch of target domain samples, thereby enabling continuous parameter-by-parameter adaptive adjustment and updating of network weight parameters, allowing the model to output accurate predicted labels for unlabeled target domain samples.
[0077] Another objective of this invention is to provide a passive domain adaptive fault classification system based on prototype alignment and parameter-by-parameter adaptive learning rate for implementing the aforementioned real-time adaptive learning bearing fault classification method and system, comprising:
[0078] The source domain pre-training module is used to perform supervised training on the initial source domain dataset, extract deep features of each category and calculate the mean of category features to obtain a pre-trained classification model based on the source domain and a source domain feature prototype.
[0079] The EMA Teacher module replicates the pre-trained model in the source domain to build a teacher model, and smoothly updates the teacher model parameters using an exponential moving average strategy to generate stable pseudo-label prediction outputs.
[0080] The target domain adaptive training module inputs target domain samples into the student model and uses pseudo-labels and prototype alignment constraints to perform unsupervised training on the target domain data. It optimizes the model's feature space structure by bringing similar features closer together and separating dissimilar features.
[0081] The pseudo-label generation module takes the deep features of the target domain sample and the softmax prediction results as input, and obtains the pseudo-label of the corresponding sample by matching the similarity with the source domain prototype.
[0082] The parameter-wise adaptive learning rate module maintains independent gradient energy statistics for each parameter in the model and adaptively adjusts the learning rate based on gradient stability to suppress parameter drift caused by pseudo-label noise and improve model update stability.
[0083] The prediction label generation module is used to output accurate target domain sample prediction labels through the adaptively updated fault classification model.
[0084] Another object of the present invention is to provide a computer device, the computer device including a memory and a processor, the memory storing a computer program, the computer program being executed by the processor causing the processor to perform the steps of the test-time adaptive learning bearing fault classification method based on prototype alignment and parameter-by-parameter adaptive learning rate.
[0085] Another object of the present invention is to provide a computer-readable storage medium storing a computer program, which, when executed by a processor, causes the processor to perform the steps of the test-time adaptive learning bearing fault classification method based on prototype alignment and parameter-by-parameter adaptive learning rate.
[0086] Another objective of this invention is to provide an information data processing terminal for implementing the aforementioned real-time adaptive learning bearing fault classification method and system based on prototype alignment and parameter-by-parameter adaptive learning rate.
[0087] Based on the above technical solutions and the technical problems solved, the advantages and positive effects of the technical solution to be protected by this invention are as follows:
[0088] First, this invention proposes an adaptive strategy based on prototype alignment and EMATeacher collaboration at the model architecture and feature space optimization levels. Under stringent experimental conditions where access to source domain data is not required, this scheme can effectively utilize source domain pre-training knowledge to reconstruct the target domain feature space, and its generalization ability and stability are significantly better than existing passive adaptation methods. Traditional passive adaptation methods often directly use the model's own predictions as pseudo-labels, which easily falls into a cycle of "self-confirmation bias," where the model continuously reinforces incorrect predictions. In contrast, this invention uses the EMA mechanism to smooth parameter updates, filtering out random noise from instantaneous predictions and providing a more stable and reliable supervision signal for the student model. Simultaneously, it innovatively introduces "source domain feature prototypes" as geometric anchors in the feature space, combined with "prototype-based contrastive loss" for constraint. Compared with traditional methods, its advantage lies in the fact that traditional mainstream methods (such as entropy minimization TENT or simple pseudo-label self-training) often only focus on reducing prediction uncertainty while ignoring the geometric structure of feature distribution. This can easily lead to forcibly compressing all samples to incorrect class centers, causing "feature collapse" or severe model forgetting. The technical solution of this invention, by calculating the cosine similarity between the target domain sample and the source domain prototype, forces the features of the target domain sample to gravitate towards the same type of prototype while pushing away the opposite type. This "attracting similarities and repelling dissimilarities" mechanism effectively imposes a strong geometric constraint on the high-dimensional feature space, ensuring that the model maintains the "compact within classes and separated between classes" source domain discriminative structure while adapting to new data. Combined with symmetric cross-entropy loss, this scheme fundamentally suppresses the drastic drift of the feature space as the data flow occurs, ensuring the robustness of the model under different operating conditions.
[0089] Secondly, this invention innovatively constructs a parameter-by-parameter adaptive learning rate mechanism at the optimization algorithm level, whose update precision surpasses that of traditional global or layer-by-layer adaptive strategies. In the special scenario of adaptive learning during testing, due to the lack of real labels, the model relies entirely on pseudo-labels for updates. The limitation of traditional methods lies in the fact that most existing technologies typically employ a uniform learning rate or fixed decay strategy for the entire model or network layer. This coarse-grained adjustment method assumes that all parameters have the same sensitivity to noise; however, in reality, the response of parameters at different locations in a neural network to features varies greatly. When pseudo-labels are erroneous, a uniform learning rate can amplify noisy gradients, thereby affecting originally stable parameters and causing severe oscillations or even model collapse. This invention maintains a dedicated gradient energy statistic for each independent parameter in the model, dynamically quantifying the update stability of that parameter over time. For parameters with messy gradient directions and excessively high energy (meaning potential noise interference), the algorithm automatically reduces their learning rate, making their updates more conservative and thus shielding them from noise signals. Conversely, for parameters with consistent gradient directions and stable energy (meaning high feature confidence), normal updates are allowed to quickly adapt to new distributions. Through this mechanism, the model can maintain update stability and fault diagnosis accuracy far exceeding traditional optimization strategies even in online adaptive training away from the source domain dataset.
[0090] Third, this technological innovation can be transferred to enterprises with industrial automation equipment within the TTA framework, particularly in the petrochemical and manufacturing industries, where a large number of bearing components operate under continuous and variable conditions. Unlike traditional offline training or batch adaptation, this technology can directly learn from streaming data online during the inference phase, enabling real-time fine-tuning of model parameters. Through this "inference-as-you-go" mechanism, the technology is expected to significantly improve the immediate response capability of bearing health monitoring systems to sudden operating conditions or unstable environments, maintaining high-precision diagnosis without downtime for retraining. This avoids production accidents caused by model response lag and promotes increased efficiency in intelligent operation and maintenance for enterprises.
[0091] Fourth, current bearing fault diagnosis technology mainly relies on static offline models or batch-based domain adaptation methods. However, in many real-world production scenarios, the environment and operating conditions change dynamically in real time, and data often arrives as single-sample streams. Traditional offline adaptation methods cannot meet the requirements of real-time performance and online processing. Furthermore, due to privacy and storage limitations, source domain data is often not visible during the testing phase. To address the problem that traditional methods struggle to handle rapid data distribution shifts during the inference phase, this invention proposes an efficient test-time adaptive learning system. This method allows the model to perform online self-updates using only the currently input test samples during the post-deployment testing phase.
[0092] Fifth, while existing TTA (Transformation and Acquisition) technologies attempt to update the model during the testing phase, most methods are prone to "catastrophic forgetting" or model collapse due to blind updates when faced with highly noisy pseudo-labels, and often ignore the differences in the sensitivity of different parameters to errors. To address this issue, this invention innovatively introduces a parameter-by-parameter adaptive learning rate mechanism and a prototype-based online alignment strategy. Instead of using a uniform update step size for all parameters, this invention dynamically adjusts the learning rate during testing based on the stability (gradient energy) of each parameter's historical gradient, thereby suppressing severe oscillations caused by noise. Simultaneously, the source domain prototype is used as a stable reference frame to constrain the feature space during online fine-tuning. This design enables the model to quickly adapt to new distributions while robustly maintaining discriminative ability when processing target domain data in real time, greatly improving the robustness of online fault diagnosis.
[0093] Sixth, for a long time, research on transfer learning in fault diagnosis has mainly focused on offline domain adaptation, while insufficient attention has been paid to "online adaptation during testing" after model deployment. Most current inventions require offline fine-tuning after collecting a batch of target domain data. However, in most cases, industrial field data is generated streamingly and requires immediate model response. As equipment operating conditions continuously change, static models face the problem of performance degradation over time. Therefore, this invention proposes that the trained model can perform online adaptive updates in single samples or small batches during the testing phase. Even when completely detached from the source domain dataset, it still achieves consistently stable classification results, making it more suitable for real-time monitoring systems in actual production environments.
[0094] Under experimental conditions where access to source domain data is not required, the data processing utilizes a collaborative architecture between the EMA Teacher (Exponential Moving Average Teacher Model) and the student model. This effectively leverages pre-trained knowledge from the source domain while adapting to changes in the target domain, resulting in better generalization and a more stable recognition rate. Using source domain feature prototypes as anchors, high-quality pseudo-labels are generated for target domain samples by calculating the cosine similarity between the target domain samples and the source domain prototypes. This avoids the bias risks associated with direct prediction and improves the model's robustness under different conditions. For target domain samples input during the testing phase, based on "prototype-based contrastive loss," sample features, enhanced features, and corresponding category source domain prototypes are brought closer together while distancing heterogeneous prototypes. This achieves efficient feature space alignment, better maintaining intra-class compactness and preserving the inter-class structure of the source domain. The greatest highlight of this invention lies in the application of a prototype-based feature alignment strategy and a parameter-wise adaptive learning rate mechanism. This ensures rapid model adaptation in the target domain without significant feature drift or "catastrophic forgetting." Furthermore, by using "symmetric cross-entropy loss" combined with "gradient energy statistics", the negative impact of noise pseudo-labels on model parameter updates is effectively suppressed. Thus, even when conducting online adaptive training away from the source domain dataset, feature space drift is still effectively mitigated, improving the stability and accuracy of the fault classification model during testing.
[0095] Passive Real-Time Adaptation: The core feature of this method lies in its complete passive and real-time adaptation. After the model is deployed to the target domain, the system can receive streaming data in real time during the inference phase and perform online adaptive updates. The entire process is driven solely by the pre-trained model and the source domain prototype, without the need to backtrack to source domain samples. In practical applications, this not only solves the bottlenecks of data privacy and transmission but also enables the model to respond instantly to dynamic conditions, greatly improving the system's deployment flexibility and online reliability.
[0096] Parameter-wise adaptive learning rate: During the online update of the target domain, this method introduces an adaptive learning rate mechanism based on gradient energy. This mechanism can automatically identify and suppress unstable gradients caused by noisy pseudo-labels, and finely adjust the update step size for each parameter, thereby preventing drastic drift and collapse of the model during the adaptation process.
[0097] Prototype-based contrastive alignment: By contrasting target domain sample features with source domain category prototypes, this approach leverages a "attracting like and repelling unlike" mechanism to force the model to maintain the inter-class structure of the source domain while adapting to new data. This method not only improves the intra-class compactness of features but also further enhances the model's robustness to target domain noise through consistency constraints across multiple views (original features and enhanced features). Attached Figure Description
[0098] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the embodiments of the present invention will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0099] Figure 1 This is a flowchart of the test-time adaptive learning method based on prototype alignment and parameter-by-parameter adaptive learning rate provided in an embodiment of the present invention;
[0100] Figure 2 This is a test-time adaptive learning system structure diagram provided by an embodiment of the present invention, based on prototype alignment and parameter-by-parameter adaptive learning rate;
[0101] Figure 3 This is a schematic diagram illustrating the real-time input of target domain samples, online model updates and fine-tuning, and output of reliable classification results provided in this embodiment of the invention. Detailed Implementation
[0102] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0103] To address the problems existing in the prior art, this invention provides a real-time adaptive learning bearing fault classification method and system based on prototype alignment and parameter-by-parameter adaptive learning rate. The invention will be described in detail below with reference to the accompanying drawings.
[0104] like Figure 1 As shown in the figure, the real-time adaptive learning bearing fault classification method and system based on prototype alignment and parameter-by-parameter adaptive learning rate provided by the embodiments of the present invention includes the following steps:
[0105] Step S1: Obtain the training dataset as the initial source domain dataset, which contains all samples and their corresponding labels; input the initial source domain dataset into the source domain pre-training module, and obtain the source domain classification pre-training model through supervised learning; at the same time, use the trained model to extract the deep features of each category of samples and calculate their mean to generate the source domain prototype set.
[0106] Step S2: Use the source domain pre-trained model obtained in step S1 as the initial model, and make a copy to build the EMATeacher model for subsequent generation of stable pseudo-labels; the pre-trained model carries the category discrimination ability and feature expression ability of the source domain, providing basic structural information for subsequent target domain adaptation.
[0107] Step S3: Obtain the test dataset as the initial target domain dataset, ensuring that the target domain and source domain are consistent in terms of category set; input the target domain samples into the EMA Teacher model to obtain the pseudo-labels of the corresponding target domain samples; guide the target domain samples into the adaptive training process through the pseudo-labels, providing supervision information for subsequent feature alignment and model updates.
[0108] Step S4: Input the target domain samples from Step S3 into the student model part of the source domain pre-trained model, and perform unsupervised training using the symmetric cross-entropy loss between the student output and the pseudo-labels. At the same time, the model uses the distance relationship between the deep features of the target domain samples and the source domain prototypes to perform prototype alignment constraints. By attracting similar features and dispersing dissimilar features, the model maintains the stability of its feature structure during the update process. During the above training process, the model maintains independent gradient statistics for each parameter and adaptively adjusts the learning rate of the parameters according to the gradient stability, achieving parameter-by-parameter adaptive updates and suppressing drastic parameter drift caused by noisy pseudo-labels. Through the above series of adaptive training steps, the model can stably transfer to the target domain data distribution without accessing the source domain data, and obtain stronger feature consistency and classification robustness.
[0109] Specifically, in step S1, a vibration signal dataset is obtained as the initial source domain dataset. The number of categories is denoted as K, and the initial source domain dataset is denoted as... ,in Represents the first sample in the initial source domain. A vibration signal, and Indicates the corresponding fault type label, This refers to the number of samples in the initial source domain. The initial source domain dataset... Input source domain pre-training module, for feature extractor With classifier Supervised learning training is performed to obtain a pre-trained classification model based on the source domain. To enhance training robustness, supervised loss based on cross-entropy can be used for training. It can be represented as:
[0110] (1)
[0111] in To supervise the loss function, the network parameters are optimized and updated using stochastic gradient descent.
[0112] After completing source domain supervised training, the trained feature extractor is used Extracting deep features from each training sample And calculate the mean of source domain category features according to category, that is, for the first category... kind:
[0113] (2)
[0114] in Indicates belonging to the first The source domain sample set of the class, Let its sample size be denoted as . Let the prototype set of all categories be denoted as . .
[0115] The above source domain pre-training and computation process results in a source domain-based classification pre-trained model. It not only has the ability to distinguish the source domain, but also can describe the stable feature structure of various types of the source domain using prototypes.
[0116] In step S2, the source domain pre-trained model obtained in step S1 is... As the initial student model And replicate to obtain the EMA Teacher model In the subsequent online adaptive process, the teacher model is smoothly updated along with the student model using an exponential moving average rule; that is, for the first... At the next update time, the teacher model parameter update can be expressed by the following formula:
[0117] (3)
[0118] in, This represents the smoothing coefficient, which is typically 0.99.
[0119] In step S3, the target domain dataset is obtained, denoted as... ,in Indicates the first The vibration signal of a sample in the target domain, and This refers to the number of samples in the target domain. The pseudo-label for the fault type in the target domain. To be predicted, the target domain dataset contains a set of categories consistent with the source domain, but its data distribution may differ from the source domain. First, to obtain the corresponding fault type pseudo-labels, we need to extract features from the target domain samples. Specifically, we input the target domain samples into a feature extractor to obtain the raw features:
[0120] (4)
[0121] in, This represents the feature dimension. Then, using these features, we measure similarity with the source domain prototype, specifically calculating the cosine similarity between each target domain sample and each prototype:
[0122] (5)
[0123] Next, we use similarity to determine the most similar class for each sample, thus obtaining the pseudo-labels for the samples:
[0124] (6)
[0125] That is, for the first For each sample, the category corresponding to the source domain prototype with the highest cosine similarity is selected as its pseudo-label. This allows it to enter the adaptive training process, providing an important basis for feature alignment and decision boundary optimization.
[0126] In step S4, the target domain samples obtained in step S3 are input into the student model. And perform adaptive training during testing. Training includes three key modules: symmetric cross-entropy loss, prototype-based contrastive loss, and parameter-wise learning rate update. First, record the student model's performance on samples... The softmax output is Let the softmax output of the EMA Teacher model for the same sample be... Next, we adopted symmetric cross-entropy as a robust form of the self-training loss, and calculated it separately for the original samples and the augmented samples, then averaged the results. The symmetric cross-entropy operator is defined as follows: ,in Let be the cross-entropy. Then the symmetric cross-entropy loss... The loss is:
[0127] (7)
[0128] in This represents the student output after data augmentation transformation during testing. This indicates the one-dimensional signal random data augmentation transformation used during the test.
[0129] For prototype-based contrastive loss, in order to construct feature sets for contrastive learning First, we need to obtain the enhanced features of the target domain samples:
[0130] (8)
[0131] In a training batch, for samples Represent its prototype ,in Indicates sample Corresponding pseudo-labels and original feature representations and enhanced feature representation After projection mapping and normalization, a set of positive sample feature groups is obtained. Any two representations within this group are considered positive sample pairs, while the corresponding representations of all other samples in this batch are considered negative samples. Its form is:
[0132] (9)
[0133] Input the above feature set into the projection head Perform feature mapping and apply the L2 norm. After normalization, the feature vectors used for contrastive learning are obtained:
[0134] (10)
[0135] Based on this, a temperature-scaled contrast loss is constructed. For a given feature, the contrast loss is defined as:
[0136] (11)
[0137] in Indicates the temperature coefficient of comparison. Indicates the reference temperature. This represents the set of positive samples for that sample. Let represent the set of negative samples. The average loss over all samples yields the contrastive learning term:
[0138] (12)
[0139] This contrastive learning process constrains the similarity relationships between samples and their prototypes, as well as between original features and enhanced features, so that the features of the target domain move closer to the class center of the source domain while maintaining intra-class compactness.
[0140] The main loss is ultimately used for adaptive updates. for:
[0141] (13)
[0142] Next, during the adaptive update process involving target domain samples, to prevent gradient noise caused by pseudo-label errors from further amplifying the drift of model parameters, an independent gradient energy statistic is constructed for each parameter in the model, and its learning rate is dynamically adjusted accordingly. The specific implementation of this adaptive mechanism is as follows.
[0143] First, for the current target domain samples, based on the model's predicted output for the samples, a negative log-likelihood loss is constructed, and this loss is used as the basis for local gradient estimation:
[0144] (14)
[0145] Backpropagation of the above loss yields the instantaneous gradients of each parameter in the model. Subsequently, to characterize the sensitivity of each parameter to pseudo-label noise, accumulated gradient energy is maintained for each parameter. And update using the squared cumulative method:
[0146] (15)
[0147] To form adaptive weights for comparability, Perform min–max normalization to obtain the weights within the relative range of variation:
[0148] (16)
[0149] Given a base learning rate Under this premise, assign a corresponding adaptive learning rate to each parameter:
[0150] (17)
[0151] in This is a lower bound to prevent the learning rate from approaching zero.
[0152] Meanwhile, when performing online adaptive updates, the accumulated gradients are first cleared to zero, and then the overall loss is adjusted based on the aforementioned adaptive learning rate. Calculate the gradient and perform an update, with the following update rule:
[0153] (18)
[0154] After the update is complete, the new squared gradient will continue to accumulate to the energy term. This serves as a reference value for updating the next batch of target domain samples, thereby enabling continuous parameter-by-parameter adaptive adjustment and updating of network weight parameters, allowing the model to output accurate predicted labels for unlabeled target domain samples.
[0155] like Figure 2 As shown, this embodiment of the invention provides a test-time adaptive learning system based on prototype alignment and parameter-by-parameter adaptive learning rate, comprising:
[0156] Deep neural networks are used to build the basic architecture for student and teacher models. They obtain deep feature representations of samples through feature extractors and complete the prediction output in the source domain pre-training and target domain adaptation process by classifiers.
[0157] Based on the prototype contrastive learning module, it is used to align the features of the target domain sample with the prototype of the source domain category, construct a ternary contrastive relationship of prototype, original features and enhanced features, and optimize the feature space structure through intra-class attraction and inter-class dispersion strategies to maintain the discriminative ability of the source domain category.
[0158] The adaptive learning rate module is used to independently maintain gradient energy statistics for each parameter of the model, dynamically adjust the learning rate of each parameter according to gradient stability, suppress drastic parameter drift caused by noise pseudo-labels, and achieve conservative and robust model updates.
[0159] The real-time prediction module is used to perform online inference on the target domain input samples after adaptive training, and output stable and accurate classification prediction results to achieve real-time response to the classification task during testing.
[0160] The pseudo-label generation module is used to generate reliable pseudo-labels for unlabeled samples in the target domain through the EMA teacher model or the source domain prototype similarity matching mechanism, providing supervision information for the adaptive training of the student model.
[0161] This invention proposes a test-time adaptive learning system based on prototype alignment and parameter-wise adaptive learning rate. Using a deep neural network as its core architecture, it achieves online adaptive model updates during the testing phase through the collaborative work of student and teacher models. In the source domain pre-training phase, the system constructs a feature extractor and classifier with stable discriminative capabilities, and simultaneously extracts source domain feature prototypes for each category to represent the stable structure of the source domain categories in the feature space. During the testing phase, the system introduces a pseudo-label generation module, utilizing the smooth prediction of the teacher model or the source domain prototype similarity matching mechanism to provide reliable supervision information for unlabeled samples in the target domain. Simultaneously, a prototype contrastive learning module aligns the target domain sample features with corresponding source domain prototypes, maintaining the discriminative structure of the feature space through intra-class attraction and inter-class dispersion. Furthermore, the adaptive learning rate module evaluates gradient stability at the parameter level and employs differentiated update strategies for different parameters, thereby achieving robust and controllable adaptive model updates during the testing phase.
[0162] The system of this invention is applicable to industrial condition monitoring scenarios such as bearing fault diagnosis, and is particularly suitable for applications with frequent changes in operating conditions, complex operating environments, and where target domain data is difficult to label or obtain in advance. The system can be deployed in industrial computers, edge computing terminals, or information data processing terminals, continuously receiving vibration signal data during equipment operation and completing online fault identification without relying on source domain samples or manual labeling. Through a test-time adaptive learning mechanism, the system can cope with data distribution drift caused by factors such as changes in rotational speed, load, and sensor differences, meeting the requirements of real-time performance, autonomy, and long-term stable operation in industrial settings.
[0163] Compared to existing fault classification methods that rely solely on offline training or overall parameter updates, this invention introduces a source domain prototype alignment mechanism, ensuring the model remains constrained by the source domain category structure during testing, significantly reducing the risk of disordered feature drift in the target domain. Furthermore, a parameter-by-parameter adaptive learning rate mechanism suppresses unstable parameter updates caused by pseudo-label noise or anomalous samples, preventing rapid performance degradation during testing. Through the collaborative efforts of multiple modules, the system maintains the stability and accuracy of classification results during inference and updating, enabling more reliable bearing fault identification under complex working conditions and long-term operation. This demonstrates significant engineering practical value and promising prospects for wider application.
[0164] like Figure 3 As shown, this invention provides a real-time adaptive learning bearing fault classification method and system based on prototype alignment and parameter-by-parameter adaptive learning rate, which achieves continuous and stable adaptation of the model in the target domain without accessing source domain data. First, in the source domain pre-training, a basic fault classification model is trained using the source domain dataset through supervised learning. The mean of deep features for each category is extracted to construct a source domain feature prototype set, which describes the stable feature distribution structure of the source domain. Then, the source domain pre-trained model is replicated to construct a real-time fault classification model. The teacher model parameters are smoothly updated using an exponential moving average to generate relatively stable pseudo-label predictions for target domain samples. In the real-time fault classification model, target domain samples are input into the student model. Unsupervised training is performed using the symmetric cross-entropy loss between the pseudo-labels generated by the teacher model and the student output. Simultaneously, the deep features of the target domain samples are comparatively aligned with the corresponding source domain prototypes. Feature-level attraction constraints maintain intra-class compactness and preserve the inter-class structure of the source domain. During this process, a parameter-wise adaptive learning rate module maintains independent gradient statistics for each parameter of the model, adaptively adjusting the update amplitude based on gradient stability and suppressing noisy gradients to prevent drastic drift during adaptive training at test time. Finally, the adaptively trained fault classification model outputs real-time, stable, and accurate predicted labels for target domain samples in the inference and classification modules, achieving reliable classification results at test time.
[0165] Source Domain Setup and Online Adaptation Mechanism: This method aims to construct an intelligent model capable of continuous evolution. This model not only possesses initial fault identification capabilities but also adapts in real-time to changes in the target domain data distribution during the inference phase, achieving accurate and stable online diagnosis. In this scenario, only the source domain-based classification pre-trained model, source domain feature prototypes, and unlabeled target data arriving in a streaming manner are available. Specifically, the implementation process is divided into two stages: offline pre-training and online adaptation. First, in the first stage, the method uses labeled source domain datasets for supervised learning to obtain a basic source domain classification pre-trained model. In this stage, a feature prototype construction step is specifically introduced, generating a "source domain feature prototype" by calculating the deep feature mean of samples in each category, which serves as a geometric anchor point describing the stable feature distribution of the source domain. After this stage, the source domain dataset is no longer available; only the pre-trained model parameters and the source domain prototype are retained for subsequent deployment. In the second stage, the online adaptation stage during testing, this invention deals with a real-time, continuously arriving target domain data stream. This invention first designs a stable prediction mechanism based on EMA Teacher, using a smoothed teacher model to generate reliable pseudo-labels. Meanwhile, a prototype-based contrast alignment strategy is adopted to geometrically constrain the real-time input target domain sample features with the source domain prototype to maintain intra-class compactness of the feature space. More importantly, to prevent model collapse in real-time environments with single-sample or mini-batch updates, this invention innovatively introduces a parameter-wise adaptive learning rate module. This module dynamically adjusts the update magnitude during testing by statistically analyzing the gradient energy of each parameter, interacting with the loss to ensure that the model can quickly respond to changes in operating conditions while effectively suppressing parameter drift caused by noise during the "inference-as-it-goes" process, significantly improving the model's online adaptive stability in dynamic environments.
[0166] The computer device, computer-readable storage medium, and information data processing terminal provided by this invention all use a built-in processor and memory as their hardware foundation. Through a computer program pre-stored in the memory, they implement a test-time adaptive learning bearing fault classification method based on prototype alignment and parameter-by-parameter adaptive learning rate. Its overall working principle is to enable the model to stably and autonomously adapt online during the testing phase based on changes in the target domain data distribution without relying on source domain samples, thereby improving the accuracy and robustness of bearing fault identification.
[0167] During operation, the processor first calls the classification model parameters and corresponding source domain feature prototype information obtained in the source domain pre-training stage as the prior structural basis. The source domain feature prototype is used to characterize the stable central structure of various bearing faults in the feature space, providing a reference for feature constraints during subsequent testing. When the information data processing terminal receives the vibration signal data of the target domain, the processor, under the control of the execution program, uses the teacher model to predict the target domain samples and generate relatively stable pseudo-labels to reduce the uncertainty caused by the direct participation of unlabeled data from the target domain in training.
[0168] Subsequently, the processor controls the student model to perform an online adaptive update process during the testing phase. On the one hand, by aligning the deep features extracted from the target domain samples with the corresponding source domain feature prototypes, the disordered drift of the model's feature representation is limited, maintaining the class discrimination structure already learned in the source domain. On the other hand, the update stability of each parameter in the model is independently evaluated, and the update magnitude of different parameters is adaptively adjusted based on the evaluation results, making the parameter updates in unstable directions more conservative, thereby suppressing model performance degradation caused by pseudo-label noise or distribution shift.
[0169] With the synergistic effect of the above mechanisms, the processor can complete the test-time adaptive learning process of inference and updating while continuously receiving samples from the target domain, so that the bearing fault classification results output by the information data processing terminal can maintain real-time performance, stability and accuracy under complex working conditions and distribution changes.
[0170] The authoritative Paderborn University bearing dataset was used to construct test-time adaptive scenarios. Four different operating conditions were selected as the source and target domains, respectively: rotational speed, load torque, and radial force of 900 rpm / 0.7 Nm / 1000 N (A1), 1500 rpm / 0.1 Nm / 1000 N (A2), 1500 rpm / 0.7 Nm / 400 N (A3), and 1500 rpm / 0.7 Nm / 1000 N (A4). Twelve passive domain adaptive fault diagnosis tasks were constructed. The specific information of the data domain and fault diagnosis tasks is shown in Table 1.
[0171] Table 1 Fault Diagnosis Task Information Table
[0172]
[0173] The experiment employed 13 different bearing damage states, covering single and compound failure modes of varying locations and degrees, as detailed in Table 2. The combination methods describe the distribution patterns of faults on different bearing components (e.g., inner and outer rings), categorized as "single" (only a single damage type), "multiple" (multiple damage types), and "random." The arrangement defines the spatial distribution of damage points on the component surface, with "no repetition" representing a regular distribution and "random" representing no fixed pattern. Damage severity is a key quantitative indicator, graded from 1 to 3 to indicate the evolution of the fault from minor to severe.
[0174] Table 2 Information on 13 Bearing Types
[0175]
[0176] The experiment used a configuration where each vibration signal sample was uniformly processed into a 2048-dimensional vector, and the sample size included 1000 samples for each fault category to ensure statistical significance. The test protocol adopted a single-target domain migration test to simulate the real-time adaptation process of the model from known working conditions to unknown working conditions. The adaptation frequency was to fine-tune the model online immediately after processing each batch of data. The evaluation metric was the average classification accuracy of all samples in the target domain as the main performance indicator.
[0177] Under the same experimental settings, four representative and widely accepted methods were selected for comparison: BOD, Law, Santa, and RMT. Here, "source" represents the recognition rate obtained without any transfer learning. The experimental recognition rates are as follows:
[0178] Table 3 Results of Bearing Diagnostic Task
[0179]
[0180] This method employs a mean-teacher framework and symmetric cross-entropy loss, optimizing the standard cross-entropy loss in the traditional mean-teacher method. Simultaneously, a prototype contrastive learning module is constructed to extract source domain feature prototypes before the testing phase, providing semantic guidance for online adaptation. Furthermore, an improved parameter-level adaptive learning rate mechanism is implemented, directly updating the parameter group learning rate while retaining Adam's historical state to avoid optimizer reset, achieving balanced updates by combining long-term trends with current-step normalization. Experiments demonstrate that this invention can effectively mitigate the impact of domain differences even when separated from the source domain, and effectively improve the recognition rate.
[0181] The test-time adaptive learning method based on prototype alignment and parameter-by-parameter adaptive learning rate provided by this invention, with its online real-time processing and robust update framework, can be widely applied in industrial fields, especially in bearing fault diagnosis and equipment health monitoring where immediate response is required. The following are two specific application examples demonstrating the practical application scenarios and effects of this method.
[0182] Example 1: Online dynamic bearing fault detection for joint bearings in industrial robots
[0183] In highly automated automobile manufacturing or precision assembly workshops, the joint bearings of industrial robots are constantly subjected to complex dynamic conditions of variable speed and load. This embodiment utilizes the test-time adaptive method of the present invention to capture and adapt to changes in operating conditions in real time during robot operation, achieving online fault detection without downtime.
[0184] 1. Source Domain Modeling and Prototype Construction: First, vibration signals of robot bearings of different types and damage levels were collected in a laboratory environment as the source domain dataset. Supervised training was performed using the source domain pre-training module to obtain a basic classification model, and the mean value of deep features for each fault category was calculated to construct a source domain feature prototype, thereby solidifying the structured knowledge of the source domain.
[0185] 2. Model Deployment Initialization: Deploy the pre-trained student model, EMA Teacher model, and source domain feature prototype to the edge computing node of the industrial robot. At this point, the original source domain data no longer participates in subsequent processes; only the model parameters and prototype are retained.
[0186] 3. Online Streaming Adaptation: During actual robot operation, vibration signals from joint bearings are received in real-time via streaming. For each arriving sample, the EMA Teacher combines prototype matching to generate stable pseudo-labels. The system utilizes symmetric cross-entropy loss and prototype-based contrastive loss to align the current sample features to the corresponding source domain prototype in real time, ensuring that the feature space does not drift under dynamic conditions.
[0187] 4. Robust parameter-by-parameter update: During online updates, the system continuously calculates the gradient energy of each parameter and dynamically adjusts the update step size through a parameter-by-parameter adaptive learning rate mechanism to suppress noise gradients caused by sudden changes in operating conditions. The updated model outputs fault prediction results instantly. If an anomaly is detected, it immediately triggers shutdown protection or maintenance warnings, achieving intelligent operation and maintenance that combines production, monitoring, and adaptation.
[0188] Example 2: Online health monitoring of traction bearings in high-speed trains
[0189] High-speed trains face a variety of variable factors during operation, including cross-regional temperature differences, tunnel effects, and track impacts. Traditional static models are ill-suited to adapt to this real-time changing data distribution. This embodiment applies the method of the present invention to perform real-time health monitoring and model fine-tuning of the traction motor bearings during train operation.
[0190] 1. Baseline Model Preparation: Using standard bearing fault data obtained from bench tests as the source domain, a deep one-dimensional convolutional neural network was trained, and fault category prototypes were extracted from the high-dimensional feature space. These prototypes serve as "stabilization anchors" for subsequent online monitoring.
[0191] 2. Onboard System Integration: Integrate the adaptive diagnostic system, which includes pre-trained parameters and prototypes, into the train's onboard monitoring unit. The system is designed to handle single-sample or micro-batch real-time data streams without requiring the transmission of massive amounts of data back to the cloud for training.
[0192] 3. Real-time Inference Fine-tuning: During train operation, sensors continuously collect vibration data from the traction bearing. While performing fault inference, the system executes a test-time adaptation (TTA) process. Through prototype-based contrast alignment, the model is forced to maintain intra-class compactness of fault characteristics when adapting to new operating environments (such as different speed gears).
[0193] 4. Safety Assessment and Dynamic Maintenance: To prevent model parameter collapse due to noise interference during high-speed operation, a parameter-by-parameter adaptive learning rate strategy is adopted to automatically suppress unstable parameter updates. This ensures that the diagnostic model maintains high reliability throughout the entire train operation. Based on the real-time output health status assessment results, the dispatch center can accurately formulate maintenance plans after the train enters the station, ensuring train operation safety and efficiency.
[0194] Example 3: Adaptive monitoring of non-stationary operating conditions of wind turbine main shaft
[0195] Wind turbine generators are typically installed in harsh outdoor environments, where the main shaft bearings are subject to continuous fluctuations in speed and load due to random variations in natural wind speed. This embodiment applies the real-time adaptive method of the present invention to address the problem of monitoring model failure caused by operating condition drift during long-term wind turbine operation.
[0196] 1. Source Domain Modeling and Prototype Construction: First, using typical operating condition vibration data or bench test data accumulated from the history of wind farms as the source domain, a basic classification model is obtained through supervised learning training. Simultaneously, the mean of deep features for each fault category in the feature space is extracted to construct a source domain feature prototype library, serving as the "geometric center" describing the essential characteristics of the faults.
[0197] 2. Embedded Deployment Initialization: Deploy the lightweight system, which includes student model, EMA Teacher model parameters, and source domain feature prototypes, to the embedded monitoring unit in the wind turbine nacelle. The system runs locally, completely independent of the storage of historical big data from the source domain.
[0198] 3. Online Streaming Adaptation: For continuous streaming vibration data generated during wind turbine operation, the system performs online inference on a sample-by-sample or in small batches. The EMA Teacher model uses historical smoothing parameters to generate pseudo-labels for current non-stationary samples. Combined with prototype-based contrastive loss, it forces the features of samples affected by speed fluctuations to the corresponding source domain prototype, preventing the feature distribution from diverging with changes in operating conditions.
[0199] 4. Robust Parameter-by-Parameter Updates: Considering that sudden changes in wind speed may introduce instantaneous noise, the system monitors the gradient energy statistics of each parameter in real time through a parameter-by-parameter adaptive learning rate module. For high-energy unstable gradients caused by drastic changes in operating conditions, the update weight of the corresponding parameter is automatically reduced to ensure that the model does not suffer catastrophic forgetting during long-term "run-and-adapt" processes and continuously outputs reliable health status assessments.
[0200] Example 4: Instantaneous Diagnosis of Micro-batch Data for High-Speed Spindle Bearings in CNC Machine Tools
[0201] In the field of precision machining, the high-speed spindle bearings of CNC machine tools are core components, and their failures are often sudden. Due to frequent switching of machining tasks, it is difficult for the system to collect a large amount of fault data under the same working conditions, requiring the model to have instantaneous adaptive capabilities under single sample or micro-batch input.
[0202] 1. Source Domain Modeling and Prototype Construction: Vibration data collected from a spindle reliability test bench is used as the source domain, covering various damage levels of the inner ring, outer ring, and rolling elements. A basic model is obtained through supervised training, and the mean values of deep features of various bearing faults are extracted to construct a source domain feature prototype.
[0203] 2. Edge System Integration: A pre-trained lightweight student model and source domain feature prototype are integrated into the edge control module of the machine tool. This module does not store historical data; it only processes real-time vibrations during the current cutting process.
[0204] 3. Instantaneous Inference Fine-Tuning: When the spindle bearing experiences occasional abnormal vibrations during machining clearance, the EMA Teacher model outputs stable pseudo-labels using historical smoothing parameters. The system utilizes symmetric cross-entropy loss, combined with prototype-based contrast constraints, to force the features of this small sample to be mapped to the vicinity of the corresponding fault prototype, achieving millisecond-level online parameter fine-tuning.
[0205] 4. Gradient Energy Control: To address the issue of excessively large gradient variance in single samples due to cutting noise, a parameter-wise adaptive learning rate mechanism plays a crucial role. The system automatically identifies and suppresses severe gradient fluctuations caused by cutting fluid impact or intermittent cutting, ensuring that model parameters only respond to real bearing fault characteristics and preventing false alarms or model crashes due to individual noise samples.
[0206] Example 5: Fault Identification of Pump Bearings in Petrochemical Units Across Sensor Types
[0207] In large petrochemical enterprises, the monitoring of critical pump units is transitioning from traditional wired piezoelectric sensors to low-cost wireless sensors. Due to significant differences in frequency response bandwidth and sensitivity between the two types of sensors (heterogeneous devices), directly reusing old models leads to a decrease in bearing fault detection rates. This embodiment verifies the system's ability to eliminate sensor differences.
[0208] 1. Construction of standard feature space: Using the vibration signal of centrifugal pump bearing collected by historically accumulated high-precision wired piezoelectric sensors as the source domain, a deep neural network is trained to extract the source domain feature prototypes of typical faults such as inner ring spalling and outer ring wear.
[0209] 2. Cross-device model deployment: The trained adaptive system is deployed to target monitoring nodes using wireless sensors. In this case, the target domain signal may exhibit high-frequency component loss or increased noise floor compared to the source domain signal.
[0210] 3. Geometric Alignment: During wireless node operation, the system utilizes source domain feature prototypes as "geometric anchors" for cross-domain sharing. Through prototype-based comparative learning, the bearing features acquired by the wireless sensors are forced to project closer to similar source domain prototypes. For example, the acquired "inner ring peeling" feature is pulled towards the "inner ring peeling" prototype established by the piezoelectric sensor, thus geometrically calibrating the feature distribution offset caused by differences in sensor hardware.
[0211] 4. Differentiated Parameter Tuning: Addressing the high noise floor inherent in wireless sensors, the parameter-by-parameter adaptive learning rate module automatically identifies parameters in the model that are sensitive to background noise and suppresses their update amplitude. This allows the model to ignore hardware noise introduced by the sensor and focus on extracting the impact characteristics of the bearing itself, achieving stable generalization across sensors.
[0212] In the description of this invention, unless otherwise stated, "a plurality of" means two or more; the terms "upper," "lower," "left," "right," "inner," "outer," "front end," "rear end," "head," "tail," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings, and are only for the convenience of describing the invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the invention. Furthermore, the terms "first," "second," "third," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0213] It should be noted that embodiments of the present invention can be implemented in hardware, software, or a combination of both. The hardware portion can be implemented using dedicated logic; the software portion can be stored in memory and executed by a suitable instruction execution system, such as a microprocessor or dedicated-design hardware. Those skilled in the art will understand that the above-described devices and methods can be implemented using computer-executable instructions and / or included in processor control code, for example, such code provided on a carrier medium such as a disk, CD, or DVD-ROM, a programmable memory such as read-only memory (firmware), or a data carrier such as an optical or electronic signal carrier. The devices and modules of the present invention can be implemented by hardware circuitry such as very large-scale integrated circuits or gate arrays, semiconductors such as logic chips, transistors, or programmable hardware devices such as field-programmable gate arrays, programmable logic devices, etc., or by software executed by various types of processors, or by a combination of the above-described hardware circuitry and software, such as firmware.
[0214] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any modifications, equivalent substitutions, and improvements made by those skilled in the art within the scope of the technology disclosed in the present invention, and within the spirit and principles of the present invention, should be covered within the scope of protection of the present invention.
Claims
1. A test-time adaptive learning system based on prototype alignment and parameter-wise adaptive learning rate, characterized in that, Comprise: A source domain pre-training module for training a base classification model on labeled source domain samples and extracting deep feature means of samples of each category to construct source domain feature prototypes representing the stable structure of source domain categories; A teacher model module for constructing a teacher model based on the base classification model in the testing stage and maintaining the temporal stability of the teacher model parameters through a smoothing update mechanism to generate stable pseudo-label predictions for target domain samples; A target domain self-adaptive training module for updating a student model based on the pseudo-labels in the case of only receiving target domain unlabeled samples and maintaining the stability of the category structure of target domain features by aligning the deep features of target domain samples with the corresponding source domain feature prototypes; A parameter-wise adaptive learning rate module for evaluating the update stability of different parameters in the model during the testing self-adaptive training process and differentiating the update amplitude of each parameter according to the stability difference to suppress the violent drift in the unstable parameter direction; An inference output module for real-time classification prediction of target domain input samples based on the model after adaptive update.
2. The system of claim 1, wherein, The target domain self-adaptive training module introduces a consistency constraint between the teacher model prediction results and the student model prediction results when performing model update to reduce the interference of pseudo-label noise on the model update direction.
3. The system of claim 1, wherein, The target domain self-adaptive training module maintains the transferability of the source domain discriminative structure in the model update process by attracting the deep features of target domain samples to the source domain feature prototypes of their corresponding categories and maintaining the distinguishing structure between different category prototypes.
4. The system of claim 1, wherein, The target domain self-adaptive training module and the inference output module are alternately executed within the same testing stage, so that the model completes parameter fine-tuning based on the current sample while outputting the prediction result, and the whole process does not rely on any source domain samples.
5. A test-time adaptive learning method based on prototype alignment and parameter-wise adaptive learning rate, characterized in that, Comprise the following steps: Supervised training on source domain samples to obtain a base classification model and extract deep feature means of samples of each category to construct source domain feature prototypes; Construct a teacher model based on the base classification model in the testing stage and maintain the temporal stability of the teacher model prediction through a smoothing update method; Input target domain unlabeled samples into the teacher model to generate pseudo-labels and guide the student model to perform online update in the testing stage; In the model update process, align the features of target domain samples with the corresponding source domain feature prototypes to maintain the stability of the category structure; Meanwhile, the update stability of different parameters in the model is independently evaluated, and the update amplitude of each parameter is adaptively adjusted based on the evaluation results, so that robust model transfer and classification prediction are realized in the testing stage.
6. The method of claim 5, wherein, The model update and classification prediction are performed simultaneously in the process of continuous arrival of target domain samples, so that the model can continuously adapt to the target domain data distribution without interruption.
7. The method of claim 5, wherein, In the testing self-adaptive learning stage, the model update process does not access the source domain samples, and only uses the model parameters and source domain feature prototypes obtained in the source domain pre-training stage as prior structure information.
8. A per-parameter adaptive learning rate update mechanism for test-time adaptive learning, characterized in that, In the online updating process of the model, a statistical quantity reflecting the stability of the gradient change of each parameter in the model is maintained; The updating reliability of each parameter under the current target domain sample driving is evaluated according to the statistical quantity; The updating range of the parameter with low updating reliability is reduced, and the parameter with high updating reliability is allowed to be updated relatively actively, so as to suppress the parameter drift caused by the pseudo-label noise at the overall model level.
9. The mechanism of claim 8, wherein, The parameter adaptive learning rate updating mechanism acts on the parameters in the feature extraction layer and the classification decision layer of the model, so that the updating rates of different functional layers are adaptively allocated according to the stability difference.
10. A test-time feature stability method based on source domain feature prototypes, characterized in that, In the source domain training stage, the mean value of the deep features of each category sample is extracted as the source domain feature prototype, which is used to describe the stable structure center of each category; In the test stage, the deep features of the target domain samples are aligned and constrained with the source domain feature prototypes, so as to limit the disordered drift of the target domain features in the model updating process; By maintaining the structural consistency between the target domain samples and their corresponding source domain feature prototypes, the model maintains the transferability of the source domain discriminative structure in the unlabeled target domain environment.