Motor Fault Diagnosis Method Based on LLM and Three-Level D3QN

The motor fault diagnosis method based on multimodal feature fusion and three-level reinforcement learning hierarchical decision-making solves the problems of low recognition accuracy and lack of interpretability of diagnostic results in existing technologies. It achieves hierarchical and accurate diagnosis of motor faults and interpretable output, adapts to independent fault samples, and improves diagnostic accuracy and practicality.

CN123115986APending Publication Date: 2026-11-17HUNAN NORMAL UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611394159.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-09
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

Existing motor fault diagnosis technologies suffer from problems such as low recognition accuracy with small samples, inability to perform hierarchical diagnosis, the inability of reinforcement learning to adapt to independent fault samples due to temporal constraints, and the lack of natural language interpretation for diagnostic results.

Method used

This paper adopts a collaborative technical solution that combines multimodal feature fusion, LLM lightweight coding, three-level reinforcement learning hierarchical decision-making, few-sample feature enhancement, adaptive reward optimization, and interpretable text generation. Through the progressive cooperation of multiple modules, a dual-branch input architecture of text and image is constructed. It integrates the prior text knowledge of motor operation and maintenance experts with the fault features of multiple vibration spectrums, builds a three-level progressive D3QN agent architecture, cancels the Markov time-series state transition assumption, sets a reinforcement learning discount factor, constructs a multi-component composite reward function, and configures a hierarchical independent priority experience replay mechanism to achieve hierarchical accuracy and interpretable output of fault diagnosis.

Benefits of technology

It achieves hierarchical and accurate diagnosis and interpretable output of motor faults under small sample conditions, improving diagnostic accuracy and practicality. It is adapted to independent fault samples, enhancing robustness to small samples and interpretability of diagnostic results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123115986A_ABST
    Figure CN123115986A_ABST
Patent Text Reader

Abstract

This invention proposes a motor fault diagnosis method based on LLM and a three-level D3QN, belonging to the interdisciplinary fields of intelligent motor fault diagnosis, large-scale models, and reinforcement learning. This invention extracts multi-source fault features through text-image multimodal fusion, obtains a unified basic state vector by fine-tuning LLM encoding using LoRA, constructs a three-level progressive D3QN agent to achieve hierarchical fault determination, designs a prototype-memory-uncertainty three-branch small-sample enhancement module, sets a discount factor to remove reinforcement learning temporal constraints, and adapts to independent fault samples; constructs a multi-component composite reward function, combines hierarchical priority experience replay with a multi-objective joint loss optimization network, and finally outputs interpretable diagnostic text through an LLM decoder. This invention solves the problems of weak generalization ability, inability to perform hierarchical diagnosis, and poor model interpretability of traditional methods, improving the accuracy and engineering practicality of motor fault diagnosis under small-sample operating conditions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of intelligent detection of motor faults, large language model and deep reinforcement learning, specifically involving a motor fault diagnosis method based on LLM (Large Language Model) and three-level D3QN (Dueling Double Deep QNetwork). Background Technology

[0002] As a core power component of industrial control equipment and wind power equipment, electric motors experience frequent failures in critical components such as bearings, rotors, and stators. Accurate fault diagnosis is a crucial aspect of equipment operation and maintenance. Current mainstream motor fault diagnosis solutions have several technical shortcomings: 1. Traditional machine learning-based fault diagnosis relies on manually designed time-frequency domain features. Feature selection is highly dependent on engineers' experience and has poor generalization performance. Fault diagnosis based on deep learning requires a massive number of labeled fault samples. In scenarios with few rare faults such as bearing cage failure and rotor bar breakage, overfitting is very likely to occur, resulting in a significant decrease in diagnostic accuracy. 2. Existing deep reinforcement learning fault diagnosis algorithms follow the Markov temporal state transition assumption, requiring samples to have continuous temporal correlation. However, in motor faults, each group of sampled samples is independent and has no physical temporal transition relationship, so conventional DQN / D3QN algorithms cannot be directly applied. 3. Existing fault diagnosis models are mostly single-level classification networks, which can only output the final fault type at one time. They cannot perform hierarchical diagnosis of "fault status - fault location - subdivided fault type", resulting in weak fault tracing capabilities. 4. Most intelligent diagnostic models are black-box models, which only output fault labels and cannot output fault causes and maintenance suggestions in natural language. The diagnostic results have poor interpretability and are difficult to meet the needs of industrial field operation and maintenance.

[0003] Therefore, there is an urgent need for an intelligent diagnostic method for motor faults that can adapt to independent fault samples, support hierarchical progressive diagnosis, have strong robustness to small samples, and have built-in diagnostic interpretation capabilities. Summary of the Invention

[0004] The purpose of this application is to provide a motor fault diagnosis method based on LLM and three-level D3QN, which overcomes the technical defects of existing motor fault diagnosis technologies, such as low recognition accuracy in small samples, inability to perform hierarchical diagnosis, the inability of reinforcement learning to adapt to independent fault samples due to temporal constraints, and the lack of natural language interpretation of diagnosis results. This method enables hierarchical and accurate diagnosis of motor faults and interpretable output under small sample operating conditions.

[0005] To address the aforementioned technical problems, this invention provides a motor fault diagnosis method based on LLM and three-level D3QN. It employs a collaborative technical solution involving multimodal feature fusion, lightweight LLM encoding, three-level reinforcement learning hierarchical decision-making, few-sample feature enhancement, adaptive reward optimization, and interpretable text generation. This multi-module progressive approach addresses the pain points of existing technologies, including: A dual-branch multimodal input architecture combining text and images is constructed, integrating prior textual knowledge from motor maintenance experts with fault features from multiple vibration spectra. This addresses the shortcomings of missing single-modal information and insufficient identification of fault features in small samples. The text branch relies on structured prompts to solidify professional knowledge such as motor fault mechanisms and diagnostic rules, and obtains standardized textual expert features through LLM encoding. The image branch collects four types of complementary fault spectra, and performs feature denoising and aggregation through a lightweight visual encoder and multi-head attention mechanism. This fully mines multi-dimensional fault information in the time domain, frequency domain, and time-frequency domain of vibration signals, and obtains cross-modal fusion features through feature concatenation. This enables complementary use of textual and graphical modal information, enhancing the completeness of fault characteristic representation. Based on the cross-modal fusion features We employ an LLM backbone freezing + LoRA adapter lightweight fine-tuning strategy, which completes fault scenario adaptation with only a small number of adapter parameters, retains the general prior knowledge of the large model, adapts to small sample datasets of motors, and obtains a unified general diagnostic state vector through global pooling. This provides standardized input for subsequent hierarchical reinforcement learning decisions. The state vector The three-level progressive D3QN intelligent agent architecture is constructed and replicates the hierarchical diagnostic logic of "judging the fault, determining the location, and subdividing the type" in manual fault diagnosis. It solves the problem that traditional single-level classification models cannot trace the source of faults. Through the input mechanism of embedding and splicing the decision actions of the upper level, it realizes the information linkage of diagnostic tasks at all levels. It relies on the shared encoder to complete feature purification and adapt to the differentiated needs of hierarchical diagnosis. The basic characterization of the fault The prototype-memory-uncertainty three-branch collaborative enhancement module addresses the technical problem of low accuracy in identifying rare faults with small samples. It dynamically enhances the ability to represent fault features with small samples by matching standard fault features with the prototype library, supplementing rare features by aggregating historical samples, and adaptively adjusting the fusion weights by quantifying uncertainty, thus balancing the model's accuracy in identifying common and rare faults. By removing the Markov temporal state transition assumption and setting the reinforcement learning discount factor γ=0, the traditional temporally dependent D3QN is transformed into an instantaneous supervised learning framework, which is adapted to the independent and disordered engineering characteristics of motor fault samples. Relying on the dueling advantage decomposition structure to separate state value and action advantage, the value estimation bias of hierarchical decision-making is reduced. Combined with the target network soft update mechanism, the model training oscillation is avoided and the decision stability is improved. A multi-component composite reward function is constructed to address the problems of the traditional single reward mechanism, such as a single optimization orientation, high missed detection rate of minority faults, and insufficient constraints on high-risk faults. The accuracy of the diagnostic foundation at each level is constrained by hierarchical basic reward and punishment constraints, the ability to identify rare faults is improved by minority fault compensation rewards, and the risk of missed detection of major faults in industrial equipment is strictly controlled by the high-risk fault punishment mechanism. This adaptively guides the three-level intelligent agent to converge accurately. A hierarchical, independent, and priority experience playback mechanism is configured to avoid hierarchical data interference. Combined with a multi-objective joint loss function, diagnostic accuracy, small sample robustness, and text generation capabilities are optimized synchronously. Relying on an LLM decoder, the fault diagnosis results are output in natural language that can be interpreted, thus breaking down the barriers between intelligent diagnosis and industrial operation and maintenance.

[0006] Optionally, the multimodal image preprocessing and LLM lightweight fine-tuning include: To adapt to neural network input standards and reduce model training overhead, this invention normalizes the size of various fault maps and reuses the weights of ImageNet pre-trained visual models. It only fine-tunes shallow features to adapt to fault scenarios, reducing the number of training parameters. To address the problem of overfitting when fine-tuning small samples of motor faults, the LLM backbone parameters are frozen throughout the process, and scene adaptation is completed only through the LoRA adapter. By fixing the rank and using a dedicated learning rate, lightweight and high-precision feature encoding is achieved, balancing model generalization ability and training efficiency. At the same time, a multi-head attention mechanism is used to weightedly fuse visual features from different fault maps, and the scale of the low-rank parameters of LoRA is fixed, enabling lightweight and collaborative adaptation of visual feature extraction and large model encoding processes.

[0007] Optionally, the iterative optimization of the three-branch few-shot enhancement module includes: The fault prototype library is initialized using a normal distribution random method. Typical fault features are matched by calculating the similarity between the input fault base representation and the prototype vector. The memory library maintains historical fault samples using a first-in-first-out elimination mechanism. Relevant historical representations are obtained through nearest neighbor retrieval and weighted aggregation. To address the issues of high uncertainty and significant feature drift in small-sample fault representations, the uncertainty index of the representation is calculated through multiple random inactivation predictions. The fusion ratio of enhanced features and safety representations is dynamically adjusted based on the uncertainty results to improve the identification capability of scarce fault samples.

[0008] Optionally, the adaptive optimization of the hierarchical composite reward includes: In industrial settings, minority fault samples in motors are scarce, making model learning difficult. Conventional reward and punishment mechanisms can easily lead to models biased towards common fault identification. Therefore, this invention sets up a continuous identification compensation mechanism for minority faults. Incremental rewards guide the model to continuously learn scarce fault features. At the same time, to address the engineering pain point of missing high-risk faults such as rotor bar breakage, a dedicated severe penalty mechanism is added. Through differentiated reward and punishment gradients, the accuracy of fault judgment, location, and type subdivision is constrained at each level, aligning with the actual safety needs of industrial operation and maintenance. The composite reward consists of three parts: hierarchical basic reward, small sample compensation reward, and high-risk fault misjudgment penalty. These are applied to the first-level fault judgment, second-level location, and third-level fault subdivision processes, respectively, to achieve differentiated optimization at different diagnostic stages.

[0009] Optionally, the optimization of the priority experience replay sampling and model iteration termination includes: Each agent is equipped with an independent experience replay pool, pre-filled with expert experience to provide initial high-quality samples for model training, accelerating model convergence. By using linearly increasing importance sampling weights, the sample distribution bias caused by priority sampling is gradually offset, ensuring training stability. This invention sets dual training termination conditions, ensuring sufficient model training while avoiding overfitting caused by excessive iteration, accurately locking in optimal model parameters to meet the needs of industrial engineering implementation. Furthermore, sampling priority is determined based on the TD error corresponding to the experience samples, and a joint optimization objective is constructed by integrating reinforcement learning diagnostic loss, few-sample consistency loss, and LLM text interpretation loss, achieving simultaneous improvement in diagnostic performance, few-sample robustness, and result interpretability.

[0010] This invention employs multimodal image-text fusion combined with LLM to achieve deep encoding of fault features, relies on a three-level hierarchical D3QN to complete tiered fault diagnosis, enhances the representation capability of fault features in small samples through a prototype-memory-uncertainty three-branch module, eliminates the temporal constraints of traditional reinforcement learning, adapts to independent fault samples, and uses multi-dimensional composite rewards to accurately guide hierarchical decision optimization. It also combines a multi-objective loss function to collaboratively train the diagnostic network and the LLM interpretation module, and finally outputs fault diagnosis results with natural language descriptions, significantly improving the accuracy and practicality of motor fault diagnosis under small sample operating conditions. Attached Figure Description

[0011] To more clearly illustrate the technical solutions of the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art 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.

[0012] Figure 1 A schematic diagram of the overall framework of the motor fault diagnosis method based on LLM and three-level small sample enhancement D3QN provided in the embodiments of the present invention; Figure 2 The block diagram of the single-level D3QN agent combined with the prototype-memory-uncertainty small-sample reinforcement module structure of the motor fault diagnosis method based on LLM and three-level few-sample reinforcement D3QN provided in the embodiments of the present invention is shown. Figure 3 A schematic diagram of the multimodal text + image feature fusion module structure of the motor fault diagnosis method based on LLM and three-level few-sample enhancement D3QN provided in the embodiments of the present invention; Figure 4 This is a schematic diagram of the three-level intelligent agent's step-by-step fault decision-making flow logic for the motor fault diagnosis method based on LLM and three-level small-sample augmented D3QN provided in the embodiments of the present invention. Figure 5 This is a schematic diagram of the average reward change curve during the D3QN reinforcement learning training process of the motor fault diagnosis method based on LLM and three-level few-shot reinforcement D3QN provided in the embodiments of the present invention. Figure 6 The bar chart shows a comparison of the small-sample fault diagnosis performance of the motor fault diagnosis method based on LLM and three-level small-sample enhanced D3QN provided in the embodiments of the present invention with that of different fault diagnosis methods. Figure 7 The bar chart shows the performance results of the three-level hierarchical diagnosis method for motor fault diagnosis based on LLM and three-level small sample enhanced D3QN provided in the embodiments of the present invention. Detailed Implementation

[0013] To enable those skilled in the art to better understand the present invention, the invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. Obviously, the described embodiments are merely some embodiments of the present invention, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.

[0014] like Figure 1 As shown, Figure 1 The diagram below illustrates the overall framework of the motor fault diagnosis method based on LLM and three-level D3QN provided in this embodiment of the invention. The method consists of six progressive execution steps, from S1 to S6, and relies on multimodal fusion, LLM encoding, and three-level reinforcement learning decision linkage to complete hierarchical interpretable fault diagnosis.

[0015] S1: Multimodal input and image-text fusion, fusing motor textual expert priors and four types of vibration spectrum features to obtain standardized cross-modal fusion features.

[0016] It should be noted that most existing motor fault diagnosis methods rely solely on a single vibration spectrum for feature analysis, ignoring prior textual information from maintenance experts. The lack of modal information leads to low identification of scarce fault features. Furthermore, a single time-frequency spectrum cannot simultaneously account for both time-domain impact and frequency-domain resonance fault features. This invention constructs a parallel extraction architecture combining text and images, complementing modal information and adapting to the extraction of weak fault features from small samples. This step specifically includes four sub-steps.

[0017] Step 11: Text branch feature embedding construction. Standardized structured Prompt text is manually written. The Prompt contains four types of expert prior information: motor component parameters, fault vibration mechanism, hierarchical diagnosis and judgment rules, and on-site working conditions. The structured Prompt is input into the LLM word segmentation embedding layer to complete word vector encoding and output fixed-dimensional text features. The feature dimensions satisfy equation (1): , in, This embodiment sets a fixed dimension for LLM text embedding. .

[0018] Step 12: Parallel extraction of multiple image spectra. The original time-series data of vibration at the bearing, rotor, and stator of the motor are collected by the vibration acceleration sensor. The data are preprocessed to generate four types of fault characterization spectra, namely the original time-series waveform, envelope spectrum, resonance demodulation spectrum, and EWT adaptive time-frequency decomposition spectrum. The four types of spectra are scaled and normalized and then sent to the DeiT-Tiny lightweight visual encoder to output four independent image features in parallel, satisfying equation (2): , in, For time-series waveform characteristics, For envelope spectrum features, For resonance demodulation characteristics, EWT time-frequency characteristics; For single-channel image feature dimensions, this embodiment sets... .

[0019] Step 13: Multi-head attention visual feature aggregation, construct an 8-head multi-head attention module, adaptively learn the feature weights of four types of fault maps, weaken redundant and noisy features, and obtain globally unified visual features through weighted aggregation. This enables noise reduction and fusion of features from the same image source.

[0020] Step 14: Cross-modal feature vector concatenation and fusion. The text expert features and aggregated visual features are concatenated dimensionally to generate the final multimodal fusion features. The fusion operation formula is shown in equation (3): , in, The horizontal concatenation operator for vectors represents directly merging the feature dimensions before and after concatenation. For the final image-text fusion feature, the total dimensions are fixed at 960.

[0021] Based on the above discussion, in an optional embodiment of the present invention, S1 specifically includes: In an optional embodiment of S1, the image map normalization size is uniformly 224×224 pixels, the number of multi-head attention heads is fixed at 8, the DeiT-Tiny encoder loads ImageNet pre-trained weights, and only fine-tunes some parameters of the feature extraction layer at the end of the visual encoder to reduce the computational cost of image branch training.

[0022] S2: The LLM coding layer with LoRA fine-tuning refines and fuses features, outputting a unified basic state vector shared by three-level agents.

[0023] It should be noted that traditional fault diagnosis uses full parameter fine-tuning after connecting to a large model, which is prone to overfitting under small sample conditions and has a huge computational cost. This invention adopts a lightweight optimization strategy of LLM backbone freezing and LoRA adapter fine-tuning only, which retains the prior knowledge of industrial faults in the large model, while adapting to small sample datasets of motors to achieve deep purification of multimodal features. This step specifically includes 3 sub-steps.

[0024] Step 21: Modality fusion feature input, inputting the multimodal fusion features obtained from equation (3) The LLM Transformer encoding layer with frozen backbone weights is fed in, and only the built-in LoRA adapter is enabled to participate in the forward propagation calculation.

[0025] Step 22: Output the hidden state of the Transformer, and output the two-dimensional hidden state matrix using LLM encoding. The dimension constraint is as shown in equation (4): , in, To encode the hidden state sequence; The length of the feature sequence; This represents the dimension of the hidden layer within the LLM.

[0026] Step 23: Global pooling dimensionality reduction is used to obtain the environment state vector. The hidden state sequence output by LLM encoding is compressed by global average pooling to obtain the basic environment state vector that can be shared by the three-level D3QN agent. The calculation formula is as shown in equation (5): , in, This is a global average pooling operation; This is the diagnostic baseline state vector; For pooling output dimensions, this embodiment sets a fixed value. .

[0027] Based on the above discussion, in an optional embodiment of the present invention, S2 specifically includes: In an optional embodiment of S2, the LLM built-in LoRA rank hyperparameter is set to 8, and the LoRA learning rate is set separately to... In the LLM backbone Transformer, all parameters are frozen and do not participate in gradient updates.

[0028] S3: Construct a three-level progressive D3QN agent for hierarchical fault decision-making, and use a three-branch module to enhance small sample features and modify the discount factor to adapt to independent fault samples.

[0029] It should be noted that: First, traditional DQN / D3QN reinforcement learning relies on the Markov time transition assumption, requiring samples to have temporal correlations. However, individual fault samples in a motor are independent and cannot meet the temporal constraints. Second, existing diagnostic models use single-level classification, which cannot replicate the manual "fault diagnosis - location determination - subdivision of type" repair logic. Third, small sample sizes and scarce fault representations are insufficient, and the model tends to favor broad-category fault identification. This invention sets up a three-level independent D3QN, three-branch feature enhancement, and sets... By abandoning timing constraints and comprehensively addressing the aforementioned pain points, this step specifically includes 7 sub-steps.

[0030] Step 31: Divide the action space of the intelligent agent into levels and gradually narrow the diagnostic scope. The three-level action space is divided as follows: Level 1 intelligent agent action space, completes the binary determination of whether the fault exists; Level 2 intelligent agent action space, completes the location of the fault installation location; Level 3 intelligent agent action space, completes the fine subdivision of the corresponding fault type for the fault location determined by Level 2.

[0031] Step 32: Differentiate the input states of each level of intelligent agent, and splice the action embedding based on the diagnostic results of the upper level to realize hierarchical information linkage. The state construction rules are as follows (6): , Where s is the basic state vector obtained by LLM encoding, and St is the input state of the t-th level D3QN agent. , These are the learnable embedding vectors corresponding to the first-level and second-level output actions, respectively. It is a 16-dimensional all-zero placeholder vector, with the embedding dimension uniformly set. It stores semantic information related to higher-level decision-making.

[0032] Step 33: Shared encoder feature mapping. Each level of the agent shares a two-layer MLP shared encoder, with the input level state as the input. Feature extraction is performed to output a low-dimensional fault representation. The calculation formula is as shown in equation (7): , in, The encoder uses a shared encoder mapping function; the encoder structure is a 144→64→64 two-layer MLP, with ReLU as the activation function, and a BatchNorm normalization layer followed by a Dropout regularization layer with a deactivation coefficient of 0.2 in series at the back end to prevent overfitting on small samples.

[0033] Step 34: Prototype-Memory-Uncertainty three-branch small sample feature enhancement, three-branch parallel operation followed by gating fusion to supplement scarce fault features: (1) Prototype branch: maintenance capacity Learnable Fault Prototype Library The cosine similarity between the basic representation and the prototype library is calculated using the formula (8): , in, This is a vector cosine similarity operation. The higher the similarity, the closer the current sample is to the typical fault prototype. (2) Memory Branch: Maintain a memory database with a maximum capacity of 2000 historical fault samples, and retrieve them. KNN nearest neighbor samples are used to aggregate historical features by introducing temperature coefficient weighting. The aggregation formula is as shown in equation (9): , in, Weights are assigned to nearest neighbor samples; The temperature coefficient is used to adjust the smoothness of the weight distribution. (3) Uncertainty branch: Dual-path Dropout forward propagation to calculate model prediction variance Solve for the fusion gating coefficient , The Sigmoid activation function is used; finally, the enhanced features and the safety representation of normal samples are fused to obtain the final decision representation, and the fusion formula is as shown in equation (10): , in, Enhance features by fusing prototype and memory; To pre-train a fixed safety representation for all normal motor samples and avoid model misjudgment of faults.

[0034] Step 35: Decompose the value advantage flow of the Dueling structure to calculate the action Q value, distinguish between global fault value and single action advantage, and improve the stability of hierarchical decision-making. The Q value calculation formula is as shown in equation (11): , in, The global state value of the fault; The dominant value for a single diagnostic action; This represents the set of actions of the k-th level agent. This represents the number of actions in the action space of the k-th level agent.

[0035] Step 36: Target network soft update and exploration strategy settings. The target network is not directly copied, but uses a smooth soft update method. The update formula is as shown in equation (12): , in, For online network parameters; Target network parameters; soft update coefficients This ensures that the target Q-value converges smoothly. -Exploration coefficient in the greedy strategy The value decreases exponentially from 0.9 to 0.05 over 5000 decision steps, balancing early exploration and later optimal decision-making.

[0036] Step 37: Modify the temporal constraints of reinforcement learning, and fix the Bellman iteration discount factor. By discarding the iteration of the state value at the next moment and canceling the temporal sample transfer constraint, the temporal D3QN is transformed into an instant reward supervised diagnosis framework, which is adapted to the input of independent disordered fault samples of motors.

[0037] Based on the above discussion, in an optional embodiment of the present invention, S3 specifically includes: in an optional embodiment of S3, the fault prototype library is initialized with a normal distribution random initialization, and the memory library follows the first-in-first-out elimination rule, eliminating the earliest historical sample after the capacity is full, so as to ensure the timeliness of the memory sample.

[0038] S4: Construct a three-component weighted composite reward function to optimize hierarchical diagnosis, small sample compensation, and high-risk fault misjudgment prevention.

[0039] It should be noted that traditional reinforcement learning only sets a single classification reward and punishment, which has problems such as insufficient reward for minority class failures, too low cost for misjudging high-risk failures, and chaotic hierarchical decision gradient. This invention integrates three components: basic classification reward, minority sample compensation reward, and severe failure misjudgment punishment, and weights and balances three major optimization objectives to accurately guide the convergence of the three-level agent. This step specifically includes 5 sub-steps.

[0040] Step 41: Determine the general expression for the composite reward. The total reward is obtained by weighted coupling of the three types of components, as shown in formula (13): , in, The basic reward and penalty values ​​for hierarchical classification; Additional rewards for identifying a minority of fault types; Penalty value for misjudging serious high-risk faults; Weighting for small sample rewards; The penalty weight for misjudging faults.

[0041] Step 42: Binary classification reward and punishment settings for first-level intelligent agents: Correct judgment of normal / fault is rewarded with +0.5, and incorrect judgment is punished with -0.2, controlling the basic cost of fault omission and false detection.

[0042] Step 43: Setting rewards and penalties for part localization of the secondary agent: reward +0.3 for correct positioning of bearing / rotor / stator, penalty -0.1 for positioning error, and weakening the gradient of part misjudgment.

[0043] Step 44: Refined fault reward and punishment settings for the three-level intelligent agent: reward +0.2 for correct fault type identification and -0.1 for incorrect identification, thus refining the accuracy of end-point diagnosis.

[0044] Step 45: Special Reward and Penalty Assignment: Additional reward for correctly identifying niche and rare faults such as bearing cages. High-risk faults such as broken rotor bars and worn spindles were mistakenly identified as normal operating conditions, resulting in a single penalty. Strictly control the risk of missing detection of high-risk industrial faults.

[0045] Based on the above discussion, in an optional embodiment of the present invention, S4 specifically includes: in an optional embodiment of S4, a reward and punishment threshold buffer is set, and after three consecutive correct identifications of minority class faults, an adaptive reward of 0.05 is automatically added to further improve the small sample learning bias.

[0046] S5: A three-level independent priority experience replay pool stores experience, constructs a multi-objective joint loss function, and collaboratively optimizes the trainable parameters in each module.

[0047] It should be noted that conventional single-experience replay pools store three levels of decision data in a mixed manner, and the mutual interference of hierarchical data leads to convergence oscillations. At the same time, optimizing only the single loss of reinforcement learning cannot take into account the optimization of small sample representation and LLM interpretability. The present invention uses hierarchical independent PER replay + three-coupling loss function to simultaneously optimize diagnostic accuracy, small sample robustness and text interpretability. This step specifically includes 6 sub-steps.

[0048] Step 51: Initialize the hierarchical replay pool. Build independent priority experience replay pools for Level 1, Level 2, and Level 3 agents respectively. In the early stage of training, pre-fill 200 full-coverage expert virtual experiences of fault paths. The pre-filled experiences are uniformly set to the highest sampling priority.

[0049] Step 52: Store diagnostic experience tuples. Each episode corresponds to a set of independent fault samples to be tested. If the first-level output is normal, the current sampling round is terminated directly; if the first-level fault is determined, second-level and third-level states are generated progressively, and the hierarchical decision tuples are stored. Store in the corresponding level replay pool.

[0050] Step 53: Calculation of experience priority and TD error. The value of experience learning is determined based on TD error. The formulas for priority and TD error calculation are Equation (14) and Equation (15) respectively: , , in, For a single empirical TD error; Prioritize empirical sampling; This avoids situations where the priority level drops to zero and sampling becomes impossible.

[0051] Step 54: Construct the multi-objective coupled total loss function, integrate D3QN diagnostic loss, small sample auxiliary loss, and LLM text interpretation loss, and jointly update the parameters in reverse. The total loss formula is as shown in equation (16): , The first term is the weighted D3QN diagnostic loss. For training batch size, Importance sampling weights; For small sample loss weights, Includes prototype contrast loss and memory feature MSE consistency loss; To explain the loss weights, To diagnose text autoregressive cross-entropy loss.

[0052] Step 55: Network iterative update rule: Online network parameter update is performed every 4 episodes; AdamW is selected as the optimizer, with a base learning rate of... Weight decay coefficient Every 10 online network updates, perform a single target network soft update (12).

[0053] Step 56: Training termination criteria. If either the entire dataset has been traversed or the accuracy of graded diagnosis has not improved for 20 consecutive episodes, training will stop immediately and the optimal network parameters will be locked.

[0054] Based on the above discussion, in an optional embodiment of the present invention, S5 specifically includes: In an optional embodiment of S5, the importance sampling weight decay coefficient is initially set at 0.4 and linearly increased to 1.0 to gradually offset the sample distribution bias caused by priority sampling.

[0055] S6: The LLM decoder splices decision features, generates natural language interpretable diagnostic results through autoregression, and fine-tunes the LoRA adapter parameters in reverse.

[0056] It should be noted that existing motor fault diagnosis models only output fault numerical labels, without outputting fault causes or maintenance suggestions, making it impossible for maintenance personnel to carry out repairs. This invention reuses the front-end diagnostic LLM model, with feature extraction at the encoding end and text generation at the decoding end. Relying on the bidirectional optimization model of interpretation loss, it achieves integrated output of diagnosis and interpretation. This step specifically includes three sub-steps.

[0057] Step 61: Decode the input features and concatenate them, integrating key information from the entire process, and combine the basic state vector. The three information dimensions of three levels—the three-level action embedding vector, the Q-value confidence of each level of decision, and the three-level decision-making confidence—are concatenated to obtain the dedicated input features for decoding.

[0058] Step 62: The decoder generates text through autoregression. The concatenated features are fed into the LLM decoder equipped with a LoRA adapter. Based on the pre-trained industrial corpus, standardized natural language diagnostic text is generated through autoregression. The output content includes four types of information: fault level, fault location, vibration characteristics, and operation and maintenance suggestions.

[0059] Step 63: Bidirectional gradient fine-tuning, calculating the diagnostic text cross-entropy interpretation loss. The reverse gradient only fine-tunes the LoRA adapter parameters at both ends of the LLM, simultaneously optimizing the accuracy of front-end fault coding and the logic of back-end text interpretation.

[0060] Based on the above discussion, in an optional embodiment of the present invention, S6 specifically includes: In an optional embodiment of S6, the LLM decoder generates a length of 80-120 characters, and the decoding temperature coefficient is set to 0.3 to ensure that the diagnostic text is rigorous and unambiguous.

[0061] To verify the effectiveness of the proposed motor fault diagnosis method based on LLM and three-level D3QN, experimental verification was conducted using industrial motor fault monitoring data. The results were analyzed from three aspects: reinforcement learning decision optimization effect, small-sample fault identification capability, and hierarchical diagnostic performance. Experimental data included normal state data and typical motor fault types such as bearing inner ring faults, bearing outer ring faults, bearing cage faults, and rotor bar breakage faults. Tests were conducted under different operating conditions and sample sizes to verify the diagnostic capabilities of the proposed method in complex industrial environments and small-sample fault scenarios.

[0062] To verify the optimization effect and convergence of the three-level D3QN agent during training, the average reward of each level of the agent was normalized during training, and the curve of the normalized average reward changing with the training rounds was plotted. The results are as follows: Figure 5 As shown, by Figure 5 As the number of training rounds increases, the average reward of the three-level D3QN agent generally increases and gradually converges, indicating that the model can effectively optimize decision-making strategies through continuous exploration and learning. The first-level agent (fault presence / absence judgment) has the fastest convergence speed, with the normalized average reward eventually stabilizing at around 0.93; the second-level agent (fault location) eventually stabilizes at around 0.72; the third-level agent (fault type subdivision), due to the greater number and difficulty of diagnostic tasks, has a relatively slower convergence speed, but still stabilizes above 0.58, indicating that the model can learn effective diagnostic strategies. Overall, all three levels of agents exhibit good convergence and stability, validating the effectiveness of the proposed D3QN training framework.

[0063] To verify the performance advantages of the method of this invention compared with existing fault diagnosis methods, a comparative experiment was conducted with traditional deep learning methods, metric learning-based methods, and reinforcement learning-based diagnostic methods. ResNet, Transformer, few-shot methods, and the method of this invention all used 20% of the training samples. The evaluation metrics for CNN (Convolutional Neural Networks) were recall and macro-F1 score. The overall diagnostic performance and the effect of three-level hierarchical diagnosis were analyzed. First, the diagnostic performance of different methods in small-sample fault scenarios was compared, and the experimental results are as follows: Figure 6 As shown. By Figure 6 It can be seen that, under the condition of limited training sample size, the method of this invention outperforms other comparative methods in terms of small sample fault recall rate and average F1-score. Compared with traditional convolutional neural network methods, the method of this invention can effectively improve the identification ability of low-frequency fault categories. The main reason is that this invention uses prototype branches to establish a reference space of typical fault features, uses memory branches to introduce historical fault sample information, and dynamically adjusts the enhancement feature fusion ratio through uncertainty branches, thereby improving the model's ability to represent scarce fault features.

[0064] To verify the effectiveness of the three-level D3QN hierarchical diagnostic structure, tests were conducted on the first-level fault detection, the second-level fault location, and the third-level fault type subdivision process. The experimental results are as follows: Figure 7 As shown. By Figure 7It can be seen that as the diagnostic levels deepen, the task complexity increases, but each level of the intelligent agent maintains high diagnostic accuracy, and the final comprehensive diagnostic result achieves a good performance level. This result demonstrates that the present invention, through a three-level progressive diagnostic strategy, decomposes the complex multi-category fault identification task into multiple hierarchical decision-making processes, effectively reducing feature confusion between different fault categories and improving the diagnostic accuracy and stability in complex motor fault scenarios.

[0065] This article uses specific examples to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. It should be noted that those skilled in the art can make several improvements and modifications to the present invention without departing from the principles of the present invention, and these improvements and modifications also fall within the protection scope of the claims of the present invention.

Claims

1. A motor fault diagnosis method based on LLM and three-level D3QN, characterized in that, include: A dual-branch, multimodal input architecture combining text and images is constructed. The text branch inputs motor fault-related information via a structured Prompt, including role settings, task settings, an overview of the time-frequency domain statistical features of the input signal, and expert prior knowledge. LLM word segmentation and embedding yield 768-dimensional textual expert features. The image branch collects four complementary fault characterization maps of the motor vibration signal. After normalization preprocessing, these maps are fed into a DeiT-Tiny lightweight encoder to extract multi-channel visual features. An 8-head multi-head attention module adaptively aggregates and denoises these features to obtain unified visual features. Finally, textual and visual features are fused through vector concatenation to construct a cross-modal fusion feature. ; The cross-modal fusion features The input LLM Transformer encoding layer employs a backbone weight freezing and LoRA adapter lightweight fine-tuning strategy to output the encoded hidden state sequence. After global average pooling, a 128-dimensional basic state vector shared by the three-level agents is obtained. ; The state vector As a three-level progressive independent D3QN agent hierarchical diagnostic architecture built by inputting environmental conditions, each agent is configured with a differentiated fault diagnosis action space to realize binary fault determination, fault location, and fine-grained fault type subdivision. A differentiated input mechanism of embedding and splicing upper-level actions is adopted to construct the exclusive input state of each agent. Feature mapping is completed through a shared MLP encoder to output a 64-dimensional basic fault representation. ; The basic characterization of the fault The input module is a three-branch small-sample enhancement module consisting of prototype, memory, and uncertainty. Through feature matching from the prototype library, weighted aggregation of historical samples, and quantification of representation uncertainty, it adaptively fuses enhanced features and secure representations using a gated fusion mechanism, and outputs the optimal decision representation. ,in For uncertainty gate coefficient, To enhance the features of dual-branch fusion, Pre-training a safe representation for normal samples; Based on the Dueling advantage decomposition structure, the optimal decision representation is used to calculate the Q-value, which separates the global state value from the single-action advantage. The Q-value calculation formula is as follows: ,in, For global fault state value, For single diagnostic action dominance value, To correspond to the number of action spaces at each level, each agent is configured with an independent target network and its parameters are smoothly updated using a soft update mechanism. The -greedy strategy completes dynamic exploration and sets a reinforcement learning discount factor. By removing the temporal state transition constraint, an immediate reward supervision framework adapted to independent fault samples is obtained. A composite reward mechanism is constructed, including hierarchical basic rewards and penalties, minority fault compensation rewards, and high-risk fault penalties. The total reward formula is as follows: ,in Based on tiered rewards and punishments, Additional rewards are provided for a small number of types of faults. To penalize misdiagnosis of high-risk faults, a differentiated graded reward and punishment gradient is used to constrain the diagnostic accuracy at each level; Independent priority experience replay pools are configured for each of the three levels of intelligent agents. Sample sampling priority is calculated using TD error to mitigate hierarchical data interference. A multi-objective joint loss function is constructed that integrates diagnostic loss, small sample consistency loss, and LLM text interpretation loss. The total loss formula is as follows: ,in For importance sampling weights, It includes prototype contrast loss and memory feature MSE consistency loss. To diagnose text autoregressive cross-entropy loss, the parameters of the entire network are collaboratively optimized, and model training is completed through preset iterative update rules and termination conditions. By splicing together the basic state, three-level action embedding, and Q-value confidence features, the input to the LLM decoder autoregressively generates standardized diagnostic text containing fault location, cause, and maintenance suggestions. The LoRA parameters are then fine-tuned by interpreting the loss, achieving bidirectional optimization of fault coding and interpretable generation.

2. The motor fault diagnosis method based on LLM and three-level D3QN as described in claim 1, characterized in that, The multimodal image preprocessing and LLM lightweight fine-tuning method includes: The four types of fault characterization maps collected were uniformly normalized to a 224×224 pixel size and input into a lightweight visual encoding network. DeiT-Tiny, loaded with ImageNet pre-trained weights, was used as the visual feature extractor. Only the parameters of the end feature adaptation layer of the visual encoder were updated. A multi-head attention mechanism was used to weightedly fuse features from different fault maps. During the LLM encoding stage, the Transformer backbone network parameters were frozen, and only the LoRA low-rank adapter was used to adjust the fault domain feature mapping parameters. The LoRA rank was set to 8, and the LoRA learning rate was set independently. Complete the adaptation for small sample fault scenarios.

3. The motor fault diagnosis method based on LLM and three-level D3QN as described in claim 1, characterized in that, The optimization methods for the three-branch few-sample enhancement module include: A learnable prototype library corresponding to fault categories is established. Similarity matching is performed between the input fault basic representation and the prototype vector to obtain typical fault enhancement features. A memory library with a maximum capacity of 2000 historical samples is established. Historical fault representations related to the current sample are obtained through nearest neighbor retrieval. Memory enhancement features are generated using a weighted aggregation method. The variance of the prediction result of the current sample is calculated through multiple random inactivation forward propagation to obtain the representation uncertainty index. The fusion ratio between prototype enhancement features, memory enhancement features and safety representation is dynamically adjusted according to the uncertainty level so that high-uncertainty scarce fault samples receive higher enhancement weights.

4. The motor fault diagnosis method based on LLM and three-level D3QN as described in claim 1, characterized in that, The adaptive optimization method of the composite reward mechanism includes: A multi-component composite reward function is constructed, consisting of hierarchical classification base reward, small sample fault compensation reward, and high-risk fault misjudgment penalty. For low sample fault categories, when the third-level agent completes the correct identification multiple times in a row, the reward weight of the corresponding fault category is increased to enhance the model's learning ability for scarce fault patterns. For high-risk faults, a penalty term is added when the model makes a missed judgment or misjudgment. The first-level fault detection, second-level part localization, and third-level fault type subdivision processes are constrained by different reward gradients.

5. The motor fault diagnosis method based on LLM and three-level D3QN as described in claim 1, characterized in that, The methods for empirical replay sampling and model iteration termination include: Each of the three levels of intelligent agents is configured with an independent priority experience replay pool. At the beginning of training, 200 expert experience samples covering different fault paths are pre-filled. During training, the sample priority is calculated based on the temporal difference error, and the data distribution bias caused by priority sampling is corrected by linearly increasing the importance sampling weight. At the same time, a joint optimization objective including D3QN diagnostic loss, small sample consistency loss and LLM interpretation generation loss is constructed to iteratively update the network parameters. When all samples in the dataset have been trained, or when the hierarchical diagnosis accuracy has not improved within 20 consecutive episodes, training is stopped and the optimal model parameters are saved.