A Method and System for Generating Controllable Community Graph Data
Through the combination of knowledge distillation and dual-channel decoupling generator, the lack of structural fidelity and computing efficiency in community graph generation is solved, cross-domain adaptability and resource efficiency are achieved, and efficient graph data generation is suitable for social networks and other fields.
Patent Information
- Application Number
- CN202510577750.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-07
- Publication Date
- 2025-08-05
- Estimated Expiration
- 2045-05-07
AI Technical Summary
In the generation of community maps, it is difficult to achieve the coordinated optimization of community structure controllability, structural fidelity and computing efficiency in the generation of community maps, especially in terms of cross-domain adaptability and resource efficiency.
The student model is trained by knowledge distillation, and a dual-channel decoupling generator is used to cooperate with the community-aware graph convolution operator to generate dual-channel decoupling through node feature representations, build a generated graph, and decoupling generation of node attributes and topological information is achieved through joint loss optimization.
It significantly improves the structural fidelity and computing efficiency of community graph generation, adapts to graph generation tasks in different fields, realizes the decoupling control of node attributes and graph structures, reduces computing resource consumption, and is suitable for resource-constrained scenarios.
Smart Images

Figure CN120107408B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a method for generating graph data, in particular to a controllable community graph data generation method and system. Background Art
[0002] As a core tool for complex network modeling, graph generation technology has important value in fields such as social network analysis and biomolecular interaction simulation. However, the acquisition of real network data is often limited by risks of privacy leakage (such as medical data sharing), observational incompleteness (such as insufficient sensor network coverage), or policy constraints (such as restrictions on sensitive information in financial transaction networks), leading to the key need for synthetic data generation as an alternative solution.
[0003] Existing generation methods can be divided into two categories: traditional models and deep learning models. However, they all have significant defects in terms of community structure preservation, computational efficiency, and controllability. Traditional random graph generation methods represented by the Erdős–Rényi (E-R) model and the Barabási–Albert (B-A) model can efficiently generate large-scale networks, but their connection mechanisms relying on preset rules are difficult to capture the heterogeneous community structure of real graphs. For example, in social network generation, such models cannot simulate the community aggregation phenomenon driven by user interests, resulting in the clustering coefficient of the generated graphs being generally more than 30% lower than that of real data. Although the Stochastic Block Model (SBM) attempts to generate a hierarchical structure through community partition parameters, the community edge probability needs to be manually set, resulting in an overlap error of up to 0.42 in the generated biological protein interaction network community, which cannot adapt to dense communities and community overlap situations.
[0004] Deep learning methods based on Generative Adversarial Network (GAN) and Variational Auto – Encoder (VAE), such as NetGAN for learning graph topology and GraphVAE, have improved the generation quality through data-driven approaches, but still face the following problems:
[0005] (1) Insufficient community structure fidelity: In existing models such as Variational graph auto-encoders (VGAE), the encoder focuses on global topological features and ignores the local dense connection characteristics of nodes within the community. Experiments show that in the academic collaboration network generation task, the community structure similarity of mainstream models, i.e., the Normalized Mutual Information (NMI) metric, is only 0.58, a 28% decrease compared to real data;
[0006] (2) Excessive computational resource consumption: Recursive generation architectures such as GraphRNN need to generate edge sequences node by node, resulting in a Graphics Processing Unit (GPU) memory occupancy exceeding 48GB when generating graphs with millions of nodes, and the generation time increasing exponentially;
[0007] (3) Single-dimensional control: Existing controllable generation methods, such as Content -Parsing Generative Adversarial Networks (CPGAN), only support community size adjustment and cannot achieve decoupled control of attribute distribution (such as user age labels) and topological structure (such as community density). When adjusting the community overlap degree of a social network, the node attribute fidelity loss reaches 41%.
[0008] Improved models for community structure preservation (such as DCSBM, SBMGNN) introduce dynamic parameter optimization, but their generation process still relies on static community partitioning and is difficult to adapt to the distribution shift of cross-domain data. For example, when migrating a model trained on a citation network to generate an e-commerce user graph, the community structure similarity decreases by 53%. In addition, graph convolution methods based on hierarchical pooling, such as Differentiable Pooling (DiffPool), can extract multi-scale features, but the matrix calculation complexity of its pooling layer is such that when processing a graph with 100,000 nodes, the training time exceeds 72 hours, severely restricting practical applications.
[0009] In summary, the existing technologies have not yet solved the problem of co - optimizing the controllability, structural fidelity, and computational efficiency of multi - domain community graph generation. Specifically: in terms of community structure preservation, existing models are difficult to simultaneously achieve community - protected generation and community structure control; in terms of computational efficiency, although methods based on Graph Neural Network (GNN) have advantages in representation learning, their high computational complexity and large number of parameters limit practical applications; in terms of controllability, existing methods cannot achieve decoupled generation of node attributes and graph structures. Therefore, there is an urgent need for a graph generation method that supports community control, cross - domain adaptation, and resource efficiency. Summary of the Invention
[0010] The purpose of the present invention is to provide a controllable community graph data generation method and system.
[0011] The purpose of the present invention can be achieved through the following technical solutions:
[0012] According to one aspect of the present invention, a controllable community graph data generation method is provided, and the method steps include:
[0013] S1. Train a student model through knowledge distillation, and use the trained student model to extract node feature representations from multi - domain graph data;
[0014] S2. Use a dual - channel decoupled generator, in cooperation with a community - aware graph convolution operator, to perform dual - channel decoupled generation based on the node feature representations, respectively obtaining node attributes and topological information; then use the node attributes and topological information to construct a generated graph;
[0015] S3. Construct a joint loss optimization based on the generated graph, and design a multi - objective label vector, and use the joint loss optimization and the multi - objective label vector to perform back - propagation optimization on the dual - channel decoupled generator;
[0016] S4. Use the optimized dual - channel decoupled generator to process the input graph, and output the final generated graph, thereby completing the graph data generation.
[0017] As a preferred technical solution, the specific process of training the student model through knowledge distillation in S1 is as follows: First, use the teacher model to extract node feature representations from multi-domain graph data through a cross-domain graph neural network; then, use the intermediate layer output and the final output probability of the teacher model as supervision signals; finally, train the student model through the cross-domain graph distillation algorithm, enabling the student model to learn the mapping relationship between multi-domain graph data and node feature representations. When the distillation loss is less than the preset loss, stop training to obtain the trained student model; among them, the teacher model adopts an improved version of the 3-layer graph convolutional network (Graph Convolutional Network v2, GCNv2) architecture, and the student model is a 2-layer multi-layer perceptron (Multi-Layer Perceptron, MLP);
[0018] The specific formula for the distillation loss is as follows:
[0019] ,
[0020] ,
[0021] Among them, is the distillation loss function; D is the domain set; is the variational encoder of domain d ; z is the latent variable; p ( z ) is the standard Gaussian prior distribution; λ is the hyperparameter; is the domain feature encoder; ψ is the shared distiller; is the graph data of domain d .
[0022] As a preferred technical solution, in the cross-domain graph distillation algorithm, the weights of each domain increase according to the complexity of the graph, and its specific formula is as follows:
[0023] ,
[0024] Among them, is the weight of domain d , which is used to weight the distillation loss of each domain in the cross-domain graph distillation algorithm; β is a parameter that increases with the number of iterations; is d the complexity score of the domain; t is the current iteration number, is any domain within the domain set D.
[0025] As a preferred technical solution, the dual-channel decoupling generation in S2 includes node attribute reconstruction and topological structure reconstruction.
[0026] As a preferred technical solution, the node attribute reconstruction is based on a multi-head graph attention network, which generates an attribute projection matrix from the node feature representation as the node attribute; the topological structure reconstruction uses sparse graph convolution. First, an adjacency probability is generated from the node feature representation, and then the topological feature representation of the node is calculated based on the adjacency probability as the topological information. The specific formulas are as follows:
[0027] ,
[0028] ,
[0029] where, is the attribute feature representation of node i ; is the multi-head graph attention encoder; is the input node feature vector; N ( i ) is the set of neighbor nodes of node i ; is the attribute projection matrix; is the adjacency probability, indicating the probability that there is an edge between node i and node j ; σ is the sigmoid activation function; SGC is the sparse graph convolution operation; and are the topological feature representations of node i and node j respectively.
[0030] As a preferred technical solution, during the node attribute reconstruction and topological structure reconstruction processes, an orthogonal constraint loss is constructed to prevent feature coupling. The specific formula is as follows:
[0031] ,
[0032] where, is the orthogonal loss term; is the attribute projection matrix; is the topological projection matrix; is the Frobenius norm.
[0033] As a preferred technical solution, the process of constructing a generated graph using the node attributes and topological information in S2 includes local subgraph sampling, linear decoding, and a progressive generation process. Among them, the local subgraph sampling process is specifically to select a central node based on the node degree probability and construct a self-centered network with a radius of 2; linear decoding is used to reduce the complexity of adjacency prediction; the progressive generation process is specifically to load the student model into the Graphics Processing Unit (GPU) in stages to adapt to the expanding graph scale, and the number of nodes is increased in each stage , where k is the stage serial number.
[0034] As a preferred technical solution, the combined loss in S3 optimizes and integrates the structure reconstruction term, the attribute fidelity term, and the control constraint term; among them, the structure reconstruction term is calculated using the binary cross-entropy of the adjacency matrix, the attribute fidelity term is calculated using the maximum mean difference, and the control constraint term is calculated using the mean square error of the control parameter; the specific formula is as follows:
[0035] ,
[0036] Among them, is the total loss; is the structure reconstruction term; is the attribute fidelity term; is the control constraint term; α is the weight coefficient of the attribute fidelity term; β is the weight coefficient of the control constraint term; is the generated adjacency matrix; is the real adjacency matrix; is the attribute distribution of the generated data; is the attribute distribution of the real data; M is the generated control parameter; is the target control parameter.
[0037] As a preferred technical solution, the multi-objective label vector in S3 includes a community control coding label and an attribute control coding label, each label is 4 bits and consists of 0 and 1; among them, the community control coding label is used to characterize the community density feature, and the attribute control coding label is used to characterize the attribute dispersion feature.
[0038] According to another aspect of the present invention, a controllable community graph data generation system is provided. The system works based on the above-mentioned controllable community graph data generation method. The system includes a cross-domain feature distillation module, a dual-channel decoupled generation module, a dynamic control optimization module, and a graph generation module;
[0039] Among them, the cross-domain feature distillation module trains the student model through knowledge distillation, and uses the trained student model to extract node feature representations from multi-domain graph data;
[0040] The dual-channel decoupled generation module uses a dual-channel decoupled generator, in cooperation with a community-aware graph convolution operator, to perform dual-channel decoupled generation based on the node feature representation, and respectively obtains node attributes and topological information; then uses the node attributes and topological information to construct a generated graph;
[0041] The dynamic control optimization module constructs a joint loss optimization based on the generation graph and designs a multi-objective label vector. It then uses the joint loss optimization and the multi-objective label vector to perform reverse optimization on the dual-channel decoupling generator.
[0042] The graph generation module uses the optimized dual-channel decoupled generator to process the input graph and output the final generated graph, thereby completing the graph data generation.
[0043] Compared with the prior art, the present invention has the following beneficial effects:
[0044] 1. In the present invention, a dual-channel decoupling generator is used to perform dual-channel decoupling generation based on node feature representation, and node attributes and topology information are obtained respectively to construct a generated graph; then the dual-channel decoupling generator is reversely optimized based on the generated graph; finally, the optimized dual-channel decoupling generator is used to process the input graph and output the final generated graph, thereby completing the graph data generation. Compared with the existing coupled generation method, the dual-channel design ensures the co-evolution of attributes and topology through the semantic alignment loss function, and cooperates with the community-aware graph convolution operator to make the generated social network node interaction behavior conform to the real-world semantic laws. Through the decoupled generation of node attributes and graph structure, the fidelity of the community structure generated by the graph is significantly enhanced.
[0045] 2. This invention first uses a teacher model to extract node feature representations from multi-domain graph data. A cross-domain graph distillation algorithm is then used to train a student model, enabling it to learn the data-to-feature mapping relationship. This results in a graph generation framework that implements dual distillation of community latent variables and model parameters. Dynamic knowledge compression techniques are then used to migrate large model representations to a lightweight architecture. This lightweight architecture enables efficient operation while maintaining high performance in resource-constrained scenarios, such as mobile devices or edge computing, making it suitable for real-time graph data processing and large-scale graph analysis tasks.
[0046] 3. The graph generation process in this invention includes local subgraph sampling, linear decoding, and progressive generation, significantly reducing computational resource consumption during graph generation. Especially when generating large-scale graphs, the progressive generation strategy and local subgraph sampling strategy effectively reduce video memory usage and computation time, enabling the model to efficiently generate high-quality community graphs with limited resources, significantly improving computational efficiency and resource utilization.
[0047] 4. This invention uses a cross-domain graph distillation algorithm to extract node feature representations from multi-domain graph data and construct a shared feature space across multiple domains, enabling the model to adapt to graph generation tasks across different domains. The weights for each domain are dynamically adjusted based on the complexity of the graph, ensuring the model's performance on complex graph data. Compared to existing technologies, this invention demonstrates greater adaptability and generalization in cross-domain graph generation tasks, effectively addressing the graph generation needs of diverse domains.
[0048] 5. The multi-objective label vector in this invention includes community control encoding labels and attribute control encoding labels, each of which is 4 bits and consists of 0s and 1s. This method pioneers an attribute constraint-guided community graph generation paradigm, encoding domain knowledge as geometric constraints of the generated space through a differentiable logic layer. Compared to traditional retraining methods, this process supports the dynamic injection of multi-dimensional attribute constraints (such as degree distribution and clustering coefficient), achieving fine-grained control while maintaining the integrity of the community structure. This enables the controllable generation of graph structure and attributes for a variety of graph data.
[0049] 6. This invention integrates structural reconstruction, attribute fidelity, and control constraints through joint loss optimization, ensuring high fidelity of the generated graph in terms of topology and node attributes. The structural reconstruction uses binary cross entropy of the adjacency matrix, the attribute fidelity uses maximum mean difference, and the control constraint uses mean squared error of control parameters. This ensures that the generated graph is highly consistent with the real graph in terms of community structure, node attributes, and control parameters. Experiments show that the generated community graph outperforms existing technologies in metrics such as community structure similarity and node attribute fidelity. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 This is a step diagram of a method for generating controllable community graph data in the present invention;
[0051] Figure 2 It is a flow chart of the synthesis diagram in the embodiment;
[0052] Figure 3 Generate a structural diagram for the controllable graph in the embodiment. DETAILED DESCRIPTION
[0053] The present invention is described in detail below with reference to the accompanying drawings and specific embodiments. This embodiment is implemented based on the technical solution of the present invention, and provides a detailed implementation method and specific operation process, but the protection scope of the present invention is not limited to the following embodiments.
[0054] Existing technologies have not yet solved the problem of collaborative optimization of controllability, structural fidelity, and computational efficiency in generating multi-domain community graphs. Specifically:
[0055] (1) In terms of community structure maintenance, the existing model is difficult to achieve both community protection generation and community structure control at the same time;
[0056] (2) In terms of computational efficiency, although the graph neural network (GNN)-based method has advantages in representation learning, its high computational complexity and high number of parameters limit its practical application;
[0057] (3) In terms of controllability, existing methods cannot achieve decoupled generation of node attributes and graph structures. Therefore, there is an urgent need for a graph generation method that supports community control, cross-domain adaptation, and high resource efficiency.
[0058] Embodiment 1
[0059] In this embodiment, a controllable community graph data generation method is applied. The method steps are as Figure 1 shown and specifically include:
[0060] S1. Train a student model through knowledge distillation, and use the trained student model to extract node feature representations from multi-domain graph data;
[0061] S2. Use a dual-channel decoupled generator, in cooperation with a community-aware graph convolutional operator, to perform dual-channel decoupled generation based on the node feature representations, and respectively obtain node attributes and topological information; then use the node attributes and topological information to construct a generated graph;
[0062] S3. Construct a joint loss optimization based on the generated graph, design a multi-objective label vector, and use the joint loss optimization and the multi-objective label vector to perform backpropagation optimization on the dual-channel decoupled generator;
[0063] S4. Use the optimized dual-channel decoupled generator to process the input graph and output the final generated graph, thereby completing the graph data generation.
[0064] This solution realizes community structure preservation and efficient generation in cross-domain scenarios through three core modules: dynamic distillation, hierarchical generation, and pluggable control. Specifically, it includes:
[0065] ① Cross-domain feature distillation layer: Use a domain-agnostic encoder to extract common graph structure features (such as community overlap, degree distribution pattern), construct a transferable latent space, and use the student model to obtain graph encoding features with low computational cost and achieve fast generation;
[0066] ② Dual-channel decoupled generator: Separate the attribute generation channel (processing node labels, features) and the topological generation channel (modeling the adjacency matrix), and achieve independent regulation of structure-attribute through parameter isolation;
[0067] ③ Dynamic control interface: Design a differentiable mask matrix and a community-guided loss function to support real-time adjustment of parameters such as community density and attribute dispersion.
[0068] In this embodiment, the specific process of training the student model through knowledge distillation in S1 is as follows: First, use the teacher model to extract node feature representations from multi-domain graph data through a cross-domain graph neural network; then, use the intermediate layer output and the final output probability of the teacher model as supervision signals; finally, train the student model through a cross-domain graph distillation algorithm so that the student model learns the mapping relationship between multi-domain graph data and node feature representations. When the distillation loss is less than the preset loss, stop training to obtain the trained student model. Among them, the teacher model adopts a 3-layer GCNv2 architecture, and the student model is a 2-layer MLP;
[0069] The specific formula for the distillation loss is as follows:
[0070] ,
[0071] ,
[0072] Among them, is the distillation loss function; D is the domain set; is the variational encoder of domain d ; z is the latent variable; p ( z ) is the standard Gaussian prior distribution; λ is the hyperparameter; is the domain feature encoder; ψ is the shared distiller; is the graph data of domain d .
[0073] In this embodiment, in the cross-domain graph distillation algorithm, the weights of each domain increase according to the complexity of the graph. The specific formula is as follows:
[0074] ,
[0075] Among them, is the weight of domain d , which is used to weight the distillation loss of each domain in the cross-domain graph distillation algorithm; β is a parameter that increases with the number of iterations; is d the complexity score of the domain; t is the current number of iterations, is any domain within the domain set D.
[0076] In this embodiment, when the number of iterations t = 800, the distillation error converges to 0.12 (cosine similarity of high-dimensional data).
[0077] In this embodiment, the dual-channel decoupling generation in S2 includes node attribute reconstruction and topological structure reconstruction.
[0078] In this embodiment, the node attribute reconstruction is based on a multi-head graph attention network, which generates an attribute projection matrix from the node feature representation as the node attribute; the topological structure reconstruction uses sparse graph convolution. First, an adjacency probability is generated from the node feature representation, and then the topological feature representation of the node is calculated based on the adjacency probability as the topological information. The specific formulas are as follows:
[0079] ,
[0080] ,
[0081] where, is the attribute feature representation of node i ; is the multi-head graph attention encoder; is the input node feature vector; N ( i ) is the set of neighbor nodes of node i ; is the attribute projection matrix; is the adjacency probability, representing the probability that there is an edge between node i and node j ; σ is the sigmoid activation function; SGC is the sparse graph convolution operation; and are the topological feature representations of node i and node j respectively.
[0082] In this embodiment, during the node attribute reconstruction and topological structure reconstruction processes, an orthogonal constraint loss is constructed to prevent feature coupling. The specific formula is as follows:
[0083] ,
[0084] where, is the orthogonal loss term; is the attribute projection matrix; is the topological projection matrix; is the Frobenius norm.
[0085] In this embodiment, the process of constructing a generated graph using the node attributes and topological information in S2 includes local subgraph sampling, linear decoding, and a progressive generation process. Among them, the local subgraph sampling process is specifically to select a central node based on the node degree probability and construct an ego-centric network with a radius of 2; linear decoding is used to reduce the complexity of adjacency prediction; the progressive generation process is specifically to load the student model into the GPU in stages to adapt to the expanding graph scale, and the number of nodes is increased by in each stage, where k is the stage number.
[0086] The process of constructing a generated graph (synthetic graph) and generating node attributes (synthetic attributes) by processing node-related information (corresponding to the processing of the adjacency matrix and graph attributes) is as follows: Figure 2 As shown, starting from the adjacency matrix, on the one hand, calculate the community density and perform community control encoding; on the other hand, perform subgraph sampling and then obtain latent variables through graph neural network encoding. Starting from the graph attributes, calculate the attribute dispersion and perform attribute control encoding. The community control encoding and attribute control encoding act together with the latent variables, and through attribute decoding, synthetic attributes are obtained, and through graph decoding, a synthetic graph is obtained. This reflects the steps of extracting features from the original graph-related information and then generating. In this embodiment, when finally generating a graph with n = 106 nodes, the video memory occupancy is only 12.8GB.
[0087] The linear decoder reduces the adjacency prediction complexity from to .
[0088] ,
[0089] where is the generated adjacency matrix; is the encoder output feature matrix; is the decoder weight matrix; is the decoder bias term.
[0090] In this embodiment, the joint loss optimization in S3 integrates the structure reconstruction term, the attribute fidelity term, and the control constraint term; among them, the structure reconstruction term is calculated using the adjacency matrix binary cross-entropy, the attribute fidelity term is calculated using the maximum mean discrepancy, and the control constraint term is calculated using the control parameter mean square error; the specific formula is as follows:
[0091] ,
[0092] where is the total loss; is the structure reconstruction term; is the attribute fidelity term; is the control constraint term; α is the weight coefficient of the attribute fidelity term; β is the weight coefficient of the control constraint term; is the generated adjacency matrix; is the true adjacency matrix; is the attribute distribution of the generated data; is the attribute distribution of the true data; M is the generated control parameter; is the target control parameter.
[0093] In this embodiment, the multi-target label vector in S3 includes a community control coding label and an attribute control coding label. Each label is 4 bits, consisting of 0 and 1, for a total of There are three possibilities; among them, the community control coding label is used to characterize the community density characteristics, and the attribute control coding label is used to characterize the attribute dispersion characteristics.
[0094] In this example, data A has a high community density (community density label is 1,1,1,1) and a low attribute dispersion (attribute dispersion label is 0,0,0,0). The concatenated label vector is:
[0095] ,
[0096] in, t is the concatenated label vector; Label for community density; is the attribute dispersion label.
[0097] During the training process, the label vector t is used as a conditional input, and the generator parameters are optimized through back-propagation to achieve controllable generation of graph structure and attributes.
[0098] In this embodiment, the optimizer uses AdamW, and the learning rate , weight decay λ =0.01.
[0099] In summary, this solution utilizes a dual-channel decoupled generator, coupled with a community-aware graph convolution operator, to perform dual-channel decoupled generation based on node feature representations, obtaining node attributes and topology information to construct a generated graph. The dual-channel decoupled generator is then reverse-optimized based on the generated graph. Finally, the optimized dual-channel decoupled generator processes the input graph and outputs the final generated graph, completing graph data generation. Compared to existing coupled generation methods, the dual-channel design ensures the co-evolution of attributes and topology through a semantic alignment loss function. Combined with the community-aware graph convolution operator, the generated social network node interactions conform to real-world semantics. Through the decoupled generation of node attributes and graph structure, the fidelity of the community structure generated by the graph is significantly enhanced.
[0100] Example 2
[0101] In this embodiment, a controllable community graph data generation system is applied, which includes a cross-domain feature distillation module, a dual-channel decoupling generation module, a dynamic control optimization module and a graph generation module;
[0102] Among them, the cross-domain feature distillation module trains the student model through knowledge distillation, and uses the trained student model to extract node feature representations from multi-domain graph data; the dual-channel decoupled generation module uses a dual-channel decoupled generator, in conjunction with a community-aware graph convolutional operator, to perform dual-channel decoupled generation based on the node feature representations, respectively obtaining node attributes and topological information; then, the generated graph is constructed using the node attributes and topological information; the dynamic control optimization module constructs a joint loss optimization based on the generated graph, designs a multi-objective label vector, and performs backpropagation optimization on the dual-channel decoupled generator using the joint loss optimization and the multi-objective label vector; the graph generation module processes the input graph using the optimized dual-channel decoupled generator and outputs the final generated graph, thereby completing the graph data generation.
[0103] In this embodiment, first, an input graph is given ; where V is the node set; E is the edge set; each node has a corresponding node feature vector .
[0104] The teacher model extracts high-level feature representations of the graph structure and node attributes from the original data and trains the student model.
[0105] Specifically, the teacher model generates feature representations in a shared latent space through a cross-domain graph neural network . Subsequently, the intermediate layer output and the final output probability of the teacher model are used as supervision signals to train a lightweight student model (Student Model, MLP). The student model learns the mapping relationship from the input data to the output features of the teacher model, thereby achieving an efficient graph generation ability.
[0106] The method first performs cross-domain feature distillation, uses an encoder to extract common features of the graph structure (such as community overlap, degree distribution pattern), constructs a transferable latent space, and uses the student model to obtain graph encoding features with low computational cost and achieve fast generation;
[0107] (1.1) Using the cross-domain graph distillation algorithm, an encoder is used to extract common features of the graph structure (such as community overlap, degree distribution pattern), construct a transferable latent space, the student model learns, constructs the mapping relationship from the input data to the output features of the teacher model, until the distillation error converges, and obtains the weights of each domain, that is, the student model completes obtaining the graph encoding features.
[0108] Construct a multi-domain shared feature space, and the constructed multi-domain shared feature space and the distillation error are:
[0109] ,
[0110] ,
[0111] where, is the distillation loss function; D is the domain set; is the d variational encoder of the domain; z is the latent variable; p ( z ) is the standard Gaussian prior distribution; λ is the hyperparameter; is the domain feature encoder; ψ is the shared distiller; is the d graph data of the domain.
[0112] The domain weights increase with the domain complexity score. The specific formula for each domain weight is:
[0113] ,
[0114] where, is the weight of the domain d , which is used to weight the distillation loss of each domain in the cross-domain graph distillation algorithm; β is the parameter, which increases with the number of iterations; is the d complexity score of the domain; t is the current number of iterations, is any domain within the domain set D.
[0115] In this embodiment, when the number of iterations t = 800, the distillation error converges to 0.12 (cosine similarity of high-dimensional data).
[0116] (1.2) Perform two-channel decoupled generation. The decoupled generation in this scheme includes two main stages: node attribute reconstruction and topological structure reconstruction;
[0117] (1.2.1) Node attribute reconstruction is based on the node features of the input graph, and the semantic information of the nodes is restored through the attribute generation channel;
[0118] The attribute generation channel is based on the multi-head graph attention network and models to obtain the attribute projection matrix of the nodes. The specific formula is:
[0119] ,
[0120] where, is the attribute feature representation of the node i ; is the multi-head graph attention encoder; is the input node feature vector; N (i ) is the set of neighbor nodes of the node i ; is the attribute projection matrix.
[0121] In this embodiment, is the attribute projection matrix of the node, and the output dimension is .
[0122] (1.2.2) Meanwhile, by using the projection of node attributes and the conditions of the dynamic control module, the topological structure of the graph is gradually constructed. The topological generation channel uses Simplifying Graph Convolutional (SGC) to generate the adjacency probability, and then the topological projection matrix of the node is calculated from the adjacency probability of the existence of an edge between nodes. The specific formula is:
[0123] ,
[0124] where is the adjacency probability, indicating the probability of an edge existing between node i and node j ; σ is the sigmoid activation function; SGC is the Simplifying Graph Convolutional operation; and are the topological feature representations of node i and node j respectively.
[0125] (1.2.3) To prevent the coupling of features between the node attribute reconstruction process and the topological structure reconstruction process, an orthogonal constraint loss is constructed. The specific formula is:
[0126] ,
[0127] where is the orthogonal loss term; is the attribute projection matrix; is the topological projection matrix; is the Frobenius norm.
[0128] (1.3) Perform dynamic control to establish multi-objective labels (each label is 4 bits, with a total of possibilities). For example, if the community density of data A is high (the community density label is 1,1,1,1) and the attribute dispersion is low (the attribute dispersion label is 0,0,0,0), the concatenated label vector is:
[0129] ,
[0130] where t is the concatenated label vector; is the community density label; is the attribute dispersion label.
[0131] During the training process, the label vector t is used as the conditional input, and the generator parameters are optimized through backpropagation to achieve controllable generation of the graph structure and attributes.
[0132] The process of feature extraction, constructing relevant encodings based on graph-related information, and then generating the final graph data (synthetic graph) and attributes (synthetic attributes) through optimization is as Figure 3 shown. Starting from the initial graph, the custom community density is determined and community control encoding is performed; at the same time, the initial graph and graph attributes are subjected to structural-attribute hybrid encoding. The attribute generation dispersion is calculated from the graph attributes and attribute control encoding is performed. The community control encoding, attribute control encoding, and structural-attribute hybrid encoding together obtain the controlled latent variable, and the controlled latent variable is used to calculate the mean and standard deviation to obtain , and finally the synthetic attributes and synthetic graph are generated, demonstrating the key links from input to output in the controllable community graph data generation.
[0133] (1.4) To reduce the computational complexity, a lightweight generation pipeline is designed:
[0134] (1.4.1) First, local subgraph sampling is performed, that is, based on the node degree probability the central node is selected to construct an ego-graph with a radius of 2;
[0135] (1.4.2) Then, a linear decoder is used to reduce the adjacency prediction complexity from to .
[0136] ,
[0137] where is the generated adjacency matrix; is the encoder output feature matrix; is the decoder weight matrix; is the decoder bias term.
[0138] (1.4.3) Progressive generation: The student model is put into the GPU in stages to adapt to the expanding graph scale, with the number of nodes increased by (k is the stage number) at each stage. When finally generating a graph with n = 106 nodes, the video memory occupancy is only 12.8GB.
[0139] (1.5) Establish a joint optimization objective, that is, the total loss function, and the total loss function integrates structure reconstruction, attribute fidelity, and control constraints:
[0140] ,
[0141] in, is the total loss; It is a structural reconstruction item; is the attribute fidelity item; is the control constraint; α is the weight coefficient of the attribute fidelity item; β is the weight coefficient of the control constraint; is the generated adjacency matrix; is the true adjacency matrix; To generate the attribute distribution of data; is the attribute distribution of real data; M is the generated control parameter; is the target control parameter.
[0142] During the learning and training process, the optimizer uses AdamW (Adam with Weight Decay, Adam optimizer with weight decay), and the learning rate is , weight decay λ =0.01.
[0143] In summary, this solution achieves dual distillation of community latent variables and model parameters, migrating large model representations to a lightweight architecture through dynamic knowledge compression technology. Compared to existing coupled generation methods, the dual-channel design ensures the co-evolution of attributes and topology through a semantic alignment loss function. Combined with the community-aware graph convolution operator, the generated social network node interactions conform to real-world semantic laws. The dynamic control module pioneers an attribute constraint-guided community graph generation paradigm, encoding domain knowledge as geometric constraints of the generated space through a differentiable logic layer. Compared to traditional retraining methods, this component supports the dynamic injection of multi-dimensional attribute constraints (such as degree distribution and clustering coefficient), achieving fine-grained control while maintaining the integrity of the community structure. Experiments demonstrate that this method achieves efficient and controllable attribute graph generation for various graph data types.
Claims
1. A controllable community graph data generation method, characterized in that: The method steps include: S1. Train the student model through knowledge distillation and use the trained student model to extract node feature representations from multi-domain graph data; S2. Using a dual-channel decoupling generator and a community-aware graph convolution operator, we perform dual-channel decoupling generation based on node feature representation to obtain node attributes and topology information respectively. We then use these information to construct a generated graph. S3. Build a joint loss optimization based on the generated graph and design a multi-objective label vector. Use the joint loss optimization and multi-objective label vector to reversely optimize the dual-channel decoupled generator. S4. Use the optimized dual-channel decoupled generator to process the input graph and output the final generated graph, thereby completing the graph data generation; The dual-channel decoupling generation in S2 includes node attribute reconstruction and topology structure reconstruction; The node attribute reconstruction is based on a multi-head graph attention network, which generates an attribute projection matrix from the node feature representation as the node attribute; the topology structure reconstruction uses sparse graph convolution, which first generates the adjacency probability from the node feature representation, and then calculates the topological feature representation of the node based on the adjacency probability as the topological information. The specific formula is as follows: , , in, h iattr For nodes i Attribute feature representation of ; GAT enc is a multi-head graph attention encoder; X i is the input node feature vector; N ( i ) is a node i The set of neighbor nodes of W attr is the attribute projection matrix; p ( A ij =1) is the adjacency probability, indicating that the node i and nodes j The probability of the existence of an edge; σ is the sigmoid activation function; SGC is the sparse graph convolution operation; h itopo and h jtopo Node i and nodes j Topological feature representation of ; In the process of node attribute reconstruction and topology structure reconstruction, an orthogonal constraint loss is constructed to prevent feature coupling. The specific formula is as follows: , in, L orth is the orthogonal loss term; W attr is the attribute projection matrix; W topo is the topological projection matrix; ||•|| F is the Frobenius norm.
2. A controllable community graph data generation method according to claim 1, characterized in that: The specific process of training the student model through knowledge distillation in S1 is as follows: first, the teacher model is used to extract node feature representations from multi-domain graph data through a cross-domain graph neural network; then, the intermediate layer output and final output probability of the teacher model are used as supervision signals; finally, the student model is trained through a cross-domain graph distillation algorithm to enable the student model to learn the mapping relationship between multi-domain graph data and node feature representations. When the distillation loss is less than the preset loss, training is stopped to obtain the trained student model; wherein, the teacher model adopts a 3-layer GCNv2 architecture, and the student model is a 2-layer MLP; The specific formula of the distillation loss is as follows: , , in, L distill is the distillation loss function; D is the domain set; q d For the field d Variational encoder; z is a hidden variable; p ( z ) is the standard Gaussian prior distribution; λ is a hyperparameter; Ф d is the domain feature encoder; ψ is the shared distiller; G d For the field d Graph data.
3. A controllable community graph data generation method according to claim 2, characterized in that: In the cross-domain graph distillation algorithm, the weight of each domain increases according to the complexity of the graph. The specific formula is as follows: , in, w d For the field d The weights are used to weight the distillation losses of each field in the cross-domain graph distillation algorithm; β is a parameter that increases with the number of iterations; Complexity ( G d )for d domain complexity score; t is the current iteration number, d’ is any domain within the domain set D.
4. A controllable community graph data generation method according to claim 1, characterized in that: The process of constructing a generated graph using node attributes and topological information in S2 includes local subgraph sampling, linear decoding, and progressive generation process. The local subgraph sampling process is specifically to select the central node based on the node degree probability and construct an egocentric network with a radius of 2; linear decoding is used to reduce the complexity of adjacency prediction; the progressive generation process is specifically to load the student model into the GPU in stages to adapt to the scale of the expanded graph, and increase the number of nodes in each stage. n step =2k, where k is the stage number.
5. A controllable community graph data generation method according to claim 1, characterized in that: The joint loss optimization in S3 integrates the structural reconstruction term, the attribute fidelity term, and the control constraint term; the structural reconstruction term is calculated using the binary cross entropy of the adjacency matrix, the attribute fidelity term is calculated using the maximum mean difference, and the control constraint term is calculated using the mean square error of the control parameters; the specific formula is as follows: , in, L total is the total loss; L recon It is a structural reconstruction item; L attr is the attribute fidelity item; L control is the control constraint; α is the weight coefficient of the attribute fidelity item; β is the weight coefficient of the control constraint; A gen is the generated adjacency matrix; A real is the true adjacency matrix; X gen To generate the attribute distribution of data; X real is the attribute distribution of real data; M is the generated control parameter; M target is the target control parameter.
6. A controllable community graph data generation method according to claim 1, characterized in that: The multi-target label vector in S3 includes a community control coding label and an attribute control coding label, each label is 4 bits and consists of 0 and 1; wherein, the community control coding label is used to represent the community density feature, and the attribute control coding label is used to represent the attribute dispersion feature.
7. A controllable community graph data generation system, characterized in that: The system operates based on a controllable community graph data generation method as described in any one of claims 1 to 6, and includes a cross-domain feature distillation module, a dual-channel decoupling generation module, a dynamic control optimization module, and a graph generation module; The cross-domain feature distillation module trains a student model through knowledge distillation and uses the trained student model to extract node feature representations from multi-domain graph data; The dual-channel decoupling generation module uses a dual-channel decoupling generator in conjunction with a community-aware graph convolution operator to perform dual-channel decoupling generation based on node feature representation, obtaining node attributes and topology information respectively; and then constructs a generation graph using the node attributes and topology information. The dynamic control optimization module constructs a joint loss optimization based on the generation graph and designs a multi-objective label vector, and uses the joint loss optimization and the multi-objective label vector to perform reverse optimization on the dual-channel decoupling generator; The graph generation module uses the optimized dual-channel decoupling generator to process the input graph and output the final generated graph, thereby completing the graph data generation.
Citation Information
Patent Citations
Knowledge distillation method, system, medium and equipment for cross-domain passive domain data
CN118298279A
Controllable hierarchical road topology generation system and method based on AIGC
CN118397449A