Current abrupt change identification method based on comparative learning
By using a multi-sensor hash network and a black hole optimization algorithm, a current surge detection method is constructed, which solves the problems of missed detection and false judgment in existing methods under complex working conditions, and achieves highly sensitive and adaptive current surge detection.
Patent Information
- Application Number
- CN202510957397.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-11
- Publication Date
- 2025-10-28
AI Technical Summary
Existing current mutation identification methods are prone to missed detections and misjudgments when faced with complex operating conditions such as load fluctuations and electromagnetic interference. They also lack model adaptability and generalization ability, making it difficult to effectively identify various mutation modes.
By employing a multi-sensor hash network structure to construct positive and negative sample pairs, and introducing residual mutation feature extraction, position-aware gating mechanism and black hole optimization algorithm, highly sensitive identification of mutation events in three-phase current time series data is achieved.
It improves the model's self-supervised learning ability, mutation detection accuracy, and structural adaptability, enabling it to accurately identify current mutations without manual annotation, and significantly improving its robustness and adaptability under complex working conditions.
Smart Images

Figure CN120850005A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power system monitoring technology, and in particular to a method for identifying current surges based on contrastive learning. Background Technology
[0002] In power distribution systems, power equipment, and industrial automation scenarios, three-phase current, as a critical operating parameter, has long been used for equipment condition monitoring and anomaly detection. Existing current abrupt change identification methods mainly rely on rule-based judgment, statistical models, or shallow machine learning algorithms to identify abnormal jumps in current signals through methods such as fixed thresholds, moving averages, time differences, or window mean comparisons. These methods are effective in environments with stable waveforms and minimal interference, but they are prone to missed detections, misjudgments, or inability to adapt when current signals change frequently due to load fluctuations, electromagnetic interference, and complex operating conditions. Furthermore, algorithms based on static rules lack model adaptability and generalization ability, and are unable to identify various abrupt change patterns.
[0003] In recent years, deep learning technology has been gradually applied to temporal anomaly detection tasks, with typical methods including convolutional neural networks, recurrent neural networks, autoencoders, and their variants. These methods improve the accuracy of mutation identification through end-to-end feature extraction capabilities. However, deep models generally rely on large amounts of labeled data for supervised training. In power scenarios, current mutation events occur infrequently, labeling costs are high, and data imbalance is a prominent issue, making it difficult for supervised learning models to generalize stably. Some studies have attempted to introduce contrastive learning mechanisms to construct positive and negative sample pairs and perform representation learning through similarity judgment between samples to alleviate the labeling problem. However, existing contrastive learning methods mostly rely on general feature extractors and fail to fully integrate the physical structure and channel features of current signals, resulting in limited performance of the models in fine-grained mutation identification.
[0004] Existing methods have shortcomings in addressing the diverse temporal fluctuation characteristics and abrupt change patterns of three-phase currents: First, they fail to generate structured positive and negative samples by incorporating current waveform change trends during the sample construction stage, resulting in a lack of sensitivity to abrupt changes. Second, they lack a feature channel mechanism that matches the temporal structure during representation learning, leading to insufficient ability of the model to capture local abrupt disturbances. Third, they lack a time-location control mechanism in multi-channel feature fusion, limiting the model's ability to perceive the location of abrupt changes. Fourth, they often employ fixed hyperparameters or general optimization strategies in parameter optimization, failing to jointly adjust the structure and weights for complex structural models.
[0005] The aforementioned problems have a significant impact on high-frequency equipment monitoring, motor status sensing, and electricity consumption behavior diagnosis scenarios. There is an urgent need to build a model system with self-supervised learning capabilities, channel sensing capabilities, sudden change response capabilities, and structural adjustability to improve the robustness and adaptability of current sudden change detection.
[0006] Therefore, how to provide a current mutation identification method based on contrastive learning is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0007] One objective of this invention is to propose a current mutation identification method based on contrastive learning. This invention employs a multi-sensor hash network structure, constructing positive and negative sample pairs and introducing residual mutation feature extraction, a position-aware gating mechanism, and a black hole optimization algorithm to achieve highly sensitive identification of mutation events in three-phase current time-series data. This invention details the complete process from sample construction, embedding representation generation, residual enhancement, channel control to optimization training, possessing advantages such as strong unsupervised modeling capabilities, high mutation detection accuracy, and optimizable and adaptable structure.
[0008] A current mutation identification method based on contrastive learning according to an embodiment of the present invention includes the following steps:
[0009] S1. Collect three-phase current time-series data and preprocess it to generate a current time-series sample set;
[0010] S2. Normalize and suppress noise for each sample window to construct a standardized time-series vector set;
[0011] S3. Construct positive and negative sample pairs based on the current change trend between windows;
[0012] S4. Input each pair of samples into the multisensory hash network model. The multisensory hash network model includes multiple parallel channels. Each channel contains a hash mapping function and a sparse activation module. The embedding results of all channels are concatenated to generate a fusion vector pair.
[0013] S5. Perform channel level difference calculation on each pair of fusion vectors to obtain residual tensors, input them into the convolution extraction module to extract cross-channel mutation features, and then perform weighted fusion with the original fusion vectors to form an enhanced embedding representation;
[0014] S6. Introduce a gating mechanism based on time position coding. After the window position vector and each channel are embedded and concatenated, input the gating unit, calculate the dynamic weight of the channel, and adjust the channel output by weighting.
[0015] S7. An improved black hole optimization algorithm is used to jointly optimize the model structure parameters and initial weights, and a fitness function with the objective of contrast loss and recognition error is constructed. In each iteration, black hole attraction, perturbation update and event horizon resampling operations are performed to obtain the optimal parameter combination.
[0016] S8. Use the optimized model for current mutation detection. Perform similarity calculation on the embedding vectors of two consecutive windows. When the similarity is lower than the preset threshold, output the mutation determination and time position.
[0017] Optionally, the preprocessing in S1 specifically includes: performing time synchronization processing on the original three-phase current data, removing missing segments and performing linear interpolation to complete them, dividing the acquired data according to the set window length and sliding step size to obtain several continuous window segments, extracting the phase current mean, rate of change and instantaneous fluctuation amplitude features for each window segment, and forming a vector form of the extracted features as the current time series sample of that window.
[0018] Optionally, the normalization and noise suppression in S2 includes: normalizing each current sample window using the Z-score normalization method, normalizing each phase current value to zero mean and unit variance according to the mean and standard deviation within the window, performing preliminary denoising operation on the normalized time-series vector using a moving average filter, with the filter window length being less than half the sample window length, and further extracting the main signal components using empirical mode decomposition based on the moving average, and reconstructing it into a normalized time-series vector.
[0019] Optionally, S3 specifically includes:
[0020] S31. Set the current change threshold vector θ = [θ A ,θ B ,θ C ], where θ A ,θ B ,θ C These represent the sensitivity thresholds for changes in the three-phase currents A, B, and C, respectively.
[0021] S32. Select any two adjacent sample windows w from the standardized time series vector set. i with w i+1 Each window contains a three-phase current sequence, represented as follows: and
[0022] S33. Calculate the mean change of the three-phase currents respectively, and obtain the change vector ΔI = [ΔI A ,ΔI B ,ΔI C ],in μ(~) represents the mean function;
[0023] S34, Calculate each dimension ΔI k With the corresponding threshold θ k Comparison, if ΔI exists k >θ k If a mutation occurs in the current window pair, the sample pair is marked as a negative sample pair, i.e., labeled y. ij =1; otherwise, mark it as a positive sample pair and assign it a label y. ij =0;
[0024] S35. Organize all constructed sample pairs and their labels into a sample pair set P = {(w i ,w i+1 ,ΔI,y ij )}, where each element contains a window pair, its corresponding current change vector ΔI, and a mutation label y ij .
[0025] Optionally, S4 specifically includes:
[0026] S41. For the sample pair set P = {(w i ,w i+1 ,ΔI,y ij Each group of windows in )} is paired with w i with w i+1 The current timing vectors are respectively input into the shared structure multi-sensor hash network model;
[0027] S42, the multi-sensory hash network model consists of N H It consists of several parallel hash channels, each containing an independent hash mapping function h. n (~) maps the input window vector to a length of d. h hash-encoded vector z n =h n (w), where n = 1, 2, ..., N H ;
[0028] S43. For each hash-coded vector z n Perform a sparse activation operation, retaining the top-k response elements and setting the rest to zero, to obtain a sparse vector. Wherein, the sparsity ratio k / d h Set the hyperparameter value;
[0029] S44. Concatenate the sparse vectors of all hash channels according to the channel dimension to obtain the complete embedding representation vector. Where || denotes vector concatenation operation;
[0030] S45, For each pair of samples, two windows w i w i+1Perform operations S41 to S44 respectively to obtain the corresponding embedding representation vectors. and
[0031] S46. Embed the vector pairs Its label y ij Together, they are fed into the residual difference calculation module and the comparison loss optimization path as input.
[0032] Optionally, S5 specifically includes:
[0033] S51. For each pair of embedding vectors They will be represented as Each vector has a dimension of N. H ~d h ;
[0034] S52, h (1) with h (2) Divided into N according to channels H Subvector pairs Where n = 1, 2, ..., N H Each subvector has a dimension of d. h ;
[0035] S53. Calculate the channel level difference for each pair of channel vectors to obtain the residual vector. Then concatenate the residual vectors of all channels in channel order into a residual tensor.
[0036] S54. Input the residual tensor R into a convolution extraction module consisting of a set of one-dimensional convolutional layers and activation functions to extract the cross-channel abrupt change feature representation vector, denoted as f. R The kernel size is k. c The step size is s c The output dimension is the same as that of R;
[0037] S55. Construct a weighted fusion mechanism to integrate the original fusion vector h. (1) h (2) With residual extraction vector f R Element-level fusion is performed to generate enhanced embedding representation pairs. The fusion method is as follows:
[0038]
[0039] Wherein, the fusion weight λ∈[0,1] is a learnable parameter or a fixed constant.
[0040] Optionally, S6 specifically includes:
[0041] S61. For each sample window w iGenerate its time index t in the original current sequence i Normalize it into a relative position code p based on the maximum sequence length T. i =t i / T;
[0042] S62, Encode position p i Input position embedding function e(p) i ), generate position vector Where d p For the position vector dimension, the embedding function can employ a learnable linear transformation or sine / cosine position encoding;
[0043] S63, Enhanced Embedded Representation Split into N channels respectively H Channel embedding subvectors Where n = 1, ..., N H Each subvector has a dimension of d. h ;
[0044] S64, Set the position vector v i With each channel embedding subvector They are concatenated separately to form a channel fusion vector.
[0045] S65, will The input gated weight generation unit includes a linear mapping layer and a sigmoid function, and the output channel weights.
[0046] S66. Weight the embedding subvectors of each channel to obtain the final channel output:
[0047]
[0048] S67. Concatenate the weighted outputs of all channels to obtain the final position-aware enhanced embedding representation. Used for subsequent comparative calculations and mutation determination.
[0049] Optionally, S7 specifically includes:
[0050] S71. Encode the structural parameters and initial weights of the multi-perceptual hash network model into a parameter vector x = [N]. H ,d h [,k,λ,W0], where N H d represents the number of hash channels. h λ is the channel embedding dimension, k is the sparse activation ratio, λ is the residual fusion weight, and W0 is the parameter vector representation of the weight initialization matrix.
[0051] S72. Initialize a population set X = {x1, x2, ..., xn} containing P candidate solutions. P}, calculate the fitness value F(x) for each solution. i The fitness function is defined as follows:
[0052]
[0053] in To compare the losses, ~ error The loss is the loss due to misjudgment of mutations, where γ1 and γ2 are weighting coefficients.
[0054] S73. Select the individual x with the lowest current fitness. ~ As a "black hole," the remaining individuals are denoted as "stars," and an update operation is performed in each iteration:
[0055]
[0056] Where r i It is a random scaling factor. For the disturbance offset term, satisfying
[0057] S74. Based on the black hole fitness F(x) in each iteration ~ With fitness for all stars and dynamic updates to the event horizon radius:
[0058]
[0059] S75, If a certain solution x j If the Euclidean distance from the black hole is less than R(t), it is considered to have been swallowed, and elastic resampling is performed to generate a new individual x′. j Its generation method involves adding perturbation noise centered on historical optimal solutions:
[0060] x′ j =x best +η j ,η j ~N(0,δ 2 );
[0061] S76. Repeat steps S72 to S75 until the maximum number of iterations or the fitness convergence condition is reached, and output the optimal parameter vector.
[0062] Optionally, S8 specifically includes:
[0063] S81, Optimize the obtained model parameter vector It is applied to a multi-sensory hash network model to construct an optimized embedded representation module;
[0064] S82. Continuously generate a window sequence {w1, w2, ..., w...} of the test running data. T Input the optimized model into each input, and output the window embedding vector sequence in sequence. Each of them This is the final vector representation after position awareness and residual enhancement;
[0065] S83, For each pair of adjacent embedding vectors Calculate the similarity score s i ;
[0066] S84. Set the mutation detection threshold τ s ∈[0,1], when the similarity score s of a pair of windows i <τ s When this occurs, it is considered a sudden change in current.
[0067] S85, Set the time position of the mutation window t i The corresponding phase identifier is recorded as a mutation event, and the set of mutation time points T = {t} is output. k |s k <τ s}, associated window (w k ,w k+1 The three-phase raw current information in );
[0068] S86. Output mutation event logs in chronological order, including mutation time points t. k , corresponding window number k, trigger phase, similarity score s k Compared with the original current change value ΔI k .
[0069] The beneficial effects of this invention are:
[0070] This invention realizes an automatic construction mechanism for positive and negative sample pairs based on current change trends. It can accurately distinguish between mutation windows and non-mutation windows without manual annotation, improve the model's adaptive representation learning ability for current mutation events, and enhance the model's practicality in weakly supervised or unsupervised scenarios.
[0071] This invention introduces a multi-sensor hash network structure and a channel-level residual enhancement mechanism to achieve multi-channel and multi-scale joint extraction of fine-grained perturbation features of current mutation signals, which significantly improves the model's response accuracy to mutation modes, especially under complex conditions such as slight fluctuations and phase imbalances, and has stronger recognition robustness.
[0072] This invention solves the problem of traditional models relying on manual parameter tuning by jointly optimizing model structure parameters and initial weights through an improved black hole optimization algorithm, thereby improving the overall recognition performance and algorithm stability. It also has good structural transferability and online update capability, and is suitable for current surge detection tasks in various power scenarios. Attached Figure Description
[0073] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:
[0074] Figure 1 This is an overall flowchart of a current mutation identification method based on contrastive learning proposed in this invention;
[0075] Figure 2 This is a flowchart illustrating the sample pair construction process for a current mutation identification method based on contrastive learning proposed in this invention.
[0076] Figure 3 This is a flowchart of the black hole optimization algorithm for a current mutation identification method based on contrastive learning proposed in this invention. Detailed Implementation
[0077] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, illustrating only the basic structure of the invention, and therefore only show the components relevant to the invention.
[0078] refer to Figure 1-3 A current mutation identification method based on contrastive learning includes the following steps:
[0079] S1. Collect three-phase current time-series data and preprocess it to generate a current time-series sample set;
[0080] S2. Normalize and suppress noise for each sample window to construct a standardized time-series vector set;
[0081] S3. Construct positive and negative sample pairs based on the current change trend between windows;
[0082] S4. Input each pair of samples into the multisensory hash network model. The multisensory hash network model includes multiple parallel channels. Each channel contains a hash mapping function and a sparse activation module. The embedding results of all channels are concatenated to generate a fusion vector pair.
[0083] S5. Perform channel level difference calculation on each pair of fusion vectors to obtain residual tensors, input them into the convolution extraction module to extract cross-channel mutation features, and then perform weighted fusion with the original fusion vectors to form an enhanced embedding representation;
[0084] S6. Introduce a gating mechanism based on time position coding. After the window position vector and each channel are embedded and concatenated, input the gating unit, calculate the dynamic weight of the channel, and adjust the channel output by weighting.
[0085] S7. An improved black hole optimization algorithm is used to jointly optimize the model structure parameters and initial weights, and a fitness function with the objective of contrast loss and recognition error is constructed. In each iteration, black hole attraction, perturbation update and event horizon resampling operations are performed to obtain the optimal parameter combination.
[0086] S8. Use the optimized model for current mutation detection. Perform similarity calculation on the embedding vectors of two consecutive windows. When the similarity is lower than the preset threshold, output the mutation determination and time position.
[0087] This invention proposes a current surge identification method based on contrastive learning, solving the false alarm and false negative problems in existing current surge detection methods. Compared with traditional rule-based detection methods, this invention does not require pre-setting fixed thresholds or simple signal processing algorithms. Instead, it constructs positive and negative sample pairs based on current change trends and automatically learns the key features of current surges using deep learning. Through this innovation, the model can more accurately identify current surges in high-noise environments with large load fluctuations, exhibiting higher robustness and adaptability.
[0088] In this embodiment, the preprocessing in S1 specifically includes: performing time synchronization processing on the original three-phase current data, removing missing segments and performing linear interpolation to complete them, dividing the acquired data according to the set window length and sliding step size to obtain several continuous window segments, extracting the phase current mean, rate of change and instantaneous fluctuation amplitude features for each window segment, and forming a vector form of the extracted features as the current time series sample of that window.
[0089] In this embodiment, the normalization and noise suppression in S2 include: normalizing each current sample window using the Z-score normalization method, normalizing each phase current value to zero mean and unit variance according to the mean and standard deviation within the window, performing preliminary denoising operation on the normalized time-series vector using a moving average filter, with the filter window length being less than half the sample window length, and further extracting the main signal components using empirical mode decomposition based on the moving average, and reconstructing it into a normalized time-series vector.
[0090] In this embodiment, S3 specifically includes:
[0091] S31. Set the current change threshold vector θ = [θ A ,θ B ,θ C ], where θ A ,θB ,θ C These represent the sensitivity thresholds for changes in the three-phase currents A, B, and C, respectively.
[0092] S32. Select any two adjacent sample windows w from the standardized time series vector set. i with w i+1 Each window contains a three-phase current sequence, represented as follows: and
[0093] S33. Calculate the mean change of the three-phase currents respectively, and obtain the change vector ΔI = [ΔI A ,ΔI B ,ΔI C ],in μ(·) represents the mean function;
[0094] S34, Calculate each dimension ΔI k With the corresponding threshold θ k Comparison, if ΔI exists k >θ k If a mutation occurs in the current window pair, the sample pair is marked as a negative sample pair, i.e., labeled y. ij =1; otherwise, mark it as a positive sample pair and assign it a label y. ij =0;
[0095] S35. Organize all constructed sample pairs and their labels into a sample pair set P = {(w i ,w i+1 ,ΔI,y ij )}, where each element contains a window pair, its corresponding current change vector ΔI, and a mutation label y ij .
[0096] This invention proposes a sample processing method based on a multi-sensor hash network. This innovative method extracts deep features from current time-series data through multiple parallel hash channels, significantly enhancing the model's responsiveness to abrupt events. Compared to traditional single-feature extraction methods, the multi-channel hash mapping of this invention can capture the abrupt features of current signals from different perspectives, providing a more comprehensive representation. This multi-channel joint learning method effectively improves the system's accuracy under complex current waveforms, reduces false positives and false negatives, and exhibits stronger robustness and flexibility.
[0097] In this embodiment, S4 specifically includes:
[0098] S41. For the sample pair set P = {(w i ,w i+1 ,ΔI,y ij Each group of windows in )} is paired with w i with wi+1 The current timing vectors are respectively input into the shared structure multi-sensor hash network model;
[0099] S42, the multi-sensory hash network model consists of N H It consists of several parallel hash channels, each containing an independent hash mapping function h. n (*) maps the input window vector to a length of d. h hash-encoded vector z n =h n (w), where n = 1, 2, ..., N H ;
[0100] S43. For each hash-coded vector z n Perform a sparse activation operation, retaining the top-k response elements and setting the rest to zero, to obtain a sparse vector. Wherein, the sparsity ratio k / d h Set the hyperparameter value;
[0101] S44. Concatenate the sparse vectors of all hash channels according to the channel dimension to obtain the complete embedding representation vector. Where || denotes vector concatenation operation;
[0102] S45, For each pair of samples, two windows w i w i+1 Perform operations S41 to S44 respectively to obtain the corresponding embedding representation vectors. and
[0103] S46. Embed the vector pairs Its label y ij Together, they are fed into the residual difference calculation module and the comparison loss optimization path as input.
[0104] This invention innovatively solves the problem of insufficient response capability of existing methods when faced with complex abrupt signals by introducing a channel-level difference calculation and residual feature fusion module. Traditional methods often fail to accurately identify minute or transient abrupt changes, while the difference calculation and residual feature fusion module of this invention can effectively extract abrupt change features and enhance the model's sensitivity to abrupt changes. In this way, this invention significantly improves the accuracy of abrupt signal detection and can effectively avoid misjudgments caused by signal fluctuations.
[0105] In this embodiment, S5 specifically includes:
[0106] S51. For each pair of embedding vectors They will be represented as Each vector has a dimension of N. H ~dh ;
[0107] S52, h (1) with h (2) Divided into N according to channels H Subvector pairs Where n = 1, 2, ..., N H Each subvector has a dimension of d. h ;
[0108] S53. Calculate the channel level difference for each pair of channel vectors to obtain the residual vector. Then concatenate the residual vectors of all channels in channel order into a residual tensor.
[0109] S54. Input the residual tensor R into a convolution extraction module consisting of a set of one-dimensional convolutional layers and activation functions to extract the cross-channel abrupt change feature representation vector, denoted as f. R The kernel size is k. c The step size is s c The output dimension is the same as that of R;
[0110] S55. Construct a weighted fusion mechanism to integrate the original fusion vector h. (1) h (2) With residual extraction vector f R Element-level fusion is performed to generate enhanced embedding representation pairs. The fusion method is as follows:
[0111]
[0112] Wherein, the fusion weight λ∈[0,1] is a learnable parameter or a fixed constant.
[0113] This invention innovatively solves the problem of traditional methods failing to accurately locate abrupt events when processing multi-channel current signals by introducing a gating mechanism based on time-position coding. Traditional methods handle multi-channel signals in a relatively simple way, failing to fully consider the importance of the temporal position between channels. This invention, through the combination of position coding and gating, enables the model to dynamically adjust the feature transfer weights of each channel, thereby more accurately identifying the temporal position of current abrupt changes. This innovation not only improves the accuracy of abrupt change detection but also enhances the model's adaptability to complex current variations.
[0114] In this embodiment, S6 specifically includes:
[0115] S61. For each sample window w i Generate its time index t in the original current sequence i Normalize it into a relative position code p based on the maximum sequence length T. i =t i / T;
[0116] S62, Encode position p i Input position embedding function e(p) i ), generate position vector Where d p For the position vector dimension, the embedding function can employ a learnable linear transformation or sine / cosine position encoding;
[0117] S63, Enhanced Embedded Representation Split into N channels respectively H Channel embedding subvectors Where n = 1, ..., N H Each subvector has a dimension of d. h ;
[0118] S64, Set the position vector v i With each channel embedding subvector They are concatenated separately to form a channel fusion vector.
[0119] S65, will The input gated weight generation unit includes a linear mapping layer and a sigmoid function, and the output channel weights.
[0120] S66. Weight the embedding subvectors of each channel to obtain the final channel output:
[0121]
[0122] S67. Concatenate the weighted outputs of all channels to obtain the final position-aware enhanced embedding representation. Used for subsequent comparative calculations and mutation determination.
[0123] This invention employs an improved black hole optimization algorithm to jointly optimize model structure parameters and initial weights, innovatively overcoming the limitations of traditional methods in hyperparameter tuning. Traditional methods typically rely on fixed parameter settings or manual tuning, while this invention, by introducing the black hole optimization algorithm, enables the model to automatically adjust its structure and weights during training, thereby achieving a better global optimum. Through this optimization approach, this invention significantly improves accuracy in current surge detection tasks and reduces reliance on manual intervention, demonstrating a high level of intelligence and automation.
[0124] In this embodiment, S7 specifically includes:
[0125] S71. Encode the structural parameters and initial weights of the multi-perceptual hash network model into a parameter vector x = [N].H ,d h [,k,λ,W0], where N H d represents the number of hash channels. h λ is the channel embedding dimension, k is the sparse activation ratio, λ is the residual fusion weight, and W0 is the parameter vector representation of the weight initialization matrix.
[0126] S72. Initialize a population set X = {x1, x2, ..., xn} containing P candidate solutions. P}, calculate the fitness value F(x) for each solution. i The fitness function is defined as follows:
[0127]
[0128] in To compare the losses, ~ error The loss is the loss due to misjudgment of mutations, where γ1 and γ2 are weighting coefficients.
[0129] S73. Select the individual x with the lowest current fitness. * As a "black hole," the remaining individuals are denoted as "stars," and an update operation is performed in each iteration:
[0130]
[0131] Where r i It is a random scaling factor. For the disturbance offset term, satisfying
[0132] S74. Based on the black hole fitness F(x) in each iteration * With fitness for all stars and dynamic updates to the event horizon radius:
[0133]
[0134] S75, If a certain solution x j If the Euclidean distance from the black hole is less than R(t), it is considered to have been swallowed, and elastic resampling is performed to generate a new individual x′. j Its generation method involves adding perturbation noise centered on historical optimal solutions:
[0135] x′ j =x best +η j ,η j ~N(0,δ 2 );
[0136] S76. Repeat steps S72 to S75 until the maximum number of iterations or the fitness convergence condition is reached, and output the optimal parameter vector.
[0137] This invention significantly improves the global search capability and convergence speed of a model by applying the black hole optimization algorithm to current surge detection. Compared with traditional optimization algorithms, the black hole optimization algorithm is more efficient in searching for the global optimum and can avoid getting trapped in local optima, thereby improving the model's generalization ability and performance. This algorithm combines perturbation updates and event horizon resampling strategies, enabling it to better adapt to the complexity of current signals and providing powerful parameter optimization support for current surge detection.
[0138] In this embodiment, S8 specifically includes:
[0139] S81, Optimize the obtained model parameter vector It is applied to a multi-sensory hash network model to construct an optimized embedded representation module;
[0140] S82. Continuously generate a window sequence {w1, w2, ..., w...} of the test running data. T Input the optimized model into each input, and output the window embedding vector sequence in sequence. Each of them This is the final vector representation after position awareness and residual enhancement;
[0141] S83, For each pair of adjacent embedding vectors Calculate the similarity score s i ;
[0142] S84. Set the mutation detection threshold τ s ∈[0,1], when the similarity score s of a pair of windows i <τ s When this occurs, it is considered a sudden change in current.
[0143] S85, Set the time position of the mutation window t i The corresponding phase identifier is recorded as a mutation event, and the set of mutation time points T = {t} is output. k |s k <τ s}, associated window (w k ,w k+1 The three-phase raw current information in );
[0144] S86. Output mutation event logs in chronological order, including mutation time points t. k , corresponding window number k, trigger phase, similarity score s k Compared with the original current change value ΔI k .
[0145] This invention innovatively solves the problem of missed detection in high-noise and complex operating conditions using a similarity-based current surge detection method. Traditional methods are easily affected by noise and interference in identifying current surges, leading to missed detections. This invention, however, effectively distinguishes between normal fluctuations and sudden surge signals by calculating the similarity score between adjacent windows and combining it with a dynamic threshold determination mechanism, significantly reducing the missed detection rate. This method improves the accuracy of surge detection, ensuring efficient and accurate localization of current surge events.
[0146] Example 1:
[0147] To verify the feasibility of this invention in practice, it was applied to the current surge detection task in a large industrial power distribution system. In this system, the three-phase current signal is frequently affected by load fluctuations, electrical interference, and equipment failures, leading to sudden changes in the current signal. Existing current surge detection methods are mainly based on threshold judgment and simple signal processing methods. Although they can effectively identify drastic current fluctuations in some cases, under actual operating conditions, due to the diversity of surge signals and the complexity of their change patterns, traditional methods have high false alarm and false negative rates, especially when the current waveform changes relatively smoothly, easily leading to misjudgments. Therefore, a new method is urgently needed that can adapt to more complex current change scenarios and improve detection accuracy.
[0148] This embodiment, based on the contrastive learning-based current surge detection method proposed in this invention, is applied to this large-scale industrial power distribution system. The aim is to improve the accuracy and real-time performance of current surge detection and reduce false alarms and missed alarms. The specific application process is as follows:
[0149] First, the system collects three-phase current time-series data through the current data acquisition modules of each electrical device. The data sampling frequency is 1kHz, and the sampling period is 1 minute. The collected data undergoes preprocessing, including noise suppression and normalization, to generate a standardized current time-series vector set. Each time-series vector corresponds to a time window, with a window length of 60 seconds. By dividing the current data into sliding windows, multiple time-window samples are generated, which will serve as the basis for subsequent processing.
[0150] Next, using the multi-sensor hash network model proposed in this invention, the system compares each pair of adjacent sample windows and constructs positive and negative sample pairs based on the current change trend. For each pair of windows, the average change of the three-phase current in each window is first calculated, and then compared with a preset threshold. If the change in a certain phase exceeds the set threshold, the window is considered to have a sudden change. According to this rule, the system divides the sample pairs into positive samples (no sudden change) and negative samples (sudden change). These sample pairs are then input into the multi-sensor hash network for deep feature learning and representation generation.
[0151] By training a multi-sensor hash network, the system learns the key features of abrupt change patterns in current signals and automatically generates an embedded representation for each sample window. When processing each pair of sample windows, the system first calculates the residual difference between each pair and extracts abrupt change features using a residual feature fusion module. This module enhances the model's response to local abrupt changes based on the characteristics of the abrupt changes, further improving detection accuracy.
[0152] Furthermore, this invention introduces a time-location encoding gating mechanism to ensure that the model can dynamically adjust the feature transfer weights for different time windows when processing multi-channel inputs. Through this mechanism, the system can more accurately identify the temporal location of current surge events.
[0153] To optimize model performance, an improved black hole optimization algorithm was employed to jointly optimize network structure parameters and initial weights. During the optimization process, the model's parameters underwent multiple iterations to ultimately obtain the optimal parameter combination, thereby improving the accuracy and robustness of current surge detection.
[0154] Through the above process, the system can accurately detect abrupt changes in current signals and output the time, location, and phase information of the abrupt change. In actual testing, the system demonstrated good real-time performance and accuracy, significantly reducing false alarm and false negative rates.
[0155] The following are experimental data from this embodiment, verifying the effectiveness and advantages of the method of the present invention in practical applications. The data comes from monitoring results of a week of continuous operation in an industrial power distribution system.
[0156] Table 1: Experimental data for detecting sudden current changes
[0157]
[0158]
[0159] The experimental data show that the proposed current abrupt change detection method exhibits high detection accuracy across multiple current window samples. For each window, the system successfully identifies the abrupt change event in the current signal and performs accurate time localization using a multi-sensor hash network model and a contrastive learning method.
[0160] For example, in the first set of data, the mean current changes were A: 5.2, B: 4.9, and C: 5.1. The system successfully detected the sudden change, which was consistent with the actual sudden change. The similarity score for this window was 0.86, the detection accuracy was 98%, the false alarm rate was 2%, and the false negative rate was 0. This indicates that the system can detect sudden current changes relatively accurately with a low false alarm rate.
[0161] In the second set of data, despite the small change in current, the system still did not detect any sudden changes, consistent with the actual situation. At this point, the similarity score was high (0.98), the detection accuracy was 100%, and there were no false alarms or false negatives. This indicates that, in the absence of sudden changes, the system can avoid misjudgments and ensure the reliability of the detection results.
[0162] In the third set of data, a current surge event occurred again, and the system successfully detected and accurately identified the surge. The detection accuracy was 97%, the false alarm rate was 1.5%, and the false negative rate was 1.2%. This set of data shows that despite some false alarms and false negatives, the overall detection performance is still good, indicating that the system can effectively respond to current surges of different degrees.
[0163] Other data sets also showed similar detection results, demonstrating high stability in both mutation identification and accuracy without mutations. In all data sets, the detection accuracy ranged from 95% to 100%, with false alarm rates mostly below 2% and false negative rates below 1%, validating the effectiveness and superiority of this invention in industrial power distribution systems.
[0164] Overall, the current surge detection method based on contrastive learning adopted in this invention, through a multi-sensor hash network and an improved black hole optimization algorithm, can accurately identify current surges under complex current waveform changes. It has high accuracy, low false alarm rate and low false alarm rate, and is suitable for efficient monitoring and fault early warning in industrial power distribution systems.
[0165] 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 identifying sudden current changes based on contrastive learning, characterized in that, The steps include: S1. Collect three-phase current time-series data and preprocess it to generate a current time-series sample set; S2. Normalize and suppress noise for each sample window to construct a standardized time-series vector set; S3. Construct positive and negative sample pairs based on the current change trend between windows; S4. Input each pair of samples into the multisensory hash network model. The multisensory hash network model includes multiple parallel channels. Each channel contains a hash mapping function and a sparse activation module. The embedding results of all channels are concatenated to generate a fusion vector pair. S5. Perform channel level difference calculation on each pair of fusion vectors to obtain residual tensors, input them into the convolution extraction module to extract cross-channel mutation features, and then perform weighted fusion with the original fusion vectors to form an enhanced embedding representation; S6. Introduce a gating mechanism based on time position coding. After the window position vector and each channel are embedded and concatenated, input the gating unit, calculate the dynamic weight of the channel, and adjust the channel output by weighting. S7. An improved black hole optimization algorithm is used to jointly optimize the model structure parameters and initial weights, and a fitness function with the objective of contrast loss and recognition error is constructed. In each iteration, black hole attraction, perturbation update and event horizon resampling operations are performed to obtain the optimal parameter combination. S8. Use the optimized model for current mutation detection. Perform similarity calculation on the embedding vectors of two consecutive windows. When the similarity is lower than the preset threshold, output the mutation determination and time position.
2. The current mutation identification method based on contrastive learning according to claim 1, characterized in that, The preprocessing in S1 specifically includes: performing time synchronization processing on the original three-phase current data, removing missing segments and performing linear interpolation to complete them, dividing the acquired data into several continuous window segments according to the set window length and sliding step size, extracting the phase current mean, rate of change and instantaneous fluctuation amplitude features for each window segment, and forming a vector form of the extracted features as the current time series sample of that window.
3. The current mutation identification method based on contrastive learning according to claim 2, characterized in that, The normalization and noise suppression in S2 include: normalizing each current sample window using the Z-score normalization method, normalizing each phase current value to zero mean and unit variance according to the mean and standard deviation within the window, performing preliminary denoising operation on the normalized time-series vector using a moving average filter, with the filter window length being less than half the sample window length, and further extracting the main signal components using empirical mode decomposition based on the moving average, and reconstructing it into a normalized time-series vector.
4. The current mutation identification method based on contrastive learning according to claim 3, characterized in that, S3 specifically includes: S31. Set the current change threshold vector θ = [θ A ,θ B ,θ C ], where θ A θ B θ C These represent the sensitivity thresholds for changes in the three-phase currents A, B, and C, respectively. S32. Select any two adjacent sample windows w from the standardized time series vector set. i with w i+1 Each window contains a three-phase current sequence, represented as follows: and S33. Calculate the mean change of the three-phase currents respectively, and obtain the change vector ΔI = [ΔI A ,ΔI B ,ΔI C ],in k∈{A,B,C}, μ(·) denotes the mean function; S34, Calculate each dimension ΔI k With the corresponding threshold θ k Comparison, if ΔI exists k >θ k If a mutation occurs in the current window pair, the sample pair is marked as a negative sample pair, i.e., labeled y. ij =1; otherwise, mark it as a positive sample pair and assign it a label y. ij =0; S35. Organize all constructed sample pairs and their labels into a sample pair set P = {(w i ,w i+1 ,ΔI,y ij )}, where each element contains a window pair, its corresponding current change vector ΔI, and a mutation label y ij .
5. The current mutation identification method based on contrastive learning according to claim 4, characterized in that, S4 specifically includes: S41. For the sample pair set P = {(w i ,w i+1 ,ΔI,y ij Each group of windows in )} is paired with w i with w i+1 The current timing vectors are respectively input into the shared structure multi-sensor hash network model; S42, the multi-sensory hash network model consists of N H It consists of several parallel hash channels, each containing an independent hash mapping function h. n (·) maps the input window vector to a length of d. h hash-encoded vector z n =h n (w), where n = 1, 2, ..., N H ; S43. For each hash-encoded vector z n Perform a sparse activation operation, retaining the top-k response elements and setting the rest to zero, to obtain a sparse vector. Wherein, the sparsity ratio k / d h Set the hyperparameter value; S44. Concatenate the sparse vectors of all hash channels according to the channel dimension to obtain the complete embedding representation vector. Where || denotes vector concatenation operation; S45, For each pair of samples, two windows w i w i+1 Perform operations S41 to S44 respectively to obtain the corresponding embedding representation vectors. and S46. Embed the vector pairs Its label y ij Together, they are fed into the residual difference calculation module and the comparison loss optimization path as input.
6. The current mutation identification method based on contrastive learning according to claim 5, characterized in that, S5 specifically includes: S51. For each pair of embedding vectors They will be represented as Each vector has a dimension of N. H ·d h ; S52, h (1) with h (2) Divided into N according to channels H Subvector pairs Where n = 1, 2, ..., N H Each subvector has a dimension of d. h ; S53. Calculate the channel level difference for each pair of channel vectors to obtain the residual vector. Then concatenate the residual vectors of all channels in channel order into a residual tensor. S54. Input the residual tensor R into a convolution extraction module consisting of a set of one-dimensional convolutional layers and activation functions to extract the cross-channel abrupt change feature representation vector, denoted as f. R The kernel size is k. c The step size is s c The output dimension is the same as that of R; S55. Construct a weighted fusion mechanism to integrate the original fusion vector h. (1) h (2) With residual extraction vector f R Element-level fusion is performed to generate enhanced embedding representation pairs. The fusion method is as follows: Wherein, the fusion weight λ∈[0,1] is a learnable parameter or a fixed constant.
7. The current mutation identification method based on contrastive learning according to claim 6, characterized in that, S6 specifically includes: S61. For each sample window w i Generate its time index t in the original current sequence i Normalize it into a relative position code p based on the maximum sequence length T. i =t i / T; S62, Encode position p i Input position embedding function e(p) i ), generate position vector where d p For the position vector dimension, the embedding function can employ a learnable linear transformation or sine / cosine position encoding; S63, Enhanced Embedded Representation Split into N channels respectively H Channel embedding subvectors Where n = 1, ..., N H Each subvector has a dimension of d. h ; S64, Set the position vector v i With each channel embedding subvector They are concatenated separately to form a channel fusion vector. S65, will The input gated weight generation unit includes a linear mapping layer and a sigmoid function, and the output channel weights. S66. Weight the embedding subvectors of each channel to obtain the final channel output: S67. Concatenate the weighted outputs of all channels to obtain the final position-aware enhanced embedding representation. Used for subsequent comparative calculations and mutation determination.
8. The current mutation identification method based on contrastive learning according to claim 7, characterized in that, Specifically, S7 includes: S71. Encode the structural parameters and initial weights of the multi-perceptual hash network model into a parameter vector x = [N]. H ,d h [,k,λ,W0], where N H d represents the number of hash channels. h λ is the channel embedding dimension, k is the sparse activation ratio, λ is the residual fusion weight, and W0 is the parameter vector representation of the weight initialization matrix. S72. Initialize a population set X = {x1, x2, ..., xn} containing P candidate solutions. P }, calculate the fitness value F(x) for each solution. i The fitness function is defined as follows: in To compare the losses, ~ error The loss is the loss due to misjudgment of mutations, where γ1 and γ2 are weighting coefficients. S73. Select the individual x with the lowest current fitness. ~ The remaining individuals are treated as "stars," and an update operation is performed in each iteration: Where r i It is a random scaling factor. For the disturbance offset term, satisfying S74. Based on the black hole fitness F(x) in each iteration ~ With fitness for all stars and dynamic updates to the event horizon radius: S75, If a certain solution x j If the Euclidean distance from the black hole is less than R(t), it is considered to have been swallowed, and elastic resampling is performed to generate a new individual x′. j Its generation method involves adding perturbation noise centered on historical optimal solutions: x′ j =x best +n j ,or j ~N(0,δ 2 ); S76. Repeat steps S72 to S75 until the maximum number of iterations or the fitness convergence condition is reached, and output the optimal parameter vector.
9. The current mutation identification method based on contrastive learning according to claim 8, characterized in that, S8 specifically includes: S81, Optimize the obtained model parameter vector It is applied to a multi-sensory hash network model to construct an optimized embedded representation module; S82. Continuously generate a window sequence {w1, w2, ..., w...} of the test running data. T Input the optimized model into each input, and output the window embedding vector sequence in sequence. Each of them This is the final vector representation after position awareness and residual enhancement; S83, For each pair of adjacent embedding vectors Calculate the similarity score s i ; S84. Set the mutation detection threshold τ s ∈[0,1], when the similarity score s of a pair of windows i <τ s When this occurs, it is considered a sudden change in current. S85, Set the time position of the mutation window t i The corresponding phase identifier is recorded as a mutation event, and the set of mutation time points T = {t} is output. k |s k <τ s }, associated window (w k ,w k+1 The three-phase raw current information in ) S86. Output mutation event logs in chronological order, including mutation time points t. k , corresponding window number k, trigger phase, similarity score s k Compared with the original current change value ΔI k .
Citation Information
Cited By
Metabolite fingerprint spectrum construction method of probiotic fermentation type Chinese herbal medicine preparation
CN121164509A