Federal knowledge distillation method for compressing photovoltaic fault detection model

By adopting a Transformer structure and a deep separable convolution student model in the photovoltaic fault detection model, combining knowledge distillation and the federal knowledge distillation method of adaptive weight allocation, resource-constrained equipment deployment and data privacy issues are solved, and efficient and secure photovoltaic fault detection is achieved.

CN120449988APending Publication Date: 2025-08-08DALIAN UNIV OF TECH
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510460187.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-14
Publication Date
2025-08-08

AI Technical Summary

Technical Problem

The existing photovoltaic fault detection models have large calculation volume and many parameters, making them difficult to deploy on resource-constrained devices. In the federated learning scenario, knowledge distillation efficiency is low and communication overhead is large, which affects the wide application of the model and data privacy and security.

Method used

Using a teacher model based on Transformer structure and a deep separable convolution student model, combined with knowledge distillation and adaptive weight allocation, the federal knowledge distillation method is reduced through local pre-training, quantitative coding and efficient knowledge fusion, and ensuring data privacy.

Benefits of technology

It realizes efficient deployment of photovoltaic fault detection models on resource-constrained equipment, ensures detection performance and data security, reduces communication overhead, improves model generalization capabilities and robustness, and is suitable for the stable operation of photovoltaic systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120449988A_ABST
    Figure CN120449988A_ABST
Patent Text Reader

Abstract

The invention discloses a federal knowledge distillation method for compressing a photovoltaic fault detection model, and belongs to the field of photovoltaic fault detection. Knowledge of the teacher model is transmitted to the student model through knowledge distillation, and the model is remarkably compressed; the detection performance is guaranteed, meanwhile, the model complexity and the calculation amount are reduced, the method can be deployed on resource-constrained equipment, and the real-time performance and the universality of photovoltaic fault detection are achieved. A federal knowledge distillation algorithm is designed, and the communication frequency and the data transmission quantity of a local node and a central server are reduced; local knowledge distillation training reduces unnecessary parameter transmission, and the central server adopts an efficient knowledge fusion algorithm to avoid complex information interaction and improve federal learning efficiency. The student model trained by federal knowledge distillation fuses teacher model knowledge, diversified data information of each local node and global knowledge representation, has stronger generalization ability and robustness under low complexity, more accurately and stably detects photovoltaic faults, and improves the operation reliability and stability of a photovoltaic system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of photovoltaic fault detection, and in particular to a federated knowledge distillation method for photovoltaic fault detection model compression. Background Art

[0002] As the world actively promotes energy transformation, photovoltaic power generation, thanks to its clean and sustainable characteristics, continues to grow in its share of the energy mix. As the scale of photovoltaic power plants continues to expand, ensuring the stable and efficient operation of photovoltaic systems has become critical to ensuring power supply. Photovoltaic fault detection models can monitor system operating status in real time, promptly identifying and diagnosing faults. This is crucial for improving power generation efficiency, reducing operation and maintenance costs, and ensuring equipment safety.

[0003] However, existing photovoltaic fault detection models face many challenges. On the one hand, in order to accurately identify complex fault modes, the models usually adopt complex structures and a large number of parameters, resulting in a sharp increase in computational complexity. This not only requires high-performance computing equipment, increasing deployment costs, but also limits the application of the model on resource-constrained devices (such as edge computing devices and small embedded systems), hindering the widespread promotion of the technology. On the other hand, in practical applications, data from multiple photovoltaic power stations are stored in different local nodes. For reasons such as data privacy protection, maintenance of commercial secrets, and data security, centralized training models are difficult to implement. Although federated learning provides a solution for distributed data collaborative training, how to achieve efficient model training and effective compression while protecting data privacy under the federated learning framework remains a difficult problem that needs to be solved urgently.

[0004] Knowledge distillation is an effective model compression technique that transfers knowledge from the teacher model to the student model, reducing model complexity while maintaining performance. It is widely used in the field of model compression. However, existing knowledge distillation methods suffer from low knowledge transfer efficiency and high communication overhead in federated learning scenarios. Due to differences in data distribution among local nodes and communication losses, knowledge transfer is ineffective. Furthermore, frequent model parameter transmission and complex calculations lead to high communication costs, seriously affecting the efficiency and practicality of federated learning. Summary of the Invention

[0005] To address the shortcomings of existing technologies, this paper proposes a federated knowledge distillation method for photovoltaic fault detection model compression. This method aims to overcome the challenges of existing photovoltaic fault detection models, which suffer from the high number of parameters and computational complexity, as well as the low efficiency and high communication overhead of knowledge distillation in federated learning scenarios. This method enables efficient model compression and distributed training, improving the deployment and detection performance of photovoltaic fault detection models on resource-constrained devices, and providing technical support for the stable and efficient operation of photovoltaic systems.

[0006] In order to achieve the above object, the present invention adopts the following technical solutions:

[0007] A federated knowledge distillation method for photovoltaic fault detection model compression includes the following steps:

[0008] S1, build a federated learning framework consisting of local nodes and a central server;

[0009] S2, builds a teacher model based on the Transformer structure at each local node;

[0010] S3, builds a lightweight convolutional neural network based on depthwise separable convolution as a student model in each local node;

[0011] S4, dividing the photovoltaic fault detection data collected by each local node into a training set and a validation set, and using the training set to perform multiple rounds of pre-training on the teacher model of the local node;

[0012] S5: For each local node, perform knowledge distillation training on the student model based on the pre-trained teacher model;

[0013] S6, uploading the trained student model parameters to the central server, the central server generates a global knowledge representation based on the knowledge fusion algorithm of adaptive weight distribution and returns the global knowledge representation to the local node, and the local node uses the global knowledge representation as a constraint to optimize the local student model.

[0014] Furthermore, in S1, local nodes are deployed in each photovoltaic power station and equipped with edge computing equipment; the local nodes are responsible for collecting local photovoltaic system operation data and performing data preprocessing; the collected parameters include real-time current, voltage, power, ambient temperature, component temperature and corresponding timestamps; data preprocessing includes: using a method based on the interquartile range (IQR) to remove outliers in the data. When correcting outliers, the adjacent data interpolation method can be used. If the outlier is power data, and its power at the previous moment is P1 and the power at the next moment is P2, then the correction value is (P1+P2) / 2; the minimum-maximum normalization method is used for processing, and the normalized data can effectively improve the convergence speed and stability of model training;

[0015] The central server is built using a high-performance server equipped with a multi-core CPU, large-capacity memory and high-speed network interface; the central server is responsible for managing the registration, joining and exit operations of local nodes; when a local node applies to join, the central server authenticates it and assigns a unique node identifier after the verification is passed; the identity authentication adopts a two-way authentication mechanism based on digital certificates, and the local node and the central server verify the legitimacy of each other's certificates to ensure the trustworthiness of the identities of both communicating parties.

[0016] Furthermore, in S2, the teacher model adopts a Transformer structure, and the model structure includes multiple Transformer blocks, each Transformer block consists of a multi-head self-attention mechanism (Multi-Head Self-Attention) and a multi-layer perceptron (MLP); the input is denoted as x, and its size is L×D, where L is the photovoltaic sequence data collected in L time steps, and D is the number of specific values of the photovoltaic data of different attributes collected in each time step after preprocessing; x is input into the Transformer block after linear projection and position encoding, and the self-attention mechanism is used to capture the long-distance dependencies and complex features in the photovoltaic data, and then the multi-layer perceptron is used to increase the nonlinear expression ability of the model; after passing through multiple layers of Transformer blocks, the output is obtained, that is, the prediction result of the teacher model for photovoltaic faults, denoted as T(x).

[0017] Furthermore, the calculation formula of the multi-head self-attention mechanism is:

[0018] MultiHead(Q,K,V)=Concat(head1,…,head h )

[0019]

[0020]

[0021] Among them, Q, K, and V are query, key, and value matrices respectively. Q, K, and V of the first-layer Transformer block are obtained by linear projection operation of x; d k is the dimension of the key vector; h is the number of heads, is the learnable weight matrix.

[0022] Furthermore, the teacher model includes 12 Transformer blocks, and the number of multi-head self-attention mechanism heads in each Transformer block is 8.

[0023] Furthermore, in S3, the core module of the student model is depthwise separable convolution; the depthwise separable convolution consists of depthwise convolution and pointwise convolution. The depthwise convolution performs convolution operations on each input channel independently, and the pointwise convolution fuses the output channels of the depthwise convolution through a convolution kernel of size 1. The input of the student model is x, the same as that of the teacher model, and the output after multiple layers of depthwise separable convolution is recorded as S(x).

[0024] Furthermore, in S4, the locally collected photovoltaic fault detection data is divided into a ratio of 70% training set and 30% validation set; the teacher model is pre-trained for multiple rounds using the training set, and the AdamW optimizer is used. The parameter update formula is:

[0025]

[0026]

[0027]

[0028] Among them, m t and v t are the first-order moment estimate and the second-order moment estimate of the gradient, β1 and β2 are the exponential decay rates of the moment estimate, g t is the gradient at the current moment, and is the revised first-order moment estimate and second-order moment estimate, θ t is the teacher model parameter at the current moment, η is the learning rate, ∈ is a small constant to prevent the denominator from being zero, and λ is the weight decay coefficient;

[0029] During the pre-training process, a learning rate warm-up strategy is adopted. Within the first five epochs, the learning rate is gradually increased linearly from 0 to the initial learning rate of 0.001. After that, it is adjusted according to the default strategy of the AdamW optimizer. By dynamically adjusting the learning rate, the teacher model achieves high accuracy and stability on the validation set and fully learns the local data fault characteristics and patterns.

[0030] Furthermore, in S5, based on the pre-trained teacher model, the student model is trained with knowledge distillation. The specific method is as follows:

[0031] The same training data is input into the teacher model and the student model respectively, and the improved loss function is used to realize knowledge transfer; the improved loss function is:

[0032] L KD =α×KL(T(x),S(x))+β×MSE(T(x),S(x))

[0033] Among them, KL(T(x),S(x)) is the KL divergence, which is used to measure the difference in the output probability distribution of the teacher model T(x) and the student model S(x). The calculation formula is:

[0034]

[0035] Where N represents the number of samples used for training;

[0036] MSE(T(x), S(x)) is the mean square error, which is used to measure the difference in the output values of the teacher model T(x) and the student model S(x). The calculation formula is:

[0037]

[0038] α and β are balance coefficients, and their optimal values are determined through cross-validation. The specific method is as follows: During the cross-validation process, the training set is further divided into 5 subsets. Four subsets are taken as training data each time, and one subset is taken as validation data. All combinations are traversed, and the α and β values that make the student model most accurate on the validation set are selected. The back-propagation algorithm is used to update the student model parameters so that its output is close to that of the teacher model.

[0039] During the training process, the student model is evaluated using the validation set every 5 epochs. If the accuracy does not improve after three consecutive evaluations, the early stopping method is used to stop training to avoid overfitting and maintain good generalization ability. At the same time, during the training process, the parameters of the student model are saved regularly, once every 10 epochs, for subsequent analysis and backtracking.

[0040] Furthermore, in S6, the specific process of generating the global knowledge representation is as follows:

[0041] A lossless compression algorithm based on Huffman coding is used to quantize and encode the parameters of the student model that has completed local knowledge distillation training, and then upload it to the central server;

[0042] After the central server receives the student model parameters uploaded by the local node, it uses the knowledge fusion algorithm based on adaptive weight distribution to comprehensively analyze the local node data quality Q i , data volume N i , data distribution diversity D KL (P i ||P global ) and local model training effect E i Perform aggregation and determine the weight w through the multi-factor linear regression model i :

[0043]

[0044] Among them, α1, α2, α3, and α4 are weight coefficients. The grid search method is used to traverse different coefficient combinations within a certain range and select the weight coefficient that makes the global knowledge representation perform best on the validation set; m is the number of local nodes;

[0045] Perform weighted averaging on the local student model parameters to generate a global knowledge representation G:

[0046]

[0047] Among them, θ i are the parameters of the i-th local student model.

[0048] Furthermore, the method for quantizing and encoding the student model parameters using the Huffman coding-based lossless compression algorithm is as follows:

[0049] First, the student model parameters are quantified. The quantification formula is:

[0050]

[0051] Among them, θ is the original student model parameter, θ min and θ max are the minimum and maximum values of the student model parameters, b is the number of bits after quantization, and q is the integer after quantization. In the quantization process, in order to reduce the impact of quantization error on model performance, an adaptive quantization method is used to adjust the quantization step size according to the dynamic range of the parameters.

[0052] Then, Huffman coding is performed on the quantized parameters, and a Huffman tree is constructed according to the frequency of the parameters. Shorter codes are assigned to parameters with high frequency, thereby reducing the amount of data transmission.

[0053] Furthermore, the data quality Q i Determine the data quality score through data cleaning and outlier detection assessment:

[0054]

[0055] Among them, n outlier is the number of outliers, n total is the total amount of data;

[0056] The data distribution diversity uses Kullback-Leibler divergence to measure the data distribution difference:

[0057] D KL (P i ||P global )

[0058] Among them, P i is the data distribution of the i-th local node, P global is the global data distribution;

[0059] The local model training effect uses the accuracy Acc i and recall rate Rec i Indicator, comprehensive training effect score E i :

[0060]

[0061] Furthermore, in S6, the specific method of optimizing the local model is as follows:

[0062] The local node adds the global knowledge representation as an additional constraint to the local student model loss function, and adopts a contrastive learning-based method to make the local student model output more similar to the global knowledge representation in the feature space; the loss function L is:

[0063] L=L KD +γ×L contrast (G,S(x))

[0064]

[0065] Among them, γ is the balance coefficient; L contrast (G, S(x)) is the contrastive learning loss function; sim is the similarity function. The present invention adopts cosine similarity, and the formula is τ is a temperature parameter used to adjust the difficulty of contrastive learning. When adjusting the temperature parameter τ, an annealing strategy is employed, gradually decreasing it from an initial value of 0.1 to 0.01 as the number of training rounds increases. This allows the model to rapidly explore the feature space in the early stages of training and focus more on local optimal solutions in the later stages. Through multiple rounds of training, the local student model fully incorporates global knowledge, improving performance and generalization.

[0066] Compared with existing technologies, the present invention achieves the following advantages: It transfers knowledge from the teacher model to the student model through knowledge distillation, significantly compressing the model. While maintaining detection performance, it reduces model complexity and computational complexity, enabling the optimized model to be deployed on resource-constrained devices, achieving real-time and widespread PV fault detection. Within the federated learning framework, raw data remains local to the node, and only encrypted model parameters are exchanged between nodes. This adheres to data privacy principles, avoids data leakage risks, ensures data security and privacy within PV power plants, and complies with laws, regulations, and enterprise data security requirements. An innovative federated knowledge distillation algorithm is designed to reduce the number of communications and data transmission between local nodes and the central server. Local knowledge distillation training reduces unnecessary parameter transmission, while the central server employs an efficient knowledge fusion algorithm to avoid complex information exchange, reducing communication costs and improving the efficiency of federated learning, making the method more feasible in practical applications. The student model trained through federated knowledge distillation integrates knowledge from the teacher model, diverse data from each local node, and a global knowledge representation. Multi-source knowledge fusion enables the student model to achieve enhanced generalization and robustness at a low complexity level, enabling more accurate and stable PV fault detection and improving the operational reliability and stability of PV systems. BRIEF DESCRIPTION OF THE DRAWINGS

[0067] Figure 1 This is a flowchart of the federated knowledge distillation method for photovoltaic fault detection model compression in the present invention. DETAILED DESCRIPTION

[0068] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings.

[0069] like Figure 1 As shown, an embodiment of the present invention provides a federated knowledge distillation method for photovoltaic fault detection model compression, comprising the following steps:

[0070] S1, builds a federated learning framework consisting of local nodes and a central server; specifically:

[0071] Edge computing devices are deployed as local nodes in photovoltaic power plants A, B, and C. Taking photovoltaic power plant A as an example, its equipment is based on a frequency of once every 5 minutes. This frequency is determined based on the general law of changes in the operating status of the photovoltaic system and the data processing cost. It can capture system status changes in a timely manner without generating too much redundant data. It collects real-time current I, voltage V, power P, and ambient temperature T of the photovoltaic panels. env , component temperature T cmp and the corresponding timestamp t. Any anomalies in the collected data were identified using the interquartile range (IQR) method and corrected using adjacent data interpolation. After data cleaning, all data were normalized using minimum-maximum normalization.

[0072] A high-performance server is used as the central server. When local node A applies to join federated learning, the central server authenticates it through a two-way authentication mechanism based on digital certificates. Upon successful authentication, the central server assigns the node ID 001. In subsequent communications, RabbitMQ message queues are used to ensure accurate and efficient communication with local node A. SSL / TLS is used to encrypt transmitted data, and the session key is updated after every 100 communications.

[0073] S2 builds a teacher model based on the Transformer structure at each local node; specifically:

[0074] A teacher model based on the Transformer structure is constructed at local nodes A, B, and C. Taking local node A as an example, the model contains 12 Transformer blocks. The number of heads in each block is set to 8, which can fully extract data features without excessive computation. The dimension of the key vector d is 1. k is 64. Through multiple experimental tuning, it is determined that the model achieves a good balance between detection accuracy and computing resource consumption under this parameter configuration.

[0075] S3 builds a lightweight convolutional neural network based on depthwise separable convolution as a student model on each local node; specifically:

[0076] A lightweight convolutional neural network based on depthwise separable convolution was constructed on local nodes A, B, and C as the student model. Based on the computing power and storage capacity of its own edge computing device, local node A initially set the model's convolution kernel size to 3×3 and the number of channels to 32. In subsequent experiments, if computing resources were found to be limited, the convolution kernel size was adjusted from 3×3 to 2×2, and the number of channels was adjusted to 24, reducing the computational load while ensuring the ability to extract key features.

[0077] S4, divide the photovoltaic fault detection data collected by each local node into a training set and a validation set, and use the training set to perform multiple rounds of pre-training on the teacher model of the local node; specifically:

[0078] Local node A divides a year's worth of collected photovoltaic fault detection data into a 70% training set and a 30% validation set. The teacher model is pre-trained using the training set, employing the AdamW optimizer. The initial learning rate η is set to 0.001, the exponential decay rates of the moment estimates β1 = 0.9, β2 = 0.999, and the weight decay coefficient λ = 0.0001 are set to effectively prevent model overfitting. A small constant ∈ = 1e-8 is used to prevent the denominator from being zero. A warm-up strategy is used for the first five epochs, linearly increasing the learning rate from 0 to 0.001.

[0079] S5, student model knowledge distillation, based on the pre-trained teacher model, performs knowledge distillation training on the student model; specifically:

[0080] The same training data is input into the teacher model and the student model respectively, and the loss function is adopted:

[0081] L KD =α×KL(T(x),S(x))+β×MSE(T(x),S(x))

[0082] Through 5-fold cross-validation, the balance coefficients α = 0.7 and β = 0.3 were determined. The student model parameters were updated using the backpropagation algorithm. After training for five epochs, the student model was evaluated using the validation set. If the accuracy did not improve after three consecutive evaluations, training was terminated using early stopping, and the student model parameters were saved every 10 epochs.

[0083] S6: Federated knowledge distillation and local model optimization; specifically:

[0084] After local nodes A, B, and C complete their local knowledge distillation training, they upload the student model parameters to the central server. Taking local node A as an example, the 32-bit floating-point parameters of the student model are quantized to 8-bit integers. After receiving the student model parameters uploaded by local nodes A, B, and C, the central server uses a knowledge fusion algorithm based on adaptive weight allocation to perform a weighted average of the three local student model parameters to generate a global knowledge representation G.

[0085] The central server then returns the global knowledge representation G to the local nodes A, B, and C. Taking local node A as an example, the global knowledge representation is added as an additional constraint to the local student model loss function, using a contrastive learning-based method. The loss function is:

[0086] L=L KD +γ×L contrast (G,S(x))

[0087] The contrastive learning loss function is:

[0088]

[0089] The similarity function uses cosine similarity, with the temperature parameter τ initially set to 0.1. A cosine annealing strategy is used, which is gradually reduced to 0.01 as the number of training rounds increases. During the optimization process, the model's performance on the test set is regularly evaluated, with performance on the test set evaluated every five rounds of training. The performance curve is recorded to promptly detect overfitting or underfitting of the model.

[0090] Finally, it should be noted that the above embodiments are intended to illustrate the technical solutions of the present invention and do not constitute any form of limitation of the present invention. Those skilled in the art should fully understand that it is entirely feasible to modify the technical solutions described in the above embodiments or to replace any or all of the technical features with equivalents. Such modifications or replacements, as long as they do not deviate from the scope of protection defined by the claims of the present invention, should be considered reasonable extensions of the present invention.

Claims

1. A federated knowledge distillation method for photovoltaic fault detection model compression, characterized in that: The following steps are involved: S1, build a federated learning framework consisting of local nodes and a central server; S2, builds a teacher model based on the Transformer structure at each local node; S3, builds a lightweight convolutional neural network based on depthwise separable convolution as the student model in each local node; S4, dividing the photovoltaic fault detection data collected by each local node into a training set and a validation set, and using the training set to perform multiple rounds of pre-training on the teacher model of the local node; S5: For each local node, perform knowledge distillation training on the student model based on the pre-trained teacher model; S6, uploading the trained student model parameters to the central server, the central server generates a global knowledge representation based on the knowledge fusion algorithm of adaptive weight distribution and returns the global knowledge representation to the local node, and the local node uses the global knowledge representation as a constraint to optimize the local student model.

2. The federated knowledge distillation method for photovoltaic fault detection model compression according to claim 1, characterized in that: The teacher model adopts a Transformer structure, which includes multiple Transformer blocks. Each Transformer block consists of a multi-head self-attention mechanism and a multi-layer perceptron. The input is denoted as x, whose size is L×D, where L is the photovoltaic sequence data collected in L time steps, and D is the number of specific values of the photovoltaic data of different attributes collected at each time step after preprocessing. After linear projection and position encoding, x is input into the Transformer block to capture the long-distance dependencies and complex features in the photovoltaic data using the self-attention mechanism, and then the nonlinear expression ability of the model is increased by the multi-layer perceptron. After passing through the multi-layer Transformer block, the output is obtained, that is, the prediction result of the teacher model for photovoltaic faults, which is denoted as T(x).

3. The federated knowledge distillation method for photovoltaic fault detection model compression according to claim 2, characterized in that: The multi-head self-attention mechanism formula is: MultiHead(Q,K,V)=Concat(head1,…,head h ) head i =Attention(QW i Q ,KW i K ,VW i V ) Among them, Q, K, and V are query, key, and value matrices respectively. Q, K, and V of the first-layer Transformer block are obtained by linear projection operation of x; d k is the dimension of the key vector; h is the number of heads, W i Q 、W i K 、W i V is the learnable weight matrix.

4. A federated knowledge distillation method for photovoltaic fault detection model compression according to claim 2 or 3, characterized in that: The core module of the student model is depthwise separable convolution; the depthwise separable convolution consists of depthwise convolution and pointwise convolution. The depthwise convolution performs convolution operations on each input channel independently, and the pointwise convolution fuses the output channels of the depthwise convolution through a convolution kernel of size 1; the input of the student model is x, and the output after multiple layers of depthwise separable convolution is recorded as S(x).

5. The federated knowledge distillation method for photovoltaic fault detection model compression according to claim 4, characterized in that: The teacher model of the local node is pre-trained based on the following method: the locally collected photovoltaic fault detection data is divided into a ratio of 70% training set and 30% validation set; the teacher model is pre-trained for multiple rounds using the training set, using the AdamW optimizer, and the parameter update formula is: m t =β1m t-1 +(1-β1)g t ,v t =β2v t-1 +(1-β2)g t 2 Among them, m t and v t are the first-order moment estimate and the second-order moment estimate of the gradient, β1 and β2 are the exponential decay rates of the moment estimate, g t is the gradient at the current moment, and is the revised first-order moment estimate and second-order moment estimate, θ t is the teacher model parameter at the current moment, η is the learning rate, ∈ is a small constant to prevent the denominator from being zero, and λ is the weight decay coefficient.

6. The federated knowledge distillation method for photovoltaic fault detection model compression according to claim 5, characterized in that: Perform knowledge distillation training on the student model. The specific method is: The same training data is input into the teacher model and the student model respectively, and the improved loss function is used to realize knowledge transfer; the improved loss function is: L KD =α×KL(T(x),S(x))+β×MSE(T(x),S(x)) Among them, KL(T(x),S(x)) is the KL divergence, which is used to measure the difference in the output probability distribution of the teacher model T(x) and the student model S(x). The calculation formula is: Where N represents the number of samples used for training; MSE(T(x), S(x)) is the mean square error, which is used to measure the difference in the output values of the teacher model T(x) and the student model S(x). The calculation formula is: α and β are balance coefficients, and their optimal values are determined through cross-validation. The back-propagation algorithm is used to update the student model parameters so that its output approaches the teacher model.

7. The federated knowledge distillation method for photovoltaic fault detection model compression according to claim 6, characterized in that: The specific process of generating global knowledge representation is as follows: A lossless compression algorithm based on Huffman coding is used to quantize and encode the parameters of the student model that has completed local knowledge distillation training, and then upload it to the central server; After the central server receives the student model parameters uploaded by the local node, it uses the knowledge fusion algorithm based on adaptive weight distribution to comprehensively analyze the local node data quality Q i , data volume N i , data distribution diversity D KL (P i ||P global ) and local model training effect E i Perform aggregation and determine the weight w through the multi-factor linear regression model i : Among them, α1, α2, α3, and α4 are weight coefficients, and the grid search method is used to select the weight coefficients that make the global knowledge representation perform best on the validation set; m is the number of local nodes; Perform weighted averaging on the local student model parameters to generate a global knowledge representation G: Among them, θ i are the parameters of the i-th local student model.

8. The method for federated knowledge distillation for photovoltaic fault detection model compression according to claim 7, characterized in that: The method for quantizing and encoding the student model parameters using the Huffman coding-based lossless compression algorithm is as follows: First, the student model parameters are quantified. The quantification formula is: Among them, θ is the original student model parameter, θ min and θ max are the minimum and maximum values of the student model parameters, b is the number of quantized bits, and q is the integer after quantization; Then, Huffman coding is performed on the quantized parameters, and a Huffman tree is constructed according to the frequency of the parameters. Shorter codes are assigned to parameters with high frequency, thereby reducing the amount of data transmission.

9. The method for federated knowledge distillation for photovoltaic fault detection model compression according to claim 7, characterized in that: The data quality Q i Determine the data quality score through data cleaning and outlier detection assessment: Among them, n outlier is the number of outliers, n total is the total amount of data; The data distribution diversity uses Kullback-Leibler divergence to measure the data distribution difference: D KL (P i ||P global ) Among them, P i is the data distribution of the i-th local node, P global is the global data distribution; The local model training effect uses the accuracy Acc i and recall rate Rec i Indicator, comprehensive training effect score E i :

10. A federated knowledge distillation method for photovoltaic fault detection model compression according to claim 7, 8 or 9, characterized in that: The specific method of optimizing the local model is as follows: The local node adds the global knowledge representation as an additional constraint to the local student model loss function, and adopts a contrastive learning-based method to make the local student model output more similar to the global knowledge representation in the feature space; the loss function L is: L=L KD +γ×L contrast (G,S(x)) Among them, γ is the balance coefficient; sim is the similarity function; τ is the temperature parameter.

Citation Information

Cited By

  • Photovoltaic sensing data processing method and system for edge calculation

    CN121901669A