Improved Crypten-MFCC non-intrusive load monitoring method
By improving the Crypten-MFCC method, combining Crypten encryption technology and improved MFCC feature extraction technology, a privacy protection machine learning framework is built, and the problems of low model generalization capabilities and high computing complexity in the existing technology are solved, and electrical equipment classification and load monitoring are realized under the security of privacy data.
Patent Information
- Application Number
- CN202510295673.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-13
- Publication Date
- 2025-06-27
AI Technical Summary
In the existing non-invasive load monitoring technology, the model generalization capability is low and the calculation complexity is high, making it difficult to achieve effective electrical equipment classification and load monitoring while ensuring the security of private data.
Using the improved Crypten-MFCC method, combined with the Crypten encryption technology of security multi-party technology and the improved MFCC feature extraction technology, a support vector machine SVM model under CrypTen, a privacy protection machine learning framework is built to realize the security classification and load monitoring of electrical equipment.
On the premise of ensuring the security of privacy data, the accuracy of electrical equipment classification and real-time load monitoring are improved, the computational complexity is reduced, and effective monitoring and safety management of electrical appliance status are achieved.
Smart Images

Figure CN120217431A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of non-intrusive load monitoring, and particularly relates to a non-intrusive load monitoring method for improving Crypten-MFCC. Background Art
[0002] With the increasing popularization of the power grid erection in China, a large amount of power grid data is transmitted among units at all levels. Power enterprises need to implement the responsibility of data security protection, establish and improve data security management systems, and take corresponding technical and management measures to ensure the security of data in the processes of collection, storage, use, processing, transmission, provision, and disclosure, and prevent data leakage, tampering, loss, etc. These requirements help to protect the security and privacy of power consumption data and prevent the illegal acquisition or abuse of user power consumption information.
[0003] The safe monitoring of non-intrusive loads in contemporary smart power grids and smart home systems is an important task for ensuring the stable operation of the power system and protecting user privacy. The classification of electrical equipment for power consumption in a secure multi-party environment means that an enterprise provides a model and multiple parties provide data, and both parties can perform model training and inference without exposing their respective information.
[0004] For the existing non-intrusive load monitoring data privacy protection technologies, there are mainly two methods: encryption and adding data perturbation. Encryption technology is an information security strategy at the cost of increasing computational complexity. In the privacy protection of non-intrusive load monitoring, homomorphic encryption technology is a widely used data privacy protection method at present. For the data perturbation technology, there are mainly charging battery and differential privacy technologies. The charging battery technology realizes non-intrusive load balancing by hiding power events or load characteristics, reducing observable useful power events. Differential privacy protects individual data by adding noise, but it is insufficient in protecting the data change law and usually needs to be combined with an encryption scheme.
[0005] There are two problems in the existing technology: one is the low model generalization ability. The method of adding data interference adds additive or multiplicative random noise to the original data, and the introduction of noise will change the spectral characteristics of the signal. Additive noise may introduce additional frequency components in the spectrum of the signal, while multiplicative noise may cause non-linear changes in the spectrum. This change makes it difficult for the filter to effectively separate the signal and noise in the frequency domain. The other is the high computational complexity. Direct encryption technology for the original data can provide good privacy security for power consumption data, but the encryption process requires complex mathematical operations and data processing to ensure the security and irreversibility of the data. Especially when dealing with large-scale data sets, this overhead will be more significant. Summary of the Invention
[0006] 1. Technical problems to be solved:
[0007] In view of the above technical problems, the present invention provides a non-intrusive load monitoring method for improving Crypten-MFCC. Based on the Crypten encryption technology of secure multi-party technology and MFCC feature extraction, a model for the security construction of each electrical device is realized, and the secure classification of each electrical device in the target scenario is realized on the premise of ensuring the security of privacy data, thereby realizing the secure monitoring of non-intrusive loads.
[0008] 2. Technical solution:
[0009] The non-intrusive load monitoring method for improving Crypten-MFCC is characterized in that it includes:
[0010] Step 1: Obtain the historical NILM signal data of each electrical device in the target scenario and preprocess the data to obtain a NILM signal time series data set with different security label types; the different security label types include normal operation and corresponding faults; the corresponding faults include abnormal starting current and harmonic distortion of the motor, steady-state power offset of resistive loads, arc discharge caused by poor contact, excessive static power consumption, and energy efficiency degradation;
[0011] Step 2: Extract the time series feature vectors in the NILM signal time series data set from the NILM signal set by improving the MFCC feature method;
[0012] Step 3: Construct a secure classification training system; construct a support vector machine (SVM) model by the machine learning library PyTorch, and apply the privacy-preserving machine learning framework CrypTen to convert the SVM model into a classification model to be trained under the CrypTen encryption framework;
[0013] Step 4: Train the secure classification training system; use the preprocessed NILM signal data set, take the time series feature vectors in the NILM signal time series data of the electrical devices in the NILM signal data set as the training sample input, and the corresponding security label type of the electrical appliance in this time series data as the training sample output, and train the classification model to be trained through the CrypTen encryption framework to obtain an electrical device secure classification model;
[0014] Step 5: Test, verify, and optimize the electrical device secure classification model to obtain an optimized electrical device secure classification model;
[0015] Step 6: Real-time collect the NILM signals of each electrical device in the target scenario and extract the corresponding feature vectors, and input them into the optimized classification model to obtain the secure classification result of the electrical device at the current moment, so as to realize the load monitoring of each electrical device in the target scenario.
[0016] Furthermore, the preprocessing in Step 1 includes:
[0017] S11: Obtain the historical NILM signals collected by the intelligent power device in the preset historical segment; the NILM signals include the voltage v(t), current i(t), active power P(t), reactive power Q(t) of the total circuit, and harmonic components up to the 15th harmonic.
[0018] S12: Preset the sampling frequency capable of capturing high-frequency transient signals, and process the obtained historical NILM signals through the preset sampling frequency to obtain the NILM signal time series data.
[0019] S13: After band-pass filtering and missing value processing of the NILM signal time series data, obtain the NILM signal time series data set based on the preset time window and the preset security label type.
[0020] Furthermore, the improved MFCC feature method includes frame segmentation, windowing, fast Fourier transform, linear filter bank design, dynamic logarithmic energy calculation, weighted DCT coefficient extraction, integrated differential features and time-domain statistics.
[0021] S21: The frame segmentation process includes:
[0022] The data in the NILM signal time series data set is represented as x(n), where n is the sampling point index and the sampling frequency is f s ; Divide x(n) into frames of length L with a frame shift of S; then the t-th frame signal is represented as:
[0023] x t (n) = x(n + t·S), 0 ≤ n < L;
[0024] In the above formula, x(n + t·S) represents the n-th sampling point of the t-th frame in the original signal.
[0025] S22: The windowing process includes:
[0026] Apply the Hamming window to each frame signal to reduce spectral leakage, where the Hamming window function w(n) is:
[0027]
[0028] The windowed t-th frame signal x t ′(n) is:
[0029] x t ′(n) = x t (n)·w(n);
[0030] S23: The fast Fourier transform is:
[0031]
[0032] In the above formula, X t (k) represents the frequency-domain signal obtained after conversion; N represents the number of points of the Fourier transform; according to this formula, the spectral amplitude |X t (k)| is obtained;
[0033] S24: The processing of the linear filter design is specifically as follows:
[0034] According to the NILM signal characteristics, the frequency domain range [0, f s / 2] is divided into 24 linearly spaced frequency bands, and the center frequencies are:
[0035]
[0036] The frequency-domain signal after transformation is respectively input into 24 triangular filters, and the frequency-domain response H m (k) of the m-th filter is:
[0037]
[0038] In the above formula, f m-1 is the center frequency of the (m - 1)-th frequency band, that is, the left boundary of the m-th filter; f m+1 is the center frequency of the (m + 1)-th frequency band, that is, the right boundary of the m-th filter;
[0039] S25: The dynamic logarithmic energy calculation process includes:
[0040] The spectral amplitude |X t (k)| is passed through the filter bank to output the energy E t (m) of each frequency band:
[0041]
[0042] A dynamic energy reference E ref is introduced to normalize the energy of each frequency band, that is:
[0043]
[0044] In the above formula, T represents the number of frames of the time window for calculating the dynamic energy reference Eref; M is the number of the linear filter bank;
[0045] The logarithmic energy logE t ′(m) of each frequency band is:
[0046] logE t ′(m) = log(E t (m) + αE ref ) ;
[0047] In the above formula, ∝ is the smoothing coefficient, taking 0.01;
[0048] The weighted DCT coefficients are extracted from the obtained logarithmic energy to obtain the cepstral coefficients C t (l);
[0049]
[0050] In the above formula, w l (m) is the weight of the l-th coefficient after transformation; w l (m) = 1 + 0.5sin(πm / M), l = 1, 2, …, K; K is the number of MFCC coefficients retained; M is the number of triangular filters;
[0051] S26: The process of the integrated differential feature and time-domain statistic is as follows:
[0052] Differential feature extraction: Calculate the first-order difference and second-order difference of the cepstral coefficient C t (l):
[0053]
[0054] In the above formula, ΔC t (l) is the first-order difference of the cepstral coefficient; Δ 2 C t (l) is the second-order difference of the cepstral coefficient;
[0055] Time-domain statistic: Calculate the mean μ(l) and variance σ t (l) of the cepstral coefficient C 2 (l) in the sliding window:
[0056]
[0057] where W is the window length, representing the time range of the sliding window, that is, the parameter controlling the time range of the statistic;
[0058] Feature fusion: Concatenate the MFCC coefficients obtained in step S25, the differential features and statistics in step S26D into the final feature vector F t , as shown in the following formula::
[0059] F t = [C t (1), …, C t (K), ΔC t (1), …, ΔC t (K), Δ 2 C t (1),..., Δ 2 C t (K), μ(1),..., μ(K), σ 2 (1),..., σ2 (K);
[0060] In the above formula, K is the number of MFCC coefficients retained in the extraction of weighted DCT coefficients.
[0061] Furthermore, in step four, the encryption tensor operation function of CrypTen is used to encrypt the key operations in the SVM model; the key operations include vector inner product and matrix multiplication; all calculations during the model training process are performed on encrypted data.
[0062] Furthermore, in step five, when training the electrical equipment safety classification model, the cross-validation method is used to evaluate and optimize the model. The dataset is divided into multiple subsets, and one subset is used as the validation set in turn, and the remaining subsets are used as the training set. The model is trained and validated multiple times, and the optimal model parameters and structure are selected according to the results of cross-validation.
[0063] 3. Beneficial effects:
[0064] (1) The improved Crypten-MFCC non-intrusive load monitoring method disclosed in the present invention can complete the training and application of the electrical appliance classification model while ensuring the security of privacy data, and realizes an electrical equipment safety monitoring technology in a background with high requirements for data privacy.
[0065] (2) In this method, based on each electrical equipment in the target scenario, using the NILM data features as analysis factors, combined with the labels of the electrical equipment, applying the SVM model under the privacy protection machine learning framework CrypTen, and combining the characteristics of the NILM signal, through the improved MFCC feature extraction technology, the efficient processing and classification of electrical appliance signals are realized.
[0066] (3) Under the premise of ensuring the accuracy of electrical appliance classification, this method realizes the real-time monitoring and safety management of the electrical appliance state. From a practical significance perspective, this design scheme can effectively protect the privacy of user data and complete the training and application of the non-intrusive load monitoring model while ensuring the security of privacy data. Brief description of the drawings
[0067] Figure 1 is the overall flowchart of the improved Crypten-MFCC non-intrusive load monitoring method of this method;
[0068] Figure 2 is the flowchart of preprocessing the historical NILM signal data in this method;
[0069] Figure 3 is the flowchart of extracting the time series feature vectors in the time series dataset in this method;
[0070] Figure 4 The flowchart of building a machine based on SVM using the Crypten framework in this method;
[0071] Figure 5 The flowchart of the secure multi-party training secure classification training system under the Crypten framework in this method. Specific implementation manners
[0072] The present invention will be specifically described below with reference to the accompanying drawings.
[0073] As shown in the attached Figure 1 The non-intrusive load monitoring method for improving Crypten-MFCC is characterized by including:
[0074] Step 1: Obtain the historical NILM signal data of each electrical device in the target scenario, preprocess the data, and obtain a NILM signal time series data set with different security label types; the different security label types include normal operation and corresponding faults; the corresponding faults include abnormal starting current and harmonic distortion of the motor, steady-state power offset of the resistive load, arc discharge caused by poor contact, excessive static power consumption, and energy efficiency degradation;
[0075] Step 2: Extract the time series feature vectors in the NILM signal time series data set from the NILM signal set by the improved MFCC feature method;
[0076] Step 3: Build a secure classification training system; build a support vector machine SVM model by the machine learning library PyTorch, and apply the privacy-preserving machine learning framework CrypTen to convert the SVM model into a to-be-trained classification model under the CrypTen encryption framework;
[0077] Step 4: Train the secure classification training system; use the preprocessed NILM signal data set, take the time series feature vectors in the NILM signal time series data set of the electrical devices in the NILM signal data set as the training sample input, and use the security label type corresponding to the electrical appliance in this time series data as the training sample output, and train the to-be-trained classification model through the CrypTen encryption framework to obtain an electrical device security classification model;
[0078] Step 5: Test, verify and optimize the electrical device security classification model to obtain an optimized electrical device security classification model;
[0079] Step 6: Real-time collect the NILM signals of each electrical device in the target scenario and extract the corresponding feature vectors, input them into the optimized classification model to obtain the security classification results of the electrical devices at the current moment, and realize the load monitoring of each electrical device in the target scenario.
[0080] Further, the preprocessing in step one includes:
[0081] S11: Obtain the historical NILM signals collected by intelligent power devices in a preset historical segment; the NILM signals include the voltage v(t), current i(t), active power P(t), reactive power Q(t), and harmonic components up to the 15th harmonic of the total circuit;
[0082] S12: Preset a sampling frequency capable of capturing high-frequency transient signals, and process the obtained historical NILM signals through the preset sampling frequency to obtain NILM signal time series data;
[0083] S13: After band-pass filtering and missing value processing of the NILM signal time series data, obtain a NILM signal time series dataset based on a preset time window and a preset security label type.
[0084] Further, the improved MFCC feature method includes frame segmentation, windowing, fast Fourier transform, linear filter bank design, dynamic logarithmic energy calculation, weighted DCT coefficient extraction, integrated differential features and time domain statistics;
[0085] S21: The frame segmentation process includes:
[0086] The data in the NILM signal time series dataset is represented as x(n), where n is the sampling point index and the sampling frequency is f s ; Divide x(n) into frames of length L with a frame shift of S; then the t-th frame signal is represented as:
[0087] x t (n) = x(n + t·S), 0 ≤ n < L;
[0088] In the above formula, x(n + t·S) represents the n-th sampling point of the t-th frame in the original signal;
[0089] S22: The windowing process includes:
[0090] Apply a Hamming window to each frame signal to reduce spectral leakage, where the Hamming window function w(n) is:
[0091]
[0092] The windowed t-th frame signal x t ′(n) is:
[0093] x t ′(n) = x t (n)·w(n);
[0094] S23: The fast Fourier transform is:
[0095]
[0096] In the above formula, X t (k) represents the frequency-domain signal obtained after conversion; N represents the number of points of the Fourier transform; according to this formula, the spectral amplitude |X t (k)| is obtained;
[0097] S24: The processing of the linear filter design is specifically as follows:
[0098] According to the NILM signal characteristics, the frequency domain range [0, f s / 2] is divided into 24 linearly spaced frequency bands, and the center frequencies are:
[0099]
[0100] The transformed frequency-domain signal is respectively input into 24 triangular filters, and the frequency-domain response H m (k) of the m-th filter is:
[0101]
[0102] In the above formula, f m-1 is the center frequency of the (m - 1)-th frequency band, that is, the left boundary of the m-th filter; f m+1 is the center frequency of the (m + 1)-th frequency band, that is, the right boundary of the m-th filter;
[0103] S25: The dynamic logarithmic energy calculation process includes:
[0104] The spectral amplitude |X t (k)| passes through the filter bank, and the energy E t (m) of each frequency band is output:
[0105]
[0106] Introduce a dynamic energy reference E ref , and normalize the energy of each frequency band, that is:
[0107]
[0108] In the above formula, T represents the number of frames of the time window for calculating the dynamic energy reference Eref; M is the number of the linear filter bank;
[0109] The logarithmic energy logE t ′(m) of each frequency band is:
[0110] logE t ′(m) = log(E t (m) + αE ref );
[0111] In the above formula, ∝ is the smoothing coefficient, taking 0.01;
[0112] The weighted DCT coefficients are extracted from the obtained logarithmic energy to obtain the cepstral coefficients C t (l);
[0113]
[0114] In the above formula, w l (m) is the weight of the l-th coefficient after transformation; w l (m) = 1 + 0.5sin(πm / M), l = 1, 2,..., K; K is the number of MFCC coefficients retained; M is the number of triangular filters;
[0115] S26: The process of the integrated differential feature and time-domain statistic is as follows:
[0116] Differential feature extraction: Calculate the first-order difference and second-order difference of the cepstral coefficient C t (l):
[0117]
[0118] In the above formula, ΔC t (l) is the first-order difference of the cepstral coefficient; Δ 2 C t (l) is the second-order difference of the cepstral coefficient;
[0119] Time-domain statistic: Calculate the mean μ(l) and variance σ t (l) of the cepstral coefficient C 2 (l) within the sliding window:
[0120]
[0121] where W is the window length, representing the time range of the sliding window, that is, the parameter controlling the time range of the statistic;
[0122] Feature fusion: Concatenate the MFCC coefficients obtained in step S25, the differential features and statistics in step S26D into the final feature vector F t , as shown in the following formula::
[0123] F t = [C t (1),..., C t (K), ΔC t (1),..., ΔC t (K), Δ 2 C t (1),..., Δ 2 C t (K), μ(1),..., μ(K), σ2 (1),...,σ 2 (K)];
[0124] In the above formula, K is the number of MFCC coefficients retained in the extraction of weighted DCT coefficients.
[0125] Furthermore, in step four, the encryption tensor operation function of CrypTen is used to encrypt the key operations in the SVM model; the key operations include vector inner product and matrix multiplication; all calculations during the model training process are performed on encrypted data.
[0126] Furthermore, in step five, when training the electrical equipment safety classification model, the cross-validation method is used to evaluate and optimize the model. The data set is divided into multiple subsets, and one of the subsets is used as the validation set in turn, and the remaining subsets are used as the training set. The model is trained and verified multiple times, and the optimal model parameters and structure are selected according to the results of cross-validation. Specific embodiments:
[0128] 1. As shown in the appendix Figure 1 deploy a high-precision power monitoring device (such as a smart meter or a dedicated sensor) at the entrance of the total circuit in the target scenario to collect the voltage v(t), current i(t), active power P(t), reactive power Q(t) and harmonic components (up to the 15th harmonic) of the total circuit in real time.
[0129] A1: According to the transient characteristics of the electrical appliance switching event, set the sampling frequency fs≥10kHz; using fs≥10kHz can ensure the capture of high-frequency transient signals.
[0130] Collect the NILM signals at all times within a preset historical time period (such as 30 consecutive days) to form the original time-domain signal sequence x(n); where n is the discrete sampling point index, and the time resolution is Δt = 1 / f s .
[0131] Apply a digital band-pass filter to the original signal x(n) to retain the characteristic frequency band (40Hz–2kHz) of the electrical equipment and filter out power frequency interference and high-frequency noise. The filter transfer function is as follows:
[0132]
[0133] In the above formula, b k , a k are filter coefficients; in this embodiment, the Chebyshev type I filter is used, with a passband ripple ≤0.1dB and a stopband attenuation ≥40dB.
[0134] A2: Missing value processing: For the signal missing segments caused by transmission interruption, linear interpolation is used to fill them.
[0135] A3: Time window division: Divide the continuous signal x(n) into analysis windows of a fixed duration. The window length Tw = 5s and the overlap rate R = 50%; then the starting point of the t-th window is:
[0136]
[0137] A4: The electrical equipment status annotation operation is divided into two different scenarios:
[0138] 1. Manual annotation: Record the on / off status (0 / 1 label) of each electrical equipment in each time window through a non-intrusive load detection device.
[0139] 2. Automatic annotation: For electrical appliances that cannot be directly monitored, apply a heuristic algorithm based on transient matching to automatically generate labels. For example, when a current mutation Δi > i th (threshold i th = 0.2A) is detected, it is marked as a status switching event.
[0140] A5: Data normalization and storage.
[0141] 1. Normalization processing: Perform Z-score standardization on the voltage and current signals in each window to eliminate the dimension difference:
[0142]
[0143] where μ and σ are the mean and standard deviation of the signal in the window, respectively.
[0144] 2. Data storage structure: Organize data samples in the following format:
[0145] Timestamp: The starting time of the window.
[0146] Original signal: The normalized v(t), i(t) sequences in the window.
[0147] Feature markers: Initially extracted time-domain features (such as the effective value V rms , I rms )
[0148] Electrical equipment label: The status of each electrical appliance in this window (0: off, 1: on).
[0149] II. As shown in the appendix Figure 2 is the flowchart of the non-intrusive load data acquisition and preprocessing work; the specific process is as in steps S21 - S26.
[0150] In this step, a filter bank dedicated to NILM signals is designed. The traditional MFCC uses a Mel filter bank, but the frequency-domain energy distribution of NILM signals is significantly different from that of speech. Therefore, a linearly distributed filter bank is designed in the present invention.
[0151] In this step, the traditional MFCC uses a fixed Mel scale, and a dynamic energy reference E is introduced in this step ref , and normalization is performed based on the historical signal energy mean value:
[0152] III. As shown in the attached Figure 4 figure, the whole process encryption of model parameters and the training process is realized through the CrypTen framework, specifically including:
[0153] C1: Encryption conversion of the SVM model.
[0154] 1. Model construction: Use PyTorch to construct a support vector machine (SVM) model with a radial basis function (RBF) as the kernel function:
[0155] K(F i ,F j ) = exp(-γPF i -F j P 2 )
[0156] where λ is the kernel parameter, and F i is the improved MFCC feature vector extracted in step B.
[0157] 2. Encrypted tensor operations: Convert the model parameters (weights w and biases b) into encrypted tensors (CrypTensors) through CrypTen. Key operations (such as the inner product w T F) are performed in the encrypted domain:
[0158]
[0159] All intermediate calculation results (such as gradients and loss values) are stored in ciphertext form to prevent data leakage during the training process.
[0160] C2: Design of the secure multi-party computation protocol (MPC).
[0161] 1. Definition of participants: Assume two participants, P1 (holding the NILM signal of electrical appliance A) and P2 (holding the NILM signal of electrical appliance B). The two parties cooperate to train the SVM model, but cannot obtain the original data of the other party.
[0162] 2. Secret sharing initialization: For the scalar parameter is split into secret shares [x]1 and [x]2, satisfying:
[0163] x = [x]1 + [x]2 mod Q
[0164] where Q is a large prime number (e.g., Q = 2 64 ), which is used to support floating-point operations.
[0165] 3. Encrypted gradient calculation: In backpropagation, each participant calculates the local gradient and shares it encrypted through the MPC protocol. The global gradient is obtained through secure aggregation:
[0166]
[0167] The final parameter update formula is:
[0168]
[0169] where η is the learning rate, and all operations are completed in the encrypted domain.
[0170] IV. As shown in the appendix Figure 5 The process of training the secure classification system includes:
[0171] D1: Binary secret sharing optimization.
[0172] To reduce the computational complexity, binary secret sharing (running within the ring) is adopted: ring) is adopted:
[0173] 1. Secret splitting: A scalar x ∈ {0, 1} is split into two shares [x]1 and [x]2, satisfying:
[0174]
[0175] where is the exclusive-or operation.
[0176] 2. Efficient encrypted calculation: Logical operations are implemented through binary circuits. For example, the multiplication gate z = x · y can be represented as:
[0177]
[0178] This protocol significantly reduces the number of communication rounds and is applicable to the training of large-scale NILM datasets.
[0179] D2: Encrypted parameter update and sharing
[0180] 1. Model parameter encryption: The weights w and biases b of the SVM are both stored in the form of binary secret sharing, and only the encrypted gradients are exchanged during the update process:
[0181]
[0182] 2. Secure Aggregation: Participants calculate the global gradient through CrypTen's secure aggregation protocol without exposing local data:
[0183]
[0184] V. Model Optimization: In this embodiment, the cross-validation method is adopted, and its verification process includes:
[0185] Cross-validation: The dataset is divided into N folds. In each round, one fold is selected as the validation set, and the rest are used as the training set. During the verification process, the model prediction results are decrypted through secure computing:
[0186] y pred = Sign(Decrypt(w T F val + b))
[0187] Verification metrics (such as accuracy, AUC) are calculated in the encrypted domain to prevent the leakage of intermediate results.
[0188] Dynamic Parameter Tuning: Optimize MFCC parameters (such as frame length L, frame shift S) and SVM hyperparameters (such as γ) based on the verification results. The tuning process is securely executed through the MPC protocol to ensure that parameter updates do not depend on plaintext data.
[0189] Although the present invention has been disclosed above with preferred embodiments, they are not used to limit the present invention. Any person skilled in this art can make various changes or modifications without departing from the spirit and scope of the present invention. Therefore, the protection scope of the present invention should be defined by the protection scope of the claims of this application.
Claims
1. Improved Crypten-MFCC non-intrusive load monitoring method, characterized by: include: Step 1: Obtain historical NILM signal data of each electrical device in the target scene, pre-process the data, and obtain a NILM signal time series data set with different safety tag types; the different safety tag types include normal operation and corresponding faults; the corresponding faults include abnormal motor starting current and harmonic distortion, steady-state offset of resistive load power, arc discharge caused by poor contact, excessive static power consumption and energy efficiency degradation; Step 2: Extract the time series feature vector of the NILM signal time series data set by improving the MFCC feature method; Step 3: Build a secure classification training system; use the machine learning library PyTorch to build a support vector machine (SVM) model, and use the privacy-preserving machine learning framework CrypTen to convert the SVM model into a classification model to be trained under the CrypTen encryption framework; Step 4: training the security classification training system; using the preprocessed NILM signal data set, the time series feature vector in the NILM signal time series data set of the electrical equipment in the NILM signal data set as the training sample input, and the security label type corresponding to the electrical appliance in the time series data as the training sample output, the classification model to be trained is trained through the CrypTen encryption framework to obtain the electrical equipment security classification model; Step 5: Test, verify and optimize the electrical equipment safety classification model to obtain an optimized electrical equipment safety classification model; Step 6: Collect the NILM signals of each electrical device in the target scene in real time and extract the corresponding feature vectors, input them into the optimized classification model to obtain the safety classification results of the electrical equipment at the current moment, and realize load monitoring of each electrical device in the target scene.
2. The non-intrusive load monitoring method of the improved Crypten-MFCC according to claim 1, characterized in that: The preprocessing in step 1 includes: S11: Acquire the historical NILM signal collected by the intelligent power device of the preset historical period; the NILM signal includes the voltage v(t), current i(t), active power P(t), reactive power Q(t), and harmonic components up to the 15th harmonic of the total circuit; S12: Preset a sampling frequency that can capture high-frequency transient signals, and process the acquired historical NILM signals at the preset sampling frequency to obtain NILM signal time series data; S13: After bandpass filtering and missing value processing of the NILM signal time series data, a NILM signal time series data set is obtained based on a preset time window and a preset security label type.
3. The non-intrusive load monitoring method of the improved Crypten-MFCC according to claim 1, characterized in that: The improved MFCC feature method includes framing, windowing, fast Fourier transform, linear filter bank design, dynamic logarithmic energy calculation, weighted DCT coefficient extraction, integrated differential features and time domain statistics; S21: The framing process includes: The data in the NILM signal time series data set is represented as x(n), where n is the sampling point index and the sampling frequency is f. s ; Divide x(n) into frames of length L, and the frame shift is S; then the t-th frame signal is expressed as: x t (n)=x(n+t·S),0≤n<L; In the above formula, x(n+t·S) represents the nth sampling point of the tth frame in the original signal; S22: The windowing process includes: A Hamming window is applied to each frame signal to reduce spectrum leakage, where the Hamming window function w(n) is: The t-th frame signal x after windowing t ′(n) is: x t ′(n)=x t (n)·w(n); S23: The fast Fourier transform is: In the above formula, X t (k) represents the frequency domain signal obtained after conversion; N represents the number of points of Fourier transform; according to this formula, the spectrum amplitude |X t (k)|; S24: The process of the linear filter design is specifically as follows: According to the characteristics of NILM signal, the frequency domain range [0,f s / 2] is divided into 24 linearly spaced bands with center frequencies of: The transformed frequency domain signal is input into 24 triangular filters respectively, and the frequency domain response H of the mth filter is m (k) is: In the above formula, f m-1 is the center frequency of the m-1th frequency band, i.e., the left edge of the mth filter; f m+1 is the center rate of the m+1th frequency band, i.e., the right edge of the mth filter; S25: The dynamic logarithmic energy calculation process includes: Set the spectrum amplitude |X t (k) | Output the energy E of each frequency band through the filter bank t (m): Introducing the dynamic energy benchmark E ref , normalize the energy of each frequency band, that is: In the above formula, T represents the calculation of dynamic energy benchmark E ref The number of frames in the time window; M is the number of linear filter banks; the logarithmic energy of each frequency band logE t ′(m) is: logE t ′(m)=log(E t (m)+αE ref ); In the above formula, ∝ is the smoothing coefficient, which is 0.01; The obtained logarithmic energy is weighted to extract the DCT coefficient to obtain the cepstrum coefficient C t (l); In the above formula, w l (m) is the lth coefficient weight after transformation; w l (m) = 1 + 0.5 sin (πm / M), l = 1, 2, ..., K; K is the number of retained MFCC coefficients; M is the number of triangular filters; S26: The process of integrating differential features and time domain statistics is: Differential feature extraction: Calculate the cepstral coefficient C t The first and second order differences of (l): In the above formula, ΔC t (l) is the first-order difference of the cepstral coefficients; Δ 2 C t (l) is the second-order difference of the cepstral coefficients; Time domain statistics: Calculate the cepstral coefficient C in a sliding window t (l) has a mean μ(l) and a variance σ 2 (l): Where W is the window length, which represents the time range of the sliding window, that is, the parameter that controls the time range of the statistic; Feature fusion: The MFCC coefficients obtained in step S25, the differential features and statistics in step S26D are concatenated into the final feature vector F t , as follows: F t =[C t (1),...,C t (K),ΔC t (1),…,ΔC t (K),Δ 2 C t (1),…,Δ 2 C t (K),μ(1),…,μ(K),σ 2 (1),…,σ 2 (K)]; In the above formula, K is the number of MFCC coefficients retained in the weighted DCT coefficient extraction.
4. The non-intrusive load monitoring method of the improved Crypten-MFCC according to claim 1, characterized in that: Step 4: In the training model, the encrypted tensor operation function of CrypTen is used to encrypt and implement the key operations in the SVM model; the key operations include vector inner product and matrix multiplication; All calculations during model training are performed on encrypted data.
5. The non-intrusive load monitoring method of the improved Crypten-MFCC according to claim 1, characterized in that: In step five, when training the electrical equipment safety classification model, the cross-validation method is used to evaluate and optimize the model. The data set is divided into multiple subsets, and one of the subsets is used as the validation set in turn, and the remaining subsets are used as the training set. The model is trained and validated multiple times, and the optimal model parameters and structure are selected based on the cross-validation results.