A service classification method fusing heterogeneous information network and generative adversarial network

By constructing a heterogeneous information network and combining it with generative adversarial networks for adversarial training, the problems of robustness and semantic capture in Web service classification are solved, achieving more efficient service classification results.

CN115238073BActive Publication Date: 2025-11-07HUNAN UNIV OF SCI & TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210856551.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-20
Publication Date
2025-11-07
Estimated Expiration
2042-07-20

AI Technical Summary

Technical Problem

Existing Web service classification methods lack robustness in heterogeneous information networks, cannot effectively capture rich semantic information, and traditional methods ignore the heterogeneity of nodes and relationships.

Method used

A heterogeneous information network is constructed, and the Metapath2vec model is used for service embedding representation. It is combined with a generative adversarial network (GAN) for adversarial training. Through the game between the generator and the discriminator, high-quality service feature embeddings are learned and the service classification is optimized.

Benefits of technology

It improves the accuracy and robustness of Web service classification, effectively preserves the rich semantic information of service nodes, and enhances classification accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115238073B_ABST
    Figure CN115238073B_ABST
Patent Text Reader

Abstract

The application discloses a service classification method fusing heterogeneous information network and generative adversarial network, comprising the following steps: (1) service heterogeneous information network construction and Metapath2vec network representation; (2) GAN adversarial training; (3) service classification. The application belongs to the technical field of Internet, and specifically refers to a method for constructing a heterogeneous information network according to the structural relationship between Web services and the attribute information of the Web services; then, the feature embedding of the services is obtained by training based on random walk of a meta path and in combination with service nodes and neighbor nodes; finally, the adversarial training is realized by using a GAN model with relationship perception, high-quality negative sample information is learned through the maximum-minimum game of a generator and a discriminator, the feature embedding of the services is optimized, and thus the service classification method fusing the heterogeneous information network and the generative adversarial network for Web service classification is realized.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of Internet, and particularly relates to a service classification method combining a heterogeneous information network and a generative adversarial network. BACKGROUND

[0002] In recent years, with the development of service computing, Web service discovery and mining have become a hot research direction. Studies have shown that correct and efficient Web service classification can effectively improve the performance of Web service discovery. At present, a large number of studies on Web service classification are mainly based on functional semantics service classification. Among them, Crosso et al. divide the elements in WSDL, remove stop words, and then classify them into roots, and then use different classification algorithms for classification. Katakis et al. consider the text description and semantic annotation of Web services, and solve the automatic classification problem of Web services in their application field. Ye et al. combine all discrete features in the Web service description document, and use the Wide & Bi-LSTM model to predict the Web service category. Chen et al. use the LSA model to perform global topic modeling on the content text of mobile applications, and then use the BiLSTM model to perform local hidden representation on the content text, and propose a mobile application classification method enhanced by a topic attention mechanism. Shi et al. propose a probability topic model MR-LDA considering multiple Web service relationships, which can model the relationship between the combination of Web services and the relationship between the shared labels of Web services. However, due to the sparsity of WSDL document data, it is difficult for the topic model to obtain effective service representation, and the effect of service classification is not obvious.

[0003] Recently, some researchers have begun to study network embedding models and technologies and apply them to classification tasks. Network embedding has the ability to learn node representations that preserve structure, and typical models and methods include random walk (such as Node2vec), neighborhood representation (such as LINE), etc. However, these models and methods are mostly suitable for homogeneous networks, but cannot learn semantic preserving representations in HIN. In order to combine the advantages of HIN and network embedding, some methods have been used for representation learning in HIN, using meta-path-based context for semantic preserving embedding, and achieving good results in classification tasks. Among them, Wan et al. proposed using class-level meta-paths to achieve very effective active learning and good classification performance in HIN. Du et al. proposed to use weight active learning multi-semantic meta-paths to achieve classification in order to effectively alleviate the problem of data sparsity.

[0004] In the above work, the heterogeneous information network method mainly focuses on capturing rich semantic information on the heterogeneous information network, and does not pay attention to the underlying distribution of nodes, so it lacks robustness for real networks which are usually sparse and noisy. According to the research, the generative adversarial network (GAN) can learn a more robust representation using the adversarial principle, and performs excellently in many problems. Usually, they impose a fixed prior distribution on the embedding space to enhance the robustness of the learned representation. However, these methods ignore the heterogeneity of nodes and relationships, and cannot capture the rich semantics on HIN. SUMMARY

[0005] In order to solve the above problems, the application provides a service classification method combining heterogeneous information network and generative adversarial network. The method first constructs a heterogeneous information network according to the structural relationship between Web services and the attribute information of itself. Then, the feature embedding of the service is obtained by training based on the random walk of the meta path and the combination of the service node and the neighbor node. Finally, the GAN model with relationship perception is used to realize the adversarial training. The high-quality negative sample information is learned through the maximum-minimum game of the generator and the discriminator, and the feature embedding of the service is optimized, so as to realize the Web service classification.

[0006] In order to realize the above functions, the technical scheme adopted by the application is as follows: a service classification method combining heterogeneous information network and generative adversarial network, comprising the following steps:

[0007] (1) Service heterogeneous information network construction and Metapath2vec network representation: the meta path shown in Table 1 is constructed, and the embedding representation between two services is calculated by using the Metapath2vec model. Metapath2vec learns network representation through random walk based on meta path and heterogeneous Skip-gram model, and captures the semantic and structural correlation between different types of nodes;

[0008] Table 1 Service related meta path

[0009]

[0010] (2) GAN adversarial training: SC-GAN mainly consists of two competing modules, namely discriminator and generator. Given a service node, the generator tries to generate a pseudo sample associated with the given service node to provide to the discriminator. The discriminator tries to improve its parameters to separate the false sample from the real sample actually connected to the given node. In this repeated process, the trained discriminator forces the producer to produce better false samples, and the discriminator enhances its judgment ability. In this iterative process, both the generator and the discriminator are positively reinforced.

[0011] (3) Service classification: The service node embedding of the SC-GAN model is input into a full connection layer, and a multinomial Logistic regression function is used to output the probability distribution of all candidate Web service categories;

[0012] The Logistic regression is used to predict the probability of different possible results of a dependent variable with a category distribution, and the output value of the multi-classification is converted into a relative probability representing the probability of the node belonging to a specific category, which is calculated according to formula (10), wherein k models respectively predict the probability of the training data belonging to a certain category, k is the number of candidate Web service categories, and w represents the weight matrix corresponding to the service node, represents the feature embedding of the vector;

[0013]

[0014] In the model training process, for all K possible classification results, K-1 independent binary logistic regression models are run, in which one category is regarded as the main category, and then the other K-1 categories and the selected main category are respectively subjected to regression operation; the maximum value of the log-likelihood is equivalent to the minimum value of the loss function, wherein the log-likelihood is calculated as follows:

[0015]

[0016] Further, in the TransE heterogeneous information network embedding method in step (2), each triple <s, r, v> (s and v represent two relationally associated service nodes, and r represents the edge type between them) in the service heterogeneous information network is represented by the latent vector of the two service nodes s and v∈V, and the latent vector of the relationship r∈R;

[0017] The generator G(·; θ G ) generates samples from the base continuous distribution using the following Gaussian distribution:

[0018]

[0019] wherein, and represent the service node embedding of the generator and the relationship matrix of the generator , respectively;

[0020] The formula of the generator is as follows:

[0021] G(s, r; θ G ) = f(W L … f(W1e + b1) + b L )

[0022] from the distribution where W * and b * denote the weight matrix and bias vector of each layer, respectively, and f is the activation function;

[0023] The set of generator parameters is i.e., the union of all node embeddings and relation matrices and the parameters of the MLP;

[0024] where λ G > 0 controls the regularization term;

[0025] The generator parameters θ G are optimized by minimizing:

[0026]

[0027] Further, the step (2) of the method, the discriminator D(e v |s, r; θ D ) evaluates the connectivity between the relationship of the service node s and the sample v;

[0028] is a given service node, is a given relation from the HIN, e v is the embedding of the sample service node, θ D denotes the D model parameters;

[0029] D outputs the probability that the sample is connected to the service under the relation r as:

[0030]

[0031] where e v is the embedding input of the sample, is the learnable embedding of the service node s, is the learnable relation matrix of the relation r;

[0032] The model parameters that form the discriminator D are the union of all service node embeddings and relation matrices obtained;

[0033] When v is a positive sample related to s to r, the probability should be higher; when it is a negative sample, the probability should be lower;

[0034] The sample v forms a triple <s, r, v> with the given service s and relation r, and each triple belongs to one of the following three cases in terms of polarity, which also leads to a part of the discriminator loss under the inspiration of conditional GAN:

[0035] Case 1: connected under the given relation, i.e., the service node and the sample do indeed pass through the HIN The triplets are considered positive if the correct relationship connection is connected, and are modeled with the following loss.

[0036]

[0037] Case 2: The connection relationship is incorrect, s and v are connected in the HIN with the wrong relationship r'≠r, and since their relevance does not match the expected semantics carried by the given relationship r, the discriminator also marks them as negative, and the loss of this part is defined as follows:

[0038]

[0039] Case 3: False service nodes from the relationship-aware generator, given a service node, it can form a false pair with the service node provided by the generator, and the discriminator aims to identify this triplet as negative, which is represented as follows:

[0040]

[0041] Where the embedding e' of the pseudo sample v is extracted from the learned distribution of the generator G; v ;

[0042] Integrate the above three parts to train the discriminator:

[0043]

[0044] Where λ D >0 controls the regularization term to avoid overfitting, and the parameters θ of the discriminator can be optimized by minimizing D .

[0045] The present application has the following beneficial effects:

[0046] (1) Apply adversarial learning to service node representation and service classification for heterogeneous information networks, not only retain the rich semantics on the service heterogeneous information network, but also ensure the robustness of the learned service node representation, and improve the accuracy of service classification;

[0047] (2) A new service classification method is proposed, which integrates heterogeneous information networks and adversarial training, which not only perceives relationships to obtain rich semantics, but also has an efficient mechanism for generating negative samples;

[0048] (3) Based on the ProgrammableWeb real dataset for experimental evaluation and analysis, the precision and quality of service classification are improved. BRIEF DESCRIPTION OF DRAWINGS

[0049] Figure 1 ​A SC-GAN model overall framework of a service classification method fusing a heterogeneous information network and a generative adversarial network is provided in the application;

[0050] Figure 2 A service heterogeneous information network framework of a walking component of a service classification method fusing a heterogeneous information network and a generative adversarial network is provided in the application;

[0051] Figure 3 An example of ATA input SC-GAN adversarial training of a service classification method fusing a heterogeneous information network and a generative adversarial network is provided in the application;

[0052] Figure 4 Variation of Micro F1 value and Macro F1 value with the number of categories of a service classification method fusing a heterogeneous information network and a generative adversarial network is provided in the application;

[0053] Figure 5 Learning curve of SC-GAN on a data set of a service classification method fusing a heterogeneous information network and a generative adversarial network is provided in the application. DETAILED DESCRIPTION

[0054] The technical solutions of the application will be described clearly and completely below with reference to the drawings. Obviously, the described embodiments are part of the embodiments of the application, rather than all the embodiments. Based on the embodiments in the application, all other embodiments obtained by those skilled in the art without creative labor fall within the protection scope of the application.

[0055] In the description of the application, it should be noted that the orientations or positional relationships indicated by the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer" and the like are based on the orientations or positional relationships shown in the drawings, and are only for the convenience of describing the application and simplifying the description, and therefore cannot be understood as indicating or implying that the devices or elements referred to must have a particular orientation, be constructed and operated in a particular orientation, and therefore cannot be understood as limiting the application. In addition, the terms "first", "second", "third" are only for the purpose of description, and cannot be understood as indicating or implying relative importance. The application will be further described below with reference to the drawings.

[0056] The overall framework of the method is as follows Figure 1As shown, it includes three parts: (1) service heterogeneous information network construction and Metapath2vec network representation; (2) GAN adversarial training; (3) service classification. First, service data is scraped from the network, and service description documents, Tags and Labels, etc. are obtained after preprocessing to construct a service heterogeneous information network. Then the relationship between service nodes s and neighbor service nodes v under the meta path is input into the Metapath2vec model, and the representation of each service node is obtained through meta path-based random walk training. Next, the obtained service node embedding is input into the GAN model with multiple perceptrons for adversarial training to capture more robust representations of service nodes. Finally, multivariate Logistic regression is used to predict the category of API services.

[0057] As Figure 2 described, "ATA" is a meta path, which expresses that services with the same label may belong to the same category (A is the Web service API node type, and T is the service label type). Generally, the meta path is given by prior knowledge in advance, and the meta path-based random walk refers to: "the node type of the next hop service node is determined by the current service node type and the meta path mode, and the corresponding service node type is selected for jumping according to the guidance of the meta path. If there are multiple neighbor nodes of the same service node type, a node is randomly selected", the meta path-based random walk strategy can capture the relationship between different node types, and ensure that the semantic relationship between different types of nodes can be properly integrated into the skip-gram model.

[0058] In terms of semantic-preserving representation learning, SC-GAN introduces a relationship-aware discriminator and generator to distinguish various types of semantic relationships between service nodes, such as Figure 3 As shown, the nodes on the service heterogeneous information network based on the meta path ATA are input into the GAN for adversarial training. For example, given a node service 1 and a relationship, such as labeled / labeling, the discriminator can distinguish between label 1 and label 2. At the same time, in order to better generate samples, a generalized generator is introduced, which can generate false samples such as label'and the like. Wherein, label'may not belong to V, label'may be an "average" of label 2 and label 3, and more similar to the false sample of label 1 which is the true sample label rather than label 2. Embodiment one:

[0060] 1. Data set preprocessing and experimental setting

[0061] To evaluate the model, we crawled information of 17782 APIs from ProgrammableWeb.com, including their names, description documents, primary and secondary categories, etc. To improve the accuracy of classification, we first preprocessed the description documents of these services, including tokenization, stop words removal, and stemming. We selected the top 10, 15, 20, 25, and 30 categories as experimental data sets, respectively. Among them, the distribution of the top 30 categories with the largest number is shown in Table 2. In the experiment, we selected 80% of the data as the training set and 20% of the data as the test set. The random walk number was 10, the walk step was 20, the representation dimension size d was 128, and the window size c was 5. In addition, to ensure the objectivity of the experiment, the parameter settings common to SC-GAN and other methods were set to the same value, while the remaining parameters were set to the default optimal value.

[0062] Table 2 Top 30 categories by number

[0063]

[0064]

[0065] 2. Comparison methods

[0066] (1) Node2ve: Node2vec is similar to Deepwalk. This method improves the random walk strategy by defining two parameters p and q, achieving a balance between breadth-first search (BFS) and depth-first search (DFS), while considering local and macro information, and has high adaptability.

[0067] (2) LINE: This method uses first-order and second-order similarity models between training vertices and uses edge sampling methods to measure the closeness between service nodes to obtain similar service nodes for classification.

[0068] (3) Metapath2vec: This method is specifically designed for network representation learning of heterogeneous graphs. It uses meta-path-based random walk to construct the heterogeneous neighbors of nodes, and then uses a heterogeneous skip-gram training model to model structurally and semantically similar nodes for semantic HIN embedding.

[0069] (4) HERec: This method designs a type constraint strategy to filter node sequences to preserve semantic HIN embedding.

[0070] 3. Experimental results

[0071] The experiment tests the classification effect of the first 10, 15, 20, 25 and 30 service categories respectively. In the experiment, Macro F1 value and Micro F1 value are used as performance evaluation indexes, and the experimental results are shown in Table 3.

[0072] Table 3 Comparison of experimental results of different models

[0073]

[0074]

[0075] From the experimental results, it can be seen that the SC-GAN method is superior to the four baseline methods in Micro F1 and Macro F1 indexes, more specifically:

[0076] (1) As the number of classes of the data set increases, the classification effect gradually decreases, which may be due to: 1) The more the number of classes of classification, the more information (noise) it contains and the more complex it is, and the difficulty of model classification increases;

[0077] 2) Classification is ranked according to the number of APIs contained in each class, and the last class will reduce the useful information it can use due to the reduction of the number of APIs it contains, thereby affecting the classification effect.

[0078] (2) The classification effect of the method based on heterogeneous information network embedding (HERec, Metapath2vec) is much better than that of the traditional homogeneous information network method (LINE, Node2vec), because: the heterogeneity of services can better preserve rich semantics, and HERec and Metapath2vec embed the heterogeneous information of services into service representation vectors in the form of meta paths.

[0079] (3) The method of simultaneously fusing heterogeneous information network and generative adversarial network SC-GAN performs significantly better than the method of using only single heterogeneous information (HERec, Metapath2vec), SC-GAN learns to preserve semantic representations in a more robust way through adversarial principles, and the representation of service node feature vectors is often more accurate, and the classification effect will also be improved.

[0080] Taking 25 service categories as an example, the learning curves of the generator (Gen) and the discriminator (Dis) of SC-GAN are as follows Figure 5As shown in the figure, (1) the loss function changes, after the initial fluctuation of the loss, Gen and Dis start Maxmin game, gradually reduce the loss of both, after about 20 time units of adversarial training, the loss of both tends to converge, the winner (i.e. Dis) gets better performance; (2) classification performance, in order to more accurately evaluate the classification performance of the SC-GAN model, the final service node representation optimized by the discriminator after the adversarial training is selected, and after about 20 time units, the Micro_F1 reaches the maximum value, and when more time units are trained, the classification quality decreases due to overfitting.

[0081] The above describes the present application and its embodiments, which are not restrictive, and the embodiments shown in the drawings are only one of the embodiments of the present application, and the actual structure is not limited thereto. In summary, if a person skilled in the art is inspired thereby, without departing from the spirit of the present application, similar structural modes and embodiments can be designed without creativity, which should belong to the protection scope of the present application.

Claims

1.A service classification method of fusing heterogeneous information network and generative adversarial network, characterized in that, Comprising the following steps: (1) Service Heterogeneous Information Network Construction and Metapath2vec Network Representation: Construct the meta path as shown in Table 1 below, and calculate the embedding representation between two services using the Metapath2vec model. Metapath2vec learns network representation through meta path-based random walk and heterogeneous Skip-gram model, capturing the semantic and structural correlation between different types of nodes; Table 1 Service-related meta path (2) GAN Adversarial Training: SC-GAN mainly consists of two competing modules, namely discriminator and generator. Given a service node, the generator tries to generate a pseudo sample associated with the given service node to provide to the discriminator. The discriminator tries to improve its parameters to separate the false sample from the real sample actually connected to the given node. In this repeated process, the trained discriminator forces the producer to produce better false samples, while the discriminator enhances its judgment ability. In this iterative process, both the generator and the discriminator are positively reinforced; (3) Service Classification: Input the service node embedding representation of the SC-GAN model into a complete connection layer, and use a multivariate Logistic regression function to output the probability distribution of all candidate Web service categories; Logistic regression is used to predict the probability of different possible outcomes of a dependent variable with a categorical distribution, converting the multi-class output values into relative probabilities representing the probability that a node belongs to a particular class, calculated as shown in equation (10), where k models predict the probability that the training data belongs to that class, k is the number of candidate web service classes, and w represents the weight matrix corresponding to the service node, representing the feature embedding of the vector; During model training, for all K possible classification results, run K-1 independent binary logistic regression models. During the running process, one of the categories is treated as the main category, and then the other K-1 categories and the selected main category are respectively subjected to regression operation; the maximum value of the log likelihood is equivalent to the minimum value of the loss function, wherein the log likelihood is calculated as follows: 2.The service classification method of fusing heterogeneous information network and generative adversarial network according to claim 1, wherein: In step (2), in the TransE heterogeneous information network embedding method, each triple <s, r, v> (s and v represent two relationally associated service nodes, and r represents the edge type between them) in the service heterogeneous information network, the latent vector representation of the two service nodes is s and v ∈ V, and the latent vector representation of the relationship is r ∈ R; The generator G(·; θ G ) generates samples from the base continuous distribution using the following Gaussian distribution: wherein, and respectively represent the service node embedding of the generator and the relation matrix of the generator respectively. The formula of the generator is as follows: G(s, r; θ G ) = f(W L … f(W1e + b1) + b L ) From the distribution W * and b * represent the weight matrix and bias vector of each layer, respectively, and f is the activation function. The parameter set of the generator is i.e. the union of all node embeddings and relation matrices and the parameters of the MLP; where λ G >0 controls the regularization term; Generator parameters θ G Optimize by minimizing: 3.The method of claim 2, wherein: The step (2) discriminators D(e v |s,r; θ D ) assess connectivity between the relationship of service nodes s and v; is a given service node, is a given relation from HIN, e v is an embedding of a sample service node, θ D denotes D model parameters; The probability that D outputs the sample connected to the service under the relationship r is: where e v is an embedding input of a sample, is a learnable embedding of a service node s, is a learnable relation matrix of a relation r; The model parameters of the discriminator D are formed, D being a union of all the service node embeddings and the relation matrix obtained; When v is a positive sample related to s to r, the probability should be higher; when it is a negative sample, the probability should be lower; The sample v forms a triple <s, r, v> with the given service s and relationship r, and each triple belongs to one of the following three cases in terms of polarity. Under the guidance of conditional GAN, each case also results in a part of the discriminator loss: Case 1: Connected under given relation, i.e., service node and sample are indeed connected by the correct relation on the HIN Such triples are considered positive and are modeled with the following loss, Case 2: Incorrect connection relationship, s and v are connected with the wrong relationship r' ≠ r in HIN, since their relevance does not match the expected semantics carried by the given relationship r, the discriminator also marks them as negative, and this part of the loss is defined as follows: Case 3: False service node from relationship-aware generator, given a service node, it can form a false pair with the service node provided by the generator, and the discriminator aims to identify this triple as negative, represented as follows: where the embedding e of the pseudo sample v v ′ is drawn from the learned distribution of the generator G; Integrate the above three parts to train the discriminator: where λ D > 0 controls the regularization term to avoid overfitting, and the parameters of the discriminator θ D can be optimized by minimizing .

Citation Information

Patent Citations

  • Semantic matching method for heterogeneous spatial information service classification based on concept lattice

    CN104765763A

  • Web service classification method based on graph convolutional neural network

    CN110717047A