Electric appliance energy consumption anomaly detection method based on deep learning
By integrating the Conv-TASNet and FEDformer models, high-precision anomaly detection of electrical appliance energy consumption is achieved, solving the problem of insufficient generalization ability in existing technologies and improving the accuracy and robustness of anomaly recognition in multi-appliance scenarios.
Patent Information
- Application Number
- CN202510783447.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-12
- Publication Date
- 2025-09-12
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing technologies have problems with insufficient generalization ability, high false alarm and missed alarm rates in detecting abnormal energy consumption of electrical appliances. In particular, it is difficult to accurately identify abnormal patterns in scenarios where multiple electrical appliances are operating in mixed conditions. Traditional deep learning models are unable to effectively handle high-dimensional time series data and the coupling relationship between electrical appliances.
By integrating the Conv-TASNet network and the FEDformer model, a full-process detection mechanism is constructed through one-dimensional convolutional feature extraction, multi-path local representation, cross-channel dynamic fusion, frequency domain decomposition and sparse spectrum weighting to achieve high-precision anomaly positioning of electrical energy consumption.
It significantly improves the adaptability and anomaly recognition accuracy of multiple electrical appliances, can accurately identify periodic and gradual anomalies of electrical appliances in complex scenarios, has high robustness and fine-grained recognition capabilities, and is suitable for energy consumption monitoring under the coordinated operation of multiple electrical appliances.
Smart Images

Figure CN120632732A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of smart grid and energy consumption monitoring, and in particular to a method for detecting abnormal energy consumption of electrical appliances based on deep learning. Background Art
[0002] With the rapid development of smart grids, the Internet of Things, and big data technologies, appliance energy consumption monitoring and analysis has become a fundamental support tool for key areas such as energy management, fault warning, and equipment maintenance. During daily operation, various electrical devices at power users experience constant changes in parameters such as voltage, current, power factor, frequency, and instantaneous power. Analyzing this energy consumption data can effectively identify abnormal patterns in electricity usage, such as appliance aging, potential leakage hazards, unauthorized access, and high energy consumption. Therefore, achieving high-precision anomaly detection in appliance energy consumption data is crucial for improving power safety and energy efficiency.
[0003] In the prior art, methods for detecting abnormal energy consumption of electrical appliances mainly focus on rule-based methods based on threshold settings and statistical model methods. The former relies on manually preset energy consumption standard lines or fluctuation ranges. For example, it is set that the power of a certain appliance cannot exceed a certain upper limit. If it exceeds, it is judged as abnormal; the latter fits the energy consumption probability distribution through historical data and identifies data points that deviate from the probability boundary. Although this type of method has a simple structure and is easy to implement, it has a serious problem of insufficient generalization ability. When the working status of electrical appliances changes frequently, or there are complex scenarios with multiple types of appliances operating together, fixed thresholds and distribution models are often unable to accurately characterize individual differences, resulting in high false alarm and missed alarm rates in abnormal identification.
[0004] To address the weak adaptability of rule-based and statistical methods, some studies have begun to introduce shallow machine learning techniques, such as support vector machines, decision trees, and random forest models, to learn and classify energy consumption data. However, shallow models have problems with processing high-dimensional time series data, such as weak modeling capabilities, manual feature extraction, and an inability to capture deep nonlinear patterns. They are particularly difficult to handle in real-world operating scenarios with strong periodicity, complex fluctuations, and strong coordinated interference between appliances. Furthermore, traditional shallow learning methods typically assume that input data features are independent of each other, but in reality, the energy consumption behaviors of different appliances often have implicit coupling relationships that cannot be effectively represented by simple modeling.
[0005] In recent years, deep learning technology has demonstrated tremendous potential in sequence modeling and anomaly detection, particularly in tasks such as speech separation, financial risk control, and industrial diagnosis. End-to-end modeling of time series features using models such as convolutional neural networks (CNNs), recurrent neural networks (RNNs), long short-term memory networks (LSTMs), and self-attention mechanisms (Transformers) has achieved significant performance improvements. However, directly applying existing deep learning architectures to anomaly detection in appliance energy consumption still faces several challenges. First, energy consumption data exhibits highly multi-scale and periodic mixed characteristics, and conventional time-domain convolutional or sequence modeling methods exhibit significant discrepancies between modeled cyclical behavior and local disturbances. Second, the sheer number and complexity of appliances, coupled with differences in frequency and power factor, make it difficult to isolate the energy consumption performance of individual appliance channels using single-path modeling alone. Third, the trend, periodic, and disturbance components of frequency-domain signals have varying sensitivities in anomaly detection, making it difficult for traditional models to distinguish the contributions of these frequency-domain structures.
[0006] Furthermore, while the FEDformer model proposed a frequency-domain modeling mechanism for time series prediction, its original structure failed to incorporate the frequency distribution characteristics of appliance energy consumption scenarios, nor did it introduce sparse selection and dynamic compression mechanisms into the frequency response space. This resulted in high reconstruction errors in high-dimensional, multi-frequency scenarios. Furthermore, while the Conv-TASNet network was used for speech separation, its original architecture lacked the ability to model appliance behavior. It was unable to perform dynamic gated separation and cross-channel modeling on multi-path energy consumption data, and lacked a context-based channel interaction mechanism, making it difficult to form global fusion features in scenarios with abnormal multi-appliance collaboration.
[0007] Therefore, how to provide a method for detecting abnormal energy consumption of electrical appliances based on deep learning is an urgent problem that technicians in this field need to solve. Summary of the Invention
[0008] One purpose of the present invention is to propose a method for detecting electrical energy consumption anomalies based on deep learning. The present invention integrates the Conv-TASNet network and the FEDformer model, and constructs a full-process detection mechanism from raw operating data preprocessing, energy consumption feature decoupling, multi-spectrum modeling, frequency attention compression, residual feature extraction to anomaly labeling output. It describes in detail an algorithm for achieving high-precision energy consumption anomaly positioning through contextual residual convolution modeling, multi-component frequency domain reconstruction and sparse spectrum weighting mechanism. The method has the advantages of strong adaptability to multiple electrical appliances, high periodic behavior modeling capability and high anomaly recognition accuracy.
[0009] According to an embodiment of the present invention, a method for detecting abnormal energy consumption of an electrical appliance based on deep learning includes the following steps:
[0010] S1. Collect the operating data of various electrical appliances in a continuous time period and perform pre-processing;
[0011] S2. Input the preprocessed operating data into the Conv-TASNet network, perform one-dimensional convolutional feature extraction, and use the gated path to separate the energy consumption characteristics of different appliances to generate a multi-path local representation sequence;
[0012] S3. Introducing a residual cross convolution unit based on channel context modeling into the Conv-TASNet network, performing cross-channel dynamic fusion on multi-path local representation sequences to generate an energy consumption expression tensor;
[0013] S4. Input the energy consumption expression tensor into the FEDformer model, perform frequency domain decomposition and periodicity modeling, and output a ternary spectrum representation based on trend component, period component, and disturbance component;
[0014] S5. Embed a spectrum selection gating structure in the FEDformer model, construct a sparse frequency domain attention matrix based on the frequency domain amplitude and energy consumption frequency response, and perform weighted reconstruction on the ternary spectrum representation to generate a fused spectrum representation sequence;
[0015] S6. Concatenate the fused spectrum representation sequence with the energy consumption expression tensor, calculate the sequence residual with the original running data, and extract the residual feature map;
[0016] S7. Mark the abnormal time period and appliance number according to the offset density and mutation distribution in the residual feature map, and output the energy consumption anomaly detection result.
[0017] Optionally, the operating data includes voltage, current, instantaneous power, power factor and frequency parameters.
[0018] Optionally, the preprocessing includes linear interpolation, noise filtering, period alignment, timestamp synchronization and Z-score normalization.
[0019] Optionally, the S2 specifically includes:
[0020] S21. Construct a multidimensional vector sequence based on the preprocessed running data according to the time step Where T represents the total number of sampling time steps, x t Represents the eigenvector corresponding to the tth time step, satisfying x t =[v t ,i t ,p t ,φ t ,f t ],v t Indicates voltage, i t represents the current, p t represents instantaneous power, φt Indicates power factor, f t represents the frequency parameter;
[0021] S22, set the sliding window length to L, the step size to δ, perform overlapping sampling on the multidimensional vector sequence X, and construct the sample tensor X n,l,d , where n∈{1,2,...,N} represents the sample number, represents the total number of samples, l∈{1,2,...,L} represents the local time step index within each sample, d∈{1,2,3,4,5} represents the feature dimension index, X n,l,d represents the d-th eigenvalue of the n-th sample at the l-th time point;
[0022] S23, the sample tensor X n,l,d In the input Conv-TASNet network, a one-dimensional convolution stacking method with an exponential expansion structure is used to construct the feature mapping path. The convolution kernel width is k and the layer expansion factor is γ. r , the feature map of the rth layer is expressed as:
[0023]
[0024] in, represents the convolutional features output by the rth layer, Represents the convolution kernel weight of the m-th position corresponding to channel c in the r-th layer, represents the bias term, BN(·) represents the batch normalization function, ReLU(·) represents the activation function, l′ represents the time step index after convolution, γ represents the expansion factor, r represents the convolution layer number, and c represents the convolution output channel number. Indicates that the nth sample is in the (l′-γ r m) the dth eigenvalue at the time point;
[0025] S24, introduce inter-layer skip connection structure between all levels of convolution output, build cross-layer feature aggregation path, use weighted fusion method to perform combination operation on different receptive field outputs, and obtain aggregated feature tensor
[0026] S25, introduce a multi-path gate separation mechanism to aggregate feature tensors Perform energy consumption channel feature separation to obtain the local representation sequence of each appliance number j∈{1,2,...,M}:
[0027]
[0028] Among them, S j,n,l′,crepresents the local representation of the j-th appliance in the n-th sample at time step l′ and channel c, M represents the number of appliances, σ(·) represents the Sigmoid activation function, and G(·) represents the gating weight function in channels.
[0029] Optionally, the aggregated feature tensor The cross-layer fusion operation is performed on the output of all convolutional layers and the expression is:
[0030]
[0031] Among them, α r Represents the fusion weight coefficient corresponding to the output of the rth layer, satisfying R represents the number of convolutional layers.
[0032] Optionally, the S3 specifically includes:
[0033] S31. Input the local representation sequence into the extended Conv-TASNet network structure, construct a residual cross convolution unit based on channel context modeling, and set the cross convolution kernel size to k. c , define the cross-channel fusion expression as:
[0034]
[0035] in, represents the output of the fusion channel of the jth appliance at sample n, time step l′, and channel c, represents the convolution fusion weight between channel c1 and channel c in the j-th electrical path, represents the residual weight of channel c in the jth electrical path, α is the weighting coefficient of the fusion path and the residual path, represents the local representation of the jth appliance at time step l′-m and channel c1 in the nth sample;
[0036] S32, will Perform channel compression and context aggregation along appliance number j, and set the context fusion weight as γ j , perform full appliance context aggregation operations:
[0037]
[0038] Among them, T n,l′,c represents the energy consumption expression tensor after context fusion, γ j represents the attention weight of the jth appliance in channel context modeling, and M represents the number of appliances.
[0039] Optionally, the S4 specifically includes:
[0040] S41. Express energy consumption as tensor Tn,l′,c Input into the FEDformer model encoder and perform frequency domain enhanced Fourier transform to obtain the frequency domain response tensor F n,ω,c , specifically defined as:
[0041]
[0042] Where ω represents the frequency index, L′ represents the time step length, i is the imaginary unit, exp(·) represents the natural exponential function with e as the base, and π represents the constant pi;
[0043] S42, the frequency domain response tensor F n,ω,c Input frequency enhancement deconstruction unit and perform periodic modeling. The frequency enhancement deconstruction unit adopts high-pass-low-pass decomposition structure to deconstruct the frequency domain response tensor according to the frequency response range to obtain the trend component Periodic component disturbance component The ternary spectrum composition is defined according to the following conditions:
[0044]
[0045] Among them, U n,ω,c is the ternary spectrum representation, 1 [·] Represents the interval characteristic function, θ1 and θ2 are the set frequency segmentation thresholds, satisfying
[0046] Optionally, the S5 specifically includes:
[0047] S51, embed spectrum selection gating structure in FEDformer decoder, and perform ternary spectrum representation U n,ω,c To perform gated compression:
[0048]
[0049] Among them, g n,ω,c Represents the gate vector output, ∈ n,ω,c represents the energy consumption frequency response value, and ε represents the numerical stability constant.
[0050] S52. Let the normalization factor be Construct a sparse frequency domain attention matrix based on the frequency domain amplitude and energy consumption frequency response:
[0051]
[0052] Among them, A n,ω,c represents the attention weight of sample n under frequency index ω and channel c, λ represents the frequency distance penalty factor, represents the frequency centroid of sample n, Ω represents the total number of frequencies, and C represents the total number of channels;
[0053] S53. Perform a weighted reconstruction operation on the ternary spectrum representation according to the sparse frequency domain attention matrix, and output a fused spectrum representation sequence. The reconstruction operation is defined as:
[0054]
[0055] Among them, Y n,l″ Represents sample n at time step l ″ The fused spectrum representation under L ″ is the length of the time series after weighted reconstruction, It represents the operation of taking the real part of a complex number, where i is the imaginary unit.
[0056] Optionally, the FEDformer model introduces a frequency enhancement deconstruction unit based on the original encoder, and adopts a high-pass-low-pass frequency segmentation mechanism to perform a ternary structural decomposition of the trend component, periodic component and disturbance component on the Fourier response of the energy consumption expression tensor, and embeds a spectrum selection gating structure in the decoder to achieve sparse activation and selective reconstruction of the spectrum representation, and finally generates a fused spectrum representation tensor to improve the modeling ability of periodic disturbances and trend deviations.
[0057] Optionally, the S6 specifically includes:
[0058] S61, concatenate the fused spectrum representation sequence and the energy consumption expression tensor, set the transformation function to be Ψ(·), and transform the energy consumption expression tensor T n,l′,c Expanded into a uniform dimension energy consumption tensor representation V n,l″ =Ψ(T n,l′,c ), so that V n,l″ With the fused spectrum represented by Y n,l″ Align in the time dimension and perform splicing operations to construct a cascade representation sequence Q n,l″ =[V n,l″ ,Y n,l″ ];
[0059] S62, based on multidimensional vector sequence Calculate the sequence residual between the multidimensional vector sequence and the cascade representation sequence, and extract the residual feature map:
[0060] R n,l″,d =(Q n,l″ -X n,l″,d ) 2 ·log2(1+|Q n,l″ |+|X n,l″,d |);
[0061] Among them, R n,l″,k represents the residual feature signal strength of sample n at time step l″ and feature dimension index d, Xn,l″,d represents the d-th eigenvalue of the n-th sample at the l″-th time point, |·| represents the absolute value operation, and log2(·) represents the logarithmic function.
[0062] The beneficial effects of the present invention are:
[0063] First, the present invention improves the Conv-TASNet network structure, introduces a multi-path gating mechanism and a cross-layer convolutional feature aggregation method, and realizes the dynamic separation and modeling of energy consumption characteristics between different electrical appliance channels. Compared with the traditional single-path convolutional structure, it can more effectively distinguish the short-term power consumption behavior characteristics of various electrical appliances, significantly improves the ability to resolve local energy consumption anomalies, and provides a stronger feature basis for parallel monitoring of multiple electrical appliances.
[0064] Secondly, the present invention embeds a spectrum enhancement decomposition mechanism and a frequency-domain attention gating structure into the FEDformer model. This decomposes the input energy consumption expression tensor into trend, periodic, and perturbation components. It then constructs a sparse spectrum attention matrix based on the frequency energy distribution to differentiate and model high-frequency perturbations, periodic anomalies, and trend shifts. This frequency-domain modeling approach overcomes the inaccurate modeling of multi-scale energy consumption patterns by traditional methods, improving the sensitivity and accuracy of detecting periodic and gradual anomalies.
[0065] Finally, this invention constructs a cascade mechanism that fuses spectral representation sequences with raw energy consumption features, and combines this with a residual graph construction method to perform offset strength estimation for each time step and feature channel. This allows for precise localization of abnormal events within a unified time-frequency representation framework. The overall algorithm possesses high temporal adaptability and frequency selection capabilities, effectively improving the robustness of anomaly detection, fine-grained recognition capabilities, and cross-appliance generalization, meeting the technical requirements for intelligent diagnosis of energy consumption behavior across multiple appliance types in complex application scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:
[0067] Figure 1 This is a flowchart of a method for detecting abnormal energy consumption of electrical appliances based on deep learning proposed by the present invention;
[0068] Figure 2 This is a schematic diagram of the Conv-TASNet network construction of the deep learning-based appliance energy consumption anomaly detection method proposed in the present invention;
[0069] Figure 3 This is a schematic diagram of the FEDformer model construction of the deep learning-based electrical appliance energy consumption anomaly detection method proposed in the present invention. DETAILED DESCRIPTION
[0070] The present invention will now be described in further detail with reference to the accompanying drawings, which are simplified schematic diagrams that illustrate the basic structure of the present invention in a schematic manner.
[0071] refer to Figure 1-3 , a method for detecting abnormal energy consumption of electrical appliances based on deep learning, comprising the following steps:
[0072] S1. Collect the operating data of various electrical appliances in a continuous time period and perform pre-processing;
[0073] S2. Input the preprocessed operating data into the Conv-TASNet network, perform one-dimensional convolutional feature extraction, and use the gated path to separate the energy consumption characteristics of different appliances to generate a multi-path local representation sequence;
[0074] S3. Introducing a residual cross convolution unit based on channel context modeling into the Conv-TASNet network, performing cross-channel dynamic fusion on multi-path local representation sequences to generate an energy consumption expression tensor;
[0075] S4. Input the energy consumption expression tensor into the FEDformer model, perform frequency domain decomposition and periodicity modeling, and output a ternary spectrum representation based on trend component, period component, and disturbance component;
[0076] S5. Embed a spectrum selection gating structure in the FEDformer model, construct a sparse frequency domain attention matrix based on the frequency domain amplitude and energy consumption frequency response, and perform weighted reconstruction on the ternary spectrum representation to generate a fused spectrum representation sequence;
[0077] S6. Concatenate the fused spectrum representation sequence with the energy consumption expression tensor, calculate the sequence residual with the original running data, and extract the residual feature map;
[0078] S7. Mark the abnormal time period and appliance number according to the offset density and mutation distribution in the residual feature map, and output the energy consumption anomaly detection result.
[0079] This paper constructs a deep modeling structure that integrates the Conv-TASNet network and the FEDformer model, systematically separates the time-domain energy consumption time series data of electrical appliances from the time domain to frequency domain modeling, and combines residual extraction and spectrum attention mechanism to establish an end-to-end energy consumption anomaly detection process, effectively improving the overall accuracy, recognition speed and versatility of anomaly detection, and is particularly suitable for energy consumption monitoring needs under the coordinated operation of multiple electrical appliances.
[0080] In this embodiment, the operating data includes voltage, current, instantaneous power, power factor and frequency parameters.
[0081] The present invention improves the completeness of input feature expression by multi-parameter modeling of operating data, covering five dimensions: voltage, current, instantaneous power, power factor and frequency, so as to enable the model to have the ability to identify multiple types of energy consumption abnormal characteristics, thereby enhancing the differential modeling effect of the operating status of various electrical appliances.
[0082] In this embodiment, the preprocessing includes linear interpolation, noise filtering, cycle alignment, timestamp synchronization and Z-score normalization.
[0083] The present invention integrates multiple strategies such as linear interpolation, noise filtering, period alignment, timestamp synchronization and Z-score normalization in the preprocessing stage, which improves the quality stability of data before inputting into the model, reduces the sensitivity of data deviation in anomaly detection, and improves the generalization performance of the model in complex environments.
[0084] In this embodiment, S2 specifically includes:
[0085] S21. Construct a multidimensional vector sequence based on the preprocessed running data according to the time step Where T represents the total number of sampling time steps, x t Represents the eigenvector corresponding to the tth time step, satisfying x t =[v t ,i t ,p t ,φ t ,f t ],v t Indicates voltage, i t represents the current, p t represents instantaneous power, φ t Indicates power factor, f t represents the frequency parameter;
[0086] S22, set the sliding window length to L, the step size to δ, perform overlapping sampling on the multidimensional vector sequence X, and construct the sample tensor X n,l,d , where n∈{1,2,...,N} represents the sample number, represents the total number of samples, l∈{1,2,...,L} represents the local time step index within each sample, d∈{1,2,3,4,5} represents the feature dimension index, X n,l,d represents the d-th eigenvalue of the n-th sample at the l-th time point;
[0087] S23, the sample tensor X n,l,dIn the input Conv-TASNet network, a one-dimensional convolution stacking method with an exponential expansion structure is used to construct the feature mapping path. The convolution kernel width is k and the layer expansion factor is γ. r , the feature map of the rth layer is expressed as:
[0088]
[0089] in, represents the convolutional features output by the rth layer, Represents the convolution kernel weight of the m-th position corresponding to channel c in the r-th layer, represents the bias term, BN(·) represents the batch normalization function, ReLU(·) represents the activation function, l′ represents the time step index after convolution, γ represents the expansion factor, r represents the convolution layer number, and c represents the convolution output channel number. Indicates that the nth sample is in the (l′-γ r m) the dth eigenvalue at the time point;
[0090] S24, introduce inter-layer skip connection structure between all levels of convolution output, build cross-layer feature aggregation path, use weighted fusion method to perform combination operation on different receptive field outputs, and obtain aggregated feature tensor
[0091] S25, introduce a multi-path gate separation mechanism to aggregate feature tensors Perform energy consumption channel feature separation to obtain the local representation sequence of each appliance number j∈{1,2,...,M}:
[0092]
[0093] Among them, S j,n,l′,c represents the local representation of the j-th appliance in the n-th sample at time step l′ and channel c, M represents the number of appliances, σ(·) represents the Sigmoid activation function, and G(·) represents the gating weight function in channels.
[0094] The present invention adopts an exponentially expanded convolution structure and a cross-layer skip connection mechanism in the Conv-TASNet network, and introduces a multi-path gating separation strategy, which significantly enhances the ability to independently model the energy consumption signals of different electrical channels, while maintaining the ability to fuse cross-scale receptive field information and improving the performance of fine-grained local anomaly detection.
[0095] In this embodiment, the aggregated feature tensor The cross-layer fusion operation is performed on the output of all convolutional layers and the expression is:
[0096]
[0097] Among them, α r Represents the fusion weight coefficient corresponding to the output of the rth layer, satisfying R represents the number of convolutional layers.
[0098] The present invention constructs a weighted fusion mechanism of multi-layer convolution outputs and introduces cross-layer fusion weight coefficients, so that the aggregated feature tensor can integrate multi-level semantic information, improves the hierarchy and robustness of feature expression, and enhances the network's responsiveness to abnormal feature perception at different scales.
[0099] In this embodiment, S3 specifically includes:
[0100] S31. Input the local representation sequence into the extended Conv-TASNet network structure, construct a residual cross convolution unit based on channel context modeling, and set the cross convolution kernel size to k. c , define the cross-channel fusion expression as:
[0101]
[0102] in, represents the output of the fusion channel of the jth appliance at sample n, time step l′, and channel c, represents the convolution fusion weight between channel c1 and channel c in the j-th electrical path, represents the residual weight of channel c in the jth electrical path, α is the weighting coefficient of the fusion path and the residual path, represents the local representation of the jth appliance at time step l′-m and channel c1 in the nth sample;
[0103] S32, will Perform channel compression and context aggregation along appliance number j, and set the context fusion weight as γ j , perform full appliance context aggregation operations:
[0104]
[0105] Among them, T n,l′,c represents the energy consumption expression tensor after context fusion, γ j represents the attention weight of the jth appliance in channel context modeling, and M represents the number of appliances.
[0106] The present invention introduces a residual cross-convolution unit for channel context modeling in the Conv-TASNet network, and combines it with the appliance channel compression and context weighting mechanism to effectively improve the collaborative modeling effect between multi-channel energy consumption signals, enabling the network to accurately perceive potential abnormal behaviors caused by complex interactions between appliances.
[0107] In this embodiment, the S4 specifically includes:
[0108] S41. Express energy consumption as tensor T n,l′,c Input into the FEDformer model encoder and perform frequency domain enhanced Fourier transform to obtain the frequency domain response tensor F n,ω,c , specifically defined as:
[0109]
[0110] Where ω represents the frequency index, L′ represents the time step length, i is the imaginary unit, exp(·) represents the natural exponential function with e as the base, and π represents the constant pi;
[0111] S42, the frequency domain response tensor F n,ω,c Input frequency enhancement deconstruction unit and perform periodic modeling. The frequency enhancement deconstruction unit adopts high-pass-low-pass decomposition structure to deconstruct the frequency domain response tensor according to the frequency response range to obtain the trend component Periodic component disturbance component The ternary spectrum composition is defined according to the following conditions:
[0112]
[0113] Among them, U n,ω,c is the ternary spectrum representation, 1 [·] Represents the interval characteristic function, θ1 and θ2 are the set frequency segmentation thresholds, satisfying
[0114] The present invention utilizes the frequency-domain enhanced Fourier transform and high-pass-low-pass segmented structure in the FEDformer encoder to realize the ternary structural deconstruction of the energy consumption frequency domain signal, finely distinguishes trend deviation, periodic disturbance and high-frequency anomaly, and improves the anomaly separability and modeling resolution at the spectral level.
[0115] In this embodiment, the S5 specifically includes:
[0116] S51, embed spectrum selection gating structure in FEDformer decoder, and perform ternary spectrum representation U n,ω,c To perform gated compression:
[0117]
[0118] Among them, g n,ω,c Represents the gate vector output, ∈ n,ω,c represents the energy consumption frequency response value, and ε represents the numerical stability constant.
[0119] S52. Let the normalization factor be Construct a sparse frequency domain attention matrix based on the frequency domain amplitude and energy consumption frequency response:
[0120]
[0121] Among them, A n,ω,c represents the attention weight of sample n under frequency index ω and channel c, λ represents the frequency distance penalty factor, represents the frequency centroid of sample n, Ω represents the total number of frequencies, and C represents the total number of channels;
[0122] S53. Perform a weighted reconstruction operation on the ternary spectrum representation according to the sparse frequency domain attention matrix, and output a fused spectrum representation sequence. The reconstruction operation is defined as:
[0123]
[0124] Among them, Y n,l″ Represents sample n at time step l ″ The fused spectrum representation under L ″ is the length of the time series after weighted reconstruction, It represents the operation of taking the real part of a complex number, where i is the imaginary unit.
[0125] The present invention constructs a sparse frequency domain attention matrix through the spectrum gating structure and frequency response amplitude, and performs weighted reconstruction operations in the frequency domain, thereby improving the selective response capability to low-energy and high-sensitivity frequency bands, suppressing the interference of high redundant frequencies on anomaly detection performance, and enhancing the sparsity and interpretability of the modeling.
[0126] In this embodiment, the FEDformer model introduces a frequency enhancement deconstruction unit based on the original encoder, and uses a high-pass-low-pass frequency segmentation mechanism to perform a ternary structural decomposition of the Fourier response of the energy consumption expression tensor into trend component, periodic component and disturbance component. A spectrum selection gating structure is embedded in the decoder to achieve sparse activation and selective reconstruction of the spectrum representation, and finally generate a fused spectrum representation tensor to improve the modeling ability of periodic disturbances and trend deviations.
[0127] The present invention enhances the FEDformer at the structural level, combining the structural decomposition of frequency segments with the gated selective spectrum reconstruction strategy. This not only improves the model's ability to perceive the differences between periodic deviations and non-periodic disturbances, but also significantly optimizes the modeling stability and anomaly location accuracy during multi-band signal fusion.
[0128] In this embodiment, S6 specifically includes:
[0129] S61, concatenate the fused spectrum representation sequence and the energy consumption expression tensor, set the transformation function to be Ψ(·), and transform the energy consumption expression tensor T n,l′,cExpanded into a uniform dimension energy consumption tensor representation V n,l″ =Ψ(T n,l′,c ), so that V n,l″ With the fused spectrum represented by Y n,l″ Align in the time dimension and perform splicing operations to construct a cascade representation sequence Q n,l″ =[V n,l″ ,Y n,l″ ];
[0130] S62, based on multidimensional vector sequence Calculate the sequence residual between the multidimensional vector sequence and the cascade representation sequence, and extract the residual feature map:
[0131] R n,l″,d =(Q n,l″ -X n,l″,d ) 2 ·log2(1+|Q n,l″ |+|X n,l″,d |);
[0132] Among them, R n,l″,k represents the residual feature signal strength of sample n at time step l″ and feature dimension index d, X n,l″,d represents the d-th eigenvalue of the n-th sample at the l″-th time point, |·| represents the absolute value operation, and log2(·) represents the logarithmic function.
[0133] The present invention constructs a residual map for abnormal feature extraction by cascading the fusion of spectrum sequences and time-domain energy consumption expression tensors, and combining the residual calculation of the original operating data. It can achieve high-confidence positioning and refined labeling of abnormal areas, providing an accurate basis for abnormal classification, alarm and tracing.
[0134] Example 1:
[0135] To verify the feasibility of this invention, we applied it to the energy consumption monitoring and anomaly identification scenario of a complex residential area. This area is home to a variety of typical consumer electrical appliances, including variable-frequency air conditioners, smart refrigerators, electric water heaters, washing machines, microwave ovens, induction cookers, range hoods, televisions, desktop computers, and power strips, totaling 13 types of power terminals. These appliances exhibit significant periodic variations in power consumption and distinct transient load fluctuations at different times. Furthermore, due to the high randomness of household members' operations and significant differences in device power levels, traditional anomaly detection methods based on fixed thresholds and static models are unable to accurately model this highly dynamic energy consumption environment.
[0136] In actual deployment, the system continuously collects operating data from various electrical appliances through front-end smart meters and edge processing units. The data mainly includes five parameters: voltage, current, instantaneous power, power factor, and frequency. The data sampling period is 5 seconds, and the operating status of the appliances within a continuous 24-hour period is monitored and analyzed. First, the raw data is preprocessed through linear interpolation and Z-score normalization, and then input into the improved Conv-TASNet network structure proposed in this invention. In the convolution path, exponentially expanded convolution and jump connection are used to extract multi-scale power consumption pattern features, and a gating mechanism is used to separate the energy consumption performance of various electrical appliances, effectively enhancing the model's ability to identify response differences between different types of equipment.
[0137] Furthermore, the extracted energy consumption expression tensor is fused across channels by introducing a residual cross-convolution structure that models channel context, forming a globally semantically enhanced representation of electricity consumption features, which is then fed into the FEDformer model for frequency domain processing. The FEDformer model performs Fourier transform and ternary decomposition operations in the encoder, outputting trend components, periodic components, and disturbance components. A sparse gated selection structure is then embedded in the decoder, which constructs frequency domain attention weights based on the frequency response, performs weighted reconstruction on the ternary spectrum, and outputs a fused spectrum representation sequence. The system ultimately combines the fused sequence with the time domain representation through a cascade operation, constructs a residual map with the original operating data, and accurately locates abnormal energy consumption periods and appliance numbers.
[0138] In the experimental comparison, the performance of the method of the present invention was compared with that of the conventional LSTM model, the unsupervised model based on Isolation Forest, and the statistical rule method. The accuracy (Precision), recall rate (Recall), F1-score and other indicators of anomaly detection were significantly better than the comparison methods. A total of 32,768 groups of equipment operation samples were collected in the real operating environment, of which 1,946 groups were marked as manually identified anomalies. The system detected 2,040 groups of abnormal samples, of which 1,873 groups were accurately matched with abnormal labels, 167 groups were falsely reported, and 73 groups were missed. Comparative data show that the method of the present invention achieved an F1-score of 0.961, while the traditional LSTM model was only 0.842, the Isolation Forest was 0.785, and the static rule-based method was only 0.693.
[0139] Furthermore, from the perspective of interpretability in energy consumption analysis, periodic anomalies accounted for 47.3% of the spectral components, trend shift anomalies accounted for 31.6%, and disturbance anomalies accounted for 21.1%. This structural result provides an important data foundation for users to further identify abnormalities in the operating status of electrical appliances. For long-period devices such as air conditioners and water heaters, this method achieved higher accuracy in frequency band positioning. For short-period, highly disturbing devices such as microwave ovens and induction cookers, the residual spectrum showed a more concentrated confidence score distribution for time point positioning, with a maximum confidence score of 0.981.
[0140] In summary, the present invention has significant advantages in processing heterogeneous energy consumption signals of multiple electrical appliances, modeling multi-scale energy consumption behavior characteristics, and realizing high-sensitivity anomaly detection. It can effectively support electricity safety monitoring, energy-saving behavior analysis and fault warning tasks in home scenarios.
[0141] Table 1 Performance comparison of different detection methods in identifying abnormal energy consumption of multiple electrical appliances
[0142]
[0143]
[0144] This table truly reflects the comprehensive improvement of the detection accuracy, stability and anomaly classification ability of the present invention in identifying abnormal energy consumption of various types of electrical appliances, verifying the actual effectiveness of the invention.
[0145] The above description is only a preferred specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any technician familiar with the technical field, within the technical scope disclosed by the present invention, who makes equivalent replacements or changes based on the technical solution and inventive concept of the present invention, should be covered by the scope of protection of the present invention.
Claims
1. A method for detecting abnormal energy consumption of electrical appliances based on deep learning, characterized in that: The steps include: S1. Collect the operating data of various electrical appliances in a continuous time period and perform pre-processing; S2. Input the preprocessed operating data into the Conv-TASNet network, perform one-dimensional convolutional feature extraction, and use the gated path to separate the energy consumption characteristics of different appliances to generate a multi-path local representation sequence; S3. Introducing a residual cross convolution unit based on channel context modeling into the Conv-TASNet network, performing cross-channel dynamic fusion on multi-path local representation sequences to generate an energy consumption expression tensor; S4. Input the energy consumption expression tensor into the FEDformer model, perform frequency domain decomposition and periodicity modeling, and output a ternary spectrum representation based on trend component, period component, and disturbance component; S5. Embed a spectrum selection gating structure in the FEDformer model, construct a sparse frequency domain attention matrix based on the frequency domain amplitude and energy consumption frequency response, and perform weighted reconstruction on the ternary spectrum representation to generate a fused spectrum representation sequence; S6. Concatenate the fused spectrum representation sequence with the energy consumption expression tensor, calculate the sequence residual with the original running data, and extract the residual feature map; S7. Mark the abnormal time period and appliance number according to the offset density and mutation distribution in the residual feature map, and output the energy consumption anomaly detection result.
2. The method for detecting abnormal energy consumption of electrical appliances based on deep learning according to claim 1, characterized in that: The operating data includes voltage, current, instantaneous power, power factor and frequency parameters.
3. The method for detecting abnormal energy consumption of electrical appliances based on deep learning according to claim 1, characterized in that: The preprocessing includes linear interpolation, noise filtering, cycle alignment, timestamp synchronization and Z-score normalization.
4. The method for detecting abnormal energy consumption of electrical appliances based on deep learning according to claim 1, characterized in that: The S2 specifically includes: S21. Construct a multidimensional vector sequence based on the preprocessed running data according to the time step Where T represents the total number of sampling time steps, x t Represents the eigenvector corresponding to the tth time step, satisfying x t =[v t ,i t ,p t ,φ t ,f t ],v t Indicates voltage, i t represents the current, p t represents instantaneous power, φ t Indicates power factor, f t represents the frequency parameter; S22, set the sliding window length to L, the step size to δ, perform overlapping sampling on the multidimensional vector sequence X, and construct the sample tensor X n,l,d , where n∈{1,2,...,N} represents the sample number, represents the total number of samples, l∈{1,2,...,L} represents the local time step index within each sample, d∈{1,2,3,4,5} represents the feature dimension index, X n,l,d represents the d-th eigenvalue of the n-th sample at the l-th time point; S23, the sample tensor X n,l,d In the input Conv-TASNet network, a one-dimensional convolution stacking method with an exponential expansion structure is used to construct the feature mapping path. The convolution kernel width is k and the layer expansion factor is γ. r , the feature map of the rth layer is expressed as: in, represents the convolutional features output by the rth layer, Represents the convolution kernel weight of the m-th position corresponding to channel c in the r-th layer, represents the bias term, BN(·) represents the batch normalization function, ReLU(·) represents the activation function, l′ represents the time step index after convolution, γ represents the expansion factor, r represents the convolution layer number, and c represents the convolution output channel number. Indicates that the nth sample is in the (l′-γ r m) the dth eigenvalue at the time point; S24, introduce inter-layer skip connection structure between all levels of convolution output, build cross-layer feature aggregation path, use weighted fusion method to perform combination operation on different receptive field outputs, and obtain aggregated feature tensor S25, introduce a multi-path gate separation mechanism to aggregate feature tensors Perform energy consumption channel feature separation to obtain the local representation sequence of each appliance number j∈{1,2,...,M}: Among them, S j,n,l′,c represents the local representation of the j-th appliance in the n-th sample at time step l′ and channel c, M represents the number of appliances, σ(·) represents the Sigmoid activation function, and G(·) represents the gating weight function in channels.
5. The method for detecting abnormal energy consumption of electrical appliances based on deep learning according to claim 4, characterized in that: The aggregated feature tensor The cross-layer fusion operation is performed on the output of all convolutional layers and the expression is: Among them, α r Represents the fusion weight coefficient corresponding to the output of the rth layer, satisfying R represents the number of convolutional layers.
6. The method for detecting abnormal energy consumption of electrical appliances based on deep learning according to claim 1, characterized in that: The S3 specifically includes: S31. Input the local representation sequence into the extended Conv-TASNet network structure, construct a residual cross convolution unit based on channel context modeling, and set the cross convolution kernel size to k. c , define the cross-channel fusion expression as: in, represents the output of the fusion channel of the jth appliance at sample n, time step l′, and channel c, represents the convolution fusion weight between channel c1 and channel c in the j-th electrical path, represents the residual weight of channel c in the jth electrical path, α is the weighting coefficient of the fusion path and the residual path, represents the local representation of the jth appliance at time step l′-m and channel c1 in the nth sample; S32, will Perform channel compression and context aggregation along appliance number j, and set the context fusion weight as γ j , perform full appliance context aggregation operations: Among them, T n,l′,c represents the energy consumption expression tensor after context fusion, γ j represents the attention weight of the jth appliance in channel context modeling, and M represents the number of appliances.
7. The method for detecting abnormal energy consumption of electrical appliances based on deep learning according to claim 1, characterized in that: The S4 specifically includes: S41. Express energy consumption as tensor T n,l′,c Input into the FEDformer model encoder and perform frequency domain enhanced Fourier transform to obtain the frequency domain response tensor F n,ω,c , specifically defined as: Where ω represents the frequency index, L′ represents the time step length, i is the imaginary unit, exp(·) represents the natural exponential function with e as the base, and π represents the constant pi; S42, the frequency domain response tensor F n,ω,c Input frequency enhancement deconstruction unit and perform periodic modeling. The frequency enhancement deconstruction unit adopts high-pass-low-pass decomposition structure to deconstruct the frequency domain response tensor according to the frequency response range to obtain the trend component Periodic component disturbance component The ternary spectrum composition is defined according to the following conditions: Among them, U n,ω,c is the ternary spectrum representation, 1 [·] Represents the interval characteristic function, θ1 and θ2 are the set frequency segmentation thresholds, satisfying 8. The method for detecting abnormal energy consumption of electrical appliances based on deep learning according to claim 1, characterized in that: The S5 specifically includes: S51, embed spectrum selection gating structure in FEDformer decoder, and perform ternary spectrum representation U n,ω,c To perform gated compression: Among them, g n,ω,c Represents the gate vector output, ∈ n,ω,c represents the energy consumption frequency response value, and ε represents the numerical stability constant. S52. Let the normalization factor be Construct a sparse frequency domain attention matrix based on the frequency domain amplitude and energy consumption frequency response: Among them, A n,ω,c represents the attention weight of sample n under frequency index ω and channel c, λ represents the frequency distance penalty factor, represents the frequency centroid of sample n, Ω represents the total number of frequencies, and C represents the total number of channels; S53. Perform a weighted reconstruction operation on the ternary spectrum representation according to the sparse frequency domain attention matrix, and output a fused spectrum representation sequence. The reconstruction operation is defined as: Among them, Y n,l″ represents the fused spectrum representation of sample n at time step l″, L″ is the length of the time series after weighted reconstruction, It represents the operation of taking the real part of a complex number, where i is the imaginary unit.
9. The method for detecting abnormal energy consumption of electrical appliances based on deep learning according to claim 8, characterized in that: The FEDformer model introduces a frequency enhancement deconstruction unit on the basis of the original encoder, and uses a high-pass-low-pass frequency segmentation mechanism to perform a ternary structural decomposition of the Fourier response of the energy consumption expression tensor into trend component, periodic component and disturbance component. A spectrum selection gating structure is embedded in the decoder to achieve sparse activation and selective reconstruction of the spectral representation, and finally a fused spectral representation tensor is generated to improve the modeling ability of periodic disturbances and trend deviations.
10. The method for detecting abnormal energy consumption of electrical appliances based on deep learning according to claim 1, characterized in that: The S6 specifically includes: S61, concatenate the fused spectrum representation sequence and the energy consumption expression tensor, set the transformation function to be Ψ(·), and transform the energy consumption expression tensor T n,l′,c Expanded into a uniform dimension energy consumption tensor representation V n,l″ =Ψ(T n,l′,c ), so that V n,l″ With the fused spectrum represented by Y n,l″ Align in the time dimension and perform splicing operations to construct a cascade representation sequence Q n,l″ =[V n,l″ ,Y n,l″ ]; S62, based on multidimensional vector sequence Calculate the sequence residual between the multidimensional vector sequence and the cascade representation sequence, and extract the residual feature map: R n,l″,d =(Q n,l″ -X n,l″,d ) 2 ·log2(1+|Q n,l″ |+|X n,l″,d |); Among them, R n,l″,k represents the residual feature signal strength of sample n at time step l″ and feature dimension index d, X n,l″,d represents the d-th eigenvalue of the n-th sample at the l″-th time point, |·| represents the absolute value operation, and log2(·) represents the logarithmic function.
Citation Information
Cited By
Mathematical modeling analysis method and system for energy consumption in production process
CN122243312A