Photovoltaic energy storage cabinet fault diagnosis method and system based on deep learning
Photovoltaic energy storage cabinet fault diagnosis is carried out through deep learning technology. The feature representation space is constructed using contrastive learning of physical constraints and feature encoders. Counterfactual samples are generated to provide explanations. This solves the problems of data scarcity and interpretability, achieves high-precision and rapid adaptation, and meets actual engineering needs.
Patent Information
- Application Number
- CN202511232676.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-01
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2045-09-01
AI Technical Summary
Existing photovoltaic energy storage cabinet fault diagnosis technology has low diagnostic accuracy and insufficient interpretability under data scarcity conditions, making it difficult to adapt to new equipment and new fault types. In addition, the interpretation method is single and cannot meet actual engineering needs.
A deep learning-based approach is adopted, and a contrastive learning algorithm with physical constraints is used to pre-train unlabeled data to construct a feature representation space. Combined with a feature encoder and a prototype diagnostic model, it provides intuitive explanations by generating counterfactual samples, and constructs feature saliency mapping and an interactive interface to support users in exploring fault conditions.
Achieve high-precision fault diagnosis with a small number of labeled samples, provide clear fault explanations, quickly adapt to new equipment, reduce data collection and deployment costs, improve maintenance personnel's understanding and trust, and improve fault handling efficiency.
Smart Images

Figure CN120744463A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of photovoltaic energy storage system fault diagnosis, and more specifically, to a photovoltaic energy storage cabinet fault diagnosis method and system based on deep learning. Background Art
[0002] With the rapid development of renewable energy technologies, photovoltaic power generation systems are widely used worldwide. As a core component of photovoltaic power generation systems, photovoltaic energy storage cabinets are responsible for energy storage, scheduling, and stable system operation. Their reliability directly affects the safety and economic benefits of the entire photovoltaic system. Therefore, accurate and timely fault diagnosis of photovoltaic energy storage cabinets is of great significance.
[0003] Currently, PV energy storage cabinet fault diagnosis mainly uses technical routes such as rule-based expert systems, traditional machine learning methods, and deep learning methods. However, existing technologies have the following shortcomings: The problem of data scarcity seriously restricts the performance of the diagnostic system. The frequency of failure of photovoltaic energy storage cabinets during normal operation is relatively low. Especially for new equipment and rare fault types, the number of fault samples available for training is very limited and the distribution is extremely uneven. Traditional supervised learning methods rely heavily on a large amount of high-quality labeled data. In a data-scarce environment, overfitting often occurs, resulting in poor model generalization ability and decreased diagnostic accuracy. Existing diagnostic methods generally have the problem of insufficient explainability. Although the fault diagnosis method based on deep learning can achieve high diagnostic accuracy in some scenarios, its internal decision-making process presents a "black box" feature and cannot provide maintenance personnel with clear diagnostic basis and fault analysis results. This lack of transparency in the diagnostic method not only reduces the credibility of the system, but also makes it difficult to guide actual maintenance work, limiting the engineering application value of the technology. Existing interpretability methods face the difficult problem of balancing performance and transparency. Traditional interpretable machine learning methods usually simplify the model structure (such as decision However, this simplification often comes at the expense of the model's expressiveness and diagnostic accuracy, and cannot fully capture the complex failure modes of photovoltaic energy storage systems and the nonlinear relationships between multi-dimensional monitoring data. The system also has limited adaptability to new equipment and fault types. Photovoltaic energy storage technology is developing rapidly, equipment models are frequently updated, and new failure modes are constantly emerging. Existing diagnostic systems lack the ability to quickly adapt to new equipment and new fault types. Whenever 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. Existing interpretability technologies often use a single interpretation method and are not very practical. Existing interpretability technologies often use a single interpretation method, such as feature importance ranking, decision tree path analysis, or attention weight visualization. The interpretation results of these methods are often not intuitive, making them difficult for maintenance personnel with different technical backgrounds to understand and apply, limiting the promotion and application of interpretable diagnostic technologies in actual engineering projects.
[0004] Therefore, there is an urgent need for a photovoltaic energy storage cabinet fault diagnosis technology that can achieve high-precision fault diagnosis under data scarcity conditions and has good interpretability and rapid adaptability to meet the needs of actual engineering applications. Summary of the Invention
[0005] The present invention provides a photovoltaic energy storage cabinet fault diagnosis method and system based on deep learning, which solves technical problems in related technologies such as low diagnostic accuracy, insufficient interpretability, and difficulty in adapting to new equipment under data scarcity conditions.
[0006] The present invention provides a photovoltaic energy storage cabinet fault diagnosis method based on deep learning, comprising: A physically constrained contrastive learning algorithm is used to pre-train unlabeled photovoltaic energy storage cabinet monitoring data to construct a physically meaningful feature representation space. Based on the feature representation space, the feature encoder is trained using labeled samples and a prototype diagnostic model is constructed; Based on the output of the feature encoder, a contrastive explanation generator is constructed to provide intuitive fault explanations by generating counterfactual samples. Based on the diagnostic process of the prototype diagnostic model and the output results of the feature encoder, a feature saliency mapping technology 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 diagnosis model, a three-layer explanation architecture of features, symptoms, and causes is constructed to convert the diagnosis results into a form that is easy for maintenance personnel to understand; Based on the three-layer explanation architecture and counterfactual samples generated by the comparative explanation generator, an interactive diagnostic interface is constructed to support users in exploring different fault conditions through hypothetical scenarios.
[0007] Furthermore, the physical constraint contrast learning algorithm includes: Apply data enhancement technology to the original energy storage cabinet monitoring data to generate positive sample pairs; Incorporating the physical model constraints of the photovoltaic energy storage cabinet into the contrastive learning process, penalizing feature representations that violate the physical laws of the energy storage system; A contrastive learning objective is constructed based on the InfoNCE loss function, which makes similar samples close to each other in the feature space and different samples far away from each other.
[0008] Furthermore, the prototype diagnostic model includes: For each fault type, a set of representative prototype vectors is learned as the feature representation of this type of fault; Calculate the similarity between the sample to be diagnosed and each fault prototype to generate the diagnosis result; The model is fine-tuned using labeled data to optimize the feature encoder and prototype parameters.
[0009] Furthermore, the feature saliency mapping technology includes: Generate fault-related heatmaps based on gradient-weighted class activation mapping technology; Perform importance analysis on time series data to identify key time points and features; Quantify the contribution of each feature to the diagnosis result and provide accurate interpretation basis.
[0010] Furthermore, the three-layer explanation framework of characteristics, symptoms, and causes includes: Generate detailed technical explanations for technical experts; Mapping technical features to device symptom descriptions, providing mid-level explanations; Generate specific repair recommendations and operating instructions based on symptoms and diagnostic results.
[0011] Furthermore, the contrastive explanation generator includes: Train an explanation generator model that can generate counterfactual examples; Use the explanation generator to generate counterfactual samples to show the impact of fault feature changes on diagnostic results; Based on the original sample and the counterfactual sample, a comparative explanation is constructed to highlight the key decision features.
[0012] Furthermore, the explanation 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 potential representation.
[0013] Furthermore, the interactive diagnostic interface includes: Support users to construct hypothetical scenarios and explore the impact of feature changes on diagnostic results; Integrate visual views to comprehensively display diagnostic information; Integrate expert feedback to continuously optimize diagnostic and interpretation quality.
[0014] Furthermore, the feature encoder adopts a multi-layer temporal convolutional network structure, in which each convolution block consists of a one-dimensional convolution layer, a batch normalization layer, an activation function and a pooling layer, and the first convolution layer uses a multi-scale convolution kernel to capture features of different time scales.
[0015] The present invention provides a photovoltaic energy storage cabinet fault diagnosis system based on deep learning, which is used to execute the above-mentioned photovoltaic energy storage cabinet fault diagnosis method based on deep learning, including: A pre-training module is used to pre-train unlabeled photovoltaic energy storage cabinet monitoring data using a physically constrained contrastive learning algorithm to construct a physically meaningful feature representation space; Prototype diagnosis module, which is used to build a prototype diagnosis model based on pre-trained feature encoders to implement fault diagnosis; The explanation generation module is used to build a contrastive explanation generator to provide intuitive fault explanations by generating counterfactual samples; Feature mapping module, used to build feature saliency mapping technology to highlight key data features that affect diagnostic results; A multi-level explanation module is used to construct a three-level explanation framework of features, symptoms, and causes, converting 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 that supports users to explore different fault conditions through hypothetical scenarios.
[0016] The beneficial effects of the present invention are as follows: through comparative learning pre-training and few-sample fine-tuning strategies, the system only needs a small number of labeled samples to learn and identify new faults, reducing data collection and labeling costs; By generating comparative explanations and mapping feature significance, the system can intuitively demonstrate why this fault occurred rather than another, improving explanation clarity and enhancing maintenance personnel's understanding and trust in diagnostic results. Through an explanation-driven representation learning mechanism, the system improves both interpretability and diagnostic accuracy, successfully resolving the contradiction between accuracy and interpretability in traditional methods. Based on the pre-training-fine-tuning framework, the system can quickly adapt to new devices and build high-performance diagnostic models without requiring a large number of samples, reducing the cost of model iteration and updating. Through a three-tiered explanation architecture of features, symptoms, and causes, the system can provide different levels of explanation based on user context, from technical parameters to specific maintenance recommendations, meeting the needs of personnel in different roles and improving the practicality of explanations. Through the interactive diagnostic interface, maintenance personnel can explore "what-if scenarios", deepen their understanding of fault mechanisms, and improve the efficiency and accuracy of fault handling. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 This is a flow chart of a photovoltaic energy storage cabinet fault diagnosis method based on deep learning in the present invention; Figure 2 It is a line chart of the loss value changes of the contrast loss, physical constraint loss and total loss in the pre-training stage of contrast learning; Figure 3 This is a bar chart showing the accuracy of the proposed method and traditional supervised learning methods in diagnosing five common photovoltaic energy storage cabinet faults; Figure 4 It is a scatter plot of the relationship between the number of labeled samples and diagnostic accuracy; Figure 5 It is a bar chart of feature importance analysis for battery overcharge fault diagnosis; Figure 6 It is a grouped bar chart of satisfaction scores of different user roles for diagnostic explanations; Figure 7 It is a radar chart that evaluates the five dimensions of diagnostic system performance. DETAILED DESCRIPTION
[0018] The subject matter described herein will now be discussed with reference to example embodiments. It should be understood that these embodiments are discussed solely to enable those skilled in the art to better understand and implement the subject matter described herein, and that the functions and arrangements of the elements discussed may be varied without departing from the scope of this specification. Various examples may omit, substitute, or add various processes or components as needed. Furthermore, features described in some examples may be combined in other examples.
[0019] At least one embodiment of the present invention discloses a photovoltaic energy storage cabinet fault diagnosis method based on deep learning, such as Figure 1 As shown, including: Step 1: Use a physically constrained contrastive learning algorithm to pre-train unlabeled photovoltaic energy storage cabinet monitoring data to construct a physically meaningful feature representation space; In this step, a physical-constrained contrastive learning algorithm is used to pre-train the unlabeled photovoltaic energy storage cabinet monitoring data to construct a feature representation space with physical meaning. It should be noted that this step includes: Step 1.1, data enhancement; Apply various data enhancement techniques to the original energy storage cabinet monitoring data to generate positive sample pairs. The specific implementation is: , using time masking, amplitude scaling, Gaussian noise addition and frequency domain transformation to generate enhanced samples To ensure that the enhancement operation does not change the physical characteristics of the fault, the parameters of the enhancement operation will be strictly controlled. For example, the amplitude scaling ratio and the variance of the Gaussian noise will be limited to a very small range to simulate real disturbances such as sensor drift or background noise, rather than creating new fault modes. At the same time, a pair of positive samples are constructed. Optionally, the selection of enhanced operations can be adapted according to the specific fault type. For example, for current fluctuation faults, frequency domain transformation can be used first; for temperature anomaly faults, amplitude scaling can be used first.
[0020] Step 1.2, physical constraint encoding; Incorporate the physical model constraints of the photovoltaic energy storage cabinet into the contrastive learning process to ensure that the learned feature representation conforms to physical laws. The specific implementation is: construct a physical constraint loss function , imposes penalties on feature representations that violate the physical laws of the energy storage system (such as energy conservation, state of charge change rate limit, temperature and resistance relationship, etc.), so that the model learns features that conform to physical laws. In some embodiments, physical constraints can be expressed as a set of inequalities or equality constraints, which are converted into regularization terms of the loss function through the penalty function method. Specifically, the physical constraint loss function It can be specifically expressed as: ; in represents the physical constraint loss function, represents the energy conservation constraint loss term, represents the state of charge constraint loss term, represents the Ohm's law constraint loss term, 、 、 They represent the weight coefficients of energy conservation constraint, state of charge constraint and Ohm's law constraint respectively.
[0021] Step 1.3, contrast feature learning; Based on the InfoNCE loss function, a comparative learning objective is constructed to make similar samples close together in the feature space and different samples far apart. The specific implementation is as follows: First, through the feature encoder Map the input data to the feature space, for the positive sample pair , minimize its feature representation and The distance between them is maximized, while maximizing the distance between them and the feature representations of other samples in the batch. The feature encoder parameters are optimized by gradient descent. The total loss function is composed of the weighted contrast loss and the physical constraint loss. The weight coefficient is adjusted by hyperparameter optimization methods such as Grid Search to find an optimal value to balance data-driven feature learning and the constraints of physical knowledge priors. Represents the feature representation of the input data X after passing through the feature encoder, Represents the feature representation of the enhanced data after passing through the feature encoder.
[0022] In this process, the specific implementation of the InfoNCE loss function is: first calculate the similarity between feature representations, that is, Function, which uses cosine similarity to calculate the similarity between two feature vectors, specifically the dot product of two normalized vectors. Then, a softmax function is used to convert the similarity into a probability distribution, in which the temperature parameter is introduced Controls the smoothness of the probability distribution. Finally, by minimizing the negative log-likelihood loss, the feature representations of the positive sample pairs are made more similar, while being more different 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 the positive sample pairs is first calculated and divided by the temperature parameter , and then calculate the exponential of this value; then calculate the sum of the exponential similarities of this feature vector and all other sample feature vectors in the batch; finally calculate the ratio of these two values and take its negative logarithm, which represents the goal of maximizing the similarity of the positive sample pair relative to the similarity of other sample pairs; in Represents the calculation of eigenvectors and The similarity function between and Respectively represent and feature vectors, Represents the temperature parameter.
[0023] The feature encoder uses a multi-layer temporal convolutional network structure, consisting of three convolutional blocks. Each convolutional block consists of a one-dimensional convolution layer, a batch normalization layer, a ReLU activation function, and a maximum pooling layer. The specific structure is as follows: the first convolution layer uses multi-scale convolution kernels (sizes 3, 5, and 7, respectively) to capture features at different time scales and fuse them through an attention mechanism (the attention mechanism here specifically refers to channel attention, which can adaptively enhance the weights of key feature channels); the middle layer uses a residual connection structure to prevent gradient vanishing (this residual connection adds the input and output element by element, allowing the gradient to propagate more effectively in the deep network); and the last layer uses global average pooling to produce a fixed-dimensional feature representation. The input of the feature encoder is the multi-dimensional time series monitoring data of the photovoltaic energy storage cabinet, and the output is a 128-dimensional feature vector that captures the key features related to the fault.
[0024] It should be understood that the feature encoder can also be implemented using other network structures. For example, in some embodiments, a transformer-based structure can be used to process long sequence dependencies, or a graph convolutional network can be used to process the association relationship between components within the energy storage cabinet.
[0025] like Figure 2 As shown in the figure, the line graph of the contrastive loss, physical constraint loss, and total loss during the contrastive learning pre-training phase shows the changing trends of different loss functions during the system pre-training phase, including contrastive loss, physical constraint loss, and total loss, over the training rounds. This verifies the convergence performance of the physical constraint contrastive learning algorithm. As can be seen from the figure, the total loss stabilizes after approximately 200 training rounds. The introduction of the physical constraint loss effectively guides the feature learning process, ensuring that the learned feature representation conforms to the physical laws of the energy storage system.
[0026] Step 2: Based on the feature representation space, the feature encoder is trained using labeled samples and a prototype diagnostic model is constructed. In this step, we use a small number of labeled samples to build an interpretable prototype diagnostic model based on the pre-trained feature encoder. In addition, this step includes: Step 2.1, fault prototype learning; For each fault type, a set of representative prototype vectors is learned as the feature representation of this type of fault. The specific implementation is: for each fault category , from the category Select or learn from labeled samples Prototype vectors: ; in, 、 、 Respectively indicate the fault type The first, second, and prototype vectors, is the number of prototype vectors for each fault category; These prototype vectors can best characterize the typical characteristic patterns of this type of fault. Optionally, prototype learning can be achieved through clustering algorithms such as K-means clustering or Gaussian mixture models, or it can be automatically learned through an end-to-end network training process.
[0027] Step 2.2, prototype similarity calculation; Calculate the similarity between the sample to be diagnosed and each fault prototype and generate the diagnosis result. The specific implementation is: for the input sample , extract feature representation through feature encoder ,calculate The similarity between each fault category prototype set can be calculated by using methods such as the nearest prototype distance and the prototype weighted average distance, and finally generating a sample The probability distribution of belonging to each fault class.
[0028] The prototype diagnosis model consists of a feature encoder and a prototype layer. The prototype layer stores the prototype vectors ( Typically 3-5, each prototype vector has the same dimensions as the feature encoder output (128 dimensions). For an input sample, the feature encoder first extracts features. The similarity between this feature and all prototype vectors is then calculated (using cosine similarity or negative Euclidean distance). Finally, a weighted voting or nearest prototype rule is used to determine the final fault category. Each vector in the prototype layer has a clear physical meaning, representing a typical characteristic pattern for a specific fault type. The fault characteristics can be intuitively understood by comparing it with the normal state.
[0029] Step 2.3, fine-tuning and optimization; Fine-tune the model using a small amount of labeled data to improve diagnostic accuracy. Specifically, this involves using a pre-trained feature encoder and supervised fine-tuning using a small amount of labeled data (only 5-10 samples per fault type) using a cross-entropy loss function and a prototype learning loss function. This optimizes the feature encoder and prototype parameters and improves diagnostic accuracy. In some implementations, techniques such as gradient projection can be used to ensure that the fine-tuning process does not disrupt the physical constraints learned during the pre-training phase.
[0030] like Figure 3 The results show the accuracy of this method compared to traditional supervised learning methods in diagnosing five common photovoltaic energy storage cabinet faults, validating the method's performance advantages in diagnosing various fault types, with a particularly significant improvement in complex fault types. Experimental results show that the method's average diagnostic accuracy for five fault types, including battery overcharge, abnormal temperature, voltage fluctuation, abnormal charging, and abnormal discharging, exceeds 90%, representing a 15% to 25% improvement over traditional methods.
[0031] like Figure 4 The scatter plot of the number of labeled samples and diagnostic accuracy, shown in Figure 2, demonstrates the relationship between the number of labeled samples for each fault type and diagnostic accuracy. This verifies that this method can achieve high accuracy with only a small amount of labeled data, demonstrating the system's data efficiency advantage. As can be seen from the figure, when the number of labeled samples for each fault type reaches 5 to 8, the diagnostic accuracy reaches over 85%, while traditional methods typically require 50 to 100 labeled samples to achieve the same performance level.
[0032] Step 3: Based on the output of the feature encoder, a contrastive explanation generator is constructed to provide intuitive fault explanations by generating counterfactual samples. In this step, a contrastive explanation generator is constructed to provide intuitive fault explanations by generating counterfactual samples. This step includes: Step 3.1, explain generator training; Train an explanation generator model that can generate counterfactual samples. The specific implementation is: build an explanation generator based on conditional generative adversarial network , the input includes the original sample , target fault category and intervention intensity , the output is the counterfactual sample , so that the counterfactual sample While keeping most features unchanged, the diagnosis result becomes the target fault category .
[0033] The loss function for generating counterfactual samples consists of two parts: The first part is the reconstruction loss, which generates samples by calculating With the original sample The square of the Euclidean distance between them ensures that the generated counterfactual samples are similar to the original samples in overall structure; The second part is the category condition loss, the discriminator network Used to evaluate whether the generated samples conform to the target fault category characteristic distribution.
[0034] These two losses are expressed through weight parameters Balance, where Control the trade-off between sample similarity and category variation. For the complete computation of the loss for generating counterfactual samples, we first compute the input sample and target fault category and intervention intensity Using Generators Generate counterfactual samples and then calculate the difference between the counterfactual samples and the original samples The square of the Euclidean distance; at the same time, using the discriminator Evaluate whether the generated samples conform to the target fault category The feature distribution of the two losses is weighted By minimizing this combined loss function, the explanation generator can generate counterfactual samples that maintain the overall structure of the original samples while conforming to the characteristics of the target fault category, providing an interpretable comparison basis for fault diagnosis.
[0035] The explanation generator adopts an encoder-decoder architecture. The encoder part uses a structure similar to the feature encoder to encode the input time series data into a potential representation; the decoder part uses a transposed convolution structure to reconstruct the potential representation into time series data. Between the encoder and decoder, a conditional injection module is configured to inject the target fault category into the decoder. and intervention intensity Information is incorporated into the latent representation. Generator training employs a combination of adversarial loss, reconstruction loss, and class-conditional loss to ensure that generated samples retain the key features of the original samples while conforming to the characteristic distribution of the target fault category. The discriminator employs a fully convolutional network architecture to simultaneously determine sample authenticity and class labels. Through adversarial training, the generator and discriminator mutually enhance each other, ultimately generating high-quality counterfactual samples.
[0036] The adversarial loss, reconstruction loss, and class-conditional loss work together to form a weighted sum of these three losses to form the final optimization goal, ensuring that the generated counterfactual samples are both credible and meet the requirements of interpretability. Specifically, the relationship and role of these three losses are as follows: Adversarial loss is the core of the standard GAN framework, through the generator and the discriminator The adversarial training enables the generator to learn the real data distribution and ensure the rationality of the generated samples; the reconstruction loss is calculated using the L1 or L2 norm to ensure that the generated counterfactual samples Overall, the original sample Maintain high similarity and only make necessary local feature modifications; the category condition loss is used in the cGAN framework to determine whether the sample meets the target fault category features, guiding the generator to learn an accurate mapping from original samples to target category samples.
[0037] It is worth noting that in some embodiments, the explanation generator can also be implemented using other generative model architectures such as variational autoencoder (VAE) or diffusion model, and the most suitable generative model architecture can be selected according to the specific application scenario.
[0038] Step 3.2, counterfactual sample generation; Use the explanation generator to generate counterfactual samples to show how the diagnosis results will change if the fault characteristics change. (The diagnosis is ), select the target fault category , by explaining the generator Generate counterfactual examples: ; in represents the generated counterfactual sample; Represents the explanation generator model; Represents the original sample to be explained; Indicates the target fault category; represents the intervention intensity parameter; Counterfactual samples and Similar but with a diagnosis of , by comparison and The key features that affect the diagnosis results are intuitively displayed.
[0039] Step 3.3, comparative explanation construction; Based on the original sample and the counterfactual sample, a comparative explanation is constructed to highlight the key decision features. The specific implementation is: calculate the original sample and counterfactual samples Differences in each feature dimension, identify the feature dimension with the most obvious differences, and generate a comparative explanation: "The sample is diagnosed as the diagnosis result rather than , 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), (representing the original value of feature C), rather than (representing the counterfactual value of feature A), (representing the counterfactual value of feature B), (representing the counterfactual value of feature C)”, thus providing an intuitive basis for diagnosis. Optionally, for complex multi-dimensional 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.
[0040] Step 4: Based on the diagnostic process of the prototype diagnostic model and the output results of the feature encoder, a feature saliency mapping technology is constructed to highlight the key data features that affect the diagnostic results; In this step, feature saliency mapping technology is constructed to highlight key data features that affect the diagnosis results. This step includes: Step 4.1, gradient weighted class activation map generation; Based on the gradient weighted class activation mapping technology, a fault-related heat map is generated. The specific implementation is as follows: for the diagnosis results and feature representation , calculate the gradient (Indicates diagnosis results Feature Representation The gradient information is weighted and fused with the feature activation value to generate a feature saliency heatmap, highlighting the feature regions that contribute most to the diagnosis. In some embodiments, integrated gradient or SmoothGrad variants can also be used to improve the stability and accuracy of the heatmap.
[0041] Step 4.2, timing importance analysis; Perform importance analysis on time series data to identify key time points and features. Specifically, this involves calculating the contribution of each time point to the diagnostic results for the time series input data, identifying key time windows, and highlighting them in a visual interface to help maintenance personnel understand the fault development process. Furthermore, this can be combined with a change point detection algorithm to automatically identify key time points when a fault occurs.
[0042] Step 4.3, feature contribution quantification; Quantify each feature's contribution to the diagnostic results, providing a precise basis for interpretation. Specifically, this is achieved by using the SHAP (SHapley Additive ex Planations) value calculation method to quantify the marginal contribution of each input feature to the diagnostic result, generating a feature importance ranking and contribution value, providing maintenance personnel with precise interpretation information. In some implementations, feature engineering knowledge can optionally be incorporated to map the contribution of low-level features to high-level fault indicators, improving the understandability of interpretations.
[0043] like Figure 5 The bar chart showing the importance of each feature in battery overcharge fault diagnosis demonstrates the ability of feature significance mapping to accurately identify key diagnostic features and provide valuable explanatory information for maintenance personnel. The figure shows that battery voltage, charge 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 provides maintenance personnel with a clear focus on fault inspection.
[0044] Step 5: Based on the output of the feature saliency mapping and the fault category judgment of the prototype diagnosis model, a three-layer explanation architecture of features, symptoms, and causes is constructed to convert the diagnosis results into a form that is easy for maintenance personnel to understand; In this step, a three-layer explanation framework of features, symptoms, and causes is constructed to convert the diagnostic results into a form that is easy for maintenance personnel to understand. This step includes: Step 5.1, technical layer explanation generation; Generate detailed technical explanations for technical experts. Specifically, this provides complete technical information, including feature importance analysis, prototype matching, and decision boundaries. This includes detailed numerical parameters and technical indicators, meeting the in-depth analysis needs of professional technicians. Note that technical explanations can include advanced analysis views, such as visual feature distribution maps and fault evolution trajectories.
[0045] Step 5.2, symptom layer explanation generation; Mapping technical features into device symptom descriptions provides mid-level explanations. Specifically, this involves using a pre-established feature-symptom mapping knowledge base to convert technical features (such as voltage fluctuations and temperature anomalies) into device symptom descriptions (such as "reduced charging efficiency" and "abnormal heat dissipation"), providing device-level explanations of fault manifestations. Furthermore, symptom-level explanations can utilize natural language generation technology to convert numerical features into descriptive text.
[0046] Step 5.3, maintenance layer explanation generation; Generate practical explanatory information for maintenance operations. Specifically, based on symptoms and diagnostic results, the system generates specific maintenance recommendations and instructions from a fault-repair knowledge base, such as "Check the cooling fan" or "Replace a specific control board," directly guiding maintenance efforts. Optionally, these recommendations can include priority ranking to help maintenance personnel prioritize repairs.
[0047] like Figure 6The grouped bar chart shows the satisfaction scores of users with different technical backgrounds for the fault explanations provided by this proposed method and traditional methods. This demonstrates that the multi-level explanation architecture can meet the needs of users with different roles, particularly improving the understanding of fault explanations by non-technical personnel. Experimental results show that for senior engineers, mid-level maintenance personnel, and general operators, the proposed method achieved satisfaction scores of 4.6, 4.4, and 4.2 (out of 5), respectively, representing improvements of 0.8, 1.2, and 1.6 points compared to traditional methods.
[0048] Step 6: Based on the three-layer explanation architecture and the counterfactual samples generated by the comparative explanation generator, an interactive diagnostic interface is constructed to support users in exploring different fault conditions through hypothetical scenarios. In this step, an interactive diagnostic interface is built to allow users to explore different fault conditions through what-if scenarios. This step includes: Step 6.1, hypothetical scenario construction; This system allows users to construct "what-if" scenarios and explore the impact of feature changes on diagnostic results. This is achieved by providing an interactive interface that allows users to adjust input feature parameters (such as voltage, current, and temperature). The system then generates new diagnostic results and explanations in real time, helping users understand the impact of different parameters on fault diagnosis. Furthermore, the system can provide recommended parameter variation ranges to ensure that user-created "what-if" scenarios are physically feasible.
[0049] Step 6.2, multi-view collaborative display; Integrate multiple visualization views to comprehensively present diagnostic information. Specifically, this involves collaboratively displaying views such as time series data, feature importance, prototype matching, and repair recommendations. User actions on one view dynamically update other views, providing a comprehensive understanding of the diagnostic context. It should be understood that the view layout can automatically adjust based on the characteristics of the display device (e.g., desktop or mobile).
[0050] Step 6.3, integration of expert feedback; Integrate expert feedback to continuously optimize the quality of diagnosis and interpretation. This is achieved by providing a feedback collection mechanism that allows experts to evaluate and revise 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 utilize an active learning framework to prioritize sample feedback that is most valuable for model improvement.
[0051] like Figure 7As shown, the radar chart of the five dimensions of diagnostic system performance evaluates the performance of the present application method and traditional methods from the five dimensions of accuracy, interpretability, data efficiency, adaptability, and real-time performance, fully demonstrating the comprehensive advantages of the present system, especially the improvements in interpretability and data efficiency. The experimental results show that the present method scores 0.89 in the interpretability dimension, an improvement of 71% compared to the traditional method's 0.52; and scores 0.91 in the data efficiency dimension, an improvement of 112% compared to the traditional method's 0.43, fully verifying the effectiveness of the present application's technical solution.
[0052] A photovoltaic energy storage cabinet fault diagnosis system based on deep learning is used to execute the photovoltaic energy storage cabinet fault diagnosis method based on deep learning, comprising: A pre-training module is used to pre-train unlabeled photovoltaic energy storage cabinet monitoring data using a physically constrained contrastive learning algorithm to construct a physically meaningful feature representation space; Prototype diagnosis module, which is used to build a prototype diagnosis model based on pre-trained feature encoders to implement fault diagnosis; The explanation generation module is used to build a contrastive explanation generator to provide intuitive fault explanations by generating counterfactual samples; Feature mapping module, used to build feature saliency mapping technology to highlight key data features that affect diagnostic results; A multi-level explanation module is used to construct a three-level explanation framework of features, symptoms, and causes, converting 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 that supports users to explore different fault conditions through hypothetical scenarios.
[0053] The above describes an embodiment of the present invention, but this embodiment is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Ordinary technicians in this field can also make more forms of equivalent embodiments based on the inspiration of this embodiment, all of which are protected by this embodiment.
Claims
1. A photovoltaic energy storage cabinet fault diagnosis method based on deep learning, characterized in that: include: A physically constrained contrastive learning algorithm is used to pre-train unlabeled photovoltaic energy storage cabinet monitoring data to construct a physically meaningful feature representation space. Based on the feature representation space, the feature encoder is trained using labeled samples and a prototype diagnostic model is constructed; Based on the output of the feature encoder, a contrastive explanation generator is constructed to provide intuitive fault explanations by generating counterfactual samples. Based on the diagnostic process of the prototype diagnostic model and the output results of the feature encoder, a feature saliency mapping technology 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 diagnosis model, a three-layer explanation architecture of features, symptoms, and causes is constructed to convert the diagnosis results into a form that is easy for maintenance personnel to understand; Based on the three-layer explanation architecture and counterfactual samples generated by the comparative explanation generator, an interactive diagnostic interface is constructed to support users in exploring different fault conditions through hypothetical scenarios.
2. A photovoltaic energy storage cabinet fault diagnosis method based on deep learning according to claim 1, characterized in that: The physical constraint contrast learning algorithm includes: Apply data enhancement technology to the original energy storage cabinet monitoring data to generate positive sample pairs; Incorporating the physical model constraints of the photovoltaic energy storage cabinet into the contrastive learning process, penalizing feature representations that violate the physical laws of the energy storage system; A contrastive learning objective is constructed based on the InfoNCE loss function, which makes similar samples close to each other in the feature space and different samples far away from each other.
3. A photovoltaic energy storage cabinet fault diagnosis method 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 this type of fault; Calculate the similarity between the sample to be diagnosed and each fault prototype to generate the diagnosis result; The model is fine-tuned using labeled data to optimize the feature encoder and prototype parameters.
4. A photovoltaic energy storage cabinet fault diagnosis method based on deep learning according to claim 1, characterized in that: The feature saliency mapping technology includes: Generate fault-related heatmaps based on gradient-weighted class activation mapping technology; Perform importance analysis on time series data to identify key time points and features; Quantify the contribution of each feature to the diagnosis result and provide accurate interpretation basis.
5. The photovoltaic energy storage cabinet fault diagnosis method based on deep learning according to claim 1 is characterized in that: The three-tiered explanatory framework of features, symptoms, and causes includes: Generate detailed technical explanations for technical experts; Mapping technical features to device symptom descriptions, providing mid-level explanations; Generate specific repair recommendations and operating instructions based on symptoms and diagnostic results.
6. A photovoltaic energy storage cabinet fault diagnosis method based on deep learning according to claim 1, characterized in that: The contrastive explanation generator includes: Train an explanation generator model that can generate counterfactual examples; Use the explanation generator to generate counterfactual samples to show the impact of fault feature changes on diagnostic results; Based on the original sample and the counterfactual sample, a comparative explanation is constructed to highlight the key decision features.
7. A photovoltaic energy storage cabinet fault diagnosis method based on deep learning according to claim 6, characterized in that: The explanation 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 potential representation.
8. The photovoltaic energy storage cabinet fault diagnosis method based on deep learning according to claim 1 is characterized in that: The interactive diagnostic interface includes: Support users to construct hypothetical scenarios and explore the impact of feature changes on diagnostic results; Integrate visual views to comprehensively display diagnostic information; Integrate expert feedback to continuously optimize diagnostic and interpretation quality.
9. The photovoltaic energy storage cabinet fault diagnosis method based on deep learning according to claim 1 is characterized in that: The feature encoder adopts a multi-layer temporal convolutional network structure. Each convolution block in the multi-layer temporal convolutional network structure consists of a one-dimensional convolution layer, a batch normalization layer, an activation function and a pooling layer. The first convolution layer uses a multi-scale convolution kernel to capture features of different time scales.
10. A photovoltaic energy storage cabinet fault diagnosis system based on deep learning, characterized in that: A photovoltaic energy storage cabinet fault diagnosis method based on deep learning for executing any one of claims 1-9, comprising: A pre-training module is used to pre-train unlabeled photovoltaic energy storage cabinet monitoring data using a physically constrained contrastive learning algorithm to construct a physically meaningful feature representation space; Prototype diagnosis module, which is used to build a prototype diagnosis model based on pre-trained feature encoders to implement fault diagnosis; The explanation generation module is used to build a contrastive explanation generator to provide intuitive fault explanations by generating counterfactual samples; Feature mapping module, used to build feature saliency mapping technology to highlight key data features that affect diagnostic results; A multi-level explanation module is used to construct a three-level explanation framework of features, symptoms, and causes, converting 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 that supports users to explore different fault conditions through hypothetical scenarios.
Citation Information
Patent Citations
System for proving robust interpretable machine learning model
CN115997218A
Industrial control anomaly interpretation method and system based on generative anti-fact sample difference
CN119067225A
Decision optimization method based on anti-fact interpretation
CN119207814A
Self-adaptive fault diagnosis method of distributed photovoltaic system and related device
CN120342323A
Using generative adversarial networks to construct realistic counterfactual explanations for machine learning models
US20220188645A1
Cited By
Transform-based double-branch photovoltaic panel fault identification method
CN121640174A