A medium voltage distribution line abnormal waveform identification method and system
By combining time-frequency dual-branch feature extraction and dynamic multi-scale convolutional network with attention enhancement mechanism, the problems of weak local features and insufficient utilization of time-frequency information in the anomaly detection of medium-voltage power distribution lines are solved, and efficient anomaly waveform recognition and online monitoring under complex operating conditions are realized.
Patent Information
- Application Number
- CN202611618191.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-20
- Publication Date
- 2026-11-20
AI Technical Summary
Existing methods for detecting anomalies in medium-voltage power distribution lines are difficult to accurately identify abnormal waveforms under complex operating conditions. In particular, they suffer from weak local anomaly features, insufficient utilization of time and frequency information, difficulty in unified modeling of multi-scale anomalies, lack of prominence of key features, and easy omission of anomaly samples.
A time-frequency dual-branch feature extraction structure is adopted, combined with a dynamic multi-scale convolutional network and an attention enhancement mechanism. Feature fusion is performed through dynamic routing weights and gating mechanisms, and the convolutional branch dilation rate is adaptively adjusted to cover anomalies of different durations. Channel-position dual attention is used to enhance the feature vector, thereby achieving accurate identification of abnormal waveforms.
It improves the accuracy and robustness of abnormal waveform identification in medium-voltage power distribution lines, reduces information omission and noise interference, enhances the model's identification ability and interpretability under complex operating conditions, and is suitable for online monitoring in computing-limited equipment.
Smart Images

Figure CN123138989A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of fault diagnosis technology for smart grids and power systems, and more specifically, to a method and system for identifying abnormal waveforms in medium-voltage distribution lines. Background Technology
[0002] Medium-voltage distribution lines are a crucial link connecting substations and terminal loads, and their operating status directly affects power supply reliability and the safety level of the distribution network. As distribution lines age, factors such as insulation aging, poor joint contact, external mechanical damage, tree discharge, lightning strikes, and load fluctuations can easily trigger abnormal waveforms. These abnormal waveforms are often characterized by short duration, unstable amplitude variations, significant localized impacts, and complex frequency domain energy distribution. If not identified in their early stages, they may escalate into short-circuit faults, grounding faults, or large-scale power outages.
[0003] Existing methods for detecting anomalies in medium-voltage power distribution lines mainly include manual inspection, threshold discrimination, traditional signal processing methods, and conventional machine learning methods. However, these methods still have the following problems in practical applications.
[0004] Traditional threshold methods are poorly adapted to complex operating conditions. The operating environment of medium-voltage distribution lines is complex; load fluctuations, transient disturbances, harmonic interference, and sampling noise can cause the boundary between normal and abnormal waveforms to be inconsistent. Simply relying on amplitude thresholds, abrupt change thresholds, or frequency thresholds can easily miss minor anomalies and cause false alarms during load surges.
[0005] A single time-domain feature or a single frequency-domain feature is insufficient to fully characterize anomaly waveforms. Anomaly waveforms contain both time-domain local features such as impulses, abrupt changes, spikes, and distortions, and frequency-domain features such as band energy shifts, enhancement of high-frequency components, and changes in spectral structure. If modeling is done only from a time-domain perspective, differences in frequency distribution may be overlooked; if modeling is done only from a frequency-domain perspective, temporal information such as the location of the anomaly and the local morphology of the waveform may be lost.
[0006] Traditional convolutional networks have a single receptive field, making it difficult to simultaneously capture local transient features and long-range waveform dependencies. Anomalies in medium-voltage power distribution lines may manifest as spike disturbances over a very short period of time, or as waveform distortions or periodic anomalies over a longer period of time. Single-scale convolutional kernels cannot simultaneously adapt to anomaly patterns of different durations and forms.
[0007] Conventional feature concatenation methods lack a selective fusion mechanism. Time-domain features and frequency-domain features contribute differently to different anomaly types. Simple concatenation or direct addition can easily introduce redundant or even noisy information, leading to insufficient attention to key anomaly features by the model.
[0008] In actual power distribution lines, the number of abnormal samples is usually less than the number of normal samples, making models prone to bias towards the normal class. When sample classes are imbalanced, conventional classification models may achieve high overall accuracy, but insufficient recall for abnormal classes, leading to missed detections. In power safety scenarios, the harm caused by missed anomalies often outweighs that of false positives.
[0009] Therefore, it is necessary to propose an intelligent identification method for abnormal waveforms in medium-voltage power distribution lines that can simultaneously utilize time-domain features, frequency-domain features, multi-scale local features, and attention selection mechanisms to improve the accuracy, robustness, and engineering deployment value of anomaly identification. Summary of the Invention
[0010] This invention mainly addresses the problems in the identification of abnormal waveforms in medium-voltage power distribution lines, such as weak local abnormal features, insufficient utilization of time and frequency information, difficulty in unified modeling of multi-scale anomalies, lack of prominent key features, insufficient feature fusion, and easy omission of abnormal samples.
[0011] This invention provides a method and system for identifying abnormal waveforms in medium-voltage power distribution lines. By acquiring waveform signals from the power distribution line and constructing waveform window samples, basic features are extracted using time-domain and frequency-domain convolutional networks. The duration of the anomaly is determined, and the dilation rate of the time-domain convolutional branches is dynamically adjusted to expand the equivalent receptive field. Dynamic routing weights are generated based on scale matching to achieve adaptive multi-scale time-domain feature fusion. Channel-position dual attention enhancement is applied to both feature paths to suppress noise. Anomaly intensity parameters are constructed by extracting features such as physical abrupt changes in the waveform and high-frequency energy distribution, generating time-frequency dynamic gating weights. The two enhanced feature vectors are adaptively weighted and fused to output an anomaly warning. This invention can accurately adapt to anomaly events spanning multiple scales and durations, improving the accuracy and interpretability of abnormal waveform identification in power distribution networks under complex operating conditions.
[0012] The present invention adopts the following technical solution.
[0013] In a first aspect, the present invention provides a method for identifying abnormal waveforms in medium-voltage power distribution lines, comprising: The power waveform signal of the medium-voltage distribution line is acquired, and after standardization and sliding window processing, waveform window samples are obtained. The waveform window samples are input into the front-end basic extraction module of the time-domain convolutional network to obtain the basic time-domain feature map; the waveform window samples are then transformed in the frequency domain to obtain the logarithmic amplitude spectrum, which is then input into the frequency-domain convolutional network to obtain the frequency-domain feature map. The duration of the anomaly is determined based on the intensity of local changes in the waveform window samples. The information coverage capability of each scale convolutional branch for the current anomalous disturbance interval is determined based on the coverage relationship between the anomaly duration and the equivalent receptive field corresponding to each scale convolutional branch. The scale matching degree is determined based on the relative scale relationship between the anomaly duration and the equivalent receptive field corresponding to each scale convolutional branch. Dynamic routing weights are generated based on the information coverage capability and the scale matching degree. The basic temporal feature map is input into each scale convolutional branch to extract multi-scale features, and the multi-scale features are weighted and fused based on the dynamic routing weights to obtain dynamic multi-scale temporal features. Channel-location dual attention enhancement is performed on the dynamic multi-scale temporal feature map and the frequency domain feature map respectively to obtain temporal enhanced feature vector and frequency domain enhanced feature vector; Based on the time-domain variation characteristics and spectral energy distribution characteristics of the waveform window samples, the time-domain anomaly intensity parameters and frequency-domain anomaly intensity parameters are determined respectively to determine the time-frequency dynamic gating weights. The time-domain enhanced feature vector and the frequency-domain enhanced feature vector are weighted and fused based on the time-frequency dynamic gating weights to obtain the final time-frequency fusion features. The final time-frequency fusion features are input into the anomaly identification classifier, which outputs the anomaly probability; anomaly alarms are generated based on the anomaly probability.
[0014] Preferably, the waveform window samples are subjected to frequency domain transformation to obtain a logarithmic amplitude spectrum, which is then input into a frequency domain convolutional network to obtain a frequency domain feature map, including: Perform a discrete Fourier transform on the waveform window samples to obtain the complex spectrum values at each frequency point; Calculate the amplitude of the complex spectral values and perform a logarithmic transformation to form a logarithmic amplitude spectrum sequence in frequency order; The logarithmic amplitude spectrum sequence is input into the frequency domain convolutional network for feature extraction, resulting in a frequency domain feature map that preserves the local feature distribution of the frequency dimension.
[0015] Preferably, determining the duration of the anomaly based on the intensity of local changes in waveform window samples includes: Calculate the intensity of local waveform changes between adjacent sampling points in the waveform window sample; Based on the mean and standard deviation of the intensity of local waveform changes within the waveform window sample, an abnormal change judgment threshold is set. The sampling locations where the intensity of local waveform changes is greater than or equal to the abnormal change determination threshold are marked as abnormal change locations, and consecutive abnormal change locations are formed into candidate disturbance intervals; the maximum continuous length in each candidate disturbance interval is determined as the main disturbance length of the current waveform window sample; The duration of the anomaly is calculated based on the main disturbance length and the sampling frequency of the power waveform signal.
[0016] Preferably, based on the coverage relationship between the anomaly duration and the equivalent receptive field corresponding to each scale convolutional branch, the information coverage capability of each scale convolutional branch for the current anomaly perturbation interval is determined, including: Determine the kernel size, number of convolutional layers, initial dilation rate, and stride of each scale convolutional branch, and calculate the equivalent receptive field length of each scale convolutional branch converted to the scale of the waveform window sample sampling point by combining the cumulative downsampling stride of the front-end basic extraction module. The main perturbation length is compared with the equivalent receptive field length corresponding to each scale convolution branch. When the equivalent receptive field length is less than the main perturbation length, it is determined that the corresponding convolution branch has insufficient perturbation information coverage. When the equivalent receptive field length is greater than or equal to the main perturbation length, it is determined that the corresponding convolution branch can cover the main perturbation interval. For convolutional branches with insufficient coverage of perturbation information, the dilation rate of the corresponding convolutional branch is increased to expand the equivalent receptive field of the corresponding convolutional branch; the equivalent receptive field length is recalculated based on the adjusted dilation rate, and the information coverage capability of the corresponding convolutional branch is re-determined based on the recalculated equivalent receptive field length until the main perturbation interval is covered or the preset dilation rate upper limit is reached.
[0017] Preferably, dynamic routing weights are generated based on information coverage and scale matching; the basic temporal feature maps are input into convolutional branches at each scale to extract multi-scale features, and the multi-scale features are weighted and fused based on the dynamic routing weights to obtain dynamic multi-scale temporal features, including: For the convolutional branch that can ultimately cover the main perturbation range, the scale matching degree is determined based on the relative scale difference between the corresponding equivalent receptive field length and the main perturbation length. The smaller the relative scale difference, the fewer non-target waveform ranges are introduced by the corresponding convolutional branch while fully covering the main perturbation range, and the higher the scale matching degree. In addition, an inflation penalty term is introduced for the corresponding convolutional branch, so that the model can give the convolutional branch with a low inflation rate a higher scale matching degree under the same field of view. For convolutional branches that still cannot cover the main perturbation range after reaching the preset expansion rate limit, the scale matching degree is attenuated according to the ratio between the equivalent receptive field length and the main perturbation length to obtain the penalized scale matching degree. The scale matching degree or the penalized scale matching degree corresponding to each scale convolutional branch is normalized to obtain the dynamic routing weights corresponding to each scale convolutional branch. The multi-scale features output by each scale convolutional branch are then weighted and fused according to the dynamic routing weights to obtain the dynamic multi-scale temporal features.
[0018] Preferably, channel-location dual attention enhancement is performed on the dynamic multi-scale temporal feature map and the frequency domain feature map respectively to obtain temporal enhanced feature vector and frequency domain enhanced feature vector, including: For dynamic multi-scale time-domain features or frequency-domain feature maps, the input features of the corresponding branches are used for global average pooling along the feature sequence dimension to obtain the global statistics of each channel and construct the channel description vector. The channel description vectors are processed sequentially through fully connected mapping and activation functions to generate channel attention weights for the corresponding branches; The input features are aggregated along the feature channel dimension to obtain the channel aggregation result. The channel aggregation result is then processed by one-dimensional convolution and activation function to generate the positional attention weights of the corresponding branches. After expanding the channel attention weights and the position attention weights to the same dimension as the input features of the corresponding branches through a spatial broadcasting mechanism, they are multiplied element-wise with the input features to obtain the attention enhancement features of the corresponding branches. Global average pooling and feature dimension alignment are performed on the attention enhancement features of the corresponding branches respectively to obtain the temporal domain enhancement feature vector and the frequency domain enhancement feature vector.
[0019] Preferably, based on the time-domain variation characteristics and spectral energy distribution characteristics of the waveform window samples, time-domain anomaly intensity parameters and frequency-domain anomaly intensity parameters are determined respectively to determine the time-frequency dynamic gating weights, including: The average change intensity, maximum local mutation intensity, and anomaly persistence ratio of the waveform window samples are calculated, and the time-domain anomaly intensity parameters are constructed by normalizing the evaluation indicators and weighted summing. The high-frequency energy proportion of the waveform window sample in the high-frequency band, the spectral energy center reflecting the location of the spectral energy distribution, and the spectral dispersion are calculated. After normalization of the evaluation index and weighted summation, the frequency domain anomaly intensity parameter is constructed. Based on the time-domain anomaly intensity parameter and the frequency-domain anomaly intensity parameter, the time-domain dynamic gating weight and the frequency-domain dynamic gating weight are determined respectively through a preset exponential mapping relationship, and are used as the time-frequency dynamic gating weight.
[0020] Secondly, the present invention provides an abnormal waveform identification system for medium-voltage power distribution lines, comprising: The data preprocessing module is used to acquire the power waveform signal of medium-voltage power distribution lines, and obtain waveform window samples through standardization and sliding window processing; The time-frequency dual-branch feature extraction module is used to input waveform window samples into a time-domain convolutional network to obtain a basic time-domain feature map; and to perform a frequency-domain transformation on the waveform window samples to obtain a logarithmic amplitude spectrum, which is then input into a frequency-domain convolutional network to obtain a frequency-domain feature map. A dynamic multi-scale temporal fusion module is used to determine the duration of anomalies based on the intensity of local changes in waveform window samples; determine the information coverage capability of each scale convolutional branch for the current abnormal disturbance interval based on the coverage relationship between the duration of anomalies and the equivalent receptive fields corresponding to each scale convolutional branch; determine the scale matching degree based on the relative scale relationship between the duration of anomalies and the equivalent receptive fields corresponding to each scale convolutional branch; generate dynamic routing weights based on information coverage capability and scale matching degree; input the basic temporal feature map into each scale convolutional branch to extract multi-scale features; and perform weighted fusion of each multi-scale feature based on the dynamic routing weights to obtain dynamic multi-scale temporal features. The dual attention enhancement module is used to perform channel-position dual attention enhancement on dynamic multi-scale time-domain features and frequency-domain feature maps respectively, to obtain time-domain enhanced feature vectors and frequency-domain enhanced feature vectors; The time-frequency dynamic fusion module is used to determine the time-domain anomaly intensity parameter and the frequency-domain anomaly intensity parameter respectively based on the time-domain variation characteristics and spectral energy distribution characteristics of the waveform window sample, so as to determine the time-frequency dynamic gating weight. Based on the time-frequency dynamic gating weight, the time-domain enhanced feature vector and the frequency-domain enhanced feature vector are weighted and fused to obtain the final time-frequency fusion feature. The anomaly identification and alarm module is used to input the final time-frequency fusion features into the anomaly identification classifier and output the anomaly probability; and to issue an anomaly alarm based on the anomaly probability.
[0021] Thirdly, the present invention provides an electronic device, including a memory and a processor; The memory is used to store computer program instructions; The processor is used to execute the computer program instructions to implement the method.
[0022] Fourthly, the present invention provides a computer-readable storage medium having a computer program stored thereon that, when executed by a processor, implements the method.
[0023] The beneficial effects of this invention are compared with those of the prior art: (1) By constructing a time-frequency dual-branch feature extraction structure and performing time-channel dual attention enhancement on time-domain features and frequency-domain features respectively, the model can simultaneously focus on key time segments, key frequency regions and important feature channels in abnormal waveforms, thereby improving the ability to express abnormal waveform features under complex disturbance conditions and reducing information omissions caused by single time-domain or frequency-domain analysis.
[0024] (2) To address the problem of difficulty in adapting a fixed receptive field due to differences in the duration of different anomalous events, this invention establishes a physical coverage relationship between the duration of the anomalous event and the convolutional receptive field. By adaptively adjusting the dilation rate of the convolutional branches at each scale and introducing a penalty decay mechanism to prevent grid effects, the original dense sampling is preferentially retained while ensuring that the receptive field fully covers the anomalous region. This design achieves highly agile and robust adaptation of the model to short-term shocks and long-term disturbances.
[0025] (3) Explicitly calculate physical characterization indicators such as average waveform change intensity, maximum abrupt change intensity, high-frequency energy ratio, and spectral dispersion. The gating mechanism can adaptively adjust the contribution ratio of time-domain and frequency-domain features according to the time-frequency evolution characteristics of different abnormal samples, avoiding information redundancy and noise superposition caused by fixed fusion methods, and improving the discrimination ability of fused features and the physical interpretability of model decisions.
[0026] (4) To address the industry challenge of scarce abnormal samples and extremely unbalanced distribution of positive and negative samples in actual power systems, this invention organically combines class-weighted cross-entropy, label smoothing, and regularization strategies during the model training phase. This not only effectively alleviates the problem of model overconfidence in normal waveforms but also improves the model's recall rate for various high-risk abnormal waveforms, truly meeting the stringent safety operation requirements of power systems where preventing missed detections is more important than preventing false alarms.
[0027] (5) This invention uses standardized waveform slices as input. The overall network consists of one-dimensional convolution, multi-scale branches, and lightweight attention modules, resulting in low computational complexity and small memory footprint. Combined with overlapping sliding windows and signal-level probabilistic fusion mechanisms, it is suitable for deployment in devices with limited computing power, such as power distribution automation terminals and edge computing gateways, enabling millisecond-level online monitoring and proactive early warning of abnormal waveforms in medium-voltage power distribution lines. Attached Figure Description
[0028] Figure 1 This is a flowchart illustrating the abnormal waveform identification method for medium-voltage power distribution lines provided by the present invention. Figure 2 This is a schematic diagram of waveform window sample construction based on overlapping sliding windows provided by the present invention; Figure 3 This is a comparison chart of the performance indicators of the basic model and the complete model provided by this invention; Figure 4 This is a comparison diagram of the confusion matrix between the basic model and the complete model provided by this invention. Detailed Implementation
[0029] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of this invention. The embodiments described in this application are merely some embodiments of this invention, and not all embodiments. Based on the spirit of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the protection scope of this invention.
[0030] Example 1: like Figure 1 As shown, this invention provides a method for identifying abnormal waveforms in medium-voltage power distribution lines. The method includes the following steps: inputting raw power waveform data, constructing a sliding window sample, extracting time-domain features, extracting frequency-domain features, extracting multi-scale convolutional features, enhancing time-channel dual attention, gating feature fusion, classifying output, and issuing anomaly warnings. The overall technical approach can be summarized as follows: Raw power waveform data input → Data preprocessing → Sliding window slicing → Time-domain / frequency-domain dual-branch feature construction → Multi-scale convolutional attention network modeling → Gated fusion → Abnormal waveform classification → Abnormal early warning output.
[0031] Step 1: Acquire the power waveform signal of the medium-voltage distribution line By using a waveform recording device (or voltage / current transformer, smart terminal, etc.) deployed on medium-voltage distribution lines, sampling is performed at a preset frequency. Real-time sampling is used to acquire one-dimensional voltage, current, or transient waveform signals during the operation of medium-voltage power distribution lines as input. Let the acquired original discrete waveform time series be:
[0032] in, Indicates the first Waveform amplitude at each sampling point; This represents the total length of the sampling points in the original waveform sequence; The sampling point number is indicated; the preset sampling frequency can be 4kHz, 10kHz, or in the range of 1kHz to 10kHz.
[0033] Step 2: Standardize the original waveform. To reduce the impact of different lines, sampling batches, and amplitude scales on feature extraction and model recognition, and to improve the model's generalization ability, the original discrete waveform time series obtained in step one is Z-score standardized to obtain a standardized waveform sequence. The standardization formula for the nth sampling point is as follows:
[0034] in, Represents the standardized first Waveform amplitude at each sampling point; This represents the entire original waveform sequence obtained based on step one. of The mean value obtained from each sampling point is calculated as follows:
[0035] Indicates based on the The standard deviation calculated from each sampling point is as follows:
[0036] In the formula, The sampling points are traversed through the index for summation calculation; To prevent numerical instability caused by a standard deviation of zero or close to zero, a very small normal value is set. In this embodiment, it can be taken as... .
[0037] Step 3: Construct a sliding window sample to obtain a waveform window sample.
[0038] Because the power waveform signals of medium-voltage distribution lines are relatively long, directly inputting them into a deep learning model would lead to high computational complexity and dilute short-term anomalies with long-sequence background. This invention employs an overlapping sliding window method to slice the standardized waveform sequence.
[0039] In this embodiment, as Figure 2 As shown, let the window length be... =8192, sliding step size =4096, then the first Each waveform window sample is represented as:
[0040] in, Indicates the first One waveform window sample; Indicates the window length; Indicates the sliding step size; This represents the window number, and its value range is... ; This represents the waveform sampling points after standardization in step two.
[0041] From a length of The original waveform can be used to obtain the total number of waveform window samples. The calculation method is as follows:
[0042] in, This indicates a floor operation. Through the above steps, a fixed-length waveform window sample can be obtained, which serves as the input to the subsequent time-frequency dual-branch multi-scale convolutional network.
[0043] It should be noted that in the implementation of offline training of the model of the present invention, in order to enable the model to learn abnormal local segments, historical power distribution line operation waveform data or simulation data with preset labels are used as the training set, such as the publicly available power waveform dataset VSB Power Line Fault Detection. In a simplified implementation, the waveform window samples obtained by the above segmentation will inherit the labels of the original waveform. If the original waveform label is... Then all window samples obtained by segmenting the waveform inherit the original label: .in, Indicates the first Sample labels for each window; Where 0 represents normal and 1 represents abnormal. After the model training and testing are completed, in the actual industrial application stage, this module directly receives unknown waveform samples that have been collected in real time by waveform recording devices deployed on power distribution lines, standardized and sliced, and can be directly input into the network for anomaly identification without relying on any labels.
[0044] Step 4: Input the waveform window sample into the front-end basic extraction module of the temporal convolutional network to obtain the basic temporal feature map.
[0045] The waveform window sample obtained in step three The input is processed in the front-end basic extraction module of the temporal convolutional network. This temporal convolutional network consists of a front-end basic extraction module and a back-end dynamic multi-scale convolutional branch. First, the basic extraction module extracts features such as spikes, abrupt changes, oscillations, and amplitude anomalies from the original waveform. For example, when L=8192, the input sample is... .
[0046] This basic extraction module mainly consists of one-dimensional convolutional layers, batch normalization layers, and nonlinear activation layers. The process of extracting features through layer-time convolution can be represented as:
[0047] The subscript t indicates that the parameter belongs to the time domain branch; Indicates the time-domain branch number The output features of the layer; the initial features of the input layer are set as follows: ; and They represent the first One-dimensional convolution Kernel weight parameters and bias terms; This represents a one-dimensional convolution operation; This indicates a batch normalization operation; This represents a nonlinear activation function, which in this embodiment can be ReLU, GELU, or SiLU.
[0048] In this embodiment, the basic extraction module specifically comprises a four-layer one-dimensional convolutional network. The kernel sizes of each layer are 7, 5, 3, and 3, respectively, with a stride of 2, and the number of output channels are 16, 32, 64, and 128, respectively. After the above operations, the output of the last layer is extracted. As the foundational temporal feature map for this module, The basic time-domain feature map It effectively preserves the local morphological information of the original waveform on the time axis, which not only enhances the model's ability to identify transient anomalies such as short-term spikes, local disturbances and waveform distortion, but also serves as the input for subsequent dynamic multi-scale convolution branches.
[0049] Step 5: Perform frequency domain transformation on the waveform window samples to obtain the logarithmic amplitude spectrum, and input it into the frequency domain convolutional network to obtain the frequency domain feature map.
[0050] Frequency domain feature branching is used to extract information such as spectral energy distribution, high-frequency disturbances, harmonic variations, and frequency component shifts from abnormal power waveforms. For the waveform window sample... First, a discrete Fourier transform is performed to obtain the complex spectrum values at each frequency point:
[0051] in, Indicates the first The window sample at the th Complex spectral values at each frequency point; Indicates the first sample in the window One sampling point; Indicates the window length; This represents the frequency index, and its value range is... ; It represents the imaginary unit.
[0052] To compress the dynamic range of the spectral amplitude and improve training stability, the amplitude of the complex spectral values is calculated and then logarithmically transformed:
[0053] in, Represents the logarithmic amplitude spectrum; Represents the complex modulus of the spectrum; This represents the natural logarithm function with the natural constant as the base. Then, it assigns the values corresponding to all frequency points. By splicing, a logarithmic amplitude spectrum sequence of length L is obtained. .
[0054] The logarithmic amplitude spectrum sequence As the initial input to the frequency domain convolutional network, i.e. Feature extraction is then performed. The process of extracting features through layer frequency domain convolution is represented as follows:
[0055] Among them, subscript This parameter indicates that it belongs to the frequency domain branch; Indicates the frequency domain branch. Layer output features; and They represent the first Weight parameters and bias terms of a one-dimensional convolution kernel in the frequency domain; , , The physical meanings of these operations are one-dimensional convolution, batch normalization, and nonlinear activation functions, respectively, which are the same as the definitions in step four above.
[0056] In this embodiment, the frequency domain one-dimensional convolutional network comprises three layers, with kernel sizes of 5, 3, and 3, a stride of 2, and output channels of 16, 32, and 64, respectively. The output feature of the last layer of this convolutional network is denoted as... Thus, a frequency domain feature map is obtained that preserves the local feature distribution of the frequency dimension. This serves as the input for subsequent frequency domain-side dual attention enhancement.
[0057] By constructing a frequency domain input branch, the frequency component changes that are difficult to express explicitly in the time domain branch can be effectively supplemented, enabling the model to have a stronger ability to identify high-frequency partial discharges, short-term disturbances, and sudden changes in spectral energy.
[0058] Step Six: Determine the duration of the anomaly based on the intensity of local changes in the waveform window samples; determine the information coverage capability of each scale convolutional branch for the current anomaly disturbance interval based on the coverage relationship between the anomaly duration and the equivalent receptive field corresponding to each scale convolutional branch; determine the scale matching degree based on the relative scale relationship between the anomaly duration and the equivalent receptive field corresponding to each scale convolutional branch; generate dynamic routing weights based on information coverage capability and scale matching degree; input the basic temporal feature map into each scale convolutional branch to extract multi-scale features, and perform weighted fusion of each multi-scale feature based on the dynamic routing weights to obtain dynamic multi-scale temporal features.
[0059] The durations of different types of abnormal events in medium-voltage power distribution lines vary. For example, local spikes and transient impacts typically correspond to shorter waveform change intervals, while sustained oscillations and waveform distortions correspond to longer waveform change intervals. To match the convolutional receptive field with the duration of the current abnormal event, this invention introduces a dynamic multi-scale convolutional feature extraction mechanism based on prior knowledge of the abnormal event duration in the time-domain branch.
[0060] Specifically, for the first obtained in step three Waveform window samples First, calculate the intensity of local changes between adjacent sampling points:
[0061] in, Indicates the first The waveform window sample number The intensity of local waveform changes at each location; Let n represent the nth local sampling point in the i-th waveform window sample sequence. Since first-order difference calculation is used, the range of index n is... .
[0062] Calculate the mean value based on the local waveform change intensity sequence within the waveform window sample. and standard deviation And determine the threshold for judging abnormal changes:
[0063] in, Threshold for determining abnormal changes; This is the coefficient for determining abnormal changes, which can be set based on training or validation data.
[0064] The intensity of local waveform changes must satisfy The sampling locations are marked as anomalous change locations, and consecutive anomalous change locations are grouped into candidate perturbation intervals. The maximum consecutive length of the candidate perturbation interval is denoted as... , to indicate the length of the main disturbance in the current waveform window sample.
[0065] Combined with the preset sampling frequency of the waveform recording device deployed on the medium-voltage distribution line as described in step one. According to the main disturbance length Calculate the abnormal duration of the current waveform window sample:
[0066] The main disturbance length obtained from this or abnormal duration This will be used to guide the evaluation of the information coverage capability of subsequent dynamic multi-scale convolutional branches.
[0067] The time-domain feature map obtained in step four Settings include One-dimensional convolution branches of different scales are taken in this embodiment. The initial set of convolution kernel sizes for each branch is set as follows: In this embodiment, the following can be adopted: The initial expansion rate is set to .
[0068] (1) Calculate the initial equivalent receptive field and information coverage capability Combining the cumulative downsampling stride of the basic temporal convolutional network in step four In this embodiment, the step size of all four layers is 2. Calculate the first The equivalent receptive field length of each scale convolution branch converted to the waveform window sample point scale. :
[0069] in This indicates the number of convolutional layers contained in the m-th scale convolutional branch; Indicates the first branch within that branch l Layer convolution kernel size; Indicates the first branch within that branch l Layer convolution dilation rate; Indicates the first branch within that branch j The step size of the layer. It is particularly important to note that when... When defining the product term .
[0070] In a preferred embodiment, to maintain feature map resolution, the stride of each network layer within each multi-scale branch is assumed to be 1, then the above equation simplifies to:
[0071] The determined main disturbance length The equivalent receptive field length of each scale convolution branch. Comparison. When When, it is determined that the corresponding convolutional branch can cover the main perturbation region; when At that time, it was determined that there was insufficient coverage of disturbance information.
[0072] In actual power distribution network operation, for extremely short-duration abnormal events such as transient spikes caused by lightning strikes or high-frequency partial discharge pulses, a relatively small initial convolution kernel is sufficient. The conditions are met. Through precise determination in this step, short-term features can be directly identified, avoiding the dilution of peak features caused by the introduction of a large number of normal background waveform sequences, thus ensuring high sensitivity in the identification of short-term transient anomalies.
[0073] (2) Dynamic expansion rate adjustment mechanism In response to insufficient coverage of disturbance information (i.e.) The convolutional branch at scale m dynamically increases its dilation rate to expand the receptive field. To prevent feature extraction failure due to out-of-bounds sampling points of the convolutional kernel, the upper limit of the dilation rate of the m-th scale branch is set. The length of the current input feature sequence is dynamically determined:
[0074] in, To prevent the empirical inflation limit of the grid effect, this embodiment can take [a certain value]. Or 16; Basic temporal feature map The sequence length satisfies , L This represents the length of the window sample.
[0075] To balance receptive field expansion and grid effect prevention, for convolutional branches with insufficient coverage, this invention adjusts the method based on the number of layers contained in the branch. Different adjustment strategies were adopted: When the branch is a single-layer convolution ( )hour: Without iteration, the minimum expansion rate that satisfies the coverage requirement can be directly calculated analytically, and is subject to a dynamic upper limit:
[0076] When the branch is a multi-layer convolution ( )hour: A layer-by-layer iterative approach is adopted, proceeding from back to front (i.e., from deeper layers closer to the output to shallower layers). In the order of expansion rate of each layer, the expansion rate of each layer is adjusted sequentially. Apply increments of 1 step size. After each increment, recalculate using the receptive field formula. Until the recalculated equivalent receptive field is satisfied. Or until the expansion rate of each layer reaches the set expansion limit.
[0077] In a preferred embodiment, to eliminate the grid effect under a large receptive field, the combination of expansion rates of multi-layer branches can be limited to a zigzag increasing sequence, for example... It expands the overall receptive field through interlayer accumulation rather than drastic expansion of a single layer.
[0078] After the above adjustments, the final adjusted equivalent receptive field length is denoted as . For a single-layer convolutional branch, let its corresponding final dilation rate be denoted as... For multi-layer convolutional branches, extract the maximum value of the final dilation rate of each layer within it (i.e., ), uniformly recorded as This is to facilitate the subsequent calculation of the inflation penalty term.
[0079] When encountering long-term abnormal events such as sustained voltage dips caused by single-phase grounding faults or prolonged waveform distortion caused by ferroresonance, conventional small kernel convolution often leads to misjudgments due to its limited field of view. This invention, through a dynamic dilation rate adjustment mechanism, adaptively "stretches" the convolutional receptive field without increasing network depth or computational parameters, matching its physical temporal coverage with the long-term abnormal event and effectively extracting global fault evolution trend features.
[0080] (3) Calculate the scale matching degree and dynamic routing weight Based on the final equivalent receptive field of each branch With the main disturbance length The relative scale relationship between them is used to calculate the scale matching degree of the m-th branch. :
[0081] in, In this embodiment, the parameter used to control the smoothness of the weight distribution can be set to 50. As the penalty coefficient, this embodiment can take... ; This is the inflation penalty coefficient. ; This represents an exponential function with the natural constant e as its base.
[0082] The above formula, when logically complete, corresponds to the following situation: For the final coverage of the main disturbance range (i.e. The convolution branch of is calculated using the first line of the formula. The relative scale difference is used to characterize the degree of matching; a smaller difference indicates fewer non-target waveform regions are introduced, resulting in a higher degree of matching. When multiple convolutional branches satisfy this condition, the matching degree is uniformly determined based on this relative scale difference; simultaneously, a dilation penalty term is introduced. This forces the model to prioritize assigning higher matching degrees to large-sized native convolutional kernels with low dilation rates under the same field of view.
[0083] For those that still cannot be covered after reaching the preset expansion rate limit (i.e.) The convolution branch is calculated using the second line of the formula. The attenuation factor is constructed using the ratio. The scale matching degree is attenuated to obtain the penalized scale matching degree.
[0084] Finally, the degree of scale matching for each branch. Softmax normalization is performed to obtain the dynamic routing weights corresponding to the convolutional branches at each scale. :
[0085] in, To traverse all Summation of a multi-scale branched cursor variable.
[0086] Through the above mechanism, an inflation penalty term is introduced when calculating the matching degree. This mechanism effectively mitigates the grid effect caused by a high dilation rate. When the receptive fields of different convolutional branches can cover the perturbation length, the model is forced to preferentially assign higher dynamic weights to branches with low dilation rates and large kernel sizes, thereby preserving the local dense details of the waveform to the greatest extent while ensuring the field of view. Simultaneously, a penalty attenuation factor is used... By applying extremely heavy score suppression to invalid branches that have reached the expansion limit but still cannot cover long-term fault cycles, the noise input caused by mismatched receptive fields is effectively suppressed, and the robustness of the model in complex signal-to-noise ratio environments is improved.
[0087] (4) Multi-scale weighted fusion For the i-th waveform window sample, let the th... Each scale convolutional branch (using an adjusted final dilation rate) applies a convolutional branch to the base temporal feature map. The output features after convolution are:
[0088] in, Indicates the first Each scale convolutional branch outputs; Indicates the kernel size as Expansion rate One-dimensional convolution; Indicates batch normalization; This represents a non-linear activation function.
[0089] Because different branches employ different dilation rates and kernel sizes, the sequence length or number of channels in their output feature maps may vary. Channel dimension alignment is achieved using 1×1 one-dimensional convolutions, and sequence length alignment is performed using zero-padding or pooling operations. After aligning the length and channel dimensions of the outputs of each scale convolutional branch, weighted fusion is performed based on dynamic routing weights to obtain dynamic multi-scale temporal features. :
[0090] Where M is the total number of multi-scale convolutional branches.
[0091] This invention breaks away from the feature redundancy caused by simple splicing of traditional multi-scale networks, and achieves on-demand feature fusion based on the prior anomaly duration. This not only makes the final feature representation highly consistent with the actual scale of different types of faults, but also greatly enhances the generalization and adaptability of the identification classifier to unknown types of distribution network disturbance events.
[0092] Step 7: Perform channel-position dual attention enhancement on the dynamic multi-scale time-domain features and frequency-domain feature maps respectively to obtain time-domain enhanced feature vectors and frequency-domain enhanced feature vectors.
[0093] To improve the model's ability to focus on key anomaly regions and key feature channels, this invention does not perform attention processing uniformly after time-frequency feature fusion. Instead, it performs time-channel dual attention enhancement on time-domain features and frequency-domain features respectively before the fusion of the two features.
[0094] The temporal attention input is the dynamic multi-scale temporal feature obtained in step six. The frequency domain attention input is the frequency domain feature map obtained in step five. For ease of correspondence with the i-th waveform window, it will be uniformly referred to here as To simplify the mathematical expression, a branch indicator variable is introduced. ,in, Indicates time-domain branching, This indicates a frequency domain branch. Let... This represents the input feature of the b-th branch, which is assigned a value if the following condition is met: when hour, ;when hour, .
[0095] Let the first The input features of each branch are: .in, Indicates the first The number of feature channels in each branch Indicates the first The length of the feature sequence of each branch. When hour, The length of the corresponding time-domain feature on the time axis; when hour, The length of the corresponding frequency domain feature on the frequency axis.
[0096] (1) Calculate the channel attention weights First, regarding the first Each branch undergoes global average pooling along the feature sequence dimension to obtain global statistics for each channel:
[0097] in, Indicates the first The first branch Global statistics for each channel; Indicates the input feature at the th The first branch The first channel in the The eigenvalues at each feature location.
[0098] The global statistics for each channel are combined into a channel description column vector:
[0099] Where T represents the transpose of a vector.
[0100] The channel description vector is sequentially input into two fully connected layers, and the Sigmoid function is used to obtain the first... Channel attention weights for each branch:
[0101] in, Indicates the first Channel attention weights for each branch; and Represents the learnable weight matrix; and Indicates the bias term; Represents the ReLU activation function; This represents the Sigmoid function.
[0102] (2) Calculate the position attention weights To highlight the first The key positions on the feature sequences in each branch are used to aggregate the channel dimensions. In this embodiment, average pooling is used to reduce the channel dimensions, that is:
[0103] in, Indicates the first The branch in the Channel aggregation results at each feature location.
[0104] The aggregation results at each feature location are combined into a location description sequence. Based on the channel aggregation results, positional attention weights are generated using a one-dimensional convolutional mapping and a sigmoid function:
[0105] in, Indicates the first The positional attention weights of each branch; Indicates the first Each branch corresponds to a one-dimensional convolution mapping. In this embodiment, the kernel size of this one-dimensional convolution can be set to 3. It should be noted that when At that time, the positional attention is applied to different temporal locations of the temporal features to highlight key time segments where anomalies occur; when At that time, the positional attention is applied to different frequency positions of the frequency domain features to highlight key frequency regions that contribute significantly to anomaly identification.
[0106] (3) Feature enhancement and vectorization mapping Because the channel attention weights and position attention weights have different dimensions than the input feature tensors, they are expanded to the same dimension as the input feature tensor using a spatial broadcasting mechanism before element-wise multiplication. Finally, the... Attention enhancement features of each branch for: .in, This represents element-wise multiplication; Used to enhance key feature channels; Used to enhance key feature locations; Broadcast indicates dimensionality broadcasting. Therefore, temporal attention-enhanced features are obtained respectively. and frequency domain attention enhancement features .
[0107] This dual-branch attention mechanism can highlight key anomalous time segments and key channels in the time domain branch, as well as key frequency regions and key channels in the frequency domain branch, before time-frequency feature fusion, thereby reducing the impact of irrelevant features and noise on subsequent time-frequency fusion.
[0108] To transform the temporal and frequency domain features into one-dimensional feature vectors suitable for subsequent gating fusion, global average pooling is performed on the temporal attention-enhanced features and the frequency domain attention-enhanced features, respectively: .in, This represents the temporal feature vector after attention enhancement. This represents the frequency domain feature vector after attention enhancement. and When the feature dimensions are inconsistent, both are mapped to the same feature dimension through linear mapping, ultimately obtaining the temporal enhanced feature vector. Frequency domain enhanced feature vectors : .
[0109] in, and These represent linear mappings of time-domain and frequency-domain features, respectively. Specifically, the linear mapping is achieved through a fully connected layer (or matrix multiplication combined with a bias term) to transform the feature dimensions. The mapped features are... and As the input for the gating time-frequency fusion in step eight.
[0110] Step 8: Based on the time-domain variation characteristics and spectral energy distribution characteristics of the waveform window samples, determine the time-domain anomaly intensity parameters and frequency-domain anomaly intensity parameters respectively, so as to determine the time-frequency dynamic gating weights. Based on the time-frequency dynamic gating weights, perform weighted fusion of the time-domain enhanced feature vector and the frequency-domain enhanced feature vector to obtain the final time-frequency fusion feature.
[0111] Different types of abnormal waveforms in medium-voltage power distribution lines exhibit different manifestations in the time and frequency domains. For example, anomalies such as spikes, sudden changes, and short-term impulses are mainly characterized by rapid changes in the time-domain waveform, while anomalies such as partial discharge, high-frequency disturbances, and harmonic variations are usually accompanied by a redistribution of spectral energy or an enhancement of high-frequency components. Therefore, to avoid generating time-frequency fusion weights solely through learnable parameters within the neural network, this invention constructs time-domain and frequency-domain anomaly intensity parameters based on the time-domain variation characteristics and frequency-domain energy distribution characteristics of the current window sample, and determines the dynamic gating weights of the time-frequency features based on these two parameters.
[0112] For the A standardized window sample First, calculate the average change intensity used to characterize the degree of change in the time-domain waveform:
[0113] in, Indicates the first The degree of change in average amplitude between adjacent sampling points in a window sample Indicates the window length; This represents the value of the nth sampling point within the window.
[0114] Further calculation of the maximum local mutation intensity:
[0115] in, It represents the maximum magnitude of the abrupt change between adjacent sampling points in the current window sample, and is used to characterize local anomalies such as spikes, abrupt changes, and transient shocks.
[0116] At the same time, the main disturbance length obtained in step six is used Calculate the percentage of abnormal persistence:
[0117] in, This indicates the duration of the main anomalous disturbance interval within the entire window sample.
[0118] To eliminate the influence of different physical indicators in terms of dimensions and numerical ranges, the evaluation indicators in both the time and frequency domains are normalized. For any given evaluation indicator... Its normalization result can be expressed as:
[0119] in, and These represent the minimum and maximum reference values of the evaluation metric in the training or validation data, respectively. To prevent extremely small positive numbers from being set in the denominator (zero), the reference minimum and maximum values remain fixed after the model completes training and enters the actual inference phase.
[0120] Based on the average change intensity, the maximum local mutation intensity, and the anomaly persistence ratio, the first... Temporal anomaly intensity parameters corresponding to each window sample: .in, , , These are the evaluation indicators after normalization. Indicates the time-domain anomaly intensity parameter; , and These represent the contribution coefficients corresponding to the average change intensity, the maximum local mutation intensity, and the anomaly persistence ratio, respectively. The contribution coefficients are non-negative parameters, which can be determined based on training or validation data, and must satisfy the following: .
[0121] On the frequency domain side, the complex spectrum obtained by performing a discrete Fourier transform on the window samples in step five is used. Calculate the first The spectral energy corresponding to each frequency point:
[0122] in, Indicates the first The window sample at the th According to the Nyquist sampling theorem, the effective physical spectral components at each frequency point are distributed at index [index missing]. Within the range.
[0123] Let the set of frequency indices corresponding to the preset high-frequency band be . The proportion of high-frequency energy can then be expressed as:
[0124] in, This represents the proportion of high-frequency energy to the total effective spectrum energy; in this embodiment, It can be set to an index set corresponding to the actual frequency of 10kHz (or a certain percentage of the Nyquist frequency). An increase in the proportion of high-frequency energy usually corresponds to the enhancement of high-frequency components caused by high-frequency disturbances, partial discharges, or transient impacts.
[0125] Further calculation of the spectral energy center:
[0126] in, Indicates the first The actual frequency corresponding to each frequency point is calculated as follows: ,in Where L is the sampling frequency and L is the window length. This indicates the spectral energy center of the current window sample, used to reflect the overall distribution of spectral energy on the frequency axis.
[0127] To further reflect the degree of spectral spread and frequency disturbance caused by abnormal waveforms, the spectral dispersion is calculated:
[0128] in, This indicates the degree of dispersion of spectral energy relative to the spectral energy center. When anomalies cause frequency component diffusion or significant changes in the spectral structure, this degree of spectral dispersion increases accordingly.
[0129] After normalizing the high-frequency energy proportion, spectral energy center, and spectral dispersion, the first... Frequency domain anomaly intensity parameters corresponding to each window sample: .in, Indicates the frequency domain anomaly intensity parameter; , and These represent the contribution coefficients corresponding to the proportion of high-frequency energy, the center of spectral energy, and the degree of spectral dispersion, respectively. The contribution coefficients are non-negative parameters, which can be determined based on training or validation data, and must satisfy the following: .
[0130] Based on time-domain anomaly intensity parameters and frequency domain anomaly intensity parameters Calculate the time-frequency dynamic gating weights corresponding to the samples in the current window:
[0131] in, This represents the time-domain dynamic gating weights corresponding to the samples in the current window. Let represent the frequency domain dynamic gating weights, and satisfy: .
[0132] Step seven has performed attention enhancement, global average pooling, and feature dimension alignment on both the temporal and frequency domain features, resulting in temporal enhanced feature vectors. Frequency domain enhanced feature vectors Therefore, the two enhanced features are weighted and fused according to the dynamic gating weights: .in, Indicates the first The final time-frequency fusion features corresponding to each window sample.
[0133] When the current anomaly mainly manifests as spikes, abrupt changes, rapid amplitude changes, and short-term shocks, the average change intensity Maximum local mutation intensity or abnormal persistence ratio Changes in time-domain anomaly intensity parameters Increase, thereby improving temporal enhancement features. The proportion of contribution to the final fusion features.
[0134] When the current anomaly is mainly manifested as high-frequency energy enhancement, spectral energy migration, or frequency component diffusion, the proportion of high-frequency energy... Spectrum Energy Center Or the degree of spectral dispersion The corresponding changes affect the frequency domain anomaly intensity parameters. Increase, thereby improving frequency domain enhancement features. The proportion of contribution to the final fusion features.
[0135] Therefore, the time-frequency fusion weights of this invention are not automatically generated by the neural network output features of the time-domain and frequency-domain branches through learnable parameters. Instead, they explicitly introduce physical features directly related to the abnormal waveforms of medium-voltage power distribution lines, such as the degree of local waveform mutation, the proportion of abnormal duration, the proportion of high-frequency energy, and the distribution of spectral energy. Based on these physical features, the relative contribution of time-domain information and frequency-domain information to the current abnormal sample is evaluated, thereby realizing dynamic time-frequency fusion based on the characteristics of the abnormal waveform itself.
[0136] Step 9: Input the final time-frequency fusion features into the anomaly identification classifier and output the anomaly probability; issue an anomaly alarm based on the anomaly probability.
[0137] The first obtained in step eight The final time-frequency fusion features corresponding to each window sample Input a classifier, and output the predicted probabilities of the samples in the window belonging to the normal and abnormal categories. For binary classification tasks, the sigmoid function can be used to output the abnormal probability.
[0138] in, This represents the probability that the i-th window sample belongs to the anomaly category; Indicates the classification layer weights; Indicates the classification layer bias; This represents the Sigmoid function.
[0139] For binary or multi-class classification tasks, if the Softmax approach is used, then the... The class probability is:
[0140] in, Indicates that the sample belongs to the first The probability of a class; Indicates the network output of the first The original classification score is calculated as follows: ; In this embodiment, the number of categories is represented. =2, meaning normal and abnormal.
[0141] The final prediction category is:
[0142] in, Indicates the category predicted by the model; This represents the category index corresponding to the highest probability value.
[0143] The abnormal warning rules are as follows:
[0144] in, =1 indicates that an abnormal alarm has been triggered; =0 indicates that no alarm is triggered; Indicates the probability of an anomaly; This indicates the preset alarm threshold, which can be set according to the on-site safety level.
[0145] If it is necessary to obtain a full-signal-level prediction from the window-level prediction, maximum probability fusion or average probability fusion can be used. For example, the same original waveform can be segmented to obtain... The probability of signal level anomalies in a given window can be defined as follows:
[0146] in, This indicates the probability of an anomaly in the entire signal; Indicates the first The probability of anomalies in each window. Using maximum probability fusion is beneficial for capturing local short-term anomalies.
[0147] Step 10: Train the abnormal waveform recognition model offline. Steps one through nine above describe the reasoning process by which the trained abnormal waveform recognition model identifies and alarms on the input power waveform. Before using the abnormal waveform recognition model for actual reasoning, it is necessary to train the learnable parameters in the model offline using labeled power waveform samples.
[0148] During the offline training phase of the model, the training samples are sequentially processed through the aforementioned data standardization, sliding window sample construction, time-domain and frequency-domain feature extraction, dynamic multi-scale convolutional feature extraction based on the prior of anomaly duration, dual-branch attention enhancement, and gated dynamic fusion based on time-frequency anomaly contribution indicators to obtain prediction results. The training loss is calculated based on the prediction results and the true labels, and the learnable parameters in the model are updated through backpropagation.
[0149] After model training is complete, the learnable parameters in the model are fixed. During the inference phase, only the waveform preprocessing, feature extraction, dynamic multi-scale convolution, attention enhancement, time-frequency gating fusion, classification prediction, and anomaly alarm processes described in steps one through nine are executed; loss function calculation and model parameter updates are no longer performed.
[0150] To address the issues of relatively few abnormal samples and unbalanced class distribution, this invention employs class-weighted cross-entropy, label smoothing, and regularization strategies during the training phase to improve the recall rate of abnormal classes and the model's generalization ability.
[0151] To alleviate the problem of model overconfidence, label smoothing is introduced:
[0152] in, This indicates the smoothed label; Indicates the label smoothing coefficient; Indicates the number of categories; This indicates the actual label.
[0153] For a single training sample, the class-weighted cross-entropy loss function is:
[0154] in, This represents the category-weighted cross-entropy loss; Indicates the first Class sample weights; The model predicts the number of... The probability of a class. Class weights can be set as follows:
[0155] in, Indicates the total number of training samples; Indicates the first The number of class samples is used to alleviate the class imbalance problem caused by a small number of abnormal samples.
[0156] After incorporating L2 regularization, the total loss function is:
[0157] in, Indicates the final training loss; Represents the L2 regularization coefficient; This represents all learnable parameters of the model; The squared norm of the model parameter is represented by the second norm.
[0158] Based on total losses Calculate the gradient and update the model parameters via backpropagation. During training, the learning rate can employ a cosine annealing strategy.
[0159] in, Indicates the first The learning rate for each iteration; This represents the minimum learning rate; Indicates the maximum learning rate; Indicates the current training round or iteration step; This indicates the maximum annealing cycle.
[0160] Example 2: This embodiment is validated through model comparison experiments, confusion matrix, and ablation experiments.
[0161] This invention utilizes temporal branching, frequency branching, multi-scale convolution, dual attention mechanisms, and a gated fusion module to enable the model to simultaneously utilize the original waveform morphology, spectral energy changes, short-term local features, and long-range perturbation features. Experimental data shows that the full model of this invention significantly improves accuracy, precision, recall, specificity, and F1 score compared to the baseline 1D-CNN model which only contains one-dimensional temporal convolution.
[0162] Table 1 Performance Comparison of Baseline and FullModel
[0163] From Table 1 and Figure 3As can be seen, the accuracy of the complete model of this invention is improved from 0.8102 to 0.8163, precision from 0.6773 to 0.6859, recall from 0.8392 to 0.8436, specificity from 0.7954 to 0.8023, and F1 score from 0.7496 to 0.7567. This demonstrates that the time-frequency dual-branch, multi-scale convolution, dual attention, and gated fusion mechanism proposed in this invention can effectively improve the performance of abnormal waveform recognition.
[0164] Based on experimental data, the confusion matrix between the 1D-CNN baseline and the FullModel is as follows: Figure 4 As shown.
[0165] To verify the contributions of each module in this invention, ablation experiments were conducted. In the experimental setup, the dual-branch structure, gated fusion, multi-scale convolution, frequency domain branch, and attention module were removed, and compared with the complete Full Model. Experimental data are shown in Table 2, where √ indicates the model includes the module, and × indicates the module was removed. The Accuracy, Precision, Recall, Specificity, and F1 scores for each model are explicitly given. Table 3 shows the confusion matrix parameters TP, TN, FP, and FN for each model. TP represents true positives, TN represents true negatives, FP represents false positives, and FN represents false negatives.
[0166] Table 2 Comparison of Ablation Test Indicators
[0167] Table 3 Comparison of parameters in the confusion matrix of ablation experiments
[0168] As shown in Tables 2 and 3, the complete FullModel achieves the best results in terms of overall performance, indicating a significant synergistic gain between the frequency domain feature extraction, dynamic multi-scale convolution, and dual attention enhancement of this invention. Removing or degrading any core module results in a less comprehensive model performance compared to the complete model.
[0169] On the one hand, by introducing a channel-position dual attention mechanism, this invention can visualize the key time segments, key frequency regions, and key feature channels that the model focuses on through attention weights. For abnormal waveforms with partial discharge, short-term spikes, or high-frequency disturbances, the model can generate higher attention responses in the corresponding time or frequency physical regions, improving the interpretability of the deep learning model's decision-making process and proving that the model output has a clear correspondence with the actual physical anomaly regions, thus meeting the reliability requirements for safety early warning in industrial settings.
[0170] On the other hand, this invention uses one-dimensional waveform segments as input, and the model structure consists of one-dimensional convolution, dynamic multi-scale convolution, a lightweight dual attention module, and a fully connected classifier, resulting in relatively controllable computational complexity. This method is easily encapsulated into a lightweight algorithm library, making it highly suitable for deployment in power distribution automation terminals, edge computing gateways, or online monitoring platforms with limited computing power. The system can perform sliding window segmentation, window-level recognition, and signal-level probability fusion on continuously acquired waveforms in real time. When the anomaly probability exceeds a threshold, an alarm signal is output, thereby achieving online intelligent identification and early warning of abnormal waveforms in medium-voltage power distribution lines.
[0171] Example 3: This embodiment provides an abnormal waveform identification system for medium-voltage power distribution lines. This system is used to specifically execute the abnormal waveform identification method described in Embodiment 1. Specifically, it includes: The data preprocessing module is used to acquire the power waveform signal of medium-voltage power distribution lines, and obtain waveform window samples through standardization and sliding window processing; The time-frequency dual-branch feature extraction module is used to input waveform window samples into a time-domain convolutional network to obtain a basic time-domain feature map; and to perform a frequency-domain transformation on the waveform window samples to obtain a logarithmic amplitude spectrum, which is then input into a frequency-domain convolutional network to obtain a frequency-domain feature map. A dynamic multi-scale temporal fusion module is used to determine the duration of anomalies based on the intensity of local changes in waveform window samples; determine the information coverage capability of each scale convolutional branch for the current abnormal disturbance interval based on the coverage relationship between the duration of anomalies and the equivalent receptive fields corresponding to each scale convolutional branch; determine the scale matching degree based on the relative scale relationship between the duration of anomalies and the equivalent receptive fields corresponding to each scale convolutional branch; generate dynamic routing weights based on information coverage capability and scale matching degree; input the basic temporal feature map into each scale convolutional branch to extract multi-scale features; and perform weighted fusion of each multi-scale feature based on the dynamic routing weights to obtain dynamic multi-scale temporal features. The dual attention enhancement module is used to perform channel-position dual attention enhancement on dynamic multi-scale time-domain features and frequency-domain feature maps respectively, to obtain time-domain enhanced feature vectors and frequency-domain enhanced feature vectors; The time-frequency dynamic fusion module is used to determine the time-domain anomaly intensity parameter and the frequency-domain anomaly intensity parameter respectively based on the time-domain variation characteristics and spectral energy distribution characteristics of the waveform window sample, so as to determine the time-frequency dynamic gating weight. Based on the time-frequency dynamic gating weight, the time-domain enhanced feature vector and the frequency-domain enhanced feature vector are weighted and fused to obtain the final time-frequency fusion feature. The anomaly identification and alarm module is used to input the final time-frequency fusion features into the anomaly identification classifier and output the anomaly probability; and to issue an anomaly alarm based on the anomaly probability.
[0172] At the methodological level, this invention is based on a sliding window sample construction mechanism, which divides long continuous waveform sequences into fixed-length samples suitable for neural network processing. This effectively overcomes the computational complexity disaster caused by direct input of long sequences, as well as the industry pain point of short-term local anomalies being diluted by long-range background. At the same time, through parallel modeling of time and frequency domain branches, the model can collaboratively extract the transient morphological information and spectral energy transfer characteristics of the original waveform in multiple dimensions, which greatly improves the completeness of the anomaly waveform representation.
[0173] At the core model level, this invention introduces three key mechanisms: Dynamic multi-scale convolution based on prior knowledge of abnormal duration: This breaks through the limitations of conventional static convolution in terms of field of view. By adaptively adjusting the dilation rate, it can accurately adapt to abnormal periods with extremely large physical spans, ranging from extremely short local spikes to long-term continuous oscillations, thus achieving on-demand scaling of the field of view.
[0174] Channel-Location Dual Attention Enhancement Module: Through a spatial broadcasting mechanism, it focuses on the key physical time / frequency segments and key feature channels where the anomaly is located, significantly reducing the interference of complex electromagnetic noise and giving the model strong physical interpretability.
[0175] The time-frequency dynamic gating fusion mechanism based on physical indicators abandons the black-box nature of traditional network parameter fusion. The model can adaptively adjust the contribution weights of time and frequency features according to the physical anomalies of the current sample (such as mutation intensity and high frequency ratio), thus achieving accurate feature distribution.
[0176] At the system engineering application level: This invention features lightweight and high robustness, and can be flexibly deployed in distribution automation terminals, edge computing gateways, online monitoring devices, or back-end cloud-based intelligent analysis platforms to achieve real-time acquisition, automated slicing, intelligent identification, and online early warning of waveform data for medium-voltage distribution lines. When the system detects that the probability of a window-level or signal-level anomaly crosses the safety threshold, it can instantly trigger an alarm and simultaneously send high-risk abnormal waveform segments, confidence probabilities, and identification and classification results, providing maintenance personnel with second-level response support for quickly locating potentially hazardous lines and isolating suspected faulty sections.
[0177] Therefore, this invention can effectively improve the accuracy, recall, and comprehensive discrimination ability of abnormal waveform identification in medium-voltage distribution lines, reduce the risk of missed anomaly detection, and enhance the interpretability of the model's judgment process through an attention mechanism. Compared with traditional manual inspection, fixed threshold judgment, manual feature recognition, and ordinary single-branch convolutional models, this invention is more suitable for intelligent monitoring scenarios of medium-voltage distribution lines with weak local anomalies, complex waveform morphology, and obvious time-frequency feature coupling, and can provide reliable technical support for early warning of distribution network faults and condition-based maintenance.
[0178] Example 4: An electronic device includes a memory and a processor, wherein the memory stores a computer program that can run on the processor, and when the processor executes the program, it implements the steps of a method for identifying abnormal waveforms in medium-voltage power distribution lines.
[0179] Example 5: A computer-readable storage medium storing computer program instructions, wherein when the computer program instructions are read and executed by a processor, the steps of a method for identifying abnormal waveforms in a medium-voltage power distribution line are implemented.
[0180] This disclosure can be a system, method, and / or computer program product. A computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for causing a processor to implement various aspects of this disclosure.
[0181] Computer-readable storage media can be tangible devices capable of holding and storing instructions for use by an instruction execution device. Computer-readable storage media can be, for example—but not limited to—electrical storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of computer-readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disc read-only memory (CD-ROM), digital multifunction disc (DVD), memory sticks, floppy disks, mechanical encoding devices, such as punch cards or recessed protrusions storing instructions thereon, and any suitable combination of the foregoing. The computer-readable storage media used herein are not to be construed as transient signals themselves, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., light pulses through fiber optic cables), or electrical signals transmitted through wires.
[0182] The computer-readable program instructions described herein can be downloaded from computer-readable storage media to various computing / processing devices, or downloaded via a network, such as the Internet, local area network, wide area network, and / or wireless network, to an external computer or external storage device. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards them to the computer-readable storage media in the respective computing / processing device.
[0183] Computer program instructions used to perform the operations of this disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, status setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages such as Smalltalk, C++, etc., and conventional procedural programming languages such as the "C" language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, electronic circuitry, such as programmable logic circuitry, field-programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), is personalized by utilizing the status information of the computer-readable program instructions to implement various aspects of this disclosure.
[0184] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific implementation of the present invention. Any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention should be covered within the protection scope of the claims of the present invention.
Claims
1. A method for identifying abnormal waveforms in medium-voltage power distribution lines, characterized in that, include: The power waveform signal of the medium-voltage distribution line is acquired, and after standardization and sliding window processing, waveform window samples are obtained. The waveform window samples are input into the front-end basic extraction module of the time-domain convolutional network to obtain the basic time-domain feature map; the waveform window samples are then transformed in the frequency domain to obtain the logarithmic amplitude spectrum, which is then input into the frequency-domain convolutional network to obtain the frequency-domain feature map. The duration of the anomaly is determined based on the intensity of local changes in the waveform window samples; Based on the coverage relationship between the duration of the anomaly and the equivalent receptive field corresponding to each scale convolutional branch, the information coverage capability of each scale convolutional branch for the current anomaly disturbance interval is determined, and based on the relative scale relationship between the duration of the anomaly and the equivalent receptive field corresponding to each scale convolutional branch, the scale matching degree is determined. Dynamic routing weights are generated based on information coverage and scale matching degree; the basic temporal feature map is input into the convolutional branch of each scale to extract multi-scale features, and the multi-scale features are weighted and fused based on the dynamic routing weights to obtain dynamic multi-scale temporal features. Channel-location dual attention enhancement is performed on the dynamic multi-scale temporal feature map and the frequency domain feature map respectively to obtain temporal enhanced feature vector and frequency domain enhanced feature vector; Based on the time-domain variation characteristics and spectral energy distribution characteristics of the waveform window samples, the time-domain anomaly intensity parameters and frequency-domain anomaly intensity parameters are determined respectively to determine the time-frequency dynamic gating weights. The time-domain enhanced feature vector and the frequency-domain enhanced feature vector are weighted and fused based on the time-frequency dynamic gating weights to obtain the final time-frequency fusion features. The final time-frequency fusion features are input into the anomaly identification classifier, which outputs the anomaly probability; anomaly alarms are generated based on the anomaly probability.
2. The method for identifying abnormal waveforms in medium-voltage power distribution lines according to claim 1, characterized in that, The waveform window samples are transformed in the frequency domain to obtain the logarithmic amplitude spectrum, which is then input into a frequency domain convolutional network to obtain a frequency domain feature map, including: Perform a discrete Fourier transform on the waveform window samples to obtain the complex spectrum values at each frequency point; Calculate the amplitude of the complex spectral values and perform a logarithmic transformation to form a logarithmic amplitude spectrum sequence in frequency order; The logarithmic amplitude spectrum sequence is input into the frequency domain convolutional network for feature extraction, resulting in a frequency domain feature map that preserves the local feature distribution of the frequency dimension.
3. The method for identifying abnormal waveforms in medium-voltage power distribution lines according to claim 1, characterized in that, The duration of the anomaly is determined based on the intensity of local changes in waveform window samples, including: Calculate the intensity of local waveform changes between adjacent sampling points in the waveform window sample; Based on the mean and standard deviation of the intensity of local waveform changes within the waveform window sample, an abnormal change judgment threshold is set. The sampling locations where the intensity of local waveform changes is greater than or equal to the abnormal change determination threshold are marked as abnormal change locations, and consecutive abnormal change locations are formed into candidate disturbance intervals; the maximum continuous length in each candidate disturbance interval is determined as the main disturbance length of the current waveform window sample; The duration of the anomaly is calculated based on the main disturbance length and the sampling frequency of the power waveform signal.
4. The method for identifying abnormal waveforms in medium-voltage power distribution lines according to claim 3, characterized in that, Based on the coverage relationship between the duration of the anomaly and the equivalent receptive field corresponding to each scale convolutional branch, the information coverage capability of each scale convolutional branch for the current anomaly disturbance interval is determined, including: Determine the kernel size, number of convolutional layers, initial dilation rate, and stride of each scale convolutional branch, and calculate the equivalent receptive field length of each scale convolutional branch converted to the scale of the waveform window sample sampling point by combining the cumulative downsampling stride of the front-end basic extraction module. The main perturbation length is compared with the equivalent receptive field length corresponding to each scale convolution branch. When the equivalent receptive field length is less than the main perturbation length, it is determined that the corresponding convolution branch has insufficient perturbation information coverage. When the equivalent receptive field length is greater than or equal to the main perturbation length, it is determined that the corresponding convolution branch can cover the main perturbation interval. For convolutional branches with insufficient coverage of perturbation information, the dilation rate of the corresponding convolutional branch is increased to expand the equivalent receptive field of the corresponding convolutional branch; the equivalent receptive field length is recalculated based on the adjusted dilation rate, and the information coverage capability of the corresponding convolutional branch is re-determined based on the recalculated equivalent receptive field length until the main perturbation interval is covered or the preset dilation rate upper limit is reached.
5. The method for identifying abnormal waveforms in medium-voltage power distribution lines according to claim 4, characterized in that, Dynamic routing weights are generated based on information coverage and scale matching. The basic temporal feature maps are input into convolutional branches at each scale to extract multi-scale features. These multi-scale features are then weighted and fused based on the dynamic routing weights to obtain dynamic multi-scale temporal features, including: For the convolutional branch that can ultimately cover the main perturbation range, the scale matching degree is determined based on the relative scale difference between the corresponding equivalent receptive field length and the main perturbation length. The smaller the relative scale difference, the fewer non-target waveform ranges are introduced by the corresponding convolutional branch while fully covering the main perturbation range, and the higher the scale matching degree. In addition, an inflation penalty term is introduced for the corresponding convolutional branch, so that the model can give the convolutional branch with a low inflation rate a higher scale matching degree under the same field of view. For convolutional branches that still cannot cover the main perturbation range after reaching the preset expansion rate limit, the scale matching degree is attenuated according to the ratio between the equivalent receptive field length and the main perturbation length to obtain the penalized scale matching degree. The scale matching degree or the penalized scale matching degree corresponding to each scale convolutional branch is normalized to obtain the dynamic routing weights corresponding to each scale convolutional branch. The multi-scale features output by each scale convolutional branch are then weighted and fused according to the dynamic routing weights to obtain the dynamic multi-scale temporal features.
6. The method for identifying abnormal waveforms in medium-voltage power distribution lines according to claim 1, characterized in that, Channel-location dual attention enhancement is applied to both the dynamic multi-scale temporal and frequency-domain feature maps to obtain enhanced temporal and frequency-domain feature vectors, including: For dynamic multi-scale time-domain features or frequency-domain feature maps, the input features of the corresponding branches are used for global average pooling along the feature sequence dimension to obtain the global statistics of each channel and construct the channel description vector. The channel description vectors are processed sequentially through fully connected mapping and activation functions to generate channel attention weights for the corresponding branches; The input features are aggregated along the feature channel dimension to obtain the channel aggregation result. The channel aggregation result is then processed by one-dimensional convolution and activation function to generate the positional attention weights of the corresponding branches. After expanding the channel attention weights and the position attention weights to the same dimension as the input features of the corresponding branches through a spatial broadcasting mechanism, they are multiplied element-wise with the input features to obtain the attention enhancement features of the corresponding branches. Global average pooling and feature dimension alignment are performed on the attention enhancement features of the corresponding branches respectively to obtain the temporal domain enhancement feature vector and the frequency domain enhancement feature vector.
7. The method for identifying abnormal waveforms in medium-voltage power distribution lines according to claim 1, characterized in that, Based on the time-domain variation characteristics and spectral energy distribution characteristics of the waveform window samples, time-domain anomaly intensity parameters and frequency-domain anomaly intensity parameters are determined respectively to determine the time-frequency dynamic gating weights, including: The average change intensity, maximum local mutation intensity, and anomaly persistence ratio of the waveform window samples are calculated, and the time-domain anomaly intensity parameters are constructed by normalizing the evaluation indicators and weighted summing. The high-frequency energy proportion of the waveform window sample in the high-frequency band, the spectral energy center reflecting the location of the spectral energy distribution, and the spectral dispersion are calculated. After normalization of the evaluation index and weighted summation, the frequency domain anomaly intensity parameter is constructed. Based on the time-domain anomaly intensity parameter and the frequency-domain anomaly intensity parameter, the time-domain dynamic gating weight and the frequency-domain dynamic gating weight are determined respectively through a preset exponential mapping relationship, and are used as the time-frequency dynamic gating weight.
8. A system for identifying abnormal waveforms in medium-voltage power distribution lines, characterized in that, include: The data preprocessing module is used to acquire the power waveform signal of medium-voltage power distribution lines, and obtain waveform window samples through standardization and sliding window processing; The time-frequency dual-branch feature extraction module is used to input waveform window samples into a time-domain convolutional network to obtain a basic time-domain feature map; and to perform a frequency-domain transformation on the waveform window samples to obtain a logarithmic amplitude spectrum, which is then input into a frequency-domain convolutional network to obtain a frequency-domain feature map. The dynamic multi-scale time-domain fusion module is used to determine the duration of anomalies based on the intensity of local changes in waveform window samples. Based on the coverage relationship between the duration of the anomaly and the equivalent receptive field corresponding to each scale convolutional branch, the information coverage capability of each scale convolutional branch for the current anomaly disturbance interval is determined, and based on the relative scale relationship between the duration of the anomaly and the equivalent receptive field corresponding to each scale convolutional branch, the scale matching degree is determined. Dynamic routing weights are generated based on information coverage and scale matching degree; the basic temporal feature map is input into the convolutional branch of each scale to extract multi-scale features, and the multi-scale features are weighted and fused based on the dynamic routing weights to obtain dynamic multi-scale temporal features. The dual attention enhancement module is used to perform channel-position dual attention enhancement on dynamic multi-scale time-domain features and frequency-domain feature maps respectively, to obtain time-domain enhanced feature vectors and frequency-domain enhanced feature vectors; The time-frequency dynamic fusion module is used to determine the time-domain anomaly intensity parameter and the frequency-domain anomaly intensity parameter respectively based on the time-domain variation characteristics and spectral energy distribution characteristics of the waveform window sample, so as to determine the time-frequency dynamic gating weight. Based on the time-frequency dynamic gating weight, the time-domain enhanced feature vector and the frequency-domain enhanced feature vector are weighted and fused to obtain the final time-frequency fusion feature. The anomaly identification and alarm module is used to input the final time-frequency fusion features into the anomaly identification classifier and output the anomaly probability; and to issue an anomaly alarm based on the anomaly probability.
9. An electronic device, comprising a memory and a processor; characterized in that: The memory is used to store computer program instructions; The processor is used to execute the computer program instructions to implement the method according to any one of claims 1-7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method of any one of claims 1-7.
