Multi-domain-oriented graph model distribution external prediction method, device and system and medium

The method of generating synthetic graph data by generator and inserting an adapter module into the back end of the classifier solves the problem of insufficient generalization ability of graph neural network models in different fields, and realizes accurate prediction of out-of-distribution graph data without accessing the original data.

CN121543635APending Publication Date: 2026-02-17GREATER BAY AREA UNIV (IN PREPARATION)
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511435274.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-09
Publication Date
2026-02-17

AI Technical Summary

Technical Problem

Existing graph neural network models suffer from insufficient generalization ability in applications across different fields, making it difficult to effectively integrate multiple heterogeneous pre-trained models without accessing the original data, and they also face issues related to data privacy protection and computational efficiency.

Method used

A generator produces synthetic graph data for each pre-trained model, and an Adapter module is inserted into the classifier backend. Combined with globally learnable fusion weight parameters, the fusion loss function is optimized to achieve model fusion and parameter tuning.

Benefits of technology

Without accessing the original data, the fusion model can retain the knowledge features of each model, solve the problem of adapting heterogeneous model architectures, and improve the prediction stability and generalization ability in the distributed offset target domain.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121543635A_ABST
    Figure CN121543635A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of graph neural networks, in particular to a multi-domain-oriented graph model distribution external prediction method, device and system and a medium, and the method comprises the steps: obtaining a plurality of heterogeneous pre-training models on different graph data domains; generating composite graph data for the corresponding pre-training model through a generator under a passive data access condition; inserting a learnable Adapter module at the rear end of a classifier of each pre-training model, adjusting classifier parameters through the Adapter module to obtain adjusted parameter representation, and performing weighted fusion on a prediction result of each pre-training model through globally learnable fusion weight parameters to obtain a final fusion prediction result; simultaneously optimizing Adapter parameters and fusion weight parameters through a back propagation algorithm to obtain a trained fusion model; predicting the distribution exterior graph data from the target domain; according to the invention, accurate prediction of cross-domain distribution exterior graph data is realized.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of graph neural network, and particularly relates to a multi-domain-oriented graph model out-of-distribution prediction method, device, system and medium. BACKGROUND

[0002] With the growing size and complexity of graph-structured data, graph neural networks (GNNs) have become an important tool for extracting insights from real-world scenarios. Graph data widely exists in social networks, biological molecules, knowledge graphs, recommendation systems, and many other fields, with non-Euclidean data structure and complex relationship expression capability.

[0003] Existing graph neural network models are usually trained on single-domain data, which limits the generalization ability of the model. In practical applications, there is a more practical but often overlooked scenario: a collection of trained graph models needs to be directly used for reasoning on unseen data, i.e., out-of-distribution graph models, while the graph data used to pretrain them is inaccessible.

[0004] For example, in social network analysis, models trained on different user group data capture specific behavior patterns; in molecular property prediction, models trained on different chemical space learn specialized structure-property relationships; in knowledge graph reasoning, models trained on different domain knowledge master domain-specific logical rules. These models, although designed for similar tasks, are trained on different datasets, and each model retains specialized knowledge.

[0005] Studies have shown that although the model performs well in its own field, its performance in other fields will decrease, and different GNN architectures may perform well in different fields. This shows that by fusing the intrinsic invariance and complementary expertise of these models, it is possible to address the challenges brought by distribution shift and achieve generalization in all fields.

[0006] However, achieving this goal faces the following challenges: (1) Knowledge extraction difficulty: Unlike traditional domain generalization methods that explicitly learn domain-invariant knowledge from domain data, learning domain-invariant knowledge from model parameters is complex in our setting; (2) Architecture heterogeneity: Pretrained models may differ in architecture and hyperparameters, making it difficult to integrate the expertise of these different models into a unified representation; (3) Data privacy protection: In many real-world scenarios, the original training data cannot be obtained due to privacy, commercial secrets, or storage costs, etc. (4)Computational efficiency requirement: efficient model fusion needs to be achieved without retraining the entire model.

[0007] Therefore, there is an urgent need for a new technical solution that can effectively fuse multiple heterogeneous pre-trained graph neural network models without accessing the original data, and achieve robust generalization to out-of-distribution graph data. SUMMARY

[0008] Therefore, the purpose of the embodiments of the present application is to provide a multi-domain oriented graph model out-of-distribution prediction method, device, system and medium to solve one or more technical problems existing in the prior art and provide at least one beneficial option or create conditions.

[0009] In one aspect, the embodiments of the present application provide a multi-domain oriented graph model out-of-distribution prediction method, which comprises the following steps: Obtain a plurality of pre-trained models on different source domains, each pre-trained model having a corresponding generator; the pre-trained model is a pre-trained graph neural network model, each pre-trained model having a different architecture and the parameters being frozen; the source domain includes a molecular dataset having different chemical structure feature distributions; Generate synthetic graph data for the corresponding pre-trained model under the condition of no source data access through the generator; Construct a fusion model based on a hybrid expert network, insert a learnable Adapter module behind the classifier of each pre-trained model, adjust the classifier parameters through the Adapter module to obtain adjusted parameter representations, and weight the prediction results of each pre-trained model through globally learnable fusion weight parameters to obtain the final fusion prediction result; Optimize the Adapter parameters and the fusion weight parameters simultaneously through a backpropagation algorithm until the fusion loss of the fusion model is minimized to obtain a trained fusion model; the fusion loss includes the prediction loss between the fusion prediction result of the fusion model and the true label; Use the trained fusion model to predict out-of-distribution graph data from the target domain and output the corresponding prediction label; the out-of-distribution graph data has different distribution characteristics from the source domain.

[0010] Optionally, the generating synthetic graph data for the corresponding pre-trained model under the condition of no source data access through the generator comprises: For each pre-trained model, determine the generator corresponding to the pre-trained model, and initialize a plurality of synthetic graphs corresponding to the generator; the number of nodes in the synthetic graph is sampled from a uniform distribution, the node features are sampled from a standard normal distribution, and the class labels are sampled from a uniform distribution; The weights of the edges between the connected nodes are generated by an edge encoder, the weights are approximated as a discrete distribution to obtain an adjacency matrix; the node feature matrix, the adjacency matrix and the category label are taken as samples, and the node features and the adjacency matrix of each sample are input into a corresponding generator, the generator processes the input node features and the adjacency matrix based on a pre-trained model with frozen parameters, and generates a predicted label corresponding to the sample through an internally learnable data construction module combined with the parameter structure of the pre-trained model frozen; A loss function value between the predicted label and the sampled label is calculated, the data construction module parameters of the generator are updated by back propagation according to the loss function value of the generator, and iterative optimization is performed until the loss function value is minimized to obtain a trained generator; the loss function value includes a prediction loss between the predicted label output by each pre-trained graph model and the corresponding category label; The parameters of the pre-trained model are input into the trained generator to form a generated graph data set corresponding to the pre-trained model.

[0011] Optionally, the loss function value of the generator is obtained in the following manner: The predicted label output by the pre-trained model after the synthetic graph data generated by the generator is input into the pre-trained model is obtained, and the cross-entropy loss between the predicted label and the sampled label of the synthetic graph data is determined; For each batch normalization layer in the pre-trained model, the mean and variance of the generated data when passing through the normalization layer are calculated respectively, and compared with the historical mean and variance saved by the normalization layer during the training process, and the sum of squares of the difference between the two is taken as the batch normalization regularization term; For each generated sample, the predicted probability distribution output by the pre-trained model is taken as the logarithm, multiplied by the probability distribution itself and summed, and then averaged for all samples to obtain a confidence regularization term; The cross-entropy loss, the batch normalization regularization term and the confidence regularization term are summed to obtain the loss function value of the generator.

[0012] Optionally, the classifier parameter is adjusted by the Adapter module to obtain an adjusted parameter representation, including: The classifier parameter in the pre-trained model is down-sampled and linearly transformed by the Adapter module to reduce the feature dimension, then processed by a nonlinear activation function, and then restored to the original dimension by up-sampling and linear transformation to obtain the adjusted parameter representation.

[0013] Optionally, the prediction results of each pre-trained model are weighted and fused by the globally learnable fusion weight parameter to obtain a final fused prediction result, including: The graph data in the generated graph data set is input into a corresponding pre-training model to obtain a hidden layer representation, the hidden layer representation and a fusion weight vector of the corresponding pre-training model are subjected to a vector splicing operation, and then normalization processing is performed to obtain a fusion weight of the pre-training model; the fusion weight vector is used to dynamically adjust the contribution degree of different pre-training models in the fusion process, has a dimension consistent with the number of pre-training models, and satisfies a normalization constraint that the sum of weights is 1; For each pre-training model, the graph data is input into the pre-training model, and a prediction result of the pre-training model after adjustment of the classifier parameters of the pre-training model by the Adapter module is obtained. The output result is multiplied by the corresponding fusion weight to obtain a weighted prediction result of the pre-training model. The weighted prediction results of all pre-training models are added to obtain a final fusion prediction result.

[0014] Optionally, the fusion loss of the fusion model is obtained in the following manner: A cross-entropy loss is calculated based on the predicted label of the fusion model for the generated graph data sample and the real label of the sample to obtain a downstream task prediction loss; The L2 norm of the learnable parameters of the Adapter module of each pre-training model is accumulated and summed to obtain an Adapter parameter regularization term; The sum of the squares of all elements in the fusion weight vector is summed and then square rooted to obtain a fusion weight regularization term; The downstream task prediction loss, the fusion weight regularization term and the Adapter parameter regularization term are weighted and summed to obtain the fusion loss of the fusion model.

[0015] Optionally, the use of the trained fusion model to predict the out-of-distribution graph data from the target domain and output the corresponding prediction label comprises: The out-of-distribution graph data from the target domain is input into the trained fusion model, and the fusion model processes the input data according to the learned Adapter parameters and fusion weight parameters to output the corresponding prediction label.

[0016] In another aspect, an embodiment of the present application provides a multi-domain-oriented graph model out-of-distribution prediction device, comprising: A first module is configured to obtain a plurality of pre-training models on different source domains, each pre-training model having a corresponding generator; the pre-training model is a pre-trained graph neural network model, each pre-training model having a different architecture and the parameters being frozen; the source domain includes a molecular data set having different chemical structure feature distributions; A second module is configured to generate synthetic graph data for the corresponding pre-training model under the condition of no source data access by the generator; The third module is used to build a fusion model based on a hybrid expert network. A learnable Adapter module is inserted into the back end of the classifier of each pre-trained model. The classifier parameters are adjusted through the Adapter module to obtain the adjusted parameter representation. The prediction results of each pre-trained model are weighted and fused through globally learnable fusion weight parameters to obtain the final fusion prediction result. The fourth module is used to simultaneously optimize the Adapter parameters and fusion weight parameters through the backpropagation algorithm until the fusion loss of the fusion model is minimized, thus obtaining the trained fusion model; the fusion loss includes the prediction loss between the fusion prediction result of the fusion model and the true label. The fifth module is used to predict the distribution map data from the target domain using the trained fusion model and output the corresponding predicted labels; the distribution map data has different distribution characteristics from the source domain.

[0017] On the other hand, embodiments of the present invention provide a multi-domain graphical model distribution out-of-distribution prediction system, comprising: At least one processor; At least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor performs the method described above.

[0018] On the other hand, embodiments of the present invention provide a computer-readable storage medium storing a processor-executable program, which, when executed by a processor, is used to perform the above-described method.

[0019] The embodiments of the present invention have the following beneficial effects: This invention discloses a method, apparatus, system, and medium for out-of-distribution prediction of graph models across multiple domains. By using a generator to generate synthetic graph data matching the decision boundaries of each heterogeneous pre-trained model without accessing the original training data, it preserves the knowledge features of each model in the source domain while avoiding data privacy and access restrictions. Next, by inserting an adapter module into the classifier backend to achieve parameter fine-tuning, and combining globally learnable fusion weights to dynamically balance the contributions of different models, the fusion model can fully absorb the complementary advantages of each pre-trained model. This design not only solves the adaptation problem of heterogeneous model architectures but also improves the predictive stability and generalization ability of the model in the target domain of distribution shift through optimization of the fusion loss function with multiple regularization constraints, ultimately achieving accurate prediction of cross-domain out-of-distribution graph data. Attached Figure Description

[0020] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0021] Figure 1 This is a schematic flowchart of a multi-domain graph model distribution out-of-distribution prediction method provided by an embodiment of the present invention; Figure 2 This is a structural block diagram of a multi-domain graph model distribution external prediction device provided in an embodiment of the present invention; Figure 3 This is a structural block diagram of a multi-domain graphical model distribution external prediction system provided in an embodiment of the present invention. Detailed Implementation

[0022] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0023] It should be noted that although the device diagram shows a modular division and the flowchart illustrates a logical order, in some cases, the steps shown or described may be performed in a different order than the modular division in the device or the order shown in the flowchart. The terms "first," "second," etc., used in the specification, claims, and the aforementioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.

[0024] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.

[0025] Furthermore, the described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. Numerous specific details are provided in the following description to give a thorough understanding of embodiments of this application. However, those skilled in the art will recognize that the technical solutions of this application can be practiced without one or more of the specific details, or other methods, components, apparatuses, steps, etc., can be employed. In other instances, well-known methods, apparatuses, implementations, or operations are not shown or described in detail to avoid obscuring various aspects of this application.

[0026] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities can be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.

[0027] The flowcharts shown in the accompanying drawings are merely illustrative and do not necessarily include all content and operations / steps, nor do they necessarily have to be performed in the described order. For example, some operations / steps can be broken down, while others can be combined or partially combined; therefore, the actual execution order may change depending on the specific circumstances.

[0028] When processing cross-domain distributed external graph data in passive data scenarios (i.e., without access to the original training data), related graph neural networks face the following technical challenges: heterogeneous model architectures trained on different domains, difficulties in knowledge extraction, poor cross-domain generalization performance, and an inability to effectively integrate the complementary advantages of multiple pre-trained models to cope with distribution shifts.

[0029] The present invention aims to provide a method, apparatus, system and medium for predicting the distribution of graph models in multiple domains. It can obtain a unified model that can achieve robust generalization in new domains with distribution shifts by fusing multiple graph neural network models pre-trained in different domains and possibly with different architectures, without accessing the original training data.

[0030] like Figure 1 As shown, Figure 1 An embodiment of the present invention provides a method for predicting out-of-distribution distributions of a multi-domain graphical model, the method comprising the following steps: S100, Obtain multiple pre-trained models in different source domains, each pre-trained model having a corresponding generator; the pre-trained models are pre-trained graph neural network models, each pre-trained model having a different architecture and all parameters frozen; This step is applied to the molecular property prediction scenario in the field of drug discovery. The source domains include molecular datasets with different distributions of chemical structural features. These differences in distribution stem from systematic variations in the topological properties of the molecular graph (e.g., edge density, ring structure complexity) and chemical properties (e.g., aromaticity, functional group type). Specifically, source domains can be different subsets divided according to the edge density of the molecular graph: low edge density domains (edge ​​density < 0.3) typically correspond to chain-like aliphatic compounds, medium edge density domains (0.3 ≤ edge density < 0.6) correspond to molecules containing a small number of cyclic structures, and high edge density domains (edge ​​density ≥ 0.6) correspond to highly conjugated aromatic compounds. This structural diversity is significant in drug discovery because molecular graphs with different edge densities often represent different pharmacological behavior patterns: high edge density aromatic compounds, due to their extensive double bond networks and conjugated systems, are prone to forming reactive metabolites or adducts with DNA after metabolic activation, thus exhibiting higher mutagenic potential; while low edge density linear molecules may exert their effects through alternative toxic pathways such as alkylation.

[0031] The out-of-distribution graph data refers to molecular graph data from target domains whose distribution characteristics differ significantly from those of the training source domain. These target domain molecules may possess chemical spatial features not fully represented in the training set, such as novel skeletal structures, different functional group combinations, or topological structures outside the edge density range of the source domain. Such distribution shift scenarios frequently occur in actual drug development, for example, when pharmaceutical companies apply models trained on a class of compounds (such as benzimidazoles) to structurally related but chemically different families of molecules (such as quinolines or indoles).

[0032] The synthetic graph refers to an artificial molecular graph structure constructed by a generator, used to recover the knowledge distribution of the source domain when the original training data is inaccessible. Each synthetic graph consists of the following components: (1) Nodes: Represent atoms in a molecule. Node characteristics include atom type (carbon, nitrogen, oxygen, sulfur, etc.), atomic charge, and hybridization type (sp, sp). 2 sp 3 Chemical descriptors such as aromaticity markers, number of hydrogen atoms, and atomic valence states are typically 7 to 100-dimensional. (2) Edges and Adjacency Matrix: Represents the chemical bonds between atoms. Edge characteristics include bond type (single, double, triple, aromatic), bond energy, bond length, and conjugation. Elements of adjacency matrix A Represents atoms and atoms The existence and strength of chemical bonds between them; (3) Category label: indicates the target property of the molecule. In the mutagenicity prediction task, it is a binary label (toxic / non-toxic). In the multi-task prediction, it can be ADMET property (such as solubility level, blood-brain barrier permeability, hepatotoxicity level) or biological activity classification (such as agonist / antagonist / inactive).

[0033] This step prepares the pre-trained model and obtains... A graph neural network model pre-trained on different source domains ,in Indicates the first The parameters of each model, each model can have a different architecture (such as GCN, GAT, GIN, etc.).

[0034] S200 generates synthetic graph data for the corresponding pre-trained model under passive data access conditions through a generator. This step generates conditional label maps for each pre-trained model. The generator that is built Used to generate a minimized pre-trained model The conditional label map of prediction error is generated by a generator based on a pre-trained model with frozen parameters. Essentially, a learnable data construction module is added to the input of the frozen pre-trained model to construct (X, A, y). The output is obtained through the pre-trained model, and the loss is calculated on the output to optimize the data construction module. One pre-trained model corresponds to one generator.

[0035] S300 constructs a fusion model based on a hybrid expert network. A learnable Adapter module is inserted into the back end of the classifier of each pre-trained model. The classifier parameters are adjusted through the Adapter module to obtain the adjusted parameter representation. The prediction results of each pre-trained model are weighted and fused through globally learnable fusion weight parameters to obtain the final fusion prediction result. S400, the Adapter parameters and fusion weight parameters are optimized simultaneously through the backpropagation algorithm until the fusion loss of the fusion model is minimized, thus obtaining the trained fusion model; the fusion loss includes the prediction loss between the fusion prediction result of the fusion model and the true label; S500: The trained fusion model is used to predict the distribution map data from the target domain and output the corresponding predicted label; the distribution map data has different distribution characteristics from the source domain.

[0036] In steps S100 to S500 of this embodiment of the invention, a generator is used to generate synthetic graph data that matches the decision boundary of each heterogeneous pre-trained model without accessing the original training data. This preserves the knowledge features of each model in the source domain while avoiding data privacy and access restriction issues. Next, an adapter module is inserted into the classifier backend to fine-tune the parameters. Combined with globally learnable fusion weights, the contributions of different models are dynamically balanced, allowing the fusion model to fully absorb the complementary advantages of each pre-trained model. This design not only solves the adaptation problem of heterogeneous model architectures but also improves the model's predictive stability and generalization ability in the target domain of the distribution offset through optimization of the fusion loss function with multiple regularization terms, ultimately achieving accurate prediction of cross-domain distributional graph data.

[0037] In some embodiments, generating synthetic graph data for the corresponding pre-trained model using a generator under passive data access conditions includes: S210, For each pre-trained model, determine the generator corresponding to the pre-trained model, and initialize multiple synthetic graphs corresponding to the generator; the number of nodes in the synthetic graph is sampled from a uniform distribution, the node features are sampled from a standard normal distribution, and the category labels are sampled from a uniform distribution. S220: The weights of the edges between connected nodes are generated by the edge encoder. The weights are approximated as a discrete distribution to obtain the adjacency matrix. The node feature matrix, adjacency matrix, and category label are used as samples. The node features and adjacency matrix of each sample are input into the corresponding generator. The generator processes the input node features and adjacency matrix based on the pre-trained model with frozen parameters. Through its internal learnable data construction module, combined with the parameter structure frozen by the pre-trained model, the generator generates the predicted label corresponding to the sample. S230, calculate the loss function value between the predicted label and the sampled label, backpropagate the generator's data construction module parameters based on the generator's loss function value, iterate and optimize until the loss function value is minimized, and obtain the trained generator; the loss function value includes the prediction loss between the predicted label output by each pre-trained graph model and the corresponding category label; S240: Input the parameters of the pre-trained model into the trained generator to form the generated graph dataset corresponding to the pre-trained model.

[0038] It should be noted that a key problem addressed by this invention is model merging in data-free scenarios. The generator constructs data in a parameterized manner, then calculates the output of the pre-trained model with frozen parameters and the loss against the sampled labels, thereby optimizing the parameterized data and ultimately obtaining the generated data. In the generator module of this invention, the parameters of the pre-trained model are frozen, and the data is parameterized. This means that the generator's training does not require data setup, so no training set is needed; the generator's input is the pre-trained model parameters.

[0039] Generate a minimized pre-trained model The process of creating a conditional labeling plot for prediction errors is as follows: Sampling node features from standard normal distribution ,in To generate the number of nodes, For feature dimensions; specifically, the standard normal distribution focuses on node features. Each element is independently and identically sampled from a normal distribution with a mean of 0 and a variance of 1, thereby ensuring that the generated node features have diversity and randomness; Labels were obtained from samples taken from a uniform distribution. As a conditional posterior truth value; label With the generated node features Matching is used to guide the generator in constructing a model that minimizes the pre-trained model. Conditional label graph of prediction error; uniform distribution ensures label diversity and unbiasedness, which helps the generator explore a wider label space; Generate an adjacency matrix using an edge encoder. : ,in This is a three-layer fully connected neural network, where [·; ·] represents a concatenation operation; It is the first There are n*n adjacency matrices. Defined as an adjacency matrix Corresponding nodes in the graph and nodes The weight of the edges connecting them. Any commonly used activation function, such as the ReLU function; express Middle node and nodes The splicing of features.

[0040] The weights of the edges are approximated as a discrete distribution, and the function takes the following form: (1); in, , , Temperature coefficient; Representing the adjacency matrix The element in the k-th row and l-th column is the weight of the edge connecting node k and node l. Representing the adjacency matrix The discrete distribution of the element in the k-th row and l-th column is the discrete distribution of the edge weights between node k and node l.

[0041] The generator is obtained through the above steps. The generated graph dataset and the overall generated graph dataset ,in This indicates the number of samples in the dataset, with each sample representing a different number of samples. , Corresponding generators The system generates the node feature matrix, adjacency matrix, and class labels for each sample. M represents the total number of pre-trained models, with each pre-trained model corresponding to a generated graph dataset.

[0042] Finally, each generator is optimized by minimizing the generation loss function.

[0043] In some embodiments, the loss function value of the generator is obtained in the following manner: Obtain the predicted label output by the pre-trained model after inputting the synthetic graph data generated by the generator into the corresponding frozen parameters, and determine the cross-entropy loss between the predicted label and the sampled label of the synthetic graph data; For each batch normalization layer in the pre-trained model, the mean and variance of the generated data when passing through the normalization layer are calculated and compared with the historical mean and variance saved by the normalization layer during training. The sum of the squares of the differences between the two is used as the batch normalization regularization term. For each generated sample, the logarithm of the predicted probability distribution output by the pre-trained model is multiplied by the probability distribution itself and summed. Then, the average is calculated over all samples to obtain the confidence regularization term. The generator's loss function value is obtained by summing the cross-entropy loss, batch normalization regularization term, and confidence regularization term.

[0044] Specifically, the loss function is as follows: (2); in, For cross-entropy loss, Indicates sample After pre-trained model The output result after that, To batch the normalization regularization terms, This is the confidence level regularization term.

[0045] The batch normalization regularization term The calculation formula is: ; in This represents the index of the batch normalization layer; for example, L=1 corresponds to the first normalization layer. This represents the historical data stored in the batch normalization layer of the pre-trained model. and Let A and B represent the mean and variance, respectively; E is the symbol for expectation, E[a|b] refers to the conditional expectation of random variable a under condition b; that is, the average value of random variable a under condition b.

[0046] The confidence regularization term The calculation is as follows: ; in, express The number of samples in the set. The generator is trained using the Adam optimizer with a learning rate of 0.001 for 200 epochs.

[0047] The process of generating a fusion model based on a hybrid expert network includes constructing a task adaptation module and an expert merging layer, as detailed below: To achieve efficient transfer and fusion while keeping the encoder parameters of the pre-trained models frozen, this invention introduces a learnable Adapter module into the classifier part of each pre-trained model and designs a globally learnable weight vector to weight the output of each pre-trained model.

[0048] The Adapter module is a lightweight bottleneck structure used to adjust feature representations in a low-dimensional space and introduce a small number of learnable parameters to avoid the risk of overfitting caused by large-scale parameter updates.

[0049] The specific structure of the Adapter module includes: Downsampling linear transformation reduces the input feature dimension to a smaller bottleneck dimension; Nonlinear activation functions (such as ReLU or GELU); Upsampling linear transformation restores the feature dimensions to their original size.

[0050] Mathematically, for each pre-trained model Classifier parameters Its representation after passing through the Adapter module is as follows: (3); (4); in, , The learnable weight matrix for the Adapter module. It is a non-linear activation function; This represents the Adapter parameters of the i-th pre-trained model; It is a pre-trained model The original classifier parameters are kept frozen to avoid overfitting; This is the parameter representation after adjustment by the Adapter module.

[0051] In some embodiments, adjusting the classifier parameters through the Adapter module to obtain the adjusted parameter representation includes: The Adapter module performs a downsampling linear transformation on the classifier parameters in the pre-trained model to reduce the feature dimension. After processing with a non-linear activation function, it performs an upsampling linear transformation to restore the dimension, resulting in the adjusted parameter representation.

[0052] Specifically, the downsampling linear transformation first maps the input high-dimensional classifier parameters to a lower-dimensional bottleneck space, thereby reducing the number of parameters and computational complexity. Next, a non-linear activation function (e.g., ReLU or GELU) is applied to the downsampled features, introducing non-linear expressive power into the model and enhancing its ability to fit complex data. Subsequently, the upsampling linear transformation remaps the low-dimensional features back to the original dimensions, ensuring that the adjusted classifier parameters remain consistent with the output structure of the pre-trained model. Finally, the adjusted classifier parameters are represented as the sum of the original parameters and an adjustment amount determined by a learnable weight matrix and a non-linear activation function, i.e., the form described by equations (3) and (4). This process not only preserves the core feature extraction capability of the pre-trained model encoder but also achieves fine-tuning of the classifier part through a small number of learnable parameters, thereby improving the model's adaptability and generalization ability in new domains or tasks.

[0053] In some embodiments, the weighted fusion of the prediction results of each pre-trained model using globally learnable fusion weight parameters to obtain the final fused prediction result includes: S310, any graph data in the generated graph dataset is input into the corresponding pre-trained model to obtain the hidden layer representation. The hidden layer representation and the fusion weight vector of the corresponding pre-trained model are concatenated and then normalized to obtain the fusion weight of the pre-trained model. The fusion weight vector is used to dynamically adjust the contribution of different pre-trained models in the fusion process. Its dimension is consistent with the number of pre-trained models and satisfies the normalization constraint that the sum of the weights is 1. S320, For each pre-trained model, input the graph data into the pre-trained model and obtain the prediction result after the classifier parameters of the pre-trained model have been adjusted by the Adapter module; S330, Multiply the output result and the corresponding fusion weight to obtain the weighted prediction result of the pre-trained model; S340 sums the weighted prediction results of all pre-trained models to obtain the final fusion prediction result.

[0054] In this embodiment, in order to fuse the predictions of multiple pre-trained models, the present invention designs a learnable fusion weight vector u, which is normalized by the softmax function to obtain the fusion weight distribution: (5); in, The number of pre-trained models, This represents the fusion weights corresponding to the i-th pre-trained model. For the fusion weight vector The i-th element; given the generated graph dataset Any graph data in , To generate graph data Input into the pre-trained model The obtained hidden layer representation. This represents the vector concatenation operation. This represents the fusion weight, ensuring that all weights are non-negative and sum to 1.

[0055] Based on the above description, the fusion function for multiple pre-trained models can be defined as follows: ; in, This indicates that the i-th pre-trained model is input to the synthetic graph data. Furthermore, the prediction result after the classifier parameters are adjusted by the Adapter module, y represents the result obtained by fusing weights. The predicted labels are obtained by weighted fusion of the prediction results from the pre-trained model.

[0056] In some embodiments, the fusion loss of the fusion model is obtained in the following manner: Based on the cross-entropy loss calculated between the predicted label of the generated graph data sample and the true label of the sample using the fusion model, the prediction loss of the downstream task is obtained. The L2 norms of the learnable parameters of each pre-trained model Adapter module are summed to obtain the Adapter parameter regularization term; The square root of the sum of the squares of all elements in the fusion weight vector is used to obtain the fusion weight regularization term. The fusion loss of the fusion model is obtained by weighted summing of the downstream task prediction loss, the fusion weight regularization term, and the Adapter parameter regularization term.

[0057] Finally, this invention jointly optimizes the Adapter parameters and fusion weight parameters by minimizing the following fusion loss function: ; in, It is the prediction loss for downstream tasks (such as classification tasks) (e.g., cross-entropy loss). This represents the Adapter parameters of the i-th pre-trained model. and The hyperparameter for balancing the regularization term has a value range of (0, 1) and is used to control the smoothness of the fusion weights and the norm of the Adapter parameter.

[0058] Predicted loss of downstream tasks in the fusion loss function Defined as: ; ; in, It's an Adapter parameter. These are the fusion weight parameters. These are graph data samples from the training set. This is a sample of graph data. The true label, It is the cross-entropy loss function. This indicates the corresponding pre-trained model for graph data samples. Predicted labels.

[0059] Downstream task prediction loss is used to measure the difference between the model's prediction results and the true labels; fusion weight regularization term is used to prevent weights from being overly concentrated on one or more pre-trained models, thereby ensuring the diversity and robustness of the fusion; Adapter parameter regularization term is used to control the complexity of the Adapter module and prevent overfitting.

[0060] During the optimization process, this invention selects Adam as the optimizer, with its learning rate set to 0.001 and decaying in each round to ensure rapid convergence of the model in the early stages of training, while allowing for fine-tuning of parameters in the later stages. After a preset number of training rounds, the trained fusion model is output, which demonstrates good adaptability and generalization ability in new domains or tasks.

[0061] In a specific implementation case, we first generate 300 samples using a generator based on the graph model trained on the MUTAG dataset. In the generator part, one generator corresponds to one model, resulting in a batch of generated graphs. All graphs are then merged together as a training set to train the subsequent fusion module. These samples preserve the original data distribution of MUTAG. Then, these 300 samples serve as the training set to train the fusion module, with its labels being binary classification, just like the MUTAG data.

[0062] The data flow is as follows: ① There are already M pre-trained graph models, and all parameters are frozen.

[0063] ② For each graph model, a generator is constructed where the model parameters are fixed, and the constructed graph data is parameterized and learnable. The loss is calculated using the learnable data and a fixed model, and then backpropagated to optimize the data. Finally, after multiple epochs, a batch of well-learned graph data is obtained.

[0064] ③Merge all the graph data obtained by the generators into a set, which will be used as the training data for the second stage.

[0065] ④ In the second stage, the M pre-trained graph models are reused, but an adapter is added to the classification head of each model for fine-tuning. The training data is input into the M graph models to obtain the outputs. The outputs are then weighted and fused to obtain the final predicted label for each training data point. The loss is calculated, and backpropagation is used to optimize the adapter and fusion weights in this stage.

[0066] In some embodiments, the step of using a trained fusion model to predict the distribution map data from the target domain and outputting the corresponding predicted label includes: The distribution map data from the target domain is input into the trained fusion model. The fusion model processes the input data according to the learned Adapter parameters and fusion weight parameters, and outputs the corresponding predicted labels.

[0067] In this embodiment, when the out-of-distribution map data of the target domain is input into the fusion model, it is first assigned to the corresponding pre-trained model for processing. Each pre-trained model uses its frozen encoder parameters to extract deep features from the input map data, generating a hidden layer representation. Next, this hidden layer representation is concatenated with the corresponding elements in the fusion weight vector, and normalized using the softmax function to obtain the fusion weight of the pre-trained model. This weight dynamically reflects the model's contribution to the current input data. Simultaneously, the classifier parameters of the pre-trained model are adjusted by the Adapter module. The Adapter module maps the high-dimensional classifier parameters to the bottleneck space through a downsampling linear transformation, enhances the nonlinear expressiveness through a nonlinear activation function, and then restores them to the original dimension through an upsampling linear transformation, forming the adjusted classifier parameters. Subsequently, the adjusted classifier parameters generate a prediction result based on the hidden layer representation extracted by the encoder. This prediction result is multiplied by the corresponding fusion weight to obtain a weighted prediction result. Finally, the weighted prediction results of all pre-trained models are summed, which is the final predicted label of the out-of-distribution map data of the target domain by the fusion model, achieving effective prediction of out-of-distribution data.

[0068] The following is a specific example: Step 101: Obtain M=6 pre-trained graph neural network models on different source domains. Specifically, based on the edge density of the graph data, the molecular property prediction dataset is divided into two subsets with different distributions (low edge density subset and medium edge density subset), and three different graph model architectures are pre-trained on these subsets: (1) Train a 2-layer GCN (Graph Convolutional Network) model on a low-side density subset with a hidden layer dimension of 32; (2) Train a 2-layer GCN model on a subset of medium edge density with a hidden layer dimension of 32; (3) Train a 2-layer GAT (Graph Attention Network) model on a low-side-density subset, with a hidden layer dimension of 32 and an attention head of 4; (4) Train a 2-layer GAT model on a subset of medium edge density, with a hidden layer dimension of 32 and an attention head of 4; (5) Train a 2-layer GIN (Graph Isomorphic Network) model on a low-side-density subset with a hidden layer dimension of 32; (6) Train a 2-layer GIN model on a subset of medium edge density with a hidden layer dimension of 32.

[0069] Each model was used for a binary classification task (molecule toxic / non-toxic), trained using the cross-entropy loss function, with a learning rate of 0.01, for 200 epochs.

[0070] Step 102: Build a generator for each pre-trained model The generator contains a side encoder, which uses a three-layer fully connected neural network structure.

[0071] Step 103: Initialize 50 composite graphs as generation objects, with the number of nodes for each graph sampled from a uniform distribution. Then, sample node features from a standard distribution as initialization.

[0072] Step 104, from uniform distribution Mid-sample binary classification labels As the true labels for the composite graphs. That is, construct corresponding true labels for 50 composite graphs, following a uniform distribution.

[0073] Step 105: Generate an adjacency matrix using an edge encoder for each pair of nodes in the graph. Calculate the adjacency matrix .

[0074] Step 106: Use the Gumbel-Softmax technique to approximate the continuous edge weights as discrete adjacency relationships. Temperature coefficient The initial value is set to 1.0, and during training, it is gradually annealed to 0.1 using an exponential decay method.

[0075] Step 107: Define the loss function for the generator. In addition to classification loss, the loss function also includes batch normalization regularization term and confidence regularization term.

[0076] Step 108: Repeat steps 103 to 107 for each pre-trained model to obtain a total of 300 generated graphs in 6 parts for subsequent model fusion training.

[0077] Step 109: For each pre-trained model, identify its classifier layer parameters (usually the final fully connected layer), while keeping the encoder layer parameters frozen. Insert a learnable adapter layer at the back end of the classifier; the adapter parameters are fine-tuned during the fusion training phase. The adapter layer is designed as a bottleneck structure with downsampling, non-linearity, and upsampling.

[0078] Step 110: Construct a fusion model to achieve multi-expert fusion for specific samples. The parameters of the fusion model are initialized using the Xavier initialization strategy.

[0079] Step 111, generate the graph The corresponding weights are calculated using a fusion model.

[0080] For all pre-trained models, predictions are made using a frozen encoder and a classification head with an adapter layer. Finally, the predictions from all pre-trained models are weighted and fused according to the fusion weights to obtain the final prediction result.

[0081] Step 112: Based on the prediction results and the generated graph data obtained in Step 108, the fusion model parameters are trained using the fusion loss function, ultimately outputting the trained fusion model. This model can robustly predict new out-of-distribution graph data, and is particularly suitable for graph classification tasks where the distribution of the test data differs from that of the training data. The optimizer is Adam, the learning rate is set to 0.001, and decays in each epoch. The training epochs are 20.

[0082] This invention solves the technical challenge of cross-domain generalization of graph neural networks under passive domain data conditions; it achieves effective integration of heterogeneous graph model architectures and breaks through the limitations of architecture compatibility; and it significantly improves the cross-domain generalization ability of the model while protecting data privacy.

[0083] Compared with related technologies, the present invention has the following advantages: In the sample generation stage, by constructing a conditional label graph generator, this invention can generate optimized synthetic graph data for each pre-trained model without accessing the original training data. The conditional label graph generation process employs a discretized side encoder constructed from a feedforward neural network, which can generate graph data with reasonable topological structure and feature distribution, providing high-quality training samples for subsequent model fusion and effectively solving the problem of lack of training data in out-of-distribution scenarios.

[0084] During the expert fusion phase, a lightweight bottleneck structure design in the Adapter adaptive module achieves efficient domain adaptation and feature adjustment by introducing a small number of learnable parameters while keeping the encoder parameters of the pre-trained model frozen. This design avoids the overfitting risk that may arise from large-scale parameter updates, while ensuring that the original feature extraction capabilities of the pre-trained model are maintained, significantly improving the model fusion effect and generalization ability.

[0085] The generator loss function of this invention combines classification loss, batch normalization regularization, and confidence regularization to ensure the quality and diversity of the generated graph data. Specifically, the batch normalization regularization ensures compatibility between the generated data and the original training distribution by constraining the statistical characteristics of the generated data in the batch normalization layer of the pre-trained model to remain consistent with historical data. The confidence regularization encourages the generation of diverse and challenging samples by maximizing prediction entropy, thus improving the model's robustness. In the second stage, the fusion model loss function achieves effective fusion of multiple heterogeneous models through joint optimization of task loss, fusion weight regularization, and adapter parameter regularization. Specifically, L2 regularization of the fusion weights ensures the smoothness of the weight distribution, preventing any single model from becoming overly dominant; regularization of the adapter parameters controls model complexity and prevents overfitting. The two-stage loss function design allows the fusion model to fully utilize the advantages of each pre-trained model, maintaining stable prediction performance even when facing graph data with distributional shifts, achieving true robust generalization.

[0086] See Figure 2 This invention provides a multi-domain graph model distribution out-of-domain prediction device, comprising: The first module is used to acquire multiple pre-trained models in different source domains, each pre-trained model having a corresponding generator; the pre-trained models are pre-trained graph neural network models, each pre-trained model having a different architecture and all parameters frozen; the source domains include molecular datasets with different chemical structure feature distributions; The second module is used to generate synthetic graph data for the corresponding pre-trained model under passive data access conditions through a generator. The third module is used to build a fusion model based on a hybrid expert network. A learnable Adapter module is inserted into the back end of the classifier of each pre-trained model. The classifier parameters are adjusted through the Adapter module to obtain the adjusted parameter representation. The prediction results of each pre-trained model are weighted and fused through globally learnable fusion weight parameters to obtain the final fusion prediction result. The fourth module is used to simultaneously optimize the Adapter parameters and fusion weight parameters through the backpropagation algorithm until the fusion loss of the fusion model is minimized, thus obtaining the trained fusion model; the fusion loss includes the prediction loss between the fusion prediction result of the fusion model and the true label. The fifth module is used to predict the distribution map data from the target domain using the trained fusion model and output the corresponding predicted labels; the distribution map data has different distribution characteristics from the source domain.

[0087] It is evident that the content of the above method embodiments is applicable to this device embodiment. The specific functions implemented in this device embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.

[0088] See Figure 3 This invention provides a multi-domain graphical model distribution out-of-domain prediction system, comprising: At least one processor; At least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor performs the method described above.

[0089] It is evident that the content of the above method embodiments is applicable to this system embodiment. The specific functions implemented in this system embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.

[0090] Furthermore, this application also discloses a computer program product or computer program stored in a computer-readable storage medium. A processor of a computer device can read the computer program from the computer-readable storage medium, and the processor executes the computer program, causing the computer device to perform the described method. Similarly, the content of the above method embodiments is applicable to this storage medium embodiment. The specific functions implemented in this storage medium embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.

[0091] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0092] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.

[0093] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0094] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.

[0095] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0096] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0097] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0098] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0099] The preferred embodiments of the present application have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present application. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and substance of the embodiments of the present application shall be within the scope of the claims of the present application.

Claims

1. A multi-domain oriented graph model distribution out-of-distribution prediction method, characterized in that, The method comprises the following steps: obtaining a plurality of pre-training models on different source domains, each pre-training model having a corresponding generator; the pre-training model is a pre-trained graph neural network model, each pre-training model has a different architecture and the parameters are frozen; the source domain includes a molecular dataset having different chemical structure feature distributions; generating synthetic graph data for the corresponding pre-training model under the condition of no source data access through the generator; building a fusion model based on a hybrid expert network, inserting a learnable Adapter module behind the classifier of each pre-training model, adjusting the classifier parameters through the Adapter module to obtain adjusted parameter representations, and weighting and fusing the prediction results of each pre-training model through global learnable fusion weight parameters to obtain the final fusion prediction result; optimizing the Adapter parameters and the fusion weight parameters simultaneously through a back propagation algorithm until the fusion loss of the fusion model is minimized to obtain a trained fusion model; the fusion loss includes the prediction loss between the fusion prediction result of the fusion model and the true label; using the trained fusion model to predict the out-of-distribution graph data from the target domain and output the corresponding prediction label; the out-of-distribution graph data has different distribution characteristics from the source domain.

2. The multi-domain oriented graph model distribution out-of-forecast method according to claim 1, characterized in that, The method comprises the following steps: for each pre-training model, determining the corresponding generator of the pre-training model, and initializing a plurality of synthetic graphs corresponding to the generator; the number of nodes in the synthetic graph is sampled from a uniform distribution, the node features are sampled from a standard normal distribution, and the class label is sampled from a uniform distribution; generating the weights of the edges between connected nodes through an edge encoder, approximating the weights to a discrete distribution to obtain an adjacency matrix; inputting the node feature matrix, the adjacency matrix and the class label as samples, inputting the node features and the adjacency matrix of each sample into the corresponding generator, and generating the prediction label corresponding to the sample through the internal learnable data construction module of the generator based on the pre-training model with frozen parameters and the parameter structure of the pre-training model; calculating the loss function value between the prediction label and the sampled label, updating the data construction module parameters of the generator through back propagation according to the loss function value of the generator, and iteratively optimizing until the loss function value is minimized to obtain a trained generator; the loss function value includes the prediction loss between the prediction label output by each pre-training graph model and the corresponding class label; inputting the parameters of the pre-training model into the trained generator to form a synthetic graph dataset corresponding to the pre-training model.

3. The multi-domain oriented graph model distribution out-of-forecast method according to claim 2, characterized in that, The loss function value of the generator is obtained by the following method: obtaining the prediction label output by inputting the synthetic graph data generated by the generator into the pre-training model with frozen parameters, and determining the cross-entropy loss between the prediction label and the sampled label of the synthetic graph data; For each batch normalization layer in the pre-training model, the mean and variance of the generated data passing through the normalization layer are calculated respectively, and compared with the historical mean and variance saved by the normalization layer during the training process, and the sum of the squares of the difference between the two is taken as the batch normalization regularization term; For each generated sample, the prediction probability distribution output by the pre-training model is taken logarithm, multiplied by the probability distribution itself and summed, and then averaged over all samples to obtain the confidence regularization term; The cross-entropy loss, batch normalization regularization term and confidence regularization term are summed to obtain the loss function value of the generator.

4. The multi-domain oriented graph model distribution out-of-forecast method according to claim 1, characterized in that, The adjustment of the classifier parameters in the pre-training model through the Adapter module to obtain the adjusted parameter representation includes: Through the Adapter module, the classifier parameters in the pre-training model are down-sampled and linearly transformed to reduce the feature dimension, then processed by a nonlinear activation function, and then restored to the original dimension through up-sampling and linear transformation to obtain the adjusted parameter representation.

5. The multi-domain oriented graph model distribution out-of-forecast method according to claim 1, characterized in that, The final fusion prediction result is obtained by weighting and fusing the prediction results of each pre-training model through the globally learnable fusion weight parameter, including: The graph data in the generated graph data set is input into the corresponding pre-training model to obtain the hidden layer representation, and the hidden layer representation and the fusion weight vector of the corresponding pre-training model are subjected to vector splicing operation and then normalized to obtain the fusion weight of the pre-training model; the fusion weight vector is used to dynamically adjust the contribution of different pre-training models in the fusion process, and the dimension is consistent with the number of pre-training models, and satisfies the normalization constraint that the sum of the weights is 1; For each pre-training model, the graph data is input into the pre-training model to obtain the prediction result of the pre-training model after the adjustment of the classifier parameters through the Adapter module; The output result is multiplied by the corresponding fusion weight to obtain the weighted prediction result of the pre-training model; The weighted prediction results of all pre-training models are added to obtain the final fusion prediction result.

6. The multi-domain oriented graph model distribution out-of-forecast method according to claim 1, characterized in that, The fusion loss of the fusion model is obtained in the following way: The cross-entropy loss is calculated based on the predicted label of the generated graph data sample by the fusion model and the true label of the sample to obtain the downstream task prediction loss; The L2 norm of the learnable parameters of the Adapter module of each pre-training model is accumulated and summed to obtain the Adapter parameter regularization term; The square root of the sum of the squares of all elements in the fusion weight vector is taken to obtain the fusion weight regularization term; The downstream task prediction loss, fusion weight regularization term and Adapter parameter regularization term are weighted and summed to obtain the fusion loss of the fusion model.

7. The multi-domain oriented graph model distribution out-of-forecast method according to claim 1, characterized in that, The trained fusion model is used to predict the out-of-distribution graph data from the target domain and output the corresponding prediction label, including: The out-of-distribution graph data from the target domain is input into the trained fusion model, and the fusion model processes the input data according to the learned Adapter parameters and fusion weight parameters to output the corresponding prediction label.

8. A multi-domain oriented graph model distribution out-of-distribution prediction apparatus, characterized in that, It includes: The first module is configured to obtain a plurality of pre-training models on different source domains, each pre-training model having a corresponding generator; The pre-training model is a pre-trained graph neural network model, each of the pre-training models has a different architecture and parameters are frozen; the source domain includes a molecular dataset having different chemical structure feature distributions; The second module is configured to generate synthetic graph data for the corresponding pre-training model under a condition of passive data access by using a generator; The third module is configured to construct a fusion model based on a hybrid expert network, insert a learnable Adapter module behind a classifier of each pre-training model, adjust the parameters of the classifier through the Adapter module to obtain adjusted parameter representations, and weight and fuse the prediction results of each pre-training model through global learnable fusion weight parameters to obtain a final fusion prediction result; The fourth module is configured to simultaneously optimize the Adapter parameters and the fusion weight parameters through a back propagation algorithm until a fusion loss of the fusion model is minimized to obtain a trained fusion model; the fusion loss includes a prediction loss between the fusion prediction result of the fusion model and a real label; The fifth module is configured to use the trained fusion model to predict a corresponding prediction label for out-of-distribution graph data from a target domain; the out-of-distribution graph data has different distribution characteristics from the source domain.

9. A multi-domain oriented graph model distribution out-of-forecast system, characterized in that, Comprise: At least one processor; At least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the method of any one of claims 1 to 7.

10. A computer readable storage medium having stored therein a program which is executable by a processor, characterized in that, The program executable by the processor when executed by the processor is used to execute the method of any one of claims 1 to 7.