Circuit breaker fault diagnosis method based on large language model and fuzzy prototype network
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHANDONG UNIV
- Filing Date
- 2026-06-09
- Publication Date
- 2026-08-07
AI Technical Summary
然而,如何将这些具有工程意义的描述信息有效引入模型,并与原始信号特征形成互补,一直缺乏有效手段
Smart Images

Figure CN122365167B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of circuit breaker fault diagnosis technology, specifically a circuit breaker fault diagnosis method based on a large language model and a fuzzy prototype network. Background Technology
[0002] Vibration signals can directly reflect the impact and energy transfer characteristics during the operation of a mechanism, and are relatively easy to obtain, making them widely used in circuit breaker fault identification. However, in actual operation, it is difficult to obtain fault samples, especially since data on new or early faults is scarce. This makes circuit breaker diagnosis a typical problem with small sample sizes. At the same time, there is often overlap in features between different fault modes, which increases the difficulty of identification.
[0003] Traditional fault diagnosis methods typically rely on manually designed features based on experience, extracting statistical indicators through time-domain, frequency-domain, or time-frequency-domain analysis and combining them with traditional classifiers for identification. These methods are heavily dependent on feature construction and have limited adaptability to changing operating conditions or complex fault scenarios, making it difficult to guarantee stable diagnostic performance. With the development of data-driven methods, deep learning models have been gradually introduced into the field of circuit breaker fault diagnosis. They automatically extract high-dimensional features from raw signals in an end-to-end manner, improving feature representation capabilities to some extent. However, deep learning methods usually rely on large amounts of labeled data to achieve good performance and are prone to overfitting under small sample conditions. Furthermore, the learned features lack clear physical meaning, and different fault categories may still exhibit overlapping distributions in the feature space, leading to unclear classification boundaries.
[0004] To address the problem of limited sample sizes, prototype network methods based on meta-learning construct category prototypes and perform distance measurements to achieve rapid adaptation to new categories, alleviating the problem of insufficient data to some extent. However, these methods still primarily rely on numerical features for category differentiation, failing to adequately utilize the potential semantic information in fault signals. When fault feature distributions overlap and inter-class differences are not significant, relying on hard discrimination mechanisms can easily lead to unstable classification results, and the discriminativeness and robustness of prototype representations still have room for improvement.
[0005] On the other hand, Large Language Models (LLMs) possess strong capabilities in semantic representation and knowledge modeling. By transforming the statistical features and operational states of signals into structured descriptions and further mapping them to semantic embedding vectors, supplementary information can be provided for traditional numerical features, thereby enhancing the ability to distinguish between different fault categories. This approach offers a new way to alleviate the problem of blurred feature boundaries. For example, different types of faults exhibit certain regularities in statistical features, spectral distribution, and impact patterns, which can be expressed through structured descriptions. However, how to effectively introduce these engineering-significant descriptive information into the model and complement the original signal features has been a long-standing challenge. If the statistical features of signals can be transformed into semantic descriptions, and corresponding semantic representations can be obtained using large language models, and then jointly modeled with the original signal features, it is hoped that additional discriminative constraints can be introduced into the feature space, thereby alleviating the feature overlap problem and improving the model's generalization ability under small sample conditions.
[0006] Therefore, there is an urgent need for a fault diagnosis method that can integrate signal features and semantic information, while taking into account small sample learning ability and classification robustness, in order to meet the practical application needs of high-voltage circuit breakers in complex operating environments. Summary of the Invention
[0007] The purpose of this invention is to provide a circuit breaker fault diagnosis method based on a large language model and a fuzzy prototype network. By fusing signal features and semantic information, and taking into account both small sample learning ability and classification robustness, the method can achieve fault diagnosis of high-voltage circuit breakers.
[0008] The technical solution adopted by this invention to solve its technical problem is: a circuit breaker fault diagnosis method based on a large language model and a fuzzy prototype network, which includes the following steps.
[0009] S1. Multi-domain sequence feature encoding.
[0010] Multi-domain sequence feature encoding is used to process the original vibration signal. Three-way feature extraction is performed: time domain, frequency domain, and time-frequency domain. M is the number of sampling points. All three features retain the sequence dimension of length L of the time series. The three features are finally concatenated along the feature dimensions, and the output shape is as follows: Multi-domain temporal embedding matrix (1), where, For time-domain feature sequences; F env It is a frequency domain feature sequence; It is a time-frequency domain feature sequence.
[0011] S2.Episode-driven dynamic semantic generation.
[0012] Semantic embedding vectors of N categories in Episode Stack the sequences along the sequence dimension to construct a semantic feature sequence matrix. (2); where, This represents stacking N column vectors along the row direction to form a matrix; k∈{1,…,N}.
[0013] S3. Interaction between bidirectional attention and fuzzy membership.
[0014] Introducing a dual-path multi-head attention mechanism, to and The system uses both query and key values to achieve cross-modal feature alignment and mutual enhancement. It also parses the attention score matrix of temporal pairs into spatiotemporal fuzzy membership degrees, and completes feature alignment and fuzzy membership degree extraction in a unified module.
[0015] S4. Fuzzy Prototype Network Classification.
[0016] Construct fuzzy weighted prototypes and calculate the Euclidean distance between the query set samples and the fuzzy prototypes of each category. After Softmax normalization, the class probabilities are: (3) The final predicted category is: (4); among which, Indicates taking The category index k that reaches the maximum value; It represents an exponential function with the natural constant e as its base.
[0017] Furthermore, step S1 includes S1.1 temporal coding: stacking the hidden layer outputs of all time steps into a sequence matrix. , The hidden layer dimension is used; it is mapped to the target feature dimension through a trainable linear projection layer: (5); among which, The weight matrix of the linear projection layer; For the bias of the linear projection layer; This is a feature dimension that will be used uniformly by all subsequent modules.
[0018] Further, step S1 includes S1.2 frequency domain encoding: S1.2.1. Applying a Hilbert transform to x to obtain an analytic signal. (6); among which, Let x be the value of x at the t-th sampling point; j is the imaginary unit; S1.2.2. Extract the signal envelope using the Hilbert transform operator. (7) Perform a discrete Fourier transform on e(t) to obtain the envelope spectrum. (8); where f is the discrete frequency index; the first L frequencies are truncated starting from frequency f > 0. f The effective frequency amplitudes constitute the frequency domain feature vector. It is then expanded into a multi-channel sequence representation using a one-dimensional convolutional layer: (9); where the Conv1D core size is 1 and the number of output channels is .
[0019] Further, step S1 includes S1.3 time-frequency domain encoding: S1.3.1. Given the mother wavelet ψ(t), define the continuous wavelet transform of the signal x(t) as... (10); where W(a, b) are the wavelet coefficients at scale a and time b; ψ*(·) is the complex conjugate of the mother wavelet; S1.3.2. Top-K s Scale selection strategy calculation (11); among which, for transpose; To extract the top-K s The scaled energy submatrix; (12); Ks is a hyperparameter, taken as... ; This is a set of scale indices, sorted in descending order of scale-average energy, taking the first Ks indices. (13) This indicates taking the value at scale a. The indices of the top Ks scales with the largest values; Let a be the average energy of scale a over the time axis. (14); S(a, b) is the wavelet energy spectrum, (15), where As is the total number of scales; It is a linear projection matrix; For bias.
[0020] Furthermore, in step S2, (16); among which, Align the projection matrix with dimensions; This represents the original semantic embedding vector obtained after LLM encoding of the fault description text of type k; For bias.
[0021] Furthermore, in step S2, (17); among which, For frozen LLM encoders; Let be the hidden layer dimension of the LLM; The category description text for the k-th class.
[0022] Further, step S3 includes S3.1 temporal query semantics: in path A, a linear projection is applied to each input, transforming it into a query, key, and value representation: (18); (19); (20); among which, , , Let A be the learnable projection matrix of path A; The feature dimension for each attention head; h is the number of attention heads; Q A A query representation based on time-series features; K A Key representation for semantic features; V A The semantic features are represented by values; for the i-th attention head, i ∈ {1, …, h}, linear projection and attention computation are performed independently; the projection matrix of the i-th head is... The query, key, and value corresponding to the i-th attention head are as follows: (21); Calculate the scaled dot product attention score for the i-th head, and apply Softmax normalization after temperature hyperparameter adjustment to obtain the fuzzy membership matrix of the head. (22); where τ is the temperature hyperparameter, The transpose of the key matrix corresponding to the i-th head; the semantically enhanced temporal features output by the i-th head. (23); Concatenate the outputs of h heads along the feature dimension, and transform them using the output projection matrix to obtain the complete output of path A: (24); among which, To output the projection matrix; This represents the concatenation operation; the mean of the fuzzy membership matrices of all attention heads is taken to obtain the global fuzzy membership matrix: (25).
[0023] Further, step S3 includes S3.2 semantic query sequence: In path B, the query, key, value representation, and output of path B are respectively: (26); (27); (28); (29); among them, and Q is a learnable parameter independent of path B; B Query representation based on semantic features; K B Key representation of temporal features; V B The value is represented by the time series feature.
[0024] Furthermore, step S3 includes S3.3Out A Global mean compression: The semantic enhancement features from all time steps are averaged along the time dimension and aggregated into a single global representation: (30); for All columns in row l.
[0025] Furthermore, step S3 includes S3.4Out B Fuzzy weighted compression: S3.4.1 calculates the mean of Fuzzy_Map_A along the time dimension to obtain the global fuzzy membership weight vector of the current sample: (31); S3.4.2. Using weight vectors right Perform soft-weighted aggregation. (32).
[0026] Furthermore, step S3 includes S3.5 Learnable Gated Fusion: Introducing learnable gated vectors for adaptive fusion. (33); (34); among which, For gated projection matrix; The bias vector; each dimension of g independently controls the fusion ratio of the two features along that dimension; X fu These are the final multimodal fusion features fed into the classifier.
[0027] Further, in step S4, constructing the fuzzy weighted prototype includes: for the i-th support sample of class k in the Episode support set... Its fusion characteristics are The standard prototype network with equal weighted mean is: (35); A hybrid weighting mechanism is added to linearly interpolate the hard constraints of category labels with fuzzy soft weights: (36); where α is the learnable mixing coefficient; The relative fuzzy membership degrees predicted by the model; a fuzzy prototype is constructed using mixed weights. (37); among which, For the sample Mixed weights for the k-th class; It is a numerically stable term.
[0028] Furthermore, in step S4, (38), among which, It is an L2 norm; For samples in the query set The fusion features are obtained through a complete feedforward network.
[0029] Furthermore, in step S4, for each query set sample, the loss function is defined as: (39); where |Q| is the total number of samples in the query set; For query set samples The true category label; This represents the model's predicted probability for the true class.
[0030] The beneficial effects of this invention are as follows: Within an end-to-end few-sample framework, this invention integrates the multi-domain physical features of time-series signals with the domain semantic capabilities of a large language model. The fuzzy membership mechanism runs through three stages: First, in the bidirectional attention path A, the attention score is parsed into a spatiotemporal fuzzy membership matrix, achieving a unified feature alignment and fuzzy weight extraction; second, this fuzzy weight is repeatedly used for feature compression in path B, forming a cross-path information collaboration closed loop; third, the global fuzzy membership weight is further used for fuzzy prototype construction, reducing the interference of boundary aliasing samples on the category center. The cascading of the three-layer fuzzy mechanism endows the framework with effectiveness under the practical industrial challenges of fuzzy fault feature boundaries and scarce samples. By introducing semantic priors to constrain the feature space, this invention can effectively characterize the relationship between complex fault features and category semantics under few-sample conditions, reducing the impact of fuzzy boundary samples on classification results, thereby improving the accuracy and generalization ability of high-voltage circuit breaker fault diagnosis, and is suitable for intelligent diagnosis scenarios under novel faults and complex operating conditions. Attached Figure Description
[0031] Figure 1 This is a flowchart illustrating the diagnostic method of the present invention. Detailed Implementation
[0032] This invention proposes a few-shot high-voltage circuit breaker fault diagnosis method that integrates semantic features from a large language model with a fuzzy prototype network. This method extracts the original vibration signal into a multi-domain temporal feature sequence and deeply couples the physical features with the dynamically generated category semantic sequence under the current few-shot task through a cross-modal attention mechanism. The model calculates the correlation between temporal features and the semantics of each fault category through the cross-modal attention mechanism. This correlation can be represented as the degree of membership of each time position to different fault categories, providing a natural soft-assignment weight for subsequent fuzzy prototype construction, thereby significantly improving diagnostic robustness in few-shot scenarios with ambiguous feature boundaries.
[0033] The overall framework of this invention includes a multi-domain sequence feature encoder, an episode-driven dynamic semantic generation module, a bidirectional attention and fuzzy membership interaction module, and a fuzzy prototype network classifier. Specifically, the multi-domain sequence feature encoder extracts time-domain, frequency-domain, and time-frequency-domain features from the original vibration signal, concatenating them to output a unified-dimensional multi-domain temporal feature matrix; the episode-driven dynamic semantic generation module constructs category description text based on the current support set samples and extracts semantic embeddings using a pre-trained large language model; the bidirectional attention and fuzzy membership interaction module establishes a bidirectional interaction relationship between temporal and semantic features, simultaneously extracts a fuzzy membership matrix, compresses and aligns the dual-path sequence features into a one-dimensional global feature vector using fuzzy membership weights, and completes adaptive fusion through a learnable gating mechanism; the fuzzy prototype network classifier constructs category prototypes using fuzzy weights and completes classification using distance metrics. This invention first extracts multi-domain features from circuit breaker vibration signals, constructing a sequence feature representation containing time-domain, frequency-domain, and time-frequency-domain information. Simultaneously, within a meta-learning task framework, it constructs category description text based on the statistical features of support set samples and extracts corresponding semantic features using a pre-trained large language model, providing additional category prior constraints for small-sample scenarios. A bidirectional cross-modal attention mechanism is used to achieve interactive alignment between temporal and semantic features, and the attention weight is used as the soft attribution degree of samples to each category. Based on this, a fuzzy weighting strategy is introduced to construct category prototypes to improve the robustness of prototype representations, and fault category discrimination is achieved through distance metrics. Figure 1 As shown, the circuit breaker fault diagnosis method based on large language model and fuzzy prototype network of the present invention includes the following steps.
[0034] S1. Multi-domain sequence feature encoding.
[0035] Let the original vibration signal be Where M is the number of sampling points. Multi-domain sequence feature encoding is used to extract three features from the original vibration signal x, each retaining a sequence dimension of length L to allow subsequent multi-head attention mechanisms to interactively align local features at different time points. The three features are finally concatenated along the feature dimension, resulting in an output shape of... The multi-domain temporal embedding matrix.
[0036] S1.1. Time-domain coding.
[0037] Temporal coding employs a two-layer Long Short-Term Memory (LSTM) network to model the original vibration signal x, capturing short-term impact characteristics and long-term periodic dependencies within the signal. Unlike scalar pooling, this method preserves the hidden layer output sequences of the LSTM at all time steps to maintain the integrity of the spatial dimension.
[0038] The forward computation of LSTM at each time step t is defined as follows: (1); (2); (3); (4); (5); (6). Among them, f t The activation value for the forget gate; W is the Sigmoid activation function. f Here is the learnable weight matrix for the forget gate; This represents the hidden state of the previous time step; For hidden layer dimensions; b is the input signal value at time t; f i is the bias vector of the forget gate; t W is the activation value of the input gate; i b is the learnable weight matrix of the input gate; i The bias vector of the input gate; o t W is the activation value of the output gate. o b is the learnable weight matrix of the output gate; o This is the bias vector for the output gate; Candidate memory cell state; W c b is the learnable weight matrix for candidate memory units; c The bias vector for candidate memory cells; The state of the memory cell at time t; The ⊙ symbol represents the state of the memory unit from the previous time step; ⊙ represents element-wise multiplication. represents the hidden state at the current time; tanh is the hyperbolic tangent function.
[0039] Stack the hidden layer outputs of all time steps into a sequence matrix. Where L is the length of the time series, and it is mapped to the target feature dimension through a trainable linear projection layer: (7). Among them, The time-domain characteristics of the entire complete signal; The weight matrix of the linear projection layer; For the bias of the linear projection layer; This serves as a consistent feature dimension for use in all subsequent modules. This represents the local temporal characteristics of the signal at the l-th time step.
[0040] S1.2. Frequency domain coding.
[0041] Envelope spectrum analysis is a classic method for extracting modulated impulse components in fault diagnosis, directly reflecting the characteristic frequencies of circuit breaker fault vibrations. This invention, based on envelope spectrum extraction, constructs a frequency domain sequence while retaining the time series length L, enabling it to participate in subsequent multi-head attention interactions.
[0042] S1.2.1. Apply Hilbert transform to the original vibration signal x to obtain the analytic signal: (8). Among them, For the analytical signal, the real part is the original vibration signal, and the imaginary part is the Hilbert transform of the original vibration signal; Let x be the value of the original vibration signal at the t-th sampling point; j is the imaginary unit; For Hilbert transformation operators.
[0043] S1.2.2. Extracting the signal envelope (9) Perform a discrete Fourier transform on the envelope signal e(t) to obtain the envelope spectrum. (10). Where f is the discrete frequency index; This represents an exponential function with the natural constant e as the base. To eliminate DC interference, the DC term at f = 0 is removed, and the first L terms are truncated starting from frequency f > 0. f The effective frequency amplitudes constitute the frequency domain feature vector. Among them, L f The number of points is determined by the frequency domain. This is then expanded into a multi-channel sequence representation using a one-dimensional convolutional layer. (11). Among them, F env It is a frequency domain feature sequence; the Conv1D kernel size is 1, and the number of output channels is... This operation maps the discrete frequency points of the envelope spectrum to a high-dimensional feature space consistent with the length of the time-domain sequence, with each row corresponding to the feature representation of a frequency component, thus preserving the time series length L aligned with the time-domain sequence.
[0044] S1.3. Time-frequency domain coding.
[0045] Continuous wavelet transform (CWT) can simultaneously characterize the local properties of a signal on both the time and frequency axes, and has good time-frequency resolution for non-stationary impact signals generated by faults.
[0046] S1.3.1. Given a mother wavelet ψ(t), the continuous wavelet transform of the signal x(t) is defined as: (12). Among them, W(a, b) are the wavelet coefficients at scale a and time b, reflecting the local energy of the signal at that time-frequency position; a>0 is the scale parameter, which is inversely proportional to the frequency; b is the translation parameter, which represents the time position; ψ*(·) is the complex conjugate of the mother wavelet.
[0047] S1.3.2. Calculate the wavelet energy spectrum (13). Where As is the total number of scales.
[0048] Directly performing global mean pooling on the scale dimension would eliminate energy information from all frequencies, degrading CWT to an energy curve that only retains the time dimension. This would result in high redundancy with the time-domain output of LSTM, negating the core advantage of time-frequency joint analysis. Therefore, this invention employs a top-Ks scale selection strategy. Specifically, it sorts the scales by their average energy on the time axis, retaining the Ks scales with the most significant energy. These scales correspond to the main frequency bands of fault modulation, thus compressing the scale dimension while preserving the most discriminative frequency domain information. (14); (15); (16); (17). Among them, Let a be the average energy of scale a over the time axis; This is a set of scale indices, sorted in descending order of scale-average energy, taking the first Ks indices. This indicates taking the value at scale a. The indices of the top Ks scales with the largest values; To extract the energy submatrix after the top-Ks scale; It is a time-frequency domain feature sequence; for transpose; It is a linear projection matrix; The bias is used; Ks is a hyperparameter, taken as... . Each row corresponds to a joint energy representation of one time step across Ks major fault frequency bands, while preserving both the temporal structure and frequency domain discrimination information.
[0049] S1.4. Three-way sequence splicing.
[0050] The three feature sequences are concatenated along the feature dimensions to form a unified multi-domain temporal embedding matrix. (18). Among them, This indicates a splicing operation. Each of the three features occupies a certain percentage. This ensures a balanced contribution of features in the time domain, frequency domain, and time-frequency domain.
[0051] S2.Episode-driven dynamic semantic generation.
[0052] Within the meta-learning framework, both training and testing follow the N-way K-shot episode paradigm. Each subtask contains N fault categories, with K labeled support samples provided for each category. Additionally, Q samples are taken from each category to form a query set for evaluation. The query set for each episode contains a total of N×Q samples. To strictly adhere to the few-shot evaluation criterion and prevent global category information from leaking into the current subtask, the generation and semantic embedding of category text must be confined to the current episode and cannot reference sample statistics from outside the episode.
[0053] S2.1. Supports physical feature extraction.
[0054] For the K samples of class k in the current Episode support set, k∈{1,…,N}, first calculate the statistical and frequency domain physical characteristics of each sample, including the mean. ,variance Root mean square value Standard deviation Peak Peak-to-peak value , cliff skewness Peak factor Waveform factor Envelope spectrum dominant frequency and the amplitude of the dominant frequency of the envelope spectrum Where E(f) is the envelope spectrum amplitude.
[0055] S2.2. Dynamic text generation.
[0056] The average physical features of the K samples in the k-th class are calculated to obtain a representative physical feature description of that class in the current episode. This description is then dynamically embedded into a predefined diagnostic template to generate the category description text for the k-th class. The dynamic generation mechanism of this invention ensures that when encountering unknown fault categories during the testing phase, the model can still instantly construct category texts based on the measured data of the current support set, without relying on prior information in the training set.
[0057] S2.3.LLM Semantic Encoding and Dimension Alignment.
[0058] The description text of N categories in the current episode. Input a pre-trained large language model. During the inference phase, because the categories of the query set samples are unknown, the model cannot generate valid category description text for them; fault detection of the query set samples relies on their multi-domain temporal embedding matrix. With support set semantic feature sequence matrix Attentional interaction between LLMs is achieved without any text input. The LLM parameters remain frozen throughout training and inference, performing only forward computation to avoid catastrophic forgetting and significantly reduce computational overhead. The output of the last hidden layer corresponding to the description text of each category is extracted as the sentence-level semantic representation for that category. (19). Among them, This represents the original semantic embedding vector obtained after LLM encoding of the fault description text of type k; For frozen LLM encoders; This represents the hidden layer dimension of the LLM. Because... Feature dimensions used consistently in subsequent modules Potential inconsistencies can be addressed by projecting through a trainable linear-dimensional alignment layer: (20). Among them, This represents the updated semantic embedding vector; Align the projection matrix with dimensions; For bias.
[0059] S2.4. Semantic sequence matrix construction.
[0060] Stack the semantic embedding vectors of the N categories in the current episode along the sequence dimension to construct a semantic feature sequence matrix. (21). Among them, This represents stacking N column vectors into a matrix along the row direction. Each row of the semantic feature sequence matrix represents a global semantic prior vector for a specific fault category in the current subtask. The number of rows N in the semantic feature sequence matrix corresponds to the length of the key sequence in the attention mechanism, enabling efficient cross-modal attention computation between the temporal feature sequence and the semantic sequence in subsequent modules.
[0061] S3. Interaction between bidirectional attention and fuzzy membership.
[0062] By introducing a dual-path multi-head attention mechanism, a multi-domain temporal embedding matrix is used. and semantic feature sequence matrix The system uses both query and key values to achieve cross-modal feature alignment and mutual enhancement. It also parses the attention score matrix of temporal pairs into spatiotemporal fuzzy membership degrees, and completes feature alignment and fuzzy membership degree extraction in a unified module, avoiding logical overlap caused by introducing redundant sub-modules.
[0063] S3.1. Sequential query semantics.
[0064] In path A, multi-domain temporal embedding serves as the query, and semantic sequences serve as keys and values, driving the local temporal features at each time step to actively retrieve the most relevant category semantic information. First, a linear projection is applied to each input, transforming it into a query, key, and value representation: (twenty two); (twenty three); (24). Among them, , , Let A be the learnable projection matrix of path A; The feature dimension for each attention head; h is the number of attention heads; Q A A query representation based on time-series features; K A Key representation for semantic features; V A Values represent semantic features. The concepts of query, key, and value originate from the attention mechanism. Query is used to retrieve relevant information, key is used to match the query, and value is the weighted aggregation of the matched content.
[0065] In a multi-head attention mechanism, for the i-th attention head, i ∈ {1, …, h}, linear projection and attention computation are performed independently. The projection matrix of the i-th head is... The query, key, and value corresponding to the i-th attention head are represented as follows: (25).
[0066] Calculate the scaled dot product attention score for the i-th head, and apply Softmax normalization after temperature hyperparameter adjustment to obtain the fuzzy membership matrix of that head. (26). Among them, τ > 0 is the temperature hyperparameter, which controls the smoothness of the membership distribution: the larger τ is, the more uniform the distribution, and the smaller τ is, the more concentrated the distribution. In this invention, τ = 0.07 is taken; For matrix The element in the l-th row and k-th column represents the judgment of the i-th head pair signal belonging to the k-th fault type at time step l, satisfying the condition... ; It is the transpose of the key matrix corresponding to the i-th head.
[0067] The semantically enhanced temporal features output by the i-th head (27). Concatenate the outputs of h heads along the feature dimension, and transform them using the output projection matrix to obtain the complete output of path A: (28). Among them, To output the projection matrix; Indicates a splicing operation; Each row of the representation integrates the temporal local features of the current time step with the category information retrieved in the semantic space, and is an enhanced representation that carries both physical dynamics and semantic priors.
[0068] To provide a unified basis for feature compression and fuzzy prototype construction in subsequent path B, the fuzzy membership matrices of all attention heads are averaged to obtain the global fuzzy membership matrix: (29). Let be the comprehensive fuzzy membership degree of all head pairs belonging to the k-th type of fault at time step l.
[0069] S3.2. Semantic query timing.
[0070] In path B, the semantic sequence serves as the query, and multi-domain temporal embeddings serve as the key and value. This drives the global semantic prior of each category to actively retrieve relevant local impact features from the temporal signal of the current sample, thus achieving semantic absorption of temporal information. The query, key, and value representations, and the output of path B are as follows: (30); (31); (32); (33). Among them, and These are learnable parameters independent of path B and are not shared with parameters of path A. Each row corresponds to a fault category and is an enhanced semantic representation that incorporates specific temporal details of the current sample. Q B Query representation based on semantic features; K B Key representation of temporal features; V B The value is represented by the time series feature.
[0071] S3.3.Out A Global mean compression.
[0072] The output sequences of dual attention have different shapes: It is a time-series-dominated cross-modal feature sequence. This is a semantically driven cross-modal feature sequence. Before feature fusion, it needs to be aligned and compressed into a one-dimensional global feature vector representing the current sample. Then, adaptive fusion is performed.
[0073] Output for path A The semantic enhancement features from all time steps are averaged along the time dimension and aggregated into a single global representation: (34). for All columns in row l; It integrates the signal's response to category semantics at all time steps and is a global summary representation of the current sample retrieved from the semantic space from a temporal perspective.
[0074] S3.4.Out B Fuzzy weighted compression.
[0075] This contains response sequences of N categories to the temporal features of the current sample. If simple mean pooling is applied to the N categories, categories highly correlated and lowly correlated with the current sample will be treated equally, resulting in a loss of category discrimination information. Therefore, this invention utilizes the fuzzy membership matrix Fuzzy_Map_A generated by path A to... Perform differentiated compression.
[0076] S3.4.1. First, calculate the mean of Fuzzy_Map_A along the time dimension to obtain the global fuzzy membership weight vector of the current sample: (35). Let... For vectors The k-th element represents the average fuzzy membership degree of the current sample to the k-th type of fault in the time-series dimension, satisfying... The weight vector Extracting semantic meaning by taking the time average of temporal attention yields clear physical meaning: The larger the value, the more semantically similar the sample is to the k-th type of fault in terms of overall temporal features.
[0077] S3.4.2. Using weight vectors right Perform soft-weighted aggregation to highlight the category response that best matches the current sample: (36). This matrix multiplication is equivalent to multiplying the matrix by... N rows by fuzzy weight Perform a weighted summation. As the weight pair of the k-th class The row vector consisting of all elements in the k-th row Weighted summation yields the fused feature representation. The relationship between samples and categories was characterized from a semantic perspective, and was then aggregated with temporal features. They complement each other.
[0078] S3.5. Learnable gating fusion.
[0079] and Each emphasizes a different direction of cross-modal interaction. The optimal fusion ratio should depend on the signal quality and clarity of the class features of the current sample, rather than fixed weights. Therefore, a learnable gating vector is introduced for adaptive fusion: (37); (38). Among them, For gated projection matrix; The bias vector; each dimension of g independently controls the fusion ratio of the two features along that dimension; X fuThe final multimodal fusion features fed into the classifier carry cross-modal information from both temporal and semantic perspectives.
[0080] S4. Fuzzy Prototype Network Classification.
[0081] Traditional soft classifiers perform well with sufficient labeled data, but they are prone to overfitting or failing to generalize to new classes in industrial scenarios where samples of novel fault categories are scarce. Prototype networks, by constructing prototype representations for each category and classifying using distance metrics, naturally support scenarios with few samples. This invention introduces a fuzzy weighting mechanism on top of the standard prototype network, proposing a fuzzy prototype network. It uses the global fuzzy membership weight vector μ generated in step S3 to differentially weight the support set samples, improving the representativeness of the prototype in scenarios with fuzzy fault boundaries.
[0082] S4.1. Construction of fuzzy weighted prototype.
[0083] For the i-th support sample of class k in the support set S of Epiisode Let its fusion characteristics be Its global fuzzy membership degree to the k-th class The element is taken from the k-th element of the weight vector μ calculated for this sample in step S3.4. The standard prototype network's equal-weight mean prototype is: (39).
[0084] Because the feature vectors of samples with ambiguous fault boundaries may deviate from the class center, equal-weighted averaging will skew the prototype position, introducing classification error. However, if the model predictions are used directly... As the sole weight, in the early stages of training before μ converges, erroneous fuzzy weights will severely skew the prototype center, causing training instability. Therefore, this invention incorporates a hybrid weight mechanism, linearly interpolating the hard constraints of the class labels with the fuzzy soft weights: (40). Where α∈ [0, 1] are learnable mixing coefficients; 1 represents a hard constraint on the class label, ensuring that the support set samples always participate in the prototype construction of their true class with non-zero weights; This represents the relative fuzzy membership degree predicted by the model. In the early stages of training, α is relatively large, and the prototype remains stable primarily due to the label. As training progresses, the fuzzy weights gradually come into play, reducing the interference of boundary aliasing samples on the prototype. In the prototype formula... It only participates in the weighting as a static coefficient and does not participate in backpropagation, thus avoiding prototype drift caused by the self-referencing structure during the α decay in the later stage of training.
[0085] Constructing a fuzzy prototype with mixed weights (41). Among them, For the sample Mixed weights for the k-th class; The fusion characteristics are those obtained after passing through the complete feedforward network; This is a numerically stable term to prevent gradient explosion caused by a denominator of zero. Because... It always holds true, and the denominator is always strictly greater than K·α, thus eliminating the risk of numerical instability.
[0086] S4.2. Distance metric and class probability.
[0087] For samples in the query set Similarly, the fused features are obtained through a complete feedforward network. Calculate its Euclidean distance to each category of fuzzy prototype: (42). Among them, It is an L2 norm. The smaller the value, the better. In the feature space, the closer the distance is to the k-th class prototype, the higher the probability of the corresponding fault classification. The negative distance is then normalized to class probability using Softmax: (43).
[0088] The final predicted category is the category with the highest probability. (44). Among them, Indicates taking The category index k that reaches the maximum value. The entire network, except for the frozen LLM body, is optimized end-to-end using cross-entropy loss within the Episode framework. For each query set sample in each Episode, the loss function is defined as: (45). Where |Q| is the total number of samples in the query set; For query set samples The true category label; This represents the model's predicted probability for the true class. The gradient updates the trainable parameters in the network via backpropagation: the parameters of the three-way encoder, the LLM dimension alignment layer, and the projection matrices of the bidirectional attention layer. The parameters of the LLM are frozen throughout the process and do not participate in gradient updates.
[0089] Thus, this invention integrates the multi-domain physical features of time-series signals with the domain semantic capabilities of a large language model within an end-to-end, low-sample framework. The fuzzy membership mechanism runs through three stages: First, in bidirectional attention path A, the attention score is parsed into a spatiotemporal fuzzy membership matrix, achieving a unified approach to feature alignment and fuzzy weight extraction; second, this fuzzy weight is repeatedly used for feature compression in path B, forming a cross-path information collaboration loop; third, the global fuzzy membership weight is further used for fuzzy prototype construction, reducing the interference of boundary aliasing samples on the category center. The cascading of these three fuzzy mechanisms endows the framework with effectiveness in real-world industrial challenges such as fuzzy fault feature boundaries and scarce samples.
Claims
1. A circuit breaker fault diagnosis method based on a large language model and fuzzy prototype network, characterized in that, Includes the following steps: S1. Multi-domain sequence feature encoding; Multi-domain sequence feature encoding is used to extract features from the original vibration signal x in the time domain, frequency domain, and time-frequency domain to obtain the time domain feature sequence. Frequency domain feature sequence F env and time-frequency domain feature sequences All three features retain a sequence dimension of length L from the time series. Concatenating the three features along their respective feature dimensions yields an output shape of... Multi-domain temporal embedding matrix (1), Indicates a splicing operation; For feature dimensions; S2.Episode-driven dynamic semantic generation; Semantic embedding vectors of N categories in Episode Stack the sequences along the sequence dimension to construct a semantic feature sequence matrix. (2); where, This represents stacking N column vectors along the row direction to form a matrix; k∈{1,…,N}; S3. Interaction between bidirectional attention and fuzzy membership; Introducing a dual-path multi-head attention mechanism, to and The system uses mutual queries and keys to achieve cross-modal feature alignment and mutual enhancement, while parsing the attention score matrix of temporal pairs into spatiotemporal fuzzy membership degrees, and completing feature alignment and fuzzy membership degree extraction in a unified module. S4. Fuzzy Prototype Network Classification; Construct fuzzy weighted prototypes and calculate the Euclidean distance between the query set samples and the fuzzy prototypes of each category. After Softmax normalization, the class probabilities are: (3) The final predicted category is: (4); among which, Indicates taking The category index k that reaches the maximum value; This represents an exponential function with the natural constant e as its base.
2. The circuit breaker fault diagnosis method based on a large language model and fuzzy prototype network according to claim 1, characterized in that, Step S1 includes S1.1 temporal coding: stacking the hidden layer outputs of all time steps into a sequence matrix. , The hidden layer dimension is used; it is then mapped to the target feature dimension through a trainable linear projection layer, resulting in... (5); among which, The weight matrix of the linear projection layer; This is the bias of the linear projection layer.
3. The circuit breaker fault diagnosis method based on a large language model and fuzzy prototype network according to claim 2, characterized in that, Step S1 includes S1.2 frequency domain coding: S1.2.1 Applying a Hilbert transform to x to obtain an analytic signal. (6); among which, Let x be the value of x at the t-th sampling point; j is the imaginary unit; The Hilbert transform operator is used; S1.2.2 Extract the signal envelope. (7) Perform a discrete Fourier transform on e(t) to obtain the envelope spectrum. (8); where f is the discrete frequency index; M is the number of sampling points; the first L samples are truncated from frequency f >
0. f The effective frequency amplitudes constitute the frequency domain feature vector. It is then expanded into a multi-channel sequence representation using a one-dimensional convolutional layer: (9); where the Conv1D core size is 1 and the number of output channels is .
4. The circuit breaker fault diagnosis method based on a large language model and fuzzy prototype network according to claim 3, characterized in that, Step S1 includes S1.3 time-frequency domain coding: S1.3.
1. Given the mother wavelet ψ(t), define the continuous wavelet transform of the signal x(t) as follows: (10); where W(a, b) are the wavelet coefficients at scale a and time b; ψ*(·) is the complex conjugate of the mother wavelet; S1.3.
2. Top-K s Scale selection strategy calculation (11); among which, for transpose; To extract the top-K s The scaled energy submatrix; (12); Ks is a hyperparameter, taken as... ; This is a set of scale indices, sorted in descending order of scale-average energy, taking the first Ks indices. (13) This indicates taking the value at scale a. The indices of the top Ks scales with the largest values; Let a be the average energy of scale a over the time axis. (14); S(a, b) is the wavelet energy spectrum, (15), where As is the total number of scales; It is a linear projection matrix; For bias.
5. The circuit breaker fault diagnosis method based on a large language model and fuzzy prototype network according to claim 4, characterized in that, In step S2, (16); among which, Align the projection matrix with dimensions; This represents the original semantic embedding vector obtained after LLM encoding of the fault description text of type k; For bias.
6. The circuit breaker fault diagnosis method based on a large language model and fuzzy prototype network according to claim 5, characterized in that, In step S2, (17); among which, For frozen LLM encoders; Let be the hidden layer dimension of the LLM; The category description text for the k-th class.
7. The circuit breaker fault diagnosis method based on a large language model and fuzzy prototype network according to claim 6, characterized in that, Step S3 includes S3.1 temporal query semantics: In path A, a linear projection is applied to each input, transforming it into a query, key, and value representation: (18); (19); (20); among which, , , Let A be the learnable projection matrix of path A; The feature dimension for each attention head; h is the number of attention heads; Q A A query representation based on time-series features; K A Key representation for semantic features; V A The semantic features are represented by values; for the i-th attention head, i ∈ {1, …, h}, linear projection and attention computation are performed independently; the projection matrix of the i-th head is... The query, key, and value corresponding to the i-th attention head are as follows: (21); Calculate the scaled dot product attention score for the i-th head, and apply Softmax normalization after temperature hyperparameter adjustment to obtain the fuzzy membership matrix of the head. (22); where τ is the temperature hyperparameter, The transpose of the key matrix corresponding to the i-th head; the semantically enhanced temporal features output by the i-th head. (23); Concatenate the outputs of h heads along the feature dimension, and transform them using the output projection matrix to obtain the complete output of path A: (24); among which, To output the projection matrix; average the fuzzy membership matrices of all attention heads to obtain the global fuzzy membership matrix: (25).
8. The circuit breaker fault diagnosis method based on a large language model and fuzzy prototype network according to claim 7, characterized in that, Step S3 includes S3.2 semantic query timing: In path B, the query representation is Q. B , key represents K B The value represents V. B and path B output Out B They are respectively: (26); (27); (28); (29); among them, and These are learnable parameters independent of path B.
9. The circuit breaker fault diagnosis method based on a large language model and fuzzy prototype network according to claim 8, characterized in that, Step S3 includes S3.3Out A Global mean compression: The semantic enhancement features from all time steps are averaged along the time dimension and aggregated into a single global representation: (30); for All columns in row l.
10. The circuit breaker fault diagnosis method based on a large language model and fuzzy prototype network according to claim 9, characterized in that, Step S3 includes S3.4Out B Fuzzy weighted compression: S3.4.1 calculates the mean of Fuzzy_Map_A along the time dimension to obtain the global fuzzy membership weight vector of the current sample: (31); S3.4.
2. Using weight vectors right Perform soft-weighted aggregation. (32).
11. The circuit breaker fault diagnosis method based on a large language model and fuzzy prototype network according to claim 10, characterized in that, Step S3 includes S3.5 Learnable Gated Fusion: Introducing learnable gated vectors for adaptive fusion. (33); (34); among which, For gated projection matrix; The bias vector; each dimension of g independently controls the fusion ratio of the two features along that dimension; X fu These are the final multimodal fusion features fed into the classifier.
12. The circuit breaker fault diagnosis method based on a large language model and fuzzy prototype network according to claim 11, characterized in that, In step S4, constructing the fuzzy weighted prototype includes: for the i-th support sample of class k in the Episode support set... Its fusion characteristics are The standard prototype network with equal weighted mean is: (35); A hybrid weighting mechanism is added to linearly interpolate the hard constraints of category labels with fuzzy soft weights: (36); where α is the learnable mixing coefficient; The relative fuzzy membership degrees predicted by the model; a fuzzy prototype is constructed using mixed weights. (37); among which, For the sample Mixed weights for the k-th class; It is a numerically stable term.
13. The circuit breaker fault diagnosis method based on a large language model and fuzzy prototype network according to claim 12, characterized in that, In step S4, (38), among which, It is an L2 norm; For query set samples The fusion features are obtained through a complete feedforward network.
14. The circuit breaker fault diagnosis method based on a large language model and fuzzy prototype network according to claim 13, characterized in that, In step S4, for each query set sample, the loss function is defined as: (39); where |Q| is the total number of samples in the query set; For query set samples The true category label; This represents the model's predicted probability for the true class.
Citation Information
Patent Citations
Industrial fault diagnosis method based on large language model and time sequence feature fusion
CN121919758A
Two-stage multi-mode bearing fault diagnosis method based on pre-training large model
CN121959109A