A community search method across datasets

By learning a transferable community representation model through offline training, and utilizing spectral-aware feature alignment and graph diffusion Transformer modules, the problem of model retraining during cross-dataset transfer is solved, and efficient community search result output is achieved.

CN122364512APending Publication Date: 2026-07-10LIAONING UNIVERSITY

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
LIAONING UNIVERSITY
Filing Date
2026-06-10
Publication Date
2026-07-10

AI Technical Summary

Technical Problem

Existing community search methods require retraining or fine-tuning of model parameters when migrating across datasets, resulting in high training costs and long deployment cycles, making it difficult to meet the needs of rapid deployment and large-scale expansion.

Method used

By learning a transferable community representation model through offline training, and utilizing the spectral awareness feature alignment module and the graph diffusion Transformer module, a community representation that is universal across datasets is generated, enabling the model to be deployed on the target dataset without retraining.

Benefits of technology

It enables direct deployment of models on different datasets, improving cross-dataset deployment efficiency and search quality, and reducing training costs and deployment cycles.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122364512A_ABST
    Figure CN122364512A_ABST
Patent Text Reader

Abstract

A cross-dataset universal community search method, belonging to the field of graph data mining and information retrieval technology, comprises the following steps: Step 1: Constructing the required sample set and training graph; Step 2: Using spectral awareness for feature alignment to form spectral awareness aligned training features; Step 3: Constructing hybrid token sequences for nodes in the training graph; Step 4: Encoding the token sequences using a Transformer encoder to obtain a unified community-aware representation; Step 5: Reconstructing the representation using a diffusion model; Step 6: Training the model; Step 7: Inputting the target dataset into the model obtained in Step 6 for community search to obtain the results. This invention, through the above method, allows the target dataset to be directly input into the model for inference and community search during the application stage, without the need for retraining or fine-tuning, thereby improving the efficiency and search quality of cross-dataset deployment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of graph data mining and information retrieval technology, specifically involving a cross-dataset universal community search method. This method obtains model parameters offline on the training dataset and can be directly deployed and used on the target dataset without retraining or fine-tuning. Background Technology

[0002] With the rapid development of applications such as recommender systems, social network analysis, academic network retrieval, enterprise knowledge graphs, and security risk control, large-scale graph structure data is widely used to characterize entities and their relationships. In graph data analysis tasks, community search is a crucial fundamental problem, typically referring to retrieving a set of nodes with strong cohesion from a graph, given a query node, to support applications such as relationship discovery, interest group identification, and group behavior analysis.

[0003] Existing community search methods mainly include traditional algorithms based on structural constraints and representation learning methods combined with machine learning. Traditional algorithms typically rely on pre-defined graph structure metrics or constraints, offering a degree of interpretability under specific assumptions. However, their search quality tends to deteriorate significantly under conditions of high noise, sparse graph structures, complex node attributes, or changes in data distribution. Learning-based community search methods, which have emerged in recent years, utilize graph neural networks or sequence modeling structures to learn node representations, thereby improving their ability to characterize complex structures and semantics. However, these methods often rely on the training distribution or supervision signals of specific datasets. When the application scenario switches to a new target dataset, retraining or fine-tuning of model parameters is usually required. This not only results in high training costs and long deployment cycles but also imposes a burden of continuous maintenance and version iteration in real-world systems, making it difficult to meet the needs of rapid deployment and large-scale expansion across different scenarios.

[0004] Therefore, how to provide a cross-dataset universal community search method that can be trained on a training dataset and then used directly on a new target dataset without retraining, and can output high-quality community search results, has become an urgent technical problem to be solved. Summary of the Invention

[0005] To address the shortcomings of existing community search methods, such as insufficient cross-dataset transferability, reliance on retraining, and high deployment and maintenance costs, this invention provides a universal community search method across datasets. This method learns a transferable community representation model through an offline training phase, and then directly inputs the target dataset into the model for inference and community search during the application phase, eliminating the need for retraining or fine-tuning. This improves cross-dataset deployment efficiency and search quality.

[0006] To achieve the above objectives, the present invention provides the following method, which includes an offline training phase and an application phase.

[0007] Phase 1: Offline training phase (completed on the training dataset).

[0008] Step 1: Construct the sample set required for training.

[0009] Step 101: Obtain the graph data of the training dataset and construct the training graph. ,in It includes at least the set of nodes, the set of edges, and the node feature matrix. .

[0010] Step 102: Determine the input units and training sample organization method for the training phase, take nodes or local structures centered on nodes as basic training units, and generate corresponding model input representations for each basic training unit.

[0011] Step 103: Construct the auxiliary set required for the training phase, including a set of positive sample pairs and a set of negative sample candidates for contrastive learning, and a set of perturbation configuration parameters for diffusion refinement to support subsequent training optimization.

[0012] Step 2: Use spectral sensing for feature alignment.

[0013] Step 201: Process the training image Node features Perform a unified mapping process to obtain feature representations under a unified input space, thereby reducing the differences in feature organization between different datasets.

[0014] Step 202: Based on training graphs The structural information is used to extract spectral correlation statistics, and the feature dimensions are evaluated and ranked based on the statistics to obtain the ranking index of the feature dimensions.

[0015] Step 203: Rearrange the training feature representations according to the sorting index obtained in step 202 to form spectral-aware aligned training features. This aims to improve feature consistency and transferability across datasets.

[0016] Step 3: Construct a hybrid token sequence.

[0017] Step 301: For the training image Nodes in the sequence construct a local token sequence The local token sequence is used to represent the local structure and attribute information within the neighborhood of the query node.

[0018] Step 302: For the training image Nodes in the chain construct a global token sequence. The global token sequence is used to represent the aggregation information of multi-hop neighborhoods or larger range structures.

[0019] Step 4: Encode the token sequence using the Transformer encoder.

[0020] Step 401: Input the hybrid token obtained in step 3 Input the Transformer encoder to obtain the propagated representation.

[0021] Step 402: Fuse the encoded outputs of the local token and the global token to obtain a unified community-aware representation of the nodes in the training graph. It is used to characterize the community-related information of nodes at the structural and semantic levels.

[0022] Step 5: Reconstruct the representation using a diffusion model.

[0023] Step 501: Process the training representations obtained in Step 4 Perform a forward perturbation process to generate a perturbation representation sequence, which is used to simulate representation shifts under distribution changes or noise perturbations across datasets.

[0024] Step 502: Construct an inverse denoising module to recover a refined representation from the perturbation representation, and learn the parameters of the denoising module during the training phase.

[0025] Step 6: Model training.

[0026] Step 601: Constructing the contrastive learning training objective Positive samples come from neighboring nodes within the same community, while negative samples come from nodes in different communities that are not directly connected.

[0027] Step 602: Construct the training objective for the diffusion model It is used to constrain the consistency and stability of the denoising module in restoring the disturbance representation.

[0028] Step 603: Combine the contrastive learning training objective with the diffusion model training objective in a weighted manner to form the overall training objective. Based on the overall training objective, the encoding network and denoising module are iteratively updated to obtain the trained model parameters. .

[0029] This concludes the offline training phase, resulting in a community representation model that can be directly deployed across datasets.

[0030] Phase Two: Application Phase (Direct deployment on the target dataset without retraining)

[0031] Step 7: Perform representation construction and community search on the target dataset.

[0032] Step 701: Obtain the target graph corresponding to the target dataset. Node features and query nodes and to Perform the same spectral sensing feature alignment process as in step 2 to obtain .

[0033] Step 702: Based on the target graph Aligned features Perform the same hybrid token sequence construction process as in step 3 to obtain the hybrid token input for the target graph. .

[0034] Step 703: With the model parameters frozen, invoke the trained tokenized encoding network and the diffusion refining module to generate node representations in the target graph or query related representations. ,in Indicates the query node The representation of.

[0035] Step 704: Based on Similarity is calculated with other node representations, and a ranked list of candidate nodes is constructed to obtain the candidate set. .

[0036] Step 705: In the candidate set We construct candidate community evaluation indicators based on similarity and modularity, and filter and determine the candidate set according to a preset search strategy to obtain the final community results. .

[0037] Step 706: Output As community search results, among For containing query nodes And a set of nodes that satisfy the cohesion requirement.

[0038] The beneficial effects of this invention are as follows: 1. This invention introduces the "train once, apply to multiple domains" paradigm to community search tasks for the first time, enabling the direct deployment of the model on unseen target graphs without the need for retraining or fine-tuning.

[0039] 2. This invention designs a spectrum-aware feature alignment module, which can uniformly align the differences in feature dimensions and semantic misalignments between different datasets from the perspective of community structure.

[0040] 3. This invention designs a graph diffusion Transformer module, which enhances cross-domain robustness through a diffusion mechanism, effectively adapts to cross-domain distribution shifts, and generates a transferable unified community representation. Attached Figure Description

[0041] Figure 1 This is a schematic diagram of the overall process of the method of the present invention. Detailed Implementation

[0042] The present invention will be further described below with reference to the accompanying drawings. It should be noted that the following embodiments are only used to illustrate the technical solution of the present invention and are not intended to limit the scope of protection of the present invention. Equivalent substitutions and conventional adjustments made by those skilled in the art to the number of model layers, hidden dimensions, block length, training accuracy, device deployment methods, and parameter settings without departing from the concept of the present invention should all fall within the scope of protection of the present invention.

[0043] like Figure 1 The diagram shown illustrates the overall process of the method of this invention, which is divided into a training phase and an application phase, specifically comprising seven steps. From the perspective of model construction, this diagram describes the specific structures of the spectral awareness feature alignment module and the graph diffusion Transformer module.

[0044] Example 1: For ease of explanation, the training dataset corresponds to the training graph notation as follows: The target dataset corresponds to the target graph denoted as .in For a set of nodes, For the set of edges, This is the node feature matrix. Both the training and target sets can contain multiple graphs; for simplicity, the following description assumes only one graph. In cases involving multiple graphs, repeat the relevant operations. The query node is denoted as... The model parameters are denoted as... The tokenized encoding network is denoted as The diffusion denoising module is denoted as .

[0045] This embodiment uses an "offline training phase (steps 1-6) + application phase (step 7)" approach to achieve cross-dataset general community search: training is performed on the training dataset to obtain... Directly call on the target dataset Infer and perform community search without retraining or fine-tuning.

[0046] Step 1: Construct the sample set required for training.

[0047] Step 101: Obtain the graph data of the training dataset and construct the training graph. .in This represents the original node feature matrix of the training graph.

[0048] Step 102: Use nodes as the basic training unit. For any node... The local and multi-hop neighborhoods of this node are constructed as structural inputs for subsequent token construction (corresponding to step 3). In the implementation, each node can be... The local sequence input and the global sequence input are generated and cached simultaneously, serving as sample inputs for the model's forward pass.

[0049] Step 103: Construct the auxiliary sets required for training. Construct 1) a set of positive sample pairs and a set of candidate negative samples for contrastive learning; 2) a set of noisy time steps for diffusion refinement. With noise schedule .

[0050] The above set is used in step 6 to form a joint training objective.

[0051] Step 2: Use spectral sensing for feature alignment.

[0052] Step 201: To eliminate the inconsistency in feature dimensions between different datasets, the original features of the training image are... Mapping to a unified dimension Construct a projection matrix on the training dataset. ,implement: , in Implementation It can be obtained by non-learning methods such as PCA / SVD to avoid introducing additional training instability.

[0053] Step 202: Calculate the feature dimension evaluation score based on spectral information.

[0054] Constructing a normalized Laplace plot of the training graph: , in For adjacency matrix, This is a degree matrix. For The Column (number) (each feature dimension) is denoted as Define the frequency-weighted spectral energy fraction: .

[0055] This fraction can also be written in terms of the smoothness of the edges:

[0056] Step 203: Sort and rearrange the feature dimensions according to spectral energy alignment.

[0057] For all feature dimensions calculate Then, press Obtain sorted index in ascending order And rearrange the feature dimensions: .

[0058] Thus, the training features after spectral awareness alignment are obtained. .

[0059] Step 3: Construct a hybrid token sequence.

[0060] Step 301: Local Token Sequence Construction. For any node Take the set of its first-hop neighbors. Calculated using cosine similarity. and Similarity, select Top- Neighbors set Constructing local sequences: , in for Middle node eigenvectors, .

[0061] Step 302: Construct the global token sequence. Let For nodes of - Jump neighborhood ( For each hop-token is obtained by mean pooling. And construct a global sequence: .

[0062] Step 4: Encode the token using an encoding network.

[0063] Step 401: Encode using a Transformer encoder. Input the local sequence and the global sequence into the Transformer encoder respectively. Let the... The layer is updated as follows: , , in For the sake of the bulls' self-attention, It is a feedforward network. For layer normalization.

[0064] Step 402: Extract the first token of the sequence and merge them into a community-aware representation. The first tokens of the local sequence and the global sequence are extracted separately as two representations. , And merge to obtain the node representation: .

[0065] Obtain the initial embedding set for all nodes. .

[0066] Step 5: Reconstruct the representation using a diffusion model.

[0067] Step 501: Forward noise addition process. For the training embeddings... Perform a forward diffusion perturbation. For any time step Sampling noise ,structure: .

[0068] Step 502: Noise Predictor and Training Objective. Construct the noise prediction network. Minimize noise prediction error: .

[0069] Step 6: Model training.

[0070] Step 601: Constructing the contrastive learning objective This goal encourages each node's representation to be closer to its "community-consistent" prototype representation, while remaining further away from prototype representations aggregated from other communities or weakly related nodes. For each node... We sample a set of positive samples. With a set of negative samples . Specifically, By node The neighborhood consists of neighbors within a 1-2 hop range that are consistent with its community (prioritizing 1-hop neighbors, supplementing with 2-hop neighbors if insufficient), and Then from and Different communities and with Sampling does not occur in directly connected nodes. The corresponding prototype representation is defined as:

[0071] Comparative loss is written as:

[0072] in It is the temperature coefficient.

[0073] Step 602: Construct diffusion targets The diffusion target is calculated according to the formula in step 502, and random sampling is performed in batches during joint training. With noise .

[0074] Step 603: Construct the overall training objective. Combine the contrastive learning and diffusion objectives in a weighted manner: .

[0075] based on The parameters of the tokenized encoding network and the diffuse noise prediction network are iteratively updated end-to-end until convergence, resulting in the trained model parameters. This concludes the offline training phase.

[0076] Step 7: Perform representation construction and community search on the target dataset.

[0077] Step 701: Target image input processing (reuse step 2).

[0078] Obtain the target image With query node .right Perform dimension alignment consistent with step 201. And calculate according to steps 202–203. And rearrange to obtain spectral alignment features .

[0079] Step 702: Target graph token construction (reuse step 3).

[0080] For any node in the target graph Construct local sequences according to step 301. Construct the global sequence according to step 302. .

[0081] Step 703: Parameter freezing inference generates initial target representation (reuse step 4).

[0082] Use the trained parameters The encoding network is invoked to perform Transformer encoding on the constructed token sequence, and then the resulting tokens are fused to obtain the initial embedding set of the target graph. .

[0083] Step 704: Use the diffusion model for cross-domain adaptation.

[0084] Deterministic backsampling using DDIM (taking) This is used to perform cross-domain adaptive corrections on these representations. Specifically, the forward noise scheduling is maintained consistent with that used during training, and Gaussian noise is injected into the domain according to the same rules. Thus, the initial high-noise state is obtained. This serves as the starting point for the reverse trajectory. Then, for... In each step, we first determine the current noisy representation. With noise denoiser Estimate the corresponding clean representation:

[0085] Then use this estimate to construct the next (lower noise) state update:

[0086] After the reverse process is complete, we output the final refined representation, i.e.

[0087] Step 705: Use community rating metrics to conduct community search.

[0088] Given a query node and its representation First calculate With all nodes in the target graph similarity (Using cosine similarity), and sorting the sequences from highest to lowest similarity to obtain the final sequence. Then only consider The prefix is ​​used as a candidate community for any split position. ,make And evaluate using similarity module degree score.

[0089] in for The set of nodes, The final output makes Prefix set that yields the maximum value This refers to search results from the community.

Claims

1. A community search method applicable across datasets, characterized in that, The steps are as follows: Step 1: Construct the sample set required for training and build the training graph. ; Step 2: Use spectral sensing for feature alignment to form spectral sensing aligned training features. ; Step 3: Target the training image Nodes in the middle, construct a hybrid token sequence ; Step 4: Encode the token sequence using a Transformer encoder to obtain a unified community-aware representation. ; Step 5: Reconstruct the representation using a diffusion model; Step 6: Construct contrastive learning training objectives Positive samples come from neighboring nodes within the same community, while negative samples come from nodes in different communities that are not directly connected; the diffusion model is constructed to train the target. This is used to constrain the consistency and stability of the denoising module's recovery of the disturbance representation; The contrastive learning training objective and the diffusion model training objective are weighted and combined to form the overall training objective. Based on the overall training objective, the encoding network and denoising module are iteratively updated to obtain the trained model parameters. ; Step 7: Input the target dataset into the model obtained in Step 6 to perform community search and obtain the results.

2. The cross-dataset universal community search method according to claim 1, characterized in that, The specific method in step 1 is as follows: Step 101: Obtain the graph data of the training dataset and construct the training graph. ,in It includes at least the set of nodes, the set of edges, and the node feature matrix. ; Step 102: Determine the input units and training sample organization method in the training phase, take nodes or local structures centered on nodes as basic training units, and generate corresponding model input representations for each basic training unit; Step 103: Construct the auxiliary set required for the training phase, including a set of positive sample pairs and a set of negative sample candidates for contrastive learning, and a set of perturbation configuration parameters for diffusion refinement to support subsequent training optimization.

3. The cross-dataset universal community search method according to claim 1, characterized in that, The specific method in step 2 is as follows: Step 201: Process the training image Node features Perform a unified mapping process to obtain feature representations in a unified input space, thereby reducing the differences in feature organization between different datasets; Step 202: Based on training graphs The structural information is used to extract spectral correlation statistics, and the feature dimensions are evaluated and ranked based on the statistics to obtain the ranking index of the feature dimensions; Step 203: Rearrange the training feature representations according to the sorting index obtained in step 202 to form spectral-aware aligned training features. To improve feature consistency and transferability in cross-dataset scenarios; The candidate set, along with the set of perturbation configuration parameters for diffusion-based refinement, supports subsequent training optimization.

4. The cross-dataset universal community search method according to claim 1, characterized in that, The specific method in step 3 is as follows: Step 301: For the training image Nodes in the sequence construct a local token sequence The local token sequence is used to represent the local structure and attribute information within the neighborhood of the query node; Step 302: For the training image Nodes in the chain construct a global token sequence. The global token sequence is used to represent the aggregation information of multi-hop neighborhoods or larger range structures.

5. The cross-dataset universal community search method according to claim 1, characterized in that, The specific method in step 4 is as follows: Step 401: Input the hybrid token obtained in step 3 Input the Transformer encoder to obtain the propagated representation; Step 402: Fuse the encoded outputs of the local token and the global token to obtain the training graph. Unified community perception representation of middle nodes It is used to characterize the community-related information of nodes at the structural and semantic levels.

6. The cross-dataset universal community search method according to claim 1, characterized in that, The specific method in step 5 is as follows: Step 501: Process the training representations obtained in Step 4 Perform a forward perturbation process to generate a perturbation representation sequence, which is used to simulate representation shifts under cross-dataset distribution changes or noise perturbations. Step 502: Construct an inverse denoising module to recover a refined representation from the perturbation representation, and learn the parameters of the denoising module during the training phase.

7. The cross-dataset universal community search method according to claim 1, characterized in that, The specific method in step 7 is as follows: Step 701: Obtain the target graph corresponding to the target dataset. Node features and query nodes and to Perform the same spectral sensing feature alignment process as in step 2 to obtain ; Step 702: Based on the target graph Aligned features Perform the same hybrid token sequence construction process as in step 3 to obtain the hybrid token input for the target graph. ; Step 703: With the model parameters frozen, invoke the trained tokenized encoding network and the diffusion refining module to generate node representations in the target graph or query related representations. ,in Indicates the query node The representation; Step 704: Based on Similarity is calculated with other node representations, and a ranked list of candidate nodes is constructed to obtain the candidate set. ; Step 705: In the candidate set We construct candidate community evaluation indicators based on similarity and modularity, and filter and determine the candidate set according to a preset search strategy to obtain the final community results. ; Step 706: Output As community search results, among For containing query nodes And a set of nodes that satisfy the cohesion requirement.