A data feature extraction method, system and computer device
By using deep neural networks to extract features and perform clustering in federated learning, it solves the problem of difficulty in characterizing the statistical characteristics of heterogeneous data, improves model performance, and enables it to provide higher-quality predictions when facing unknown data and working conditions. result.
Patent Information
- Application Number
- CN202410591472.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-14
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2044-05-14
AI Technical Summary
In federated learning, the statistical characteristics of heterogeneous data are difficult to characterize, resulting in model parameters that may not converge, affecting model performance.
By using a deep neural network locally on the client to extract feature data sets, and constructing a distance matrix for clustering, the clustering centers are obtained, and then the clustering centers are further clustered to extract private data features.
On the premise of protecting data privacy, it can effectively characterize the statistical characteristics of private data, improve the training effect of federated learning on heterogeneous data, improve model performance, and provide higher-quality prediction results when facing unknown data and working conditions.
Smart Images

Figure CN118171076B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of feature extraction, and in particular to a data feature extraction method, system and computer equipment. Background Art
[0002] During the AI model training process, data sharing can greatly improve model performance, allowing the model to provide higher quality optimization and prediction results when faced with unknown data types and working conditions.
[0003] During the AI model training process, model builders often use federated learning technology to obtain data from multiple clients for knowledge sharing. In order to protect the data privacy of multiple clients while sharing knowledge, federated learning technology replaces direct data transmission with encrypted data transmission, so that the original data does not leave the local area, thereby protecting the privacy and security of the data.
[0004] However, when aggregating encrypted data from multiple clients, the heterogeneity of private data makes it difficult to characterize its statistical characteristics, which may cause the model parameters of federated learning to fail to converge, resulting in reduced model performance. Therefore, while protecting data privacy and security, feature processing methods for heterogeneous data are crucial for model aggregation. Summary of the invention
[0005] In view of the problem that federated learning has poor processing effect on heterogeneous data and is difficult to characterize its statistical characteristics, the present invention provides a data feature extraction method, comprising the following steps:
[0006] Obtain privacy sample data sets from multiple clients;
[0007] The data in the multiple privacy sample data sets are respectively input into the deep neural network for feature extraction to obtain multiple feature data sets; a first distance matrix is established according to the feature points of the multiple feature data sets. L , for the first distance matrix L Perform clustering to obtain the cluster center of each client's privacy sample data set;
[0008] The cluster centers of the multiple clients are sent to the model building end, a second distance matrix is built according to the cluster centers of the multiple clients, and the second distance matrix is re-clustered to obtain the privacy data features.
[0009] Preferably, the multiple privacy sample data sets are respectively input into a deep neural network for feature extraction to obtain multiple feature data sets, including the following steps:
[0010] Input the sample information statistics in the privacy sample data set into the deep neural network, and decompose the sample information statistics into multiple Gaussian distributions according to the mapping function of the deep neural network;
[0011] Determine the variance and mean of multiple Gaussian distributions;
[0012] The variance and mean of multiple Gaussian distributions are used as output features to obtain multiple feature data sets.
[0013] Preferably, the first distance matrix is established based on the feature points of the plurality of feature data sets. L , including the following steps:
[0014] Calculate the weight of the data point according to the similarity between two adjacent data points in the feature data set, and construct a weight matrix W according to the obtained weight;
[0015] The sum of the weights of all edges directly connected to the data points in the feature data set is defined as the degree, and a diagonal matrix D is constructed based on the obtained multiple degrees;
[0016] The first distance matrix L is obtained by subtracting D and W.
[0017] Preferably, clustering the first distance matrix comprises the following steps:
[0018] Use the Higg cut function to L Perform eigenvalue decomposition, select the eigenvector corresponding to the second smallest non-zero eigenvalue decomposed, select the first m nodes according to the eigenvector sorting, and combine the m eigenvectors corresponding to the first m nodes into a Matrix H of dimension;
[0019] Cluster each row of the matrix H as a sample, randomly specify l objects as cluster centers, and assign the samples to the classes represented by each cluster center according to the distance from each sample to the cluster center;
[0020] The mean of each category is obtained, and the mean is used as the cluster center for re-clustering, and the iteration is continued until the clustering requirements are met.
[0021] Preferably, the Higg cut function is:
[0022]
[0023] In the formula, Represents the distance between vertices; Represent all of and; represents the degree of A, that is, the sum of the weights of all vertices connected to A. is the weight of the edge between two points;
[0024] Among them, let:
[0025] In the formula, is the weight of the edge between two points, U is the orthogonal matrix of W, is a symmetric matrix of W.
[0026] Preferably, the weights of the data points are calculated based on the similarity between two adjacent data points in the feature data set, and a weight matrix is constructed based on the obtained weights. W , including the following steps:
[0027] Step 1: Set up a k value, according to the k The value is selected to be the closest to the data point in the feature dataset k vertices;
[0028] Step 2: Calculation k The distance between the vertex and the data point is used to obtain the weight between the two points; if one of the two data points is not in the other k In the set of nearest vertices, the weight between two data points is 0;
[0029] Step 3: Repeat steps 1 and 2 until the weights between all data points are obtained;
[0030] Step 4: Construct a weight matrix by weights between all data points.
[0031] Preferably, setting a k value comprises the following steps:
[0032] Specifying a plurality of non-adjacent k values in the feature data set, drawing a first clustering performance index curve according to the plurality of non-adjacent k values, finding an inflection point through the first clustering performance index curve, and using the inflection point as an initial inflection point;
[0033] Taking the initial inflection point as a reference, a second clustering performance index curve is drawn according to continuous k values in the interval where the initial inflection point is located, and a new inflection point is found through the second clustering performance index curve, and the new inflection point is used as the set k value.
[0034] Preferably, it also includes non-privacy data feature extraction, which specifically includes the following steps:
[0035] Obtain non-private sample meta information;
[0036] Encode the non-privacy sample meta-information to form a matrix;
[0037] The similar information in the association matrix is obtained, and the encoded information is multiplied with weight matrices of different dimensions to output non-private data features.
[0038] The present invention also provides a data feature extraction system, comprising:
[0039] The data set acquisition module is used to obtain the privacy sample data sets of multiple clients;
[0040] The cluster center acquisition module is used to input the data in multiple privacy sample data sets into the deep neural network for feature extraction to obtain multiple feature data sets; establish the first distance matrix based on the feature points of the multiple feature data sets L ; For the first distance matrix L Perform clustering to obtain the cluster center of each client's privacy sample data set;
[0041] The privacy data feature extraction module is used to send the cluster centers of multiple clients to the model building end, build a second distance matrix according to the cluster centers of multiple clients, and re-cluster the second distance matrix to obtain privacy data features.
[0042] The present invention also provides a computer device, comprising a memory and a processor; the memory stores a computer program, and the processor is used to run the computer program in the memory to execute the feature extraction method.
[0043] Compared with the prior art, the data feature extraction method, system and computer device provided by the present invention have the following beneficial effects:
[0044] The present invention uses a deep neural network to extract a feature data set locally on the client, establishes a distance matrix for the feature points of the feature data set, and clusters the distance matrix to obtain the cluster center, so as to characterize the statistical characteristics of the privacy data under the premise of protecting the privacy of the client, and improve the training effect of federated learning on heterogeneous data; by sending the cluster centers of multiple clients to the model building end for re-clustering, the privacy data features can be extracted, thereby realizing multi-domain and multi-modal knowledge sharing, improving the model performance, and enabling the model to provide higher quality prediction results when facing unknown data and working conditions. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 The present invention provides a flow chart of the data feature extraction method. DETAILED DESCRIPTION
[0046] Example
[0047] The present invention provides a data feature extraction method, specifically as follows Figure 1 As shown, the following steps are included:
[0048] Step 1: Obtain privacy sample datasets from multiple clients.
[0049] The privacy sample data set includes personal action record information and production and business information.
[0050] Step 2: Input the data in multiple privacy sample data sets into the deep neural network for feature extraction to obtain multiple feature data sets, which specifically includes the following steps:
[0051] Input the sample information statistics in the privacy sample data set into the deep neural network, and decompose the sample information statistics into multiple Gaussian distributions according to the mapping function of the deep neural network;
[0052] Determine the variance and mean of sample information statistics through multiple Gaussian distributions;
[0053] The variance and mean of the sample information statistics are used as output features to obtain multiple feature data sets.
[0054] The neural network used in the present invention is a twin network, an autoencoder or a graph neural network, etc.
[0055] Step 3: Establish the first distance matrix based on the feature points of multiple feature data sets L , including the following steps:
[0056] (1) Calculate the weight of the data point based on the similarity between two adjacent data points in the feature data set, and construct a weight matrix based on the obtained weight W , including the following steps:
[0057] (1.1) Specify multiple non-adjacent k Value, based on multiple non-adjacent k Draw the first clustering performance index curve, find the inflection point through the first clustering performance index curve, and use the inflection point as the initial inflection point;
[0058] (1.2) Taking the initial inflection point as the reference, the continuous k The second clustering performance index curve is drawn by the second clustering performance index curve, and a new inflection point is found through the second clustering performance index curve, and the new inflection point is used as the setting k value;
[0059] (1.3) According to k The value is selected to be the closest to the data point in the feature dataset k vertices;
[0060] (1.4) Calculation k The distance between the vertex and the data point is used to get the weight between the two points; if one of the two data points is not in the other k In the set of nearest vertices, the weight between two data points is 0;
[0061] (1.5) Repeat (1.3)-(1.4) until the weights between all data points are obtained;
[0062] (1.6) Construct a weight matrix by the weights between all data points".
[0063] (2) The sum of the weights of all edges directly connected to the data points in the feature data set is defined as the degree, and a diagonal matrix D is constructed based on the obtained multiple degrees.
[0064] Set up a dataset , where each sample Contains g dimensions, which are the mean and variance of multiple Gaussian distributions decomposed by the sample. The vectors in the data set are regarded as n points in the g-dimensional space, and this undirected graph is recorded as , where the vertices are denoted by , E is the set of edges, and the weight of the edge between two points is recorded as , And when When , it means there is no connection between the two vertices. Represents the similarity between two points.
[0065] Establish the weight matrix W, where , so W is a symmetric matrix.
[0066]
[0067] The degree is defined as the sum of the weights of all edges connected to the vertex, that is, The degree matrix is defined as a diagonal matrix consisting of n degrees, that is:
[0068]
[0069] First calculate the Euclidean distance between two points , when two vertices and If both parties are in the set of k adjacent vertices of each other at the same time, then , if one of the two is not in the set of k adjacent vertices of the other, then let .
[0070]
[0071] The unnormalized Laplacian matrix is defined as L=DW.
[0072] Step 4: For the first distance matrix L Perform clustering to obtain the cluster center of each client's private sample data set.
[0073] Use the Higg cut function to perform eigenvalue decomposition on the first distance matrix, select the eigenvector corresponding to the second smallest non-zero eigenvalue decomposed, select the first m nodes according to the eigenvector sorting, and combine the m eigenvectors corresponding to the first m nodes into a A matrix H of dimension .
[0074] Higg cut function (abbreviated CC Function) is:
[0075]
[0076] In the formula, Represents the distance between vertices; Represent all of and; represents the degree of A, that is, the sum of the weights of all vertices connected to A. is the weight of the edge between two points;
[0077] Among them, let:
[0078] In the formula, is the weight of the edge between two points, U is the orthogonal matrix of W, is a symmetric matrix of W.
[0079] Select the eigenvector corresponding to the second smallest non-zero eigenvalue, select the first m nodes according to the eigenvector sorting, and combine the m eigenvectors corresponding to the first m nodes into a Dimensional matrix H, each vector in H is standardized according to the following formula:
[0080] ;
[0081] Form a segmentation matrix H, perform clustering on each row, and obtain cluster division. is a vector in the matrix H.
[0082] Step 5: Send the cluster centers of multiple clients to the model building end, build a second distance matrix based on the cluster centers of multiple clients, and re-cluster the second distance matrix to obtain privacy data features.
[0083] Randomly select k objects from the sample as the initial cluster centers, calculate the distance between each sample point and each cluster center, and assign the sample point to the cluster with the nearest distance. After the assignment is completed, update the positions of the k cluster centers to the mean of all objects in the current k clusters. If the cluster center changes, re-cluster. When the cluster center no longer changes, output the clustering result.
[0084] In the present invention, the method for constructing the second distance matrix is the same as the method for constructing the first distance matrix, and the method for re-clustering the second distance matrix is the same as the method for clustering the first distance matrix.
[0085] In addition, the present invention also includes obtaining non-private sample meta information and extracting non-private data features. The non-private sample meta information includes the sample's geographic information, overall production capacity information, and daily consumption information, and the feature extraction steps are: obtaining non-private sample meta information; encoding the non-private sample meta information to form a matrix; correlating similar information in the matrix, and using the encoded information to multiply the weight matrices of different dimensions to output non-private data features. By extracting non-private data features, the diverse meta information in actual scenarios can be effectively utilized to adapt to the analysis of more variable factors and complex tasks.
[0086] The present invention also provides a data feature extraction system, including a data set acquisition module, a cluster center acquisition module and a privacy data feature extraction module. The data set acquisition module is used to acquire privacy sample data sets of multiple clients; the cluster center acquisition module is used to input the data in the multiple privacy sample data sets into a deep neural network for feature extraction to obtain multiple feature data sets; a first distance matrix is established based on the feature points of the multiple feature data sets. L , for the first distance matrix L Clustering is performed to obtain the cluster center of the privacy sample data set of each client; the privacy data feature extraction module is used to send the cluster centers of multiple clients to the model building end, build a second distance matrix based on the cluster centers of multiple clients, and re-cluster the second distance matrix to obtain privacy data features.
[0087] The present invention also provides a computer device, comprising a memory and a processor; the memory stores a computer program, and the processor is used to run the computer program in the memory to execute the feature extraction method.
[0088] In summary, compared with the prior art, the data feature extraction method, system and computer device provided by the present invention have the following beneficial effects:
[0089] The present invention uses a deep neural network to extract a feature data set locally on the client, establishes a distance matrix for the feature points of the feature data set, and clusters the distance matrix to obtain the cluster center, so as to characterize the statistical characteristics of the privacy data under the premise of protecting the privacy of the client, and improve the training effect of federated learning on heterogeneous data; by sending the cluster centers of multiple clients to the model building end for re-clustering, the privacy data features can be extracted, thereby realizing multi-domain and multi-modal knowledge sharing, improving the model performance, and enabling the model to provide higher quality prediction results when facing unknown data and working conditions.
[0090] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.
[0091] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A data feature extraction method, characterized in that: The following steps are involved: Obtain privacy sample data sets from multiple clients; Inputting the data in the multiple privacy sample data sets into the deep neural network for feature extraction respectively to obtain multiple feature data sets; establishing a first distance matrix L according to the feature points of the multiple feature data sets, clustering the first distance matrix L, and obtaining the cluster center of the privacy sample data set of each client; The cluster centers of the multiple clients are sent to the model building end, a second distance matrix is built according to the cluster centers of the multiple clients, and the second distance matrix is re-clustered to obtain the privacy data features; Inputting multiple privacy sample data sets into the deep neural network for feature extraction respectively, and obtaining multiple feature data sets, including the following steps: Input the sample information statistics in the privacy sample data set into the deep neural network, and decompose the sample information statistics into multiple Gaussian distributions according to the mapping function of the deep neural network; Determine the variance and mean of multiple Gaussian distributions; The variance and mean of multiple Gaussian distributions are used as output features to obtain multiple feature data sets; Clustering the first distance matrix L comprises the following steps: Perform eigenvalue decomposition on the first distance matrix L using the Higg cut function, select the eigenvector corresponding to the second smallest non-zero eigenvalue decomposed, select the first m nodes according to the eigenvector sorting, and form the m eigenvectors corresponding to the first m nodes into an n×m dimension matrix H; Cluster each row of the matrix H as a sample, randomly specify l objects as cluster centers, and assign the samples to the classes represented by each cluster center according to the distance from each sample to the cluster center; The mean of each category is obtained, and the mean is used as the cluster center for re-clustering, and the iteration is continued until the clustering requirements are met.
2. The data feature extraction method according to claim 1, characterized in that: The step of establishing a first distance matrix L according to the feature points of the plurality of feature data sets comprises the following steps: Calculate the weight of the data point according to the similarity between two adjacent data points in the feature data set, and construct a weight matrix W according to the obtained weight; The sum of the weights of all edges directly connected to the data points in the feature data set is defined as the degree, and a diagonal matrix D is constructed based on the obtained multiple degrees; The first distance matrix L is obtained by subtracting D and W.
3. The data feature extraction method according to claim 2, characterized in that: The Higg cut function is: In the formula, S A Represents the distance between vertices; Represents all S A vol(A) represents the degree of A, that is, the sum of the weights of all vertices connected to A, w ij is the weight of the edge between two points, V represents the set of feature data sets, A represents the subset of data points in V, represents the complement of A; Among them, let: In the formula, w ij is the weight of the edge between two points, U is the orthogonal matrix of W, Λ is the symmetric matrix of W, and h(A) is the function used to solve the eigenvector h in the matrix H.
4. The data feature extraction method according to claim 2, characterized in that: The weight of the data point is calculated according to the similarity of two adjacent data points in the feature data set, and the weight matrix W is constructed according to the obtained weight, including the following steps: Step 1: Set a k value, and select k vertices closest to the data points in the feature data set according to the k value; Step 2: Calculate the distance between k vertices and the data point to obtain the weight between the two points; If one of the two data points is not in the set of the other's k nearest vertices, the weight between the two data points is 0; Step 3: Repeat steps 1 and 2 until the weights between all data points are obtained; Step 4: Construct a weight matrix by weights between all data points.
5. The data feature extraction method according to claim 4, characterized in that: The step of setting a k value comprises the following steps: Specifying a plurality of non-adjacent k values in the feature data set, drawing a first clustering performance index curve according to the plurality of non-adjacent k values, finding an inflection point through the first clustering performance index curve, and using the inflection point as an initial inflection point; Taking the initial inflection point as a reference, a second clustering performance index curve is drawn according to continuous k values in the interval where the initial inflection point is located, and a new inflection point is found through the second clustering performance index curve, and the new inflection point is used as the set k value.
6. The data feature extraction method according to claim 1, characterized in that: It also includes non-privacy data feature extraction, which includes the following steps: Obtain non-private sample meta information; Encode the non-privacy sample meta-information to form a matrix; The similar information in the association matrix is obtained, and the encoded information is multiplied with weight matrices of different dimensions to output non-private data features.
7. A data feature extraction system, characterized in that: include: The data set acquisition module is used to obtain the privacy sample data sets of multiple clients; A cluster center acquisition module is used to input the data in multiple privacy sample data sets into a deep neural network for feature extraction to obtain multiple feature data sets; establish a first distance matrix L according to the feature points of the multiple feature data sets; cluster the first distance matrix L to obtain the cluster center of the privacy sample data set of each client; A privacy data feature extraction module is used to send the cluster centers of multiple clients to the model building end, build a second distance matrix according to the cluster centers of multiple clients, and re-cluster the second distance matrix to obtain privacy data features; The cluster center acquisition module inputs multiple privacy sample data sets into the deep neural network for feature extraction to obtain multiple feature data sets, specifically: Input the sample information statistics in the privacy sample data set into the deep neural network, and decompose the sample information statistics into multiple Gaussian distributions according to the mapping function of the deep neural network; Determine the variance and mean of multiple Gaussian distributions; The variance and mean of multiple Gaussian distributions are used as output features to obtain multiple feature data sets; The clustering center acquisition module clusters the first distance matrix L, specifically: Perform eigenvalue decomposition on the first distance matrix L using the Higg cut function, select the eigenvector corresponding to the second smallest non-zero eigenvalue decomposed, select the first m nodes according to the eigenvector sorting, and form the m eigenvectors corresponding to the first m nodes into an n×m dimension matrix H; Cluster each row of the matrix H as a sample, randomly specify l objects as cluster centers, and assign the samples to the classes represented by each cluster center according to the distance from each sample to the cluster center; The mean of each category is obtained, and the mean is used as the cluster center for re-clustering, and the iteration is continued until the clustering requirements are met.
8. A computer device, characterized in that: The method comprises a memory and a processor; the memory stores a computer program, and the processor is used to run the computer program in the memory to execute the method according to any one of claims 1 to 6.
