Modeling method for detection and positioning of power quality composite disturbance based on one-dimensional YOLO

CN120086749BActive Publication Date: 2026-10-09ZHEJIANG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411317259.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-20
Publication Date
2026-10-09
Estimated Expiration
2044-09-20

AI Technical Summary

Technical Problem

但是两类方法均是在波形层面进行检测分类,在考虑更多复合扰动类型时需要对模型进行调整,存在灵活性不足的问题,而且模型给出的类型标签仅仅反映了整段波形内各基本扰动的存在情况,无法进一步获取波形内部各基本扰动的个数情况和时间区间信息

Benefits of technology

[0011] The beneficial effects of this invention are: this invention can not only complete the detection and identification at the level of basic disturbance elements, making up for the lack of flexibility of traditional detection and classification methods, but also provide the number of each basic disturbance and the time interval information. By learning from training samples of low-multiple-number composite disturbances, the model can accurately detect higher-multiple-number composite disturbances, providing strong support for the governance of power quality disturbances.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120086749B_ABST
    Figure CN120086749B_ABST
Patent Text Reader

Abstract

The application discloses a power quality composite disturbance detection and positioning modeling method based on one-dimensional YOLO. Distributed power sources and nonlinear loads are connected to the power grid in large numbers, so that power quality disturbance (PQDs) events occur frequently, multiple disturbances cross-couple to form composite disturbances, and power quality problems become increasingly complex. The application first uses a backbone network and a neck network to realize multi-scale feature extraction and fusion of PQDs, and finally realizes detection and classification at the basic disturbance element level after decoding and post-processing operations are sequentially performed on the output of the head network. The model can give the number of each disturbance element and time interval information, and through learning of low-number composite disturbances, accurate detection of higher-number composite disturbances can be realized, thereby providing strong support for the management of power quality disturbances.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of power systems. Specifically, it adopts a data science research model to study power quality disturbance analysis methods and constructs a power quality composite disturbance detection, localization, and modeling method based on one-dimensional YOLO. Background Technology

[0002] The widespread integration of distributed power sources and nonlinear loads into the power grid has led to frequent power quality disturbances (PQDs). Multiple disturbances coupled together to form complex disturbances, making power quality problems increasingly complicated. The extensive application of monitoring devices is one of the main characteristics of smart grids. The massive amounts of PQD data carry valuable information about the operating status of systems and equipment. The detection, classification, and timing of PQDs are the prerequisites and foundation for power quality management.

[0003] Existing PQDs detection and classification methods can be divided into two-step methods based on signal processing and pattern classifiers, and deep learning methods based on artificial intelligence. The former's classification performance is greatly affected by subjective factors, making it difficult to achieve optimal results; the latter achieves automatic feature extraction and classification in an end-to-end manner, resulting in higher classification accuracy. However, both methods perform detection and classification at the waveform level, requiring model adjustments when considering more complex perturbation types, thus lacking flexibility. Furthermore, the type labels provided by the model only reflect the presence of each basic perturbation within the entire waveform, failing to further obtain the number and time interval information of each basic perturbation within the waveform.

[0004] Research on power quality disturbance detection and classification considering time location is currently limited, and most studies employ different methods for time location, making them difficult to apply to complex disturbances. Furthermore, point classification methods categorize each sampling point of PQDs and indirectly obtain the start and end times of each disturbance by identifying abrupt changes in the category of the sampling point in the time series. However, point classification cannot guarantee category continuity, and misclassified sampling points can negatively impact the determination of the disturbance's start / end time. Summary of the Invention

[0005] The technical problem to be solved by the present invention is to overcome the defects of the prior art and provide a model construction method that can simultaneously complete the detection, classification and temporal localization of composite PQDs. By taking basic perturbations as the detection objects, hierarchical modeling of single perturbations and multiple perturbations is realized, and information such as the type, number and time interval of each basic perturbation element in PQDs is obtained, thus obtaining a more detailed description of PQDs.

[0006] This invention includes the following steps:

[0007] S1: Establish mathematical models of various basic power quality perturbation elements and generate composite PQDs samples, and construct corresponding training sets, validation sets and test sets;

[0008] S2: Construct a power quality composite disturbance detection classification and temporal localization model based on one-dimensional YOLO (1D-YOLO-PQDs), and design a decoder for each layer of feature maps;

[0009] S3: Train a 1D-YOLO-PQDs model using the training set;

[0010] S4: Post-process the model's output to obtain the final detection results, and evaluate the model's detection, classification, and localization performance using multiple performance metrics on the test set.

[0011] The beneficial effects of this invention are: this invention can not only complete the detection and identification at the level of basic disturbance elements, making up for the lack of flexibility of traditional detection and classification methods, but also provide the number of each basic disturbance and the time interval information. By learning from training samples of low-multiple-number composite disturbances, the model can accurately detect higher-multiple-number composite disturbances, providing strong support for the governance of power quality disturbances. Attached Figure Description

[0012] Figure 1 This is a flowchart of the method for constructing a power quality composite disturbance detection, classification, and time-based localization model based on one-dimensional YOLO, as described in this invention.

[0013] Figure 2 This is a schematic diagram of the overall structure and post-processing of the 1D-YOLO-PQDs model.

[0014] Figure 3 This is a diagram showing the relationship between the CBL module and the Res module.

[0015] Figure 4 This is a structural diagram of the ConvSet module.

[0016] Figure 5 This is a comparison chart of the time positioning error of the model under different noise levels.

[0017] Figure 6 This is a comparison chart showing the model when considering different training sets. Detailed Implementation

[0018] The present invention will be further described below with reference to the accompanying drawings. The present invention includes the following steps:

[0019] according to Figure 1 As shown in the embodiments of this application, a method for constructing a power quality composite disturbance detection classification and time-based localization model based on one-dimensional YOLO is provided, including the following steps:

[0020] S1: Establish mathematical models for eight basic power quality perturbation elements and generate composite PQDs samples, and construct corresponding training, validation and test sets;

[0021] Mathematical models were established for the eight basic power quality disturbance elements in four categories, as shown in Table 1.

[0022] Table 1 Classification of Basic Power Quality Disturbances

[0023]

[0024] The composite perturbation is generated according to equation (1). To ensure sample quality, at most one perturbation is considered for each class.

[0025]

[0026] In the formula, sin(t) is the standard sinusoidal signal; sag(t), swl(t), and itr(t) are the voltage sag, voltage swell, and voltage interruption disturbance factors, respectively; imp(t), osc(t), and nth(t) are the transient impact, transient oscillation, and voltage gap disturbance factors, respectively; flk(t) and hmy(t) are the flicker and harmonic disturbance factors, respectively; and noise(t) is the noise signal.

[0027] Training, validation, and test sets are generated with a sample ratio of 4:1:1. In the training and validation sets, the proportion of samples with each type of disturbance signal—noise-free, with signal-to-noise ratios of 50dB, 40dB, and 30dB—is equal. Noise signals are added to the test set as needed for testing.

[0028] S2: Construct a power quality composite disturbance detection classification and temporal localization model based on one-dimensional YOLO (1D-YOLO-PQDs), and design a decoder for each layer of feature maps;

[0029] The 1D-YOLO-PQDs proposed in this embodiment are based on the YOLOv3 network, and the overall framework is as follows: Figure 2 As shown, the network performs layered detection of eight basic power quality disturbance elements at shallow, medium, and deep layers. Figure 2 The right side indicates the type of disturbance each layer is responsible for. Functionally, the detection network consists of a backbone network, a neck network, and a head network.

[0030] The backbone network extracts features of PQDs waveforms at different scales through layer-by-layer convolution and downsampling operations. The CBL module and Res residual module are the basic components of the backbone network, and their relationship is as follows: Figure 3 As shown.

[0031] The CBL module is further composed of a 1D-Convolutional Layer, a batch normalization (BN) layer, and a Leaky ReLU activation layer connected in series. The (1×11 / 2, 64) below the module indicates that the size of the convolutional kernel is 1×11, the convolutional stride is 2, and the output dimension is 64. The convolutional residual Res module provides the effect of direct connection across layers, which can alleviate the problems of gradient vanishing and gradient explosion after the network is deepened. It contains two CBL modules, which use 1×1 / 1 and 1×11 / 1 convolutional layers respectively.

[0032] The neck network, in the form of a Feature Pyramid Network (FPN), progressively uploads deep semantic features to shallow layers, obtaining fused features containing rich high-level abstract features and precise location information features, thus achieving the fusion and enhancement of feature maps at three different scales. The ConvSet module used for feature fusion is as follows... Figure 4 As shown, by using 1×1 / 1 and 1×11 / 1 CBL sub-modules interchangeably, the results of splicing feature maps at different scales can be better fused and enhanced.

[0033] In the head network, this embodiment first uses the CBL submodule and the Conv submodule to perform channel dimension transformation on the three feature maps of different scales after feature fusion, to obtain feature maps f1, f2 and f3 with scales of 4M*6, 2M*6 and M*2 respectively, where M = Q / 32 and Q is the total number of sampling points of PQDs.

[0034] On one hand, feature map f3 is used to detect flicker perturbations and harmonic perturbations. Since it does not involve time localization, global average pooling (GAP) is used to aggregate the global features of f3 in the sequence dimension. Then, the sigmoid function is used to decode it and output the probability values ​​of flicker perturbations and harmonic perturbations. The output of the sigmoid function at 0 is 0.5 as the dividing threshold. When the probability value is greater than 0.5, the corresponding perturbation is considered to exist.

[0035] On the other hand, let x i,j Let be the value of the i-th feature map vector in f1 and f2 along the channel dimension j, where i ranges from 1 to 4M in f1 and from 1 to 2M in f2. The feature map vectors in f1 and f2 are decoded according to equation (3) to obtain the candidate time window vector.

[0036]

[0037] Based on the fundamental principles of the YOLO algorithm, f1 divides the original sequence into 4M equal segments. Each feature map vector within these segments is responsible for detecting gaps, oscillations, and impulse perturbations within that segment. i,4 The confidence score c output by the Sigmoid activation function i This indicates the probability confidence level that the corresponding equally divided segments contain gaps, oscillations, or impulse disturbances. j = 1, 2, 3 represents the conditional class probability of the three types of perturbations, given by x. i,j The values ​​j = 1, 2, 3 are obtained through a Softmax operation. f2 detects three types of amplitude perturbations across 2M equally spaced segments of the original sequence; similarly, the corresponding c can be obtained. i and The meaning of w. i u in i and s i These represent the absolute coordinates of the midpoint of the time window and its width, respectively.

[0038] Furthermore, to facilitate model learning, x i,5 The Sigmoid activation function outputs the ratio of the distance from the perturbation center to the left boundary of segment i to the length r0 of each segment, where r0 is 8 and 16 in f1 and f2, respectively; x i,6 It is used to output the relative prior time window width r a The logarithm of r a In f1 and f2, take the number of sampling points corresponding to 5ms and 75ms respectively.

[0039] S3: Train a 1D-YOLO-PQDs model using the training set;

[0040] During training, the model's total loss function consists of three parts, namely

[0041] L M =L1+L2+L3 (4)

[0042] Where L3 is the binary cross-entropy loss for flicker perturbation and harmonic perturbation, and the single-sample loss expression is:

[0043]

[0044] In formula (5) and p k These represent the probability label value and the predicted value of the existence of perturbation k, respectively.

[0045] L1 and L2 are the sum of losses for all feature map vectors in the corresponding feature maps.

[0046] Taking L1 as an example, its confidence loss is l c Positioning loss loc And classification loss lcls It consists of three parts:

[0047]

[0048] In the formula, the confidence loss and classification loss use binary cross-entropy loss and multi-class cross-entropy loss, respectively, c i The meaning is consistent with that in equation (3). The predicted value is the conditional class probability of the true class; the localization loss uses mean-square error (MSE) loss, which is divided into two parts: the proportion of center points and the logarithm of the time window length, x. i,5 and x i,6 The meaning is consistent with the previous text. and This corresponds to the label value. Depending on whether the assigned segment contains a disturbing target, the feature map vector can be divided into positive and negative categories, with corresponding indicator functions. Take the values ​​1 and 0 respectively, and so on. It can take the values ​​0 and 1.

[0049] As shown in the above expression, only the confidence loss needs to be calculated for the negative class feature map vectors. Considering that the number of negative class feature map vectors is much larger than that of positive class vectors, a weight coefficient λ is used. noobj To achieve equilibrium; λ loc , λ cls These are the weights for the localization loss and classification loss, respectively.

[0050] The 1D-YOLO-PQDs model is trained using the training set, and the validation set is used to determine hyperparameters such as batch size, initial learning rate, and number of training generations.

[0051] S4: Post-process the model's output to obtain the final detection results, and evaluate the model's detection, classification, and localization performance using multiple performance metrics on the test set.

[0052] For the candidate time windows output by f1 and f2, post-processing is required based on the confidence level, conditional category probability, and mutual positional relationship of each time window to finally obtain the disturbance detection result.

[0053] The output post-processing includes three steps: time window boundary rounding and clipping, time window filtering, and non-maximum suppression (NMS).

[0054] Specifically:

[0055] 1) Rounding and clipping the time window boundaries.

[0056] u predicted by the model i and s iCalculate the left boundary coordinates of the i-th candidate time window and right boundary coordinates The two coordinate values ​​are first rounded to the nearest integer according to equation (7), and then values ​​exceeding the sequence length range are pruned to obtain the final coordinate values ​​of the start and end sampling points of the perturbation. and Round(×) is the rounding function.

[0057]

[0058] 2) Time window filtering.

[0059] For each candidate time window, the category with the highest conditional category probability is selected as the perturbation type, and compared with the confidence level c. i Multiplying these values ​​yields the class confidence score. A threshold δ is set to filter out candidate time windows with class confidence scores below the threshold. The choice of threshold depends on the specific task. The model trained in this application exhibits good detection and classification performance, meaning that the model provides class confidence scores close to 1 for positive samples and 0 for negative samples, making the final output of the model insensitive to the threshold. Therefore, δ is taken as the commonly used value of 0.5 in engineering practice.

[0060] 3) Non-maximum suppression.

[0061] For the same perturbation target, the model may output multiple candidate time windows that meet the category confidence threshold. Redundant time windows are filtered out between time windows of the same category using Non-Maximum Suppression (NMS). Specifically, time windows with lower category confidence are filtered out between two overlapping time windows of the same category. This process is repeated until there is no overlap between time windows of each category.

[0062] Furthermore, the detection and classification performance of the model is evaluated using precision, recall, and F1 score, and their expressions are as follows.

[0063]

[0064] In the formula, TP, FP, and FN represent the number of correctly identified, falsely identified, and missed identified targets, respectively. Precision is the proportion of the model's predictions that hit the real target, used to measure the model's ability to find only relevant targets; recall indicates how many real targets the model's predictions can cover at most, used to measure the model's ability to find all relevant targets; the F1 score is the harmonic mean of the two, which can comprehensively evaluate the model's detection performance.

[0065] For disturbances involving flicker and harmonics, since the location of the disturbance is not involved, the definitions of TP, FP, and FN remain consistent with the traditional definitions. For the remaining six basic disturbance types, a correct identification (TP) requires the following two conditions to be met simultaneously: 1) the predicted time window overlaps with the actual time window; 2) the disturbance type is correctly classified.

[0066] If multiple prediction time windows simultaneously meet both of the above conditions, the prediction time window with the highest category confidence is selected and matched with the actual time window; the remaining ones are considered false positives. Furthermore, windows that only meet condition 2 but not condition 1 are also considered false positives. If no prediction time meets the above conditions, it is considered a missed identification.

[0067] For each type of fundamental perturbation, the mean absolute error (err) of the start / end time is calculated for the correctly identified sample TP. b and err e :

[0068]

[0069] Where TP represents the number of correctly identified items, and f s Sampling frequency, and These represent the predicted coordinates of the start and end points of each TP. and The actual values ​​of the starting and ending point coordinates, respectively.

[0070] Application example:

[0071] To verify the effectiveness of the model established in this invention, a total of 41 power quality disturbance mathematical models were established as shown in Table 2, including 9 single disturbances, 16 double disturbances, and 16 triple disturbances, among which the normal signal is regarded as a special single disturbance.

[0072] Table 2. Perturbation composition of the sample set

[0073]

[0074] The fundamental frequency was set to 50Hz, the sampling frequency to 6.4kHz, the sampling duration to 0.28s, and a total of 1792 sampling points. Training set T, validation set H, and test set D were generated using MATLAB. The training set contained 1600 samples of each perturbation signal, while the validation and test sets contained 400 samples of each perturbation signal. The training and validation sets had equal proportions of samples with no noise and signal-to-noise ratios of 50dB, 40dB, and 30dB for each perturbation signal. Noise signals were added to the test set as needed for subsequent experiments.

[0075] Considering the model involves both detection / classification and temporal localization tasks, a large learning rate can easily lead to training divergence. Therefore, a relatively small initial learning rate of 1e-4 was chosen. The optimizer is RMSprop, with a momentum coefficient of 0.9 and a weight decay coefficient of 5e-4. A learning rate decay strategy is employed, halving the learning rate every 5 generations. The training batch size is 64, and each batch of data is obtained by randomly sampling from the training set to enhance the generalization ability of the final model. The loss function λ... noobj , λ loc and λ cls Take values ​​of 0.05, 5, and 1 respectively.

[0076] After multiple experiments and adjustments, the model converged completely after 20 iterations under the above hyperparameter settings. Therefore, an early stopping mechanism was adopted to train for 20 generations and end the training to reduce the risk of overfitting.

[0077] Different signal-to-noise ratio noises were added to the test set, and the F1-Score was tested. The results are shown in Table 3.

[0078] Table 3 F1-Score at different noise levels

[0079]

[0080] As can be seen, the model constructed in this application achieves an overall F1-Score of over 99% under the aforementioned signal-to-noise ratio conditions, with a low incidence of false positives and false negatives.

[0081] For correctly identified (TP) samples, the start time positioning error was statistically analyzed, and the mean absolute error (err) of the start time under different signal-to-noise ratio environments in the test set for six types of disturbances was calculated. b and the mean absolute error of the end time err e like Figure 5 As shown. By Figure 5 It can be seen that this model can achieve millisecond-level start / end time localization of disturbed targets and has a certain degree of robustness to noise.

[0082] The training set T is divided into a single-perturbation training subset T1, a double-perturbation training subset T2, and a triple-perturbation training subset T3. Similarly, the test set D, which contains 30dB Gaussian noise, is also divided into D1, D2, and D3 according to the perturbation multiplicity.

[0083] Models were trained using training sets T1 and T1+T2 respectively, resulting in Model 1 and Model 2. The model trained using set T is designated as Model 3. The combined F1-Score, combined classification accuracy, and combined start / end time mean absolute error of the three models on D1, D2, and D3 were evaluated. The results are as follows: Figure 6 As shown.

[0084] Depend on Figure 6 It can be seen that, compared with Model 3, which is trained on training sets T containing single, double, and triple perturbations, Model 1, which is trained using only single perturbation data, can only achieve high detection and classification performance and time localization accuracy on the single perturbation test set D1, but performs poorly on D2 and D3. Model 2, which further considers double perturbation waveforms as training samples on the basis of single perturbation, achieves a comprehensive F1-Score of 97.79% and a comprehensive classification accuracy of 90.53% on the triple perturbation validation set D3. The comprehensive time localization error at the start and end times is reduced to 1.5ms. This shows that Model 2, through learning from low-multiple perturbation data, can identify basic detections in triple perturbation waveforms and adapt to more complex PQDs. This demonstrates the advantages of modeling based on basic perturbations.

[0085] As can be seen from the above application examples, the model established by this invention can not only make up for the lack of flexibility of traditional detection and classification methods, but also complete the detection and identification at the level of basic perturbation elements, while providing the number of each basic perturbation and time interval information, and has a certain degree of robustness to noise.

Claims

1. A method for detecting, locating, and modeling composite power quality disturbances based on one-dimensional YOLO, characterized in that, Includes the following steps: S1: Establish mathematical models of various basic power quality perturbation elements and generate composite PQDs samples, and construct corresponding training sets, validation sets and test sets; S2: Construct a power quality composite disturbance detection, classification, and temporal localization model based on one-dimensional YOLO, and design a decoder for each layer of feature maps; S3: Train the above model using the training set; S4: Post-process the model's output to obtain the final detection results, and evaluate the model's detection, classification, and localization performance on the test set using multiple performance metrics; The model described in step S2 is based on the YOLOv3 network and consists of a backbone network, a neck network, and a head network. It performs hierarchical detection of each basic perturbation element at three different depth levels. In the head network, the three feature maps output by the neck network at different scales are transformed by channel dimension to obtain scales of respectively. , and Feature map , and ,in , The total number of sampling points for PQDs; The feature map To detect flicker and harmonic disturbances, global average pooling is used to aggregate feature maps. The global features in the sequence dimension are then decoded using the Sigmoid function to output the probability values ​​of flicker perturbation and harmonic perturbation. By analyzing feature maps and Decode to obtain the candidate time window vector; this time window vector contains the conditional class probability of the perturbation, the probability confidence of the perturbation, the absolute coordinates of the midpoint of the time window, and the width. The decoding is performed as follows: remember for , The Middle Each feature map vector in the channel dimension The value on, where middle The range is , The middle is ,right and The feature map vector is decoded according to the following formula to obtain the candidate time window vector. ; in For activation function, The confidence score is... and These represent the absolute coordinates of the midpoint and the width of the time window, respectively. For activation function Output confidence score This indicates the probability confidence level that the corresponding equally divided segments contain gaps, oscillations, or impulse disturbances. The output perturbation center is located outside the region after activation function. Distance from the left boundary and length of each segment The ratio, For use in outputting the relative prior time window width The logarithm of This represents the conditional category probability of the three types of perturbations; The post-processing described in step S4 includes time window boundary rounding and clipping, time window filtering, and non-maximum suppression.

2. The method for detecting, locating, and modeling power quality composite disturbances based on one-dimensional YOLO according to claim 1, characterized in that: The ratio of samples in the training set, validation set, and test set mentioned in step S1 is 4:1:

1. Each perturbation sample in the training set and validation set contains four noise levels: no noise, signal-to-noise ratio of 50dB, 40dB, and 30dB, and the proportions are the same.

3. The method for detecting, locating, and modeling power quality composite disturbances based on one-dimensional YOLO according to claim 1, characterized in that: The loss function in step S3 of the training process is the sum of the losses on the three feature maps, where: The loss on shallow and medium-level feature maps consists of three parts: confidence loss, category loss, and localization loss. The loss on deep feature maps consists of confidence loss.

4. The method for detecting, locating, and modeling power quality composite disturbances based on one-dimensional YOLO according to claim 1, characterized in that: The evaluation metrics include the F1 score when the category confidence threshold is 0.5 and the average absolute localization bias; the former is used to evaluate the model's detection and classification capabilities, while the latter is used to quantify the deviation in temporal localization.

Citation Information

Patent Citations

  • Electric energy quality disturbance detection method based on YOLO algorithm

    CN110728195A

  • Power quality disturbance identification method based on improved one-dimensional deep residual shrinkage network

    CN117093519A