A photovoltaic energy storage cabinet fault diagnosis method and system based on deep learning
By using deep learning technology to diagnose faults in photovoltaic energy storage cabinets, and constructing a feature representation space using physical constraint contrastive learning and feature encoders, counterfactual samples are generated to provide explanations. This solves the problems of low diagnostic accuracy and insufficient interpretability of photovoltaic energy storage cabinets under data scarcity conditions, and achieves efficient and clear fault diagnosis and explanation, adapting to new equipment and reducing costs.
Patent Information
- Application Number
- CN202511232676.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-01
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2045-09-01
AI Technical Summary
Existing photovoltaic energy storage cabinet fault diagnosis technologies suffer from low accuracy and insufficient interpretability under conditions of scarce data, making it difficult to adapt to new equipment and new fault types. Furthermore, the interpretation methods are limited and difficult for maintenance personnel to understand and apply.
We employ a deep learning-based approach, utilizing a physically constrained contrastive learning algorithm to pre-train unlabeled data, constructing a feature representation space. By combining a feature encoder and a prototype diagnostic model, we provide intuitive explanations by generating counterfactual samples, and construct a feature saliency mapping and a three-layer explanation architecture to support an interactive diagnostic interface.
It achieves high-precision fault diagnosis with a small number of labeled samples, provides clear fault explanations, allows for rapid adaptation to new equipment, reduces data acquisition and deployment costs, improves maintenance personnel's understanding and trust, and meets actual engineering needs.
Smart Images

Figure CN120744463B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of photovoltaic energy storage system fault diagnosis technology, and more specifically, to a photovoltaic energy storage cabinet fault diagnosis method and system based on deep learning. Background Technology
[0002] With the rapid development of renewable energy technologies, photovoltaic (PV) power generation systems are widely used globally. As a core component of PV power generation systems, PV energy storage cabinets are responsible for energy storage, dispatching, and stable system operation; their reliability directly affects the safety and economic benefits of the entire PV system. Therefore, accurate and timely fault diagnosis of PV energy storage cabinets is of great significance.
[0003] Currently, fault diagnosis of photovoltaic energy storage cabinets mainly employs technical approaches such as rule-based expert systems, traditional machine learning methods, and deep learning methods. However, existing technologies have the following shortcomings:
[0004] Data scarcity severely restricts the performance of diagnostic systems. Photovoltaic energy storage cabinets experience relatively low failure frequencies during normal operation, especially for new equipment and rare fault types. The number of fault samples available for training is extremely limited and unevenly distributed. Traditional supervised learning methods heavily rely on large amounts of high-quality labeled data, often leading to overfitting in data-scarce environments, resulting in poor model generalization and decreased diagnostic accuracy. Existing diagnostic methods generally suffer from insufficient interpretability. While deep learning-based fault diagnosis methods can achieve high diagnostic accuracy in certain scenarios, their internal decision-making processes are "black box" characteristics, failing to provide maintenance personnel with clear diagnostic basis and fault analysis results. This lack of transparency not only reduces the system's credibility but also hinders practical maintenance work, limiting the technology's engineering application value. Existing interpretable methods face a trade-off between performance and transparency. Traditional interpretable machine learning methods typically simplify the model structure (e.g., decision-making processes). While some simplification methods (such as tree-based and linear models) can improve model interpretability, this often comes at the cost of sacrificing the model's expressive power and diagnostic accuracy. These methods fail to fully capture the complex fault modes and nonlinear relationships between multi-dimensional monitoring data in photovoltaic energy storage systems. Furthermore, existing diagnostic systems lack the ability to adapt to new equipment and fault types. With the rapid development of photovoltaic energy storage technology and frequent equipment model updates, new fault modes constantly emerge. Each time a new model of equipment is deployed, it is often necessary to re-collect a large amount of fault data and train the diagnostic model from scratch, resulting in high system deployment costs and long cycles, making it difficult to meet actual engineering needs. Finally, the interpretation methods are often simplistic and lack practicality. Existing interpretability technologies mostly employ single interpretation methods, such as feature importance ranking, decision tree path analysis, or attention weight visualization. The interpretation results of these methods often lack intuitiveness and are difficult for maintenance personnel with different technical backgrounds to understand and apply, limiting the widespread application of interpretable diagnostic technologies in practical engineering.
[0005] Therefore, there is an urgent need for a photovoltaic energy storage cabinet fault diagnosis technology that can achieve high-precision fault diagnosis under data-scarce conditions, while possessing good interpretability and rapid adaptability, in order to meet the needs of practical engineering applications. Summary of the Invention
[0006] This invention provides a method and system for fault diagnosis of photovoltaic energy storage cabinets based on deep learning, which solves the technical problems of low diagnostic accuracy, insufficient interpretability, and difficulty in adapting to new equipment under the condition of scarce data in related technologies.
[0007] This invention provides a deep learning-based fault diagnosis method for photovoltaic energy storage cabinets, comprising:
[0008] A contrastive learning algorithm with physical constraints is used to pre-train monitoring data of unlabeled photovoltaic energy storage cabinets to construct a feature representation space with physical meaning;
[0009] Based on the feature representation space, a feature encoder is trained using labeled samples and a prototype diagnostic model is constructed.
[0010] Based on the output of the feature encoder, a comparative explanation generator is constructed to provide intuitive explanations of faults by generating counterfactual samples.
[0011] Based on the diagnostic process of the prototype diagnostic model and the output of the feature encoder, a feature saliency mapping technique is constructed to highlight the key data features that affect the diagnostic results.
[0012] Based on the output of feature saliency mapping and the fault category judgment of the prototype diagnostic model, a three-layer interpretation architecture of features, symptoms and causes is constructed to transform the diagnostic results into a form that is easy for maintenance personnel to understand.
[0013] Based on a three-layer explanation architecture and counterfactual samples generated by a comparative explanation generator, an interactive diagnostic interface is constructed to support users in exploring different fault conditions through hypothetical scenarios.
[0014] Furthermore, the contrastive learning algorithm for the physical constraints includes:
[0015] Data augmentation techniques are applied to the raw energy storage cabinet monitoring data to generate positive sample pairs;
[0016] The physical model constraints of the photovoltaic energy storage cabinet are incorporated into the comparative learning process to penalize feature representations that violate the physical laws of the energy storage system.
[0017] Contrastive learning objectives are constructed based on the InfoNCE loss function, which bring similar samples closer together in the feature space and keep different samples further apart.
[0018] Furthermore, the prototype diagnostic model includes:
[0019] For each fault type, a set of representative prototype vectors is learned as the feature representation of that type of fault;
[0020] Calculate the similarity between the sample to be diagnosed and each fault prototype, and generate diagnostic results;
[0021] The model is fine-tuned using labeled data to optimize the feature encoder and prototype parameters.
[0022] Furthermore, the feature saliency mapping technique includes:
[0023] A heatmap related to faults is generated based on gradient-weighted class activation mapping technology.
[0024] Perform importance analysis on time series data to identify key time points and features;
[0025] Quantifying the contribution of each feature to the diagnostic results provides a precise basis for interpretation.
[0026] Furthermore, the three-tiered explanatory framework of features, symptoms, and causes includes:
[0027] Generate detailed technical explanations for technical experts;
[0028] This maps technical characteristics to device symptom descriptions, providing a mid-level explanation.
[0029] Based on symptoms and diagnostic results, specific maintenance recommendations and operating instructions are generated.
[0030] Furthermore, the comparative explanation generator includes:
[0031] Training an explanation generator model capable of generating counterfactual samples;
[0032] A counterfactual sample is generated using an interpretation generator to demonstrate the impact of changes in fault characteristics on diagnostic results;
[0033] Based on the original samples and counterfactual samples, a comparative explanation is constructed to highlight key decision-making characteristics.
[0034] Furthermore, the interpreter adopts an encoder-decoder architecture. The encoder part uses a structure similar to the feature encoder, and the decoder part adopts a transposed convolution structure. A conditional injection module is configured between the encoder and decoder to incorporate the target fault category and intervention intensity information into the latent representation.
[0035] Furthermore, the interactive diagnostic interface includes:
[0036] It supports users in constructing hypothetical scenarios to explore the impact of feature changes on diagnostic results;
[0037] Integrate visual views to comprehensively display diagnostic information;
[0038] We integrate expert feedback to continuously optimize the quality of diagnosis and interpretation.
[0039] Furthermore, the feature encoder adopts a multi-layer temporal convolutional network structure. Each convolutional block in the multi-layer temporal convolutional network structure consists of a one-dimensional convolutional layer, a batch normalization layer, an activation function, and a pooling layer. The first convolutional layer uses multi-scale convolutional kernels to capture features at different time scales.
[0040] This invention provides a deep learning-based photovoltaic energy storage cabinet fault diagnosis system for executing the aforementioned deep learning-based photovoltaic energy storage cabinet fault diagnosis method, comprising:
[0041] The pre-training module is used to pre-train the monitoring data of unlabeled photovoltaic energy storage cabinets using a contrastive learning algorithm with physical constraints, and to construct a feature representation space with physical meaning.
[0042] The prototype diagnostic module is used to build a prototype diagnostic model based on a pre-trained feature encoder to achieve fault diagnosis.
[0043] The explanation generation module is used to build a comparative explanation generator, which provides intuitive explanations of failures by generating counterfactual samples;
[0044] The feature mapping module is used to construct feature saliency mapping techniques to highlight key data features that affect diagnostic results.
[0045] The multi-level explanation module is used to construct a three-level explanation architecture of features, symptoms, and causes, and to transform the diagnostic results into a form that is easy for maintenance personnel to understand.
[0046] The interactive interface module is used to build an interactive diagnostic interface, allowing users to explore different fault conditions through hypothetical scenarios.
[0047] The beneficial effects of this invention are: by using a comparative learning pre-training and a few-sample fine-tuning strategy, the system can learn to identify novel faults with only a small number of labeled samples, thus reducing the cost of data collection and labeling;
[0048] Through comparative interpretation generation and feature saliency mapping, the system can intuitively show "why this is the fault and not another", improving the clarity of the explanation and enhancing maintenance personnel's understanding and trust in the diagnostic results;
[0049] By using an interpretation-driven representation learning mechanism, the system improves both interpretability and diagnostic accuracy, successfully resolving the contradiction between accuracy and interpretability in traditional methods.
[0050] Based on the pre-training-fine-tuning framework, the system can quickly adapt to new devices and build high-performance diagnostic models without a large number of samples, thus reducing the cost of model iteration and updates.
[0051] Through a three-tiered explanatory architecture of features, symptoms, and causes, the system can provide different levels of explanation based on the user's background, from technical parameters to specific maintenance suggestions, meeting the needs of different roles and improving the practicality of the explanations.
[0052] Through the interactive diagnostic interface, maintenance personnel can explore "hypothetical scenarios," deepen their understanding of fault mechanisms, and improve the efficiency and accuracy of fault handling. Attached Figure Description
[0053] Figure 1 This is a flowchart of a photovoltaic energy storage cabinet fault diagnosis method based on deep learning in this invention;
[0054] Figure 2 It is a line graph showing the changes in the contrastive loss, physical constraint loss, and total loss during the contrastive learning pre-training phase;
[0055] Figure 3 This is a bar chart showing the accuracy performance of the proposed method versus the traditional supervised learning method in diagnosing five common photovoltaic energy storage cabinet faults.
[0056] Figure 4 It is a scatter plot showing the relationship between the number of labeled samples and diagnostic accuracy;
[0057] Figure 5 This is a bar chart analyzing the feature importance of battery overcharge fault diagnosis.
[0058] Figure 6 This is a bar chart showing the satisfaction ratings of different user roles regarding the diagnostic interpretation.
[0059] Figure 7 It is a radar chart evaluating the performance of the diagnostic system across five dimensions. Detailed Implementation
[0060] The subject matter described herein will now be discussed with reference to exemplary embodiments. It should be understood that these embodiments are discussed only to enable those skilled in the art to better understand and implement the subject matter described herein, and changes may be made to the function and arrangement of the elements discussed without departing from the scope of this specification. Various processes or components may be omitted, substituted, or added as needed in the examples. Furthermore, some features described in the examples may be combined in other examples.
[0061] At least one embodiment of the present invention discloses a fault diagnosis method for photovoltaic energy storage cabinets based on deep learning, such as... Figure 1 As shown, it includes:
[0062] Step 1: Use a physical constraint contrastive learning algorithm to pre-train the monitoring data of unlabeled photovoltaic energy storage cabinets to construct a feature representation space with physical meaning;
[0063] In this step, a physically constrained contrastive learning algorithm is used to pre-train the monitoring data of unlabeled photovoltaic energy storage cabinets to construct a physically meaningful feature representation space. It should be noted that this step includes:
[0064] Step 1.1, Data Augmentation;
[0065] Multiple data augmentation techniques are applied to the raw energy storage cabinet monitoring data to generate positive sample pairs. Specifically, this involves applying various data augmentation techniques to the input time-series monitoring data. Enhanced samples are generated using methods such as temporal masking, amplitude scaling, Gaussian noise addition, and frequency domain transformation. To ensure that augmentation operations do not alter the physical characteristics of the fault, the parameters of the augmentation operations are strictly controlled. For example, the amplitude scaling ratio and the variance of Gaussian noise are limited to a very small range to simulate real disturbances such as sensor drift or background noise, rather than creating new fault modes. Simultaneously, a pair of positive samples is constructed. Optionally, the selection of enhancement operations can be adapted to the specific fault type. For example, frequency domain transformation can be used preferentially for current fluctuation faults, and amplitude scaling can be used preferentially for temperature anomaly faults.
[0066] Step 1.2, Physical constraint coding;
[0067] The physical model constraints of the photovoltaic energy storage cabinet are incorporated into the comparative learning process to ensure that the learned feature representations conform to physical laws. Specifically, this is achieved by constructing a physical constraint loss function. Penalties are imposed on features that violate the physical laws of energy storage systems (such as energy conservation, limits on the rate of change of state of charge, and the relationship between temperature and resistance), causing the model to learn features that conform to these physical laws. In some implementations, physical constraints can be represented as a set of inequalities or equality constraints, which are then transformed into regularization terms of the loss function using a penalty function method. Specifically, the physical constraint loss function... This can be specifically expressed as:
[0068] ;
[0069] in Represents the physical constraint loss function. This represents the energy conservation constraint loss term. This represents the state-of-charge constraint loss term. This represents the loss term constrained by Ohm's law. , , These represent the weighting coefficients for the energy conservation constraint, the state of charge constraint, and the Ohm's law constraint, respectively.
[0070] Step 1.3, comparative feature learning;
[0071] A contrastive learning objective is constructed based on the InfoNCE loss function, which brings similar samples closer together and dissimilar samples further apart in the feature space. Specifically, this is achieved by first using a feature encoder... Mapping the input data to the feature space, for positive sample pairs Minimize its feature representation and The distance between features is maximized, while simultaneously maximizing the distance between features and other sample feature representations in the batch. The feature encoder parameters are optimized using gradient descent. The total loss function is composed of a weighted sum of contrastive loss and physical constraint loss, with the weight coefficients adjusted using hyperparameter optimization methods such as grid search to find an optimal value that balances data-driven feature learning with the constraints of prior physical knowledge. This represents the feature representation of the input data X after passing through the feature encoder. This represents the feature representation of the augmented data after passing through the feature encoder.
[0072] In this process, the InfoNCE loss function is implemented as follows: First, the similarity between feature representations is calculated, i.e. The function calculates the similarity between two feature vectors using cosine similarity, specifically as the dot product of two normalized vectors. Then, a softmax function is used to convert the similarity into a probability distribution, incorporating a temperature parameter. The smoothness of the probability distribution is controlled. Finally, by minimizing the negative log-likelihood loss, the feature representations of positive sample pairs are made more similar, while also becoming more distinct from the feature representations of other samples in the batch, thus forming a meaningful clustering structure in the feature space. For the complete InfoNCE loss calculation, the similarity of the feature vectors of positive sample pairs is first calculated and divided by the temperature parameter. Then calculate the exponent of this value; next, calculate the exponent sum of the similarity between this feature vector and the feature vectors of all other samples in the batch; finally, calculate the ratio of these two values and take its negative logarithm, which represents the objective of maximizing the similarity of positive sample pairs relative to the similarity of other sample pairs.
[0073] in Indicates the calculation of eigenvectors and A function of similarity between them and They represent the first The and the first 1 eigenvector This represents the temperature parameter.
[0074] The feature encoder employs a multi-layer temporal convolutional network structure, containing three convolutional blocks. Each convolutional block consists of a one-dimensional convolutional layer, a batch normalization layer, a ReLU activation function, and a max-pooling layer. Specifically, the first convolutional layer uses multi-scale convolutional kernels (sizes 3, 5, and 7) to capture features at different time scales and fuses them through an attention mechanism (specifically, channel attention, which adaptively enhances the weights of key feature channels). The intermediate layers use residual connections to prevent gradient vanishing (this residual connection adds the input and output element-wise, allowing gradients to propagate more effectively in the deep network). The last layer uses global average pooling to generate a fixed-dimensional feature representation. The input to the feature encoder is multi-dimensional temporal monitoring data from the photovoltaic energy storage cabinet, and the output is a 128-dimensional feature vector that captures key fault-related features.
[0075] It should be understood that the feature encoder can also be implemented using other network structures. For example, in some implementations, a Transformer-based structure can be used to handle long sequence dependencies, or a graph convolutional network can be used to handle the relationships between components inside the energy storage cabinet.
[0076] like Figure 2 As shown in the figure, the line graph illustrating the changes in the contrastive loss, physical constraint loss, and total loss during the pre-training phase of contrastive learning demonstrates the trends of different loss functions with training epochs during the system's pre-training phase, including the contrastive loss, physical constraint loss, and total loss. This verifies the convergence performance of the physical constraint contrastive learning algorithm. The graph shows that the total loss tends to stabilize after approximately 200 training epochs. The introduction of the physical constraint loss effectively guides the feature learning process, ensuring that the learned feature representations conform to the physical laws of the energy storage system.
[0077] Step 2: Based on the feature representation space, train the feature encoder using labeled samples and build a prototype diagnostic model;
[0078] In this step, an interpretable prototype diagnostic model is constructed based on a pre-trained feature encoder using a small number of labeled samples. Furthermore, this step includes:
[0079] Step 2.1, Fault Prototype Learning;
[0080] For each fault type, a set of representative prototype vectors is learned as the feature representation of that fault type. Specifically, for each fault category... From category Select or learn from labeled samples One prototype vector:
[0081] ;
[0082] in, , , These represent the fault categories. The 1st, the 2nd, the 3rd One prototype vector, The number of prototype vectors for each fault category;
[0083] These prototype vectors can best represent the typical characteristic patterns of this type of fault. Optionally, prototypes can be learned through clustering algorithms, such as K-means clustering or Gaussian mixture models, or automatically through an end-to-end network training process.
[0084] Step 2.2, Prototype similarity calculation;
[0085] Calculate the similarity between the sample to be diagnosed and each faulty prototype to generate diagnostic results. Specifically, for the input sample... Feature representation is extracted through a feature encoder. ,calculate The similarity between samples and the prototype set for each fault category can be calculated using methods such as nearest prototype distance or prototype weighted average distance, ultimately generating samples. The probability distribution of each fault category.
[0086] The prototype diagnostic model consists of a feature encoder and a prototype layer. The prototype layer stores the features for each fault category. prototype vectors ( Typically 3-5 dimensions), each prototype vector has the same dimension as the feature encoder output (128 dimensions). For an input sample, features are first extracted by the feature encoder, then the similarity between that feature and all prototype vectors is calculated (using cosine similarity or negative Euclidean distance), and finally, the final fault category is determined by weighted voting or the nearest prototype rule. Each vector in the prototype layer has a clear physical meaning, representing a typical feature pattern of a specific fault type, and the fault characteristics can be intuitively understood by comparing it with the normal state.
[0087] Step 2.3, fine-tuning and optimization;
[0088] The diagnostic accuracy can be improved by fine-tuning the model using a small amount of labeled data. Specifically, based on a pre-trained feature encoder, a cross-entropy loss function and a prototype learning loss function are used for supervised fine-tuning with a small amount of labeled data (only 5-10 samples per fault type). This optimizes the feature encoder and prototype parameters, thereby improving diagnostic accuracy. In some implementations, techniques such as gradient projection can be used to ensure that the fine-tuning process does not destroy the physical constraint characteristics learned in the pre-training stage.
[0089] like Figure 3As shown, the accuracy of the proposed method compared to traditional supervised learning methods in diagnosing five common photovoltaic energy storage cabinet faults is demonstrated, verifying the performance advantages of the proposed method in various fault diagnosis methods, especially in complex fault types where the improvement is more significant. Experimental results show that the average diagnostic accuracy of the proposed method exceeds 90% for five fault types: battery overcharging, abnormal temperature, voltage fluctuation, abnormal charging, and abnormal discharging, which is 15%–25% higher than that of traditional methods.
[0090] like Figure 4 As shown in the scatter plot, the relationship between the number of labeled samples and the diagnostic accuracy is illustrated, demonstrating that the proposed method can achieve high accuracy with a small amount of labeled data, showcasing the system's data efficiency advantage. The plot shows that when the number of labeled samples for each type of fault reaches 5–8, the diagnostic accuracy can reach over 85%, while traditional methods typically require 50–100 labeled samples to achieve the same performance level.
[0091] Step 3: Based on the output of the feature encoder, construct a comparative explanation generator to provide intuitive explanations of faults by generating counterfactual samples;
[0092] In this step, a contrastive explanation generator is constructed to provide intuitive explanations of failures by generating counterfactual samples. This step includes:
[0093] Step 3.1, Explain generator training;
[0094] Train an explanation generator model capable of generating counterfactual samples. Specifically, this involves constructing an explanation generator based on a conditional generative adversarial network. The input includes the original sample. Target Fault Category and intervention intensity The output is a counterfactual sample. , making counterfactual samples While keeping most features unchanged, the diagnostic result becomes the target fault category. .
[0095] The loss function for generating counterfactual samples consists of two parts:
[0096] The first part is the reconstruction loss, which is calculated by generating samples. Compared with the original sample The squared Euclidean distance between them is used to ensure that the generated counterfactual samples are similar to the original samples in overall structure;
[0097] The second part is the category-conditional loss and the discriminator network. Used to evaluate whether the generated samples conform to the target fault category. The characteristic distribution of .
[0098] These two losses are obtained through weight parameters Balance, in which The trade-off between sample similarity and category variation is controlled. For the complete calculation of the generated counterfactual sample loss, the input samples are first processed. and target fault category and the intensity of intervention Using generators Generate a counterfactual sample, and then compare the counterfactual sample with the original sample. The square of the Euclidean distance; simultaneously, using a discriminator Assess whether the generated samples conform to the target fault category. The characteristic distribution of the two loss terms is determined, and the two loss terms are weighted accordingly. The combined loss function forms the total loss. By minimizing this combined loss function, the interpreter generator can produce counterfactual samples that both maintain the overall structure of the original samples and conform to the characteristics of the target fault category, providing interpretable comparative evidence for fault diagnosis.
[0099] The generator employs an encoder-decoder architecture. The encoder uses a structure similar to a feature encoder to encode the input temporal data into a latent representation; the decoder uses a transposed convolutional structure to reconstruct the latent representation back into temporal data. Between the encoder and decoder, a conditional injection module is configured to inject the target fault category. and intervention intensity Information is incorporated into the latent representation. The generator training employs a combination of adversarial loss, reconstruction loss, and class-conditional loss to ensure that generated samples retain the main features of the original samples while conforming to the feature distribution of the target fault category. The discriminator uses a fully convolutional network structure to simultaneously determine the authenticity of samples and class labels. The generator and discriminator mutually reinforce each other through adversarial training, ultimately generating high-quality counterfactual samples.
[0100] The adversarial loss, reconstruction loss, and category conditional loss work together, and the weighted sum of these three losses forms the final optimization objective, ensuring that the generated counterfactual samples are both realistic and credible, and meet interpretability requirements. Specifically, the relationship and function of these three losses are as follows:
[0101] Adversarial loss is the core of the standard GAN framework, achieved through the generator. and discriminator Adversarial training enables the generator to learn the distribution of real data, ensuring the plausibility of the generated samples; the reconstruction loss is calculated using the L1 or L2 norm to ensure the generation of counterfactual samples. Overall, compared with the original sample Maintaining high similarity, only necessary local feature modifications are made; the class conditional loss in the cGAN framework is used to determine whether a sample conforms to the target fault category. The features guide the generator to learn an accurate mapping from the original sample to the target class sample.
[0102] It is worth noting that in some embodiments, the interpreter generator may also be implemented using other generative model architectures such as variational autoencoder (VAE) or diffusion model, and the most suitable generative model architecture may be selected according to the specific application scenario.
[0103] Step 3.2, generating counterfactual samples;
[0104] A counterfactual sample is generated using an interpretation generator to demonstrate "how the diagnostic results would change if the fault characteristics changed." Specifically, this is implemented by: [The following is a separate, unrelated section:] For the sample to be interpreted... (The diagnosis result is) Select the target fault category. By interpreting the generator Generate counterfactual samples:
[0105] ;
[0106] in This represents the generated counterfactual sample; This represents an explanation of the generator model; This represents the original sample to be explained; Indicates the target fault category; Indicates the intervention intensity parameter;
[0107] Counterfactual samples and Similar but the diagnosis is By comparison and The differences are visually demonstrated to show the key features that affect the diagnostic results.
[0108] Step 3.3, comparative explanation construction;
[0109] Based on the original samples and counterfactual samples, a comparative explanation is constructed to highlight key decision-making characteristics. Specifically, this involves calculating the original samples... Counterfactual samples Based on the differences across various feature dimensions, identify the feature dimension with the most significant differences and generate a comparative interpretation: "The sample is diagnosed as a diagnostic result." Instead This is mainly because the values of features A, B, and C are... (Represents the original value of feature A) (Represents the original value of feature B) (Represents the original value of feature C), not... (Represents the counterfactual value of feature A) (Represents the counterfactual value of feature B) (representing the counterfactual value of feature C), thus providing an intuitive basis for diagnosis. Optionally, for complex multidimensional time series data, dimensionality reduction techniques (such as t-SNE or UMAP) can be used to visualize the differences, making it easier for maintenance personnel to understand.
[0110] Step 4: Based on the diagnostic process of the prototype diagnostic model and the output of the feature encoder, construct a feature saliency mapping technique to highlight key data features that affect the diagnostic results;
[0111] In this step, a feature saliency mapping technique is constructed to highlight key data features that affect diagnostic results. This step includes:
[0112] Step 4.1: Gradient-weighted class activation map generation;
[0113] A fault-related heatmap is generated based on gradient-weighted class activation mapping technology. Specifically, for diagnostic results... and feature representation Calculate the gradient (Indicates the diagnosis result) For feature representation The partial derivatives of the gradient are used to weight and fuse the gradient information with the feature activation values to generate a feature saliency heatmap, highlighting the feature regions that contribute the most to the diagnostic results. Additionally, in some embodiments, variant techniques such as integral gradient or SmoothGrad can be used to improve the stability and accuracy of the heatmap.
[0114] Step 4.2, Time Importance Analysis;
[0115] Importance analysis is performed on time-series data to identify key time points and features. Specifically, for the time-series input data, the contribution of each time point to the diagnostic results is calculated, key time windows are identified, and these are highlighted in a visualization interface to help maintenance personnel understand the fault development process. Furthermore, a change point detection algorithm can be combined to automatically identify the critical time points when the fault occurs.
[0116] Step 4.3, feature contribution quantification;
[0117] The contribution of each feature to the diagnostic results is quantified to provide accurate interpretation. Specifically, the SHAP (SHapley Additive ex Planations) value calculation method is used to quantify the marginal contribution of each input feature to the diagnostic results, generating a ranking of feature importance and contribution values, providing maintenance personnel with precise interpretive information. In some implementations, feature engineering knowledge can be optionally incorporated to map the contribution of low-level features to high-level fault indicators, improving the interpretability of the explanation.
[0118] like Figure 5 As shown in the bar chart, the feature importance analysis for battery overcharge fault diagnosis displays the importance scores of each feature during the fault diagnosis process. This verifies that the feature saliency mapping technique can accurately identify key diagnostic features and provide valuable interpretive information for maintenance personnel. The chart reveals that battery voltage, charging current, and temperature change rate are the three most important features affecting battery overcharge fault diagnosis, with importance scores of 0.42, 0.31, and 0.18, respectively. This indicates the key areas for fault inspection for maintenance personnel.
[0119] Step 5: Based on the output of feature saliency mapping and the fault category judgment of the prototype diagnostic model, construct a three-layer interpretation architecture of features, symptoms and causes, and transform the diagnostic results into a form that is easy for maintenance personnel to understand.
[0120] This step involves constructing a three-tiered explanatory framework of characteristics, symptoms, and causes to translate the diagnostic results into a format easily understood by maintenance personnel. This step includes:
[0121] Step 5.1, technical layer interpretation and generation;
[0122] It generates detailed technical explanations for technical experts. Specifically, it provides complete technical information such as feature importance analysis, prototype matching degree, and decision boundaries, including detailed numerical parameters and technical indicators to meet the in-depth analysis needs of technical professionals. It should be noted that the technical explanations can include advanced analytical views such as visualized feature distribution maps and fault evolution trajectories.
[0123] Step 5.2, symptom layer interpretation and generation;
[0124] Technical features are mapped to device symptom descriptions, providing a mid-level explanation. Specifically, a pre-established feature-symptom mapping knowledge base is used to transform technical features (such as voltage fluctuations and abnormal temperatures) into device symptom descriptions (such as "decreased charging efficiency" and "abnormal heat dissipation"), providing an explanation of the device-level fault manifestations. Furthermore, the symptom-level explanation can employ natural language generation technology to convert numerical features into descriptive text.
[0125] Step 5.3, maintenance layer interpretation and generation;
[0126] Generate practical explanatory information for maintenance operations. Specifically, based on symptoms and diagnostic results, and through a fault-maintenance knowledge base, generate specific maintenance suggestions and operational instructions, such as "check the cooling fan" or "replace a specific model of control board," directly guiding maintenance practice. Optionally, maintenance suggestions can include priority ranking to help maintenance personnel rationally arrange the maintenance sequence.
[0127] like Figure 6 As shown in the bar chart, the satisfaction scores of users with different technical backgrounds on the diagnostic interpretations provided by the proposed method and traditional methods are grouped and presented. This verifies that the multi-level interpretation architecture can meet the needs of users with different roles, especially improving the understanding of fault interpretations for non-technical personnel. Experimental results show that for senior engineers, intermediate maintenance personnel, and ordinary operators, the satisfaction scores of the proposed method are 4.6, 4.4, and 4.2 (out of 5), respectively, which are 0.8, 1.2, and 1.6 points higher than those of the traditional method.
[0128] Step 6: Based on the counterfactual samples generated by the three-layer explanation architecture and the comparative explanation generator, an interactive diagnostic interface is built to support users in exploring different fault conditions through hypothetical scenarios;
[0129] This step involves building an interactive diagnostic interface that allows users to explore different fault scenarios through hypothetical scenarios. This step includes:
[0130] Step 6.1, Hypothesis Scenario Construction;
[0131] The system supports users in constructing hypothetical scenarios to explore the impact of characteristic changes on diagnostic results. Specifically, it provides an interactive interface that allows users to adjust input characteristic parameters (such as voltage, current, and temperature). The system generates new diagnostic results and interpretations in real time, helping users understand the impact of different parameters on fault diagnosis. Furthermore, the system can provide suggestions on the range of parameter changes to ensure that the hypothetical scenarios constructed by users are physically feasible.
[0132] Step 6.2, Multi-view collaborative display;
[0133] It integrates multiple visualization views to comprehensively display diagnostic information. Specifically, it collaboratively displays time-series data views, feature importance views, prototype matching views, and maintenance suggestion views. User actions on one view will trigger updates in other views, providing a comprehensive understanding of the diagnostic context. It should be understood that the view layout can automatically adjust according to the characteristics of the display device (such as desktop or mobile).
[0134] Step 6.3, Expert Feedback Integration;
[0135] Integrating expert feedback allows for continuous optimization of diagnostic and interpretive quality. Specifically, this involves providing a feedback collection mechanism that allows experts to evaluate and correct diagnostic results and interpretations. The system records this feedback and uses it for model optimization, enabling continuous improvement of the diagnostic system. Optionally, feedback integration can employ an active learning framework, prioritizing the collection of sample feedback most valuable for model improvement.
[0136] like Figure 7 As shown in the radar chart, the performance of the diagnostic system is evaluated across five dimensions: accuracy, interpretability, data efficiency, adaptability, and real-time performance. This comprehensively demonstrates the system's advantages, particularly its improvements in interpretability and data efficiency. Experimental results show that the proposed method scores 0.89 in interpretability, a 71% improvement over the traditional method's 0.52; and achieves a score of 0.91 in data efficiency, a 112% improvement over the traditional method's 0.43, fully validating the effectiveness of the proposed technical solution.
[0137] A deep learning-based photovoltaic energy storage cabinet fault diagnosis system is used to execute the aforementioned deep learning-based photovoltaic energy storage cabinet fault diagnosis method, including:
[0138] The pre-training module is used to pre-train the monitoring data of unlabeled photovoltaic energy storage cabinets using a contrastive learning algorithm with physical constraints, and to construct a feature representation space with physical meaning.
[0139] The prototype diagnostic module is used to build a prototype diagnostic model based on a pre-trained feature encoder to achieve fault diagnosis.
[0140] The explanation generation module is used to build a comparative explanation generator, which provides intuitive explanations of failures by generating counterfactual samples;
[0141] The feature mapping module is used to construct feature saliency mapping techniques to highlight key data features that affect diagnostic results.
[0142] The multi-level explanation module is used to construct a three-level explanation architecture of features, symptoms, and causes, and to transform the diagnostic results into a form that is easy for maintenance personnel to understand.
[0143] The interactive interface module is used to build an interactive diagnostic interface, allowing users to explore different fault conditions through hypothetical scenarios.
[0144] The embodiments of the present invention have been described above. However, the embodiments are not limited to the specific implementation methods described above. The specific implementation methods described above are merely illustrative and not restrictive. Those skilled in the art can make more equivalent embodiments under the guidance of the present embodiments, and all of them are within the protection scope of the present embodiments.
Claims
1. A fault diagnosis method for photovoltaic energy storage cabinets based on deep learning, characterized in that, include: A contrastive learning algorithm with physical constraints is used to pre-train monitoring data of unlabeled photovoltaic energy storage cabinets to construct a feature representation space with physical meaning; Based on the feature representation space, a feature encoder is trained using labeled samples and a prototype diagnostic model is constructed. Based on the output of the feature encoder, a comparative explanation generator is constructed to provide intuitive explanations of faults by generating counterfactual samples. Based on the diagnostic process of the prototype diagnostic model and the output of the feature encoder, a feature saliency mapping technique is constructed to highlight the key data features that affect the diagnostic results. Based on the output of feature saliency mapping and the fault category judgment of the prototype diagnostic model, a three-layer interpretation architecture of features, symptoms and causes is constructed to transform the diagnostic results into a form that is easy for maintenance personnel to understand. Based on a three-layer explanation architecture and counterfactual samples generated by a comparative explanation generator, an interactive diagnostic interface is constructed to support users in exploring different fault conditions through hypothetical scenarios.
2. The method for fault diagnosis of photovoltaic energy storage cabinet based on deep learning according to claim 1, characterized in that, The contrastive learning algorithm for the physical constraints includes: Data augmentation techniques are applied to the raw energy storage cabinet monitoring data to generate positive sample pairs; The physical model constraints of the photovoltaic energy storage cabinet are incorporated into the comparative learning process to penalize feature representations that violate the physical laws of the energy storage system. Contrastive learning objectives are constructed based on the InfoNCE loss function, which bring similar samples closer together in the feature space and keep different samples further apart.
3. The method for fault diagnosis of photovoltaic energy storage cabinet based on deep learning according to claim 1, characterized in that, The prototype diagnostic model includes: For each fault type, a set of representative prototype vectors is learned as the feature representation of that type of fault; Calculate the similarity between the sample to be diagnosed and each fault prototype, and generate diagnostic results; The model is fine-tuned using labeled data to optimize the feature encoder and prototype parameters.
4. The method for fault diagnosis of photovoltaic energy storage cabinet based on deep learning according to claim 1, characterized in that, The feature saliency mapping technique includes: A heatmap related to faults is generated based on gradient-weighted class activation mapping technology. Perform importance analysis on time series data to identify key time points and features; Quantifying the contribution of each feature to the diagnostic results provides a precise basis for interpretation.
5. The method for fault diagnosis of photovoltaic energy storage cabinet based on deep learning according to claim 1, characterized in that, The three-tiered explanatory framework of features, symptoms, and causes includes: Generate detailed technical explanations for technical experts; This maps technical characteristics to device symptom descriptions, providing a mid-level explanation. Based on symptoms and diagnostic results, specific maintenance recommendations and operating instructions are generated.
6. The method for fault diagnosis of photovoltaic energy storage cabinet based on deep learning according to claim 1, characterized in that, The comparative interpretation generator includes: Training an explanation generator model capable of generating counterfactual samples; A counterfactual sample is generated using an interpretation generator to demonstrate the impact of changes in fault characteristics on diagnostic results; Based on the original samples and counterfactual samples, a comparative explanation is constructed to highlight key decision-making characteristics.
7. The method for fault diagnosis of photovoltaic energy storage cabinet based on deep learning according to claim 6, characterized in that, The interpreter generator adopts an encoder-decoder architecture. The encoder part uses a structure similar to the feature encoder, and the decoder part adopts a transposed convolution structure. A conditional injection module is configured between the encoder and decoder to incorporate the target fault category and intervention intensity information into the latent representation.
8. The method for fault diagnosis of photovoltaic energy storage cabinet based on deep learning according to claim 1, characterized in that, The interactive diagnostic interface includes: It supports users in constructing hypothetical scenarios to explore the impact of feature changes on diagnostic results; Integrate visual views to comprehensively display diagnostic information; We integrate expert feedback to continuously optimize the quality of diagnosis and interpretation.
9. The method for fault diagnosis of photovoltaic energy storage cabinet based on deep learning according to claim 1, characterized in that, The feature encoder adopts a multi-layer temporal convolutional network structure. Each convolutional block in the multi-layer temporal convolutional network structure consists of a one-dimensional convolutional layer, a batch normalization layer, an activation function, and a pooling layer. The first convolutional layer uses multi-scale convolutional kernels to capture features at different time scales.
10. A photovoltaic energy storage cabinet fault diagnosis system based on deep learning, characterized in that, A method for performing a deep learning-based photovoltaic energy storage cabinet fault diagnosis according to any one of claims 1-9 includes: The pre-training module is used to pre-train the monitoring data of unlabeled photovoltaic energy storage cabinets using a contrastive learning algorithm with physical constraints, and to construct a feature representation space with physical meaning. The prototype diagnostic module is used to build a prototype diagnostic model based on a pre-trained feature encoder to achieve fault diagnosis. The explanation generation module is used to build a comparative explanation generator, which provides intuitive explanations of failures by generating counterfactual samples; The feature mapping module is used to construct feature saliency mapping techniques to highlight key data features that affect diagnostic results. The multi-level explanation module is used to construct a three-level explanation architecture of features, symptoms, and causes, and to transform the diagnostic results into a form that is easy for maintenance personnel to understand. The interactive interface module is used to build an interactive diagnostic interface, allowing users to explore different fault conditions through hypothetical scenarios.
Citation Information
Patent Citations
Industrial control anomaly interpretation method and system based on generative anti-fact sample difference
CN119067225A
Decision optimization method based on anti-fact interpretation
CN119207814A