CN117633574A - Distributed resource data clustering method and system - Google Patents

Distributed resource data clustering method and system Download PDF

Info

Publication number
CN117633574A
CN117633574A CN202311698120.9A CN202311698120A CN117633574A CN 117633574 A CN117633574 A CN 117633574A CN 202311698120 A CN202311698120 A CN 202311698120A CN 117633574 A CN117633574 A CN 117633574A
Authority
CN
China
Prior art keywords
clustering
feature
data
conv
convolution
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311698120.9A
Other languages
Chinese (zh)
Inventor
邓星
朱红
朱克东
张明
潘小辉
李峰
严嘉豪
徐鹏
夏秋
王刚
杨胜春
李亚平
田伟
刘俊
吕建虎
于韶源
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
State Grid Corp of China SGCC
China Electric Power Research Institute Co Ltd CEPRI
Nanjing Power Supply Co of State Grid Jiangsu Electric Power Co Ltd
Original Assignee
State Grid Corp of China SGCC
China Electric Power Research Institute Co Ltd CEPRI
Nanjing Power Supply Co of State Grid Jiangsu Electric Power Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by State Grid Corp of China SGCC, China Electric Power Research Institute Co Ltd CEPRI, Nanjing Power Supply Co of State Grid Jiangsu Electric Power Co Ltd filed Critical State Grid Corp of China SGCC
Priority to CN202311698120.9A priority Critical patent/CN117633574A/en
Publication of CN117633574A publication Critical patent/CN117633574A/en
Pending legal-status Critical Current

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Image Analysis (AREA)

Abstract

The invention discloses a distributed resource data clustering method and a distributed resource data clustering system, wherein the method comprises the following steps: acquiring various power curve data of distributed resources, and converting the power curve data into tensor-form input data; inputting the input data into a CNN model for feature extraction, wherein the CNN model comprises a ResNet, a detail feature extraction module and a spatial attention module; capturing detail information in the power curve data by adopting a detail feature extraction module in the encoding stage; in the decoding stage, adopting a spatial attention module to dynamically adjust the characteristic weights of different positions, reconstructing the characteristic weights, and outputting the characteristic weights through a full connection layer; and carrying out cluster analysis on the output of the full-connection layer by using a spectral clustering algorithm to obtain a cluster to which each sample belongs. The invention can effectively process the power curve data and provides a high-efficiency and accurate solution for intelligent clustering of distributed resources.

Description

Distributed resource data clustering method and system
Technical Field
The invention belongs to the technical field of power engineering, and particularly relates to a distributed resource data clustering method and system.
Background
With the wide application of distributed resources in various industries, such as energy management, intelligent manufacturing, etc., intelligent clustering of distributed resources is becoming a research direction of great attention. The distributed resource includes power profile data for various devices that record the energy consumption patterns of the devices over different time periods, reflecting the operating characteristics and behavior patterns of the devices. By reasonably clustering the power curve data, the applications of classification management, anomaly detection, energy consumption analysis and the like of the equipment can be realized, so that powerful support is provided for reasonable utilization and intelligent management of distributed resources.
However, traditional clustering methods face some challenges in handling distributed resources. First, because distributed resource data generally presents a large-scale and high-dimensional characteristic, the conventional clustering method is difficult to effectively capture the internal structure of the data. Second, the data of the distributed resources are generally distributed on different locations or nodes, and how to perform cluster analysis in the distributed computing environment needs to be considered, so as to ensure the high efficiency and accuracy of the computation. With the increasing and complexity of distributed resources, how to efficiently cluster these resources for intelligent management and optimal configuration is an important research topic.
Disclosure of Invention
The invention aims to overcome the defects of the background technology, and provides a distributed resource data clustering method and a distributed resource data clustering system.
In order to achieve the above purpose, the present invention adopts the following technical scheme:
in a first aspect, the present invention provides a distributed resource data clustering method, including:
acquiring various power curve data of distributed resources, and converting the power curve data into tensor-form input data;
inputting the input data into a CNN model for feature extraction, wherein the CNN model comprises a ResNet, a detail feature extraction module and a spatial attention module; capturing detail information in the power curve data by adopting a detail feature extraction module in the encoding stage; in the decoding stage, adopting a spatial attention module to dynamically adjust the characteristic weights of different positions, reconstructing the characteristic weights, and outputting the characteristic weights through a full connection layer;
and carrying out cluster analysis on the output of the full-connection layer by using a spectral clustering algorithm to obtain a cluster to which each sample belongs.
As a further improvement of the present invention, the capturing, by using a detail feature extraction module, detail information in the power curve data in the encoding stage includes:
receiving characteristic information x from ResNet adjacent two scales a And x b Extracting:
for characteristic x a Performing maximum pooling downsampling, compressing the feature into half of the original, then performing 1×1 convolution, compressing the number of channels into half of the original, and linearly combining the information among channels to obtain feature information x without changing the spatial dimension of the feature map a Semantic features of (2);
for characteristic x b Performing a 1×1 convolution to extract useful local feature information to obtain feature information x b Semantic features of (2);
the semantic features obtained by the two operations are added and subtracted respectively;
then respectively carrying out 3X 3 convolution to further extract the features; then get x a ' and x b 'A'; finally x is a ' and x b ' adding to get the final output y out
As a further improvement of the invention, the calculation formula of the processing procedure of the detail feature extraction module is as follows:
x a ′=Conv 3×3 (Conv 1×1 (Maxpool(x a ))+Conv 1×1 (x b )),
x b ′=Conv 3×3 (Conv 1×1 (x b )-Conv 1×1 (Maxpool(x a ))),
y out =x a ′+x b ′.
in the formula, conv 1×1 (. Cndot.) represents a two-dimensional convolution with a convolution kernel size of 1, a batch normalization and a ReLU activation function, conv 3×3 (. Cndot.) represents a two-dimensional convolution with a convolution kernel size of 3, batch normalization, and a ReLU activation function; maxPool (·) represents maximum pooling; wherein x is a And x b Representing two different scale features generated by ResNet, respectively.
As a further improvement of the present invention, the step of dynamically adjusting and reconstructing the feature weights of different positions by using a spatial attention module in the decoding stage includes:
first for input feature x in Respectively carrying out maximum pooling and average pooling to respectively obtain x 1 Sum x 2 The method comprises the steps of carrying out a first treatment on the surface of the Then to x 1 Performing a 1 x 1 convolution to extract features to obtain x 1 ' then x 1 ' and x 2 Performs an addition operation and then adds x 2 ' performing a 3 x 3 convolution to obtain feature x 2 ", then is combined with x 1 The 'addition operation' performs fusion to obtain x 1 "C"; then the obtained x 1 "AND x 2 Splicing, then carrying out 1X 1 convolution, then carrying out Sigmiod activation, and finally carrying out weighted multiplication on the obtained product and the input characteristics to obtain a final output y out
As a further improvement of the invention, the calculation formula of the processing procedure of the spatial attention module is as follows:
x 1 ′=Conv 1×1 (Maxpool(x in )),
x 2 ′=x 1 ′+Avgpool(x in ),
x 1 ″=Conv 3×3 (x 2 ′)+x 1 ′,
wherein AvgPool (·) represents global average pooling and MaxPool (·) represents global maximum pooling;representing element-by-element multiplication; conv 1×1 (. Cndot.) represents a two-dimensional convolution with a convolution kernel size of 1, a batch normalization and a ReLU activation function, conv 3×3 (. Cndot.) represents a two-dimensional convolution with a convolution kernel size of 3, batch normalization, and a ReLU activation function; y is out Representing the final output, [;]representing the splice operation, sig (·) represents the Sigmiod activation function.
As a further improvement of the invention, the method for carrying out cluster analysis on the output of the full connection layer by using a spectral clustering algorithm to obtain a cluster to which each sample belongs comprises the following steps:
taking the output of the full connection layer as input data to obtain a feature matrix; each row represents a sample and each column represents a feature;
then, the similarity matrix is calculated: constructing a similarity matrix W according to input data, and calculating the similarity between samples;
then construct an adjacency graph: converting the similarity matrix into a weighted undirected graph, wherein nodes represent samples and the weights of edges represent the similarity between the samples;
then, similarity matrix calculation is carried out: for the adjacency graph, calculating the degree of each node;
and then carrying out Laplace matrix L calculation: calculating a Laplace matrix;
then, characteristic value decomposition is carried out: decomposing the eigenvalue of the Laplace matrix, taking the first k eigenvalues and calculating the characteristics thereofSign vector u= { U 1 ,u 2 ,u 3 ,…,u k },U∈R n*k K is a positive integer;
then select feature vectors: selecting corresponding feature vectors as the basis of clustering according to the feature values;
and then clustering: taking the selected feature vector as input, and clustering samples by using a K-means clustering algorithm;
finally, a clustering result is obtained: and obtaining a cluster to which each sample belongs according to the output of the clustering algorithm.
As a further improvement of the invention, the calculation formula of the process of carrying out cluster analysis on the output of the full-connection layer by utilizing the spectral clustering algorithm is as follows:
L=D-W,
L rw =D -1 L,
wherein d (v) i ,v j ) Representing the euclidean distance between two samples, σ represents the scale parameter.
In a second aspect, the present invention provides a distributed resource data clustering method system, including:
the data acquisition module is used for acquiring various power curve data of the distributed resource and converting the power curve data into tensor-form input data;
the feature extraction module is used for inputting the input data into a CNN model for feature extraction, and the CNN model comprises a ResNet, a detail feature extraction module and a spatial attention module; capturing detail information in the power curve data by adopting a detail feature extraction module in the encoding stage; in the decoding stage, adopting a spatial attention module to dynamically adjust the characteristic weights of different positions, reconstructing the characteristic weights, and outputting the characteristic weights through a full connection layer;
and the cluster analysis module is used for carrying out cluster analysis on the output of the full-connection layer by utilizing a spectral clustering algorithm to obtain a cluster to which each sample belongs.
In a third aspect, the present invention provides an electronic device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the distributed resource data clustering method when executing the computer program.
Fourth aspect the present invention provides a computer readable storage medium storing a computer program which when executed by a processor implements the distributed resource data clustering method.
Compared with the prior art, the invention has the following beneficial effects:
the invention provides a distributed resource data clustering method based on detail feature reinforcement and space attention by combining a deep learning algorithm and a clustering algorithm, which comprises the steps of firstly preparing corresponding data, distributing distributed resources, namely various power curves, converting input data into tensor forms which can be processed by a CNN model, inputting the tensor forms into the CNN model for feature extraction, and acquiring detail information which is extracted by a simple CNN in a coding stage, so that a detail feature extraction module is introduced for capturing the detail information in the power curve data; the module can effectively extract local features in the power curve through multi-layer convolution operation, so that the expression capacity of the model is enhanced. A spatial attention module is introduced in the decoding stage, so that the model can dynamically adjust the feature weights of different positions, so that the model is more focused on the region beneficial to the clustering task, and the clustering precision of the model is improved. And in addition, reconstructing the features processed by the detail feature extraction and spatial attention module in the decoding stage so as to retain important information. And then mapping the features to a final clustering result space through a full connection layer to prepare for the input of a spectral clustering algorithm. And finally, carrying out cluster analysis on the output of the full-connection layer by utilizing a spectral clustering algorithm, thereby realizing intelligent clustering of the distributed resources. The invention not only obtains remarkable technical breakthrough in the aspect of power curve data processing, but also brings remarkable beneficial effects in the application of distributed resource data clustering, and provides a high-efficiency and accurate solution for intelligent clustering of distributed resources.
Drawings
FIG. 1 is a flow chart of a distributed resource data clustering method of the present invention;
FIG. 2 is a basic flow chart of the present invention;
FIG. 3 is a schematic diagram of a detailed feature extraction module according to the present invention;
FIG. 4 is a schematic diagram of a spatial attention module configuration of the present invention;
FIG. 5 is a system schematic diagram of a distributed resource data clustering method according to the present invention;
fig. 6 is a schematic diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present invention and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
The invention aims to overcome the limitation of the traditional clustering method in the distributed resource data clustering, and provides a distributed resource data clustering method based on detail feature reinforcement and spatial attention. The algorithm utilizes a deep learning technology to extract characteristics of the power curve data of the electric appliance, and processes the characteristics through a detail characteristic strengthening module and a space attention module, so that more representative characteristic vectors are obtained. And inputting the processed characteristics into a spectral clustering model to realize intelligent clustering of the distributed resources.
As shown in fig. 1, a first object of the present invention is to provide a distributed resource data clustering method, which includes:
s1, acquiring various power curve data of distributed resources, and converting the power curve data into tensor-form input data;
s2, inputting the input data into a CNN model for feature extraction, wherein the CNN model comprises a ResNet, a detail feature extraction module and a spatial attention module; capturing detail information in the power curve data by adopting a detail feature extraction module in the encoding stage; in the decoding stage, adopting a spatial attention module to dynamically adjust the characteristic weights of different positions, reconstructing the characteristic weights, and outputting the characteristic weights through a full connection layer;
and S3, carrying out cluster analysis on the output of the full-connection layer by using a spectral clustering algorithm to obtain a cluster to which each sample belongs.
The invention can fully excavate the information in the distributed resource, improve the clustering precision and provide an effective technical means for resource management in the actual application scene. Meanwhile, the technology has strong practicability and popularization value, and has positive significance for promoting intelligent management of distributed resources. The strong advantage of CNN in feature extraction is combined, and the salient expression of a spectral clustering algorithm in a clustering method is combined.
As some examples, the model employed by the present invention is described as follows:
(1) Model training: the network model includes a backbone network, resNet18, a Detail Feature Extraction Module (DFEM) and a Spatial Attention Module (SAM); under the combined action of the modules, time series data can be well extracted and features can be mapped to a clustering space, so that preparation is made for subsequent clustering tasks.
(2) Spectral clustering prediction: features passing through the full connection layer are mapped to a high-dimensional vector space, a similarity matrix is constructed by using the high-dimensional feature vectors, and a spectral clustering algorithm projects the high-dimensional features into a low-dimensional feature space by using the constructed similarity matrix, so that similar samples in the space are more similar. And then normalizing or converting the similarity matrix to obtain a Laplace matrix, mapping the samples into a new feature space by calculating feature vectors of the Laplace matrix, generally selecting the first several feature vectors of the Laplace matrix as new feature representations, clustering the samples in a higher-dimensional feature space, and finally dividing the samples into different clustering clusters according to the relative position relationship in the mapped feature space.
The invention thus has the following advantages:
feature extraction capability: according to the invention, the ResNet is introduced to perform feature extraction, so that abundant feature information can be efficiently extracted from electric appliance power curve data, and the ResNet is used as a deep neural network structure, so that the feature extraction capability can be effectively improved when a power curve with a complex mode and a rule is processed.
And (5) strengthening detail information: through the detail characteristic strengthening module, the invention can strengthen detail information when fusing the characteristics of adjacent scales; this enables the clustering model to capture small changes in the power curve more sharply, thereby improving the accuracy of clustering.
Introduction of spatial concerns: the spatial attention module introduced in the decoding stage can weight local characteristics in specific areas, which means that the algorithm can pay attention to the importance of certain areas in the power curve, so that the model treats information of different areas more pertinently, and the attention mechanism enables the clustering model to have stronger perceptibility on key parts of the power curve.
High-efficiency full connection layer output: through the output of the full connection layer, the invention converts the high-level abstract features extracted by the deep learning model into feature vectors which can be processed by a spectral clustering algorithm; this reduces the complexity of the clustering model and provides a more representative input for spectral clustering. And (3) improving clustering accuracy: the invention comprehensively utilizes the deep learning method and the spectral clustering technology, and can obtain more accurate clustering results in the distributed resource data clustering task; by means of depth feature extraction of the power curve and application of the efficient clustering model, the method is excellent in performance in complex scenes, and clustering accuracy and robustness are improved.
As an alternative embodiment of the present invention, firstly, when processing time series data such as a power curve, the present invention often needs to pay attention to subtle changes and detailed features in the data, which are very important for distinguishing different devices or situations, however, the conventional feature extraction method may not capture the detailed information well, so that a special module needs to be designed to enhance the extraction capability of the spatial information; second, the power curve data typically contains features of different scales, such as transient and persistent variations, and fusing features of adjacent scales can help the model more fully understand the characteristics of the data. Therefore, the design of a detail feature extraction module to realize the fusion of adjacent scale information and capture and strengthen detail information has strong practicability. The module can strengthen the extraction capability of detail information, can realize the fusion of adjacent scale information, finely process different scale characteristics and enhance the expression capability of a model, so that the clustering model can better adapt to the characteristics of time sequence data such as a power curve and the like, and the accuracy and the robustness of a clustering effect are improved.
The specific technical description is as follows: the detail feature extraction module receives feature information from two adjacent scales of ResNet, namely when the two adjacent scales are extracted, firstly, x is calculated a A maximum pooling downsampling is performed, the features are compressed to half of the original,the calculation amount of the model can be reduced while important feature information is maintained. Then a 1X 1 convolution is carried out on the information, the number of channels is compressed to be half of the original number, thus the information among the channels can be linearly combined on the premise of not changing the space dimension of the feature map, and then another feature x is carried out b Performing a 1 x 1 convolution to extract useful local feature information; and then, adding and subtracting semantic features obtained by the two operations respectively, so that mutual information between the features is introduced, common information can be reserved by the adding operation, and the difference between the two operations can be highlighted by the subtracting operation, so that the features are richer and more diversified. And then respectively carrying out 3X 3 convolution, so that the characteristics can be further extracted, and the characteristics are more representative; then get x a ' and x b 'A'; finally x is a ' and x b ' adding to get the final output y out . In general, the module performs refining and extraction of feature information from two adjacent scales through a series of convolution, pooling and feature fusion operations, thereby enhancing the expressive power and performance of the model.
As an alternative embodiment of the present invention, for the time series data such as the power curve, the information of different time periods or areas may have different importance, while the conventional attention mechanism simply gives the same attention to different areas, and cannot flexibly distinguish the importance of different areas, so a module needs to be designed to dynamically adjust the feature weights, so that the model can treat the information of different areas more specifically. The design of the spatial attention module enables the model to better sense the importance of each region in the input data, and the model can pay attention to the important regions more pertinently by carrying out weighting processing on the specific regions, so that the sensing capability of the model on the spatial information is improved; moreover, the spatial attention module dynamically adjusts the feature weights, so that the model has higher flexibility and expression capability when processing information of different areas, the model can be better adapted to the characteristics of data such as a power curve, and the accuracy and the robustness of the clustering model are improved. In practical applications, the time sequence data of the power curve may be affected by various factors, the importance of different areas may change along with the time, and the design space attention module may enable the model to flexibly cope with the complexity, so that the adaptability of the model is improved.
The specific technical description is as follows: the module consists of two branches. First for input feature x in Respectively carrying out maximum pooling and average pooling to respectively obtain x 1 And x 2 The salient features and the average distribution features of the input features are extracted respectively. Then to x 1 Performing a 1 x 1 convolution to extract more useful features yields x 1 ' then x 1 ' and x 2 Performing addition operation to obtain x by combining the double-branch characteristics 2 ' then x 2 ' performing a 3 x 3 convolution results in a more refined feature x 2 ", then is combined with x 1 The 'addition operation' performs fusion to obtain x 1 "C"; then the obtained x 1 "AND x 2 Splicing to obtain a richer feature, performing 1×1 convolution, performing Sigmiod activation, and performing weighted multiplication with the input feature to obtain output y out . The module is used as a part of a distributed resource data clustering method based on detail feature reinforcement and spatial attention, and is technically characterized in that attention degrees of different areas of input data are reinforced by dynamically adjusting feature weights, so that the perception capability of a model on spatial information is improved, and the adaptability and the expression capability of the model in a distributed resource data clustering task are enhanced.
As an alternative embodiment of the invention, the invention applies a spectral clustering algorithm to the output of the deep learning model to perform the final clustering. Because the deep learning network has strong feature learning capability when processing complex data, the high-level abstract feature information can be extracted from the original data; the output of the deep learning network is input into a clustering algorithm, so that the feature learning capability of the deep learning can be fully exerted, and the global information utilization capability of clustering is combined, thereby improving the clustering effect. However, the traditional clustering algorithm such as K-Means has poor cluster division effect on non-convex shapes, and is easy to divide complex clusters into a plurality of small clusters; however, the spectral clustering algorithm can find complex non-convex clusters by using a spectral decomposition technology through representing data points as nodes of a graph, thereby meeting the requirement of processing the complex clusters in actual data. In the distributed resource data clustering task, the electrical appliance power curve data often has higher complexity and nonlinear characteristics, and the spectral clustering algorithm is suitable for a nonlinear separable data set, so that the intrinsic complex structure and mode of the data can be captured; in addition, the spectral clustering algorithm is insensitive to the distribution form of the data and the number of clusters, so that the method is suitable for data sets in various forms and can flexibly adapt to different distributed resource data clustering scenes.
Technical description of spectral clustering algorithm: first, data preparation is performed: and taking the output of the full connection layer as input data to obtain a feature matrix. Each row represents a sample and each column represents a feature. Then, the similarity matrix is calculated: and constructing a similarity matrix W according to the input data, and calculating the similarity between samples. Then construct an adjacency graph: the similarity matrix is converted into a weighted undirected graph in which nodes represent samples and the weights of edges represent the similarity between the samples. Then, the calculation of the degree matrix D is performed: for the adjacency graph, the degree of each node (the sum of the weights of the edges to which the degree finger nodes connect) is calculated. And then calculating the Laplace matrix L: a laplace matrix is calculated. Then, characteristic value decomposition is carried out: performing eigenvalue decomposition on the Laplace matrix, taking the first k eigenvalues and calculating the eigenvector U= { U 1 ,u 2 ,u 3 ,…,u k },U∈R n*k . Then select feature vectors: and selecting the corresponding feature vector as a clustering basis according to the feature value. The first few eigenvectors with smaller eigenvalues are typically chosen. And then clustering: and taking the selected feature vector as input, and clustering samples by using a K-means clustering algorithm. Finally, a clustering result is obtained: and obtaining a cluster to which each sample belongs according to the output of the clustering algorithm.
The present invention will be described in detail with reference to specific embodiments and drawings.
A distributed resource data clustering method based on detail feature reinforcement and spatial attention in the embodiment of the invention is shown in fig. 2. In the encoding stage, in order to effectively process a power curve with a complex mode and a rule, resNet is utilized to perform feature extraction, so that abundant feature information can be efficiently extracted from electric appliance power curve data. Considering that the feature fine granularity extracted by a simple ResNet structure is insufficient, the detail features of a power curve can not be captured, so that the detail information can be emphasized when features of adjacent scales are fused by adopting a detail feature strengthening module; this enables the clustering model to capture small changes in the power curve more sharply, thereby improving the accuracy of clustering. However, there may be some critical time periods or specific power variations in the power curve data, and for clustering tasks, the information of these regions may be more important, so the present invention adds a spatial attention module in the decoding stage, and may selectively enhance the feature expression of the region of interest, so as to better capture the characteristics thereof. Moreover, different characteristic distributions may exist in the power curves of different devices, and the model can adaptively process the characteristics of different power curves through the introduction of the spatial attention module, so that the clustering model has more universality and adaptability. The invention converts the high-level abstract features extracted by the deep learning model into feature vectors which can be processed by the spectral clustering algorithm through the full connection layer, and provides more representative input for the subsequent spectral clustering algorithm. Finally, a spectral clustering algorithm is applied, and because in a distributed resource data clustering task, the electrical appliance power curve data often has higher complexity and nonlinear characteristics, the spectral clustering algorithm is applicable to a nonlinear separable data set, and the inherent complex structure and mode of the data can be captured; in addition, the spectral clustering algorithm is insensitive to the distribution form of the data and the number of clusters, so that the method is suitable for data sets in various forms and can flexibly adapt to different distributed resource data clustering scenes. The complete architecture of the model is shown in fig. 2.
As shown in fig. 3, the main network firstly adopts the res net18 to extract the features, the res net is a deep neural network structure, when processing a power curve with a complex mode and a rule, the feature extraction capability can be effectively improved, and the res net18 can ensure the feature extraction capability and reduce the model complexity. In the deep learning model, as information is transmitted to a deep network, the problem of gradient disappearance or gradient explosion easily occurs, so that part of detail features are difficult to effectively reserve and use; in addition, for the existing distributed resource data clustering task, tiny fluctuation in the power curve often contains important information, subtle differences can exist in the power curves of different devices, the differences often appear on detailed information, and a traditional deep learning model can not sufficiently capture the microscopic changes. Therefore, the invention designs a detail characteristic strengthening module, aims at relieving the problems, ensures that the model can fully utilize detail information in the power curve, and enables the model to capture tiny changes in the power curve more sharply, thereby improving the differentiation degree of the clustering model and enabling the clustering model to better distinguish differences among different equipment or working conditions. The specific implementation process is as follows:
the detail feature extraction module receives feature information from two adjacent scales of ResNet, namely when the two adjacent scales are extracted, firstly, x is calculated a And (3) carrying out maximum pooling downsampling, compressing the features into half of the original features, reducing the calculation amount of the model, and simultaneously retaining important feature information. Then a 1X 1 convolution is carried out on the information, the number of channels is compressed to be half of the original number, thus the information among the channels can be linearly combined on the premise of not changing the space dimension of the feature map, and then another feature x is carried out b Performing a 1 x 1 convolution to extract useful local feature information; and then, adding and subtracting semantic features obtained by the two operations respectively, so that mutual information between the features is introduced, common information can be reserved by the adding operation, and the difference between the two operations can be highlighted by the subtracting operation, so that the features are richer and more diversified. And then respectively carrying out 3X 3 convolution, so that the characteristics can be further extracted, and the characteristics are more representative; then get x a ' and x b 'A'; finally, willx a ' and x b ' adding to get the final output y out . In general, the module performs refining and extraction of feature information from two adjacent scales through a series of convolution, pooling and feature fusion operations, thereby enhancing the expressive power and performance of the model. The calculation formula of the above process is as follows:
x a ′=Conv 3×3 (Conv 1×1 (Maxpool(x a ))+Conv 1×1 (x b )),
x b ′=Conv 3×3 (Conv 1×1 (x b )-Conv 1×1 (Maxpool(x a ))),
y out =x a ′+x b ′.
in the formula, conv 1×1 (. Cndot.) represents a two-dimensional convolution with a convolution kernel size of 1, a batch normalization and a ReLU activation function, conv 3×3 (. Cndot.) represents a two-dimensional convolution with a convolution kernel size of 3, batch normalization, and a ReLU activation function. MaxPool (·) represents maximum pooling. Wherein x is a And x b Representing two different scale features generated by ResNet, respectively.
As shown in fig. 4, the features output by the detail feature enhancement module are feature semantics with finer granularity, and how to distinguish some key time periods and specific power changes in the semantics with higher fine granularity and reduce the influence of irrelevant noise is important at this time, so that an attention mechanism is introduced, however, the conventional spatial attention mechanism cannot meet the requirement of the task, specifically is that: the data characteristics of the distributed resource have complex correlation, so that the simple linear weight combination may not capture the correlation relation of the input data well, and the information is lost to a certain extent.
Therefore, the spatial attention module is adopted and introduced in the decoding stage, so that the feature expression of the region of interest can be selectively enhanced, and the characteristics of the region of interest can be better captured. Moreover, different characteristic distributions may exist in the power curves of different devices, and the model can adaptively process the characteristics of different power curves through the introduction of the spatial attention module, so that the clustering model has more universality and adaptability. The specific implementation process is as follows:
the module consists of two branches. First for input feature x in Respectively carrying out maximum pooling and average pooling to respectively obtain x 1 And x 2 The salient features and the average distribution features of the input features are extracted respectively. Then to x 1 Performing a 1 x 1 convolution to extract more useful features yields x 1 ' then x 1 ' and x 2 Performing addition operation to obtain x by combining the double-branch characteristics 2 ' then x 2 ' performing a 3 x 3 convolution results in a more refined feature x 2 ", then is combined with x 1 The 'addition operation' performs fusion to obtain x 1 "C"; then the obtained x 1 "AND x 2 Splicing to obtain a richer feature, performing 1×1 convolution, performing Sigmiod activation, and performing weighted multiplication with the input feature to obtain output y out . The module is used as a part of the distributed resource data clustering method, and is technically characterized in that the attention degree of different areas of input data is enhanced by dynamically adjusting the feature weight, so that the perception capability of the model on spatial information is improved, and the adaptability and the expression capability of the model in the distributed resource data clustering task are enhanced. The calculation formula of the above process is as follows:
x 1 ′=Conv 1×1 (Maxpool(x in )),
x 2 ′=x 1 ′+Avgpool(x in ),
x 1 ″=Conv 3×3 (x 2 ′)+x 1 ′,
in the formula, avgPool (·) represents global average pooling, maxPool (·) represents global maximum pooling;representing an element-by-element multiplication. Conv 1×1 (. Cndot.) represents a two-dimensional convolution with a convolution kernel size of 1, a batch normalization and a ReLU activation function, conv 3×3 (. Cndot.) represents a two-dimensional convolution with a convolution kernel size of 3, batch normalization, and a ReLU activation function. y is out Representing the final output. [ (r) ];]representing the splice operation, sig (·) represents the Sigmiod activation function.
The invention converts the high-level abstract features extracted by the deep learning model into feature vectors which can be processed by the spectral clustering algorithm through the full connection layer, and provides more representative input for the subsequent spectral clustering algorithm.
Finally, a spectral clustering algorithm is applied, and because in a distributed resource data clustering task, the electrical appliance power curve data often has higher complexity and nonlinear characteristics, the spectral clustering algorithm is applicable to a nonlinear separable data set, and the inherent complex structure and mode of the data can be captured; in addition, the spectral clustering algorithm is insensitive to the distribution form of the data and the number of clusters, so that the method is suitable for data sets in various forms and can flexibly adapt to different distributed resource data clustering scenes. Compared with some traditional clustering algorithms, the influence of the spectral clustering on noise and outliers is relatively small, and the robustness of the clustering can be improved to a certain extent. The specific implementation process of the spectral clustering algorithm is as follows:
first, data preparation is performed: and taking the output of the full connection layer as input data to obtain a feature matrix. Each row represents a sample and each column represents a feature. Then, the similarity matrix is calculated: and constructing a similarity matrix W according to the input data, and calculating the similarity between samples. Then construct an adjacency graph: the similarity matrix is converted into a weighted undirected graph in which nodes represent samples and the weights of edges represent the similarity between the samples. Then, the similarity matrix D is calculated: for the adjacency graph, the degree of each node (the sum of the weights of the edges to which the degree finger nodes connect) is calculated. And then calculating the Laplace matrix L: a laplace matrix is calculated. Then, characteristic value decomposition is carried out: decomposing the eigenvalue of the Laplace matrix, taking the first k eigenvalues and calculating the eigenvectorQuantity u= { U 1 ,u 2 ,u 3 ,…,u k },U∈R n*k . Then select feature vectors: and selecting the corresponding feature vector as a clustering basis according to the feature value. The first few eigenvectors with smaller eigenvalues are typically chosen. And then clustering: and taking the selected feature vector as input, and clustering samples by using a K-means clustering algorithm. Finally, a clustering result is obtained: and obtaining a cluster to which each sample belongs according to the output of the clustering algorithm. Wherein k is a positive integer.
The calculation formula of the above process is as follows:
L=D-W,
L rw =D -1 L,
wherein d (v) i ,v j ) Representing the euclidean distance between two samples, σ represents the scale parameter.
As shown in fig. 5, a second object of an embodiment of the present invention is to provide a distributed resource data clustering system, including:
the data acquisition module is used for acquiring various power curve data of the distributed resource and converting the power curve data into tensor-form input data;
the feature extraction module is used for inputting the input data into a CNN model for feature extraction, and the CNN model comprises a ResNet, a detail feature extraction module and a spatial attention module; capturing detail information in the power curve data by adopting a detail feature extraction module in the encoding stage; in the decoding stage, adopting a spatial attention module to dynamically adjust the characteristic weights of different positions, reconstructing the characteristic weights, and outputting the characteristic weights through a full connection layer;
and the cluster analysis module is used for carrying out cluster analysis on the output of the full-connection layer by utilizing a spectral clustering algorithm to obtain a cluster to which each sample belongs.
As shown in fig. 6, a third object of an embodiment of the present invention is to provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the distributed resource data clustering method when executing the computer program.
It is a fourth object of embodiments of the present invention to provide a computer readable storage medium storing a computer program which, when executed by a processor, implements the distributed resource data clustering method.
It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
Finally, it should be noted that: the above embodiments are only for illustrating the technical aspects of the present invention and not for limiting the same, and although the present invention has been described in detail with reference to the above embodiments, it should be understood by those of ordinary skill in the art that: modifications and equivalents may be made to the specific embodiments of the invention without departing from the spirit and scope of the invention, which is intended to be covered by the claims.

Claims (10)

1. A distributed resource data clustering method, comprising:
acquiring various power curve data of distributed resources, and converting the power curve data into tensor-form input data;
inputting the input data into a CNN model for feature extraction, wherein the CNN model comprises a ResNet, a detail feature extraction module and a spatial attention module; capturing detail information in the power curve data by adopting a detail feature extraction module in the encoding stage; in the decoding stage, adopting a spatial attention module to dynamically adjust the characteristic weights of different positions, reconstructing the characteristic weights, and outputting the characteristic weights through a full connection layer;
and carrying out cluster analysis on the output of the full-connection layer by using a spectral clustering algorithm to obtain a cluster to which each sample belongs.
2. The distributed resource data clustering method of claim 1, wherein capturing detail information in the power curve data using a detail feature extraction module in the encoding stage comprises:
receiving characteristic information x from ResNet adjacent two scales a And x b Extracting:
for characteristic x a Performing maximum pooling downsampling, compressing the feature into half of the original, then performing 1×1 convolution, compressing the number of channels into half of the original, and linearly combining the information among channels to obtain feature information x without changing the spatial dimension of the feature map a Semantic features of (2);
for characteristic x b Performing a 1×1 convolution to extract useful local feature information to obtain feature information x b Semantic features of (2);
the semantic features obtained by the two operations are added and subtracted respectively;
then respectively carrying out 3X 3 convolution to further extract the features; then get x a ' and x b 'A'; finally x is a ' and x b ' adding to get the final output y out
3. The distributed resource data clustering method according to claim 2, wherein the calculation formula of the processing procedure of the detail feature extraction module is as follows:
x a ′=Conv 3×3 (Conv 1×1 (Maxpool(x a ))+Conv 1×1 (x b )),
x b ′=Conv 3×3 (Conv 1×1 (x b )-Conv 1×1 (Maxpool(x a ))),
y out =x a ′+x b ′.
in the formula, conv 1×1 (. Cndot.) represents a two-dimensional convolution with a convolution kernel size of 1, a batch normalization and a ReLU activation function, conv 3×3 (. Cndot.) represents a two-dimensional convolution with a convolution kernel size of 3, batch normalization, and a ReLU activation function; maxPool (& gt)) Representing maximum pooling; wherein x is a And x b Representing two different scale features generated by ResNet, respectively.
4. The method of claim 1, wherein the step of dynamically adjusting and reconstructing feature weights at different positions using a spatial attention module during a decoding stage comprises:
first for input feature x in Respectively carrying out maximum pooling and average pooling to respectively obtain x 1 And x 2 The method comprises the steps of carrying out a first treatment on the surface of the Then to x 1 Performing a 1 x 1 convolution to extract features to obtain x 1 ' then x 1 ' and x 2 Performs an addition operation and then adds x 2 ' performing a 3 x 3 convolution to obtain feature x 2 ", then is combined with x 1 The 'addition operation' performs fusion to obtain x 1 "C"; then the obtained x 1 "AND x 2 Splicing, then carrying out 1X 1 convolution, then carrying out Sigmiod activation, and finally carrying out weighted multiplication on the obtained product and the input characteristics to obtain a final output y out
5. The method of claim 4, wherein the processing of the spatial attention module is calculated as follows:
x 1 ′=Conv 1×1 (Maxpool(x in )),
x 2 ′=x 1 ′+Avgpool(x in ),
x 1 ″=Conv 3×3 (x 2 ′)+x 1 ′,
wherein AvgPool (·) represents global average pooling and MaxPool (·) represents global maximum pooling;representing element-by-element multiplication; conv 1×1 (. Cndot.) represents a two-dimensional convolution with a convolution kernel size of 1, a batch normalization and a ReLU activation function, conv 3×3 (. Cndot.) represents a two-dimensional convolution with a convolution kernel size of 3, batch normalization, and a ReLU activation function; y is out Representing the final output, [;]representing the splice operation, sig (·) represents the Sigmiod activation function.
6. The method for clustering distributed resource data according to claim 1, wherein the performing cluster analysis on the output of the full connection layer by using a spectral clustering algorithm to obtain a cluster to which each sample belongs includes:
taking the output of the full connection layer as input data to obtain a feature matrix; each row represents a sample and each column represents a feature;
and (4) calculating a similarity matrix: constructing a similarity matrix W according to input data, and calculating the similarity between samples;
constructing an adjacency graph: converting the similarity matrix into a weighted undirected graph, wherein nodes represent samples and the weights of edges represent the similarity between the samples;
and (3) similarity matrix calculation: for the adjacency graph, calculating the degree of each node;
and (4) carrying out Laplace matrix L calculation: calculating a Laplace matrix;
and (3) performing eigenvalue decomposition: performing eigenvalue decomposition on the Laplace matrix, taking the first k eigenvalues and calculating the eigenvector U= { U 1 ,u 2 ,u 3 ,…,u k },U∈R n*k K is a positive integer;
selecting a feature vector: selecting corresponding feature vectors as the basis of clustering according to the feature values;
clustering: taking the selected feature vector as input, and clustering samples by using a K-means clustering algorithm;
and (3) obtaining a clustering result: and obtaining a cluster to which each sample belongs according to the output of the clustering algorithm.
7. The method for clustering distributed resource data according to claim 6, wherein the calculation formula of the process of performing cluster analysis on the output of the full connection layer by using a spectral clustering algorithm is as follows:
L=D-W,
L rw =D -1 L,
wherein d (v) i ,v j ) Representing the euclidean distance between two samples, σ represents the scale parameter.
8. A distributed resource data clustering system, comprising:
the data acquisition module is used for acquiring various power curve data of the distributed resource and converting the power curve data into tensor-form input data;
the feature extraction module is used for inputting the input data into a CNN model for feature extraction, and the CNN model comprises a ResNet, a detail feature extraction module and a spatial attention module; capturing detail information in the power curve data by adopting a detail feature extraction module in the encoding stage; in the decoding stage, adopting a spatial attention module to dynamically adjust the characteristic weights of different positions, reconstructing the characteristic weights, and outputting the characteristic weights through a full connection layer;
and the cluster analysis module is used for carrying out cluster analysis on the output of the full-connection layer by utilizing a spectral clustering algorithm to obtain a cluster to which each sample belongs.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, the processor implementing the distributed resource data clustering method of any one of claims 1-7 when the computer program is executed.
10. A computer readable storage medium, characterized in that the computer readable storage medium stores a computer program which, when executed by a processor, implements the distributed resource data clustering method of any one of claims 1-7.
CN202311698120.9A 2023-12-09 2023-12-09 Distributed resource data clustering method and system Pending CN117633574A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311698120.9A CN117633574A (en) 2023-12-09 2023-12-09 Distributed resource data clustering method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311698120.9A CN117633574A (en) 2023-12-09 2023-12-09 Distributed resource data clustering method and system

Publications (1)

Publication Number Publication Date
CN117633574A true CN117633574A (en) 2024-03-01

Family

ID=90016249

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311698120.9A Pending CN117633574A (en) 2023-12-09 2023-12-09 Distributed resource data clustering method and system

Country Status (1)

Country Link
CN (1) CN117633574A (en)

Similar Documents

Publication Publication Date Title
Song et al. Monocular depth estimation using laplacian pyramid-based depth residuals
EP4156017A1 (en) Action recognition method and apparatus, and device and storage medium
CN109829537B (en) Deep learning GAN network children's garment based style transfer method and equipment
Shi et al. Star: Sparse transformer-based action recognition
CN114493014A (en) Multivariate time series prediction method, multivariate time series prediction system, computer product and storage medium
CN112818407B (en) Video privacy protection method based on generation countermeasure network
CN116152611B (en) Multistage multi-scale point cloud completion method, system, equipment and storage medium
Liu et al. A novel local texture feature extraction method called multi-direction local binary pattern
Kakillioglu et al. 3D capsule networks for object classification with weight pruning
Guo et al. 3d-pruning: A model compression framework for efficient 3d action recognition
Yihui et al. Pyramid Matting: A resource-adaptive multi-scale pixel pair optimization framework for image matting
Zheng Stack-YOLO: A friendly-hardware real-time object detection algorithm
CN113205137A (en) Image identification method and system based on capsule parameter optimization
CN111209530A (en) Tensor decomposition-based heterogeneous big data factor feature extraction method and system
CN117633574A (en) Distributed resource data clustering method and system
Rui et al. EDite-HRNet: Enhanced Dynamic Lightweight High-Resolution Network for Human Pose Estimation
CN111767419A (en) Picture searching method, device, equipment and computer readable storage medium
Zhang et al. FPGA-based implementation of hand gesture recognition using convolutional neural network
CN115984911A (en) Attribute generation countermeasure network and face image continuous transformation method based on same
Samad et al. SCMA: exploring dual-module attention with multi-scale kernels for effective feature extraction
Thu et al. Ec2net: Efficient attention-based cross-context network for near real-time salient object detection
Yu et al. A multi-view fusion method via tensor learning and gradient descent for image features
CN110910029A (en) Power load clustering method and system
CN117036862B (en) Image generation method based on Gaussian mixture variation self-encoder
CN116126931B (en) Power consumption data mining method, device and system for power distribution area and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination