A bow graph matching method and system based on spectral clustering

By using the K-means++ algorithm optimized by spectral clustering and genetic algorithm to perform two-stage clustering and feature encoding on high-dimensional data, the efficiency and accuracy problems of the BOW model in graph matching are solved, and higher graph matching accuracy and running efficiency are achieved.

CN114818934BActive Publication Date: 2026-02-13XI'AN UNIVERSITY OF ARCHITECTURE AND TECHNOLOGY
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210462631.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-28
Publication Date
2026-02-13
Estimated Expiration
2042-04-28

AI Technical Summary

Technical Problem

Existing graph matching methods based on the BOW model have imperfect mapping methods during the semantic mapping process, making it difficult to distinguish visual words and failing to fully utilize semantic relevance, resulting in low graph matching efficiency and low accuracy.

Method used

The high-dimensional dataset is clustered using a spectral clustering algorithm, and a two-stage clustering algorithm, K-means++, optimized by a genetic algorithm, is used. Feature encoding is performed through local constraint encoding, and finally, an SVM classifier is used for classification.

Benefits of technology

It improves the accuracy and efficiency of graph matching, with classification accuracy of 66.7%, 77.5% and 75.3% on three public datasets, respectively, which is significantly better than traditional algorithms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114818934B_ABST
    Figure CN114818934B_ABST
Patent Text Reader

Abstract

The application discloses a BOW graph matching method and system based on spectral clustering, and the method comprises the following processes: extracting node features and topological features of a citation network graph; using an optimized K-means++ algorithm obtained by combining a spectral clustering algorithm with a genetic algorithm to optimize K values, to convert node features and topological feature descriptors of the citation network graph into words, and realizing construction of a dictionary; using a local constraint coding mode to code features of the dictionary, to obtain a visual vocabulary histogram; and classifying the visual vocabulary histogram, to realize the BOW graph matching method based on spectral clustering. The application uses the spectral clustering algorithm to cluster high-dimensional data sets, and then uses the K-means algorithm to perform two-stage clustering in a low-dimensional solution space, so that the problems of poor processing effect on high-dimensional data and low classification effect are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of graph matching algorithms, and relates to a BOW graph matching method and system based on spectral clustering. Background Technology

[0002] With the rapid development of information technology, various types of data have emerged on the internet. These include structured data that can be represented by data or a unified structure, unstructured data that cannot be represented by data or a unified structure, and semi-structured data that changes according to actual needs and has no predefined pattern. This heterogeneity in data formats greatly hinders the effective use of information. Amidst such a large volume of data, graph data, with its own unique characteristics, is gradually becoming a common data type.

[0003] Graphs can accurately represent the topological structure of relationships between different data. Therefore, graph data has wide applications in various fields such as social networks, document processing, and compound collections. For example, in the field of chemistry, the internal structures of organic or inorganic compounds represented by graph data contain a wealth of valuable and vivid information. From a systems perspective, graphs represent the interactions between systems and their components; from an integration perspective, graphs describe all relationships connecting an object to other objects in the system. Graphs have even been proven by philosophers to be the best mathematical structure for describing the world, which also reflects the superiority of graph structures. From an algorithmic perspective, because all common data types can be viewed as instantiations of simple graph structures, graphs have an extremely wide range of applications. Despite these superior properties, the implementation of graph structures is computationally very expensive. Therefore, researching basic graph matching methods has both theoretical significance and practical value.

[0004] Efficiently retrieving valuable information from massive amounts of graph data has become a focus in many fields. Mining graph pattern information from graph data and constructing graph matching algorithms with low computational complexity are current hot topics in pattern recognition research. This has also led to the demand for efficient graph matching methods, a fundamental method for graph retrieval and structural pattern recognition. Graph matching refers to the process of finding correspondences between nodes and edges in two graphs. These correspondences should satisfy certain constraints, allowing a substructure in one graph to be mapped to a similar structure in another. Graph matching algorithms are fundamental methods for extracting effective information from massive amounts of graph data. However, due to their high complexity, graph matching research is challenging. Therefore, researching algorithms with fast matching speeds and relatively high accuracy requirements to achieve basic graph matching, i.e., measuring the similarity between graphs, is particularly necessary.

[0005] The BOW model is a relatively excellent method in pattern recognition, but the method based on the BOW model still has some deficiencies. For example, the problem that the visual words are not easy to distinguish due to the imperfect mapping method in the semantic mapping process, and the semantic correlation between the visual words is not fully utilized. SUMMARY

[0006] The present application aims to overcome the above-mentioned shortcomings of the prior art, and provides a BOW graph matching method and system based on spectral clustering. The present application uses a spectral clustering algorithm to cluster high-dimensional data sets, and then uses a K-means algorithm for two-stage clustering in a low-dimensional solution space, thereby solving the problems of poor processing effect on high-dimensional data and low classification effect.

[0007] In order to achieve the above-mentioned purpose, the present application adopts the following technical solutions:

[0008] A BOW graph matching method based on spectral clustering, comprising the following processes:

[0009] extracting node features and topological features of the citation network graph;

[0010] using an optimized K-means++ algorithm obtained by using a spectral clustering algorithm in combination with a genetic algorithm to optimize the K value to convert the node feature and topological feature descriptor of the citation network graph into a word, and realizing the construction of a dictionary;

[0011] using a local constraint coding method to code the features of the dictionary to obtain a visual vocabulary histogram;

[0012] classifying the visual vocabulary histogram to realize the BOW graph matching method based on spectral clustering.

[0013] Preferably, the process of extracting the topological features of the citation network graph comprises: extracting the topological features of the citation network graph and constructing a graph topological feature vector using the topological features.

[0014] Preferably, the topological features are the connection relationship between the points and edges in the citation network graph, and a graph topological feature vector suitable for non-precise graph matching is constructed using the method of spatial syntax theory. The topological features include node betweenness, control value, connection value, average depth value and integration degree.

[0015] Preferably, the process of using the genetic algorithm to optimize the K-means++ algorithm with optimized K value comprises the following steps:

[0016] 1) setting the value range of K value, and randomly generating an initial population, and setting the current generation number t = 1;

[0017] 2) constructing a BOW model according to the K value obtained by the chromosome, and then calculating the number of correct classifications and errors of the model;

[0018] 3) Select the winning individual, cross, mutation operation, get the next generation population;

[0019] 4) Set the current generation t = t + 1;

[0020] 5) Determine whether t is greater than the set number of generations T or the error function J m Equal to 0, meet one of the conditions, jump back to step 2), otherwise, step 6);

[0021] 6) Output a set of optimized K values, realize the optimization of K-means algorithm, get the optimized K-means++ algorithm.

[0022] Preferably, the calculation process of the spectral clustering algorithm combined with the optimized K-means++ algorithm comprises the following steps:

[0023] 1) Generate a diagonal matrix D and an n x n adjacency matrix A from the input data;

[0024] 2) Calculate the Laplacian matrix L rsym Using the diagonal matrix D and the n x n adjacency matrix A

[0025] 3) Calculate the eigenvalues of L rsym , sort the eigenvalues from small to large, take the first k eigenvalues, and calculate the eigenvectors u1, u2, … u k of the first k eigenvalues; form a matrix U = {u1, u2, … u k} from the k column vectors, U ∈ R n*k ;

[0026] 4) Let y i ∈ R k be the i-th row vector of U, where i = 1, 2, …, n, then unitize y i ∈ R k in turn, so that |y i | = 1;

[0027] 5) Cluster the new sample points Y = {y1, y2, … y n} into clusters C1, C2, …, C k by the optimized K-means++ algorithm;

[0028] 6) Input clusters A1, A2, …, A k , where A i = {j | y j ∈ C i}.

[0029] Preferably, the SVM classifier algorithm is used for classification when classifying the visual vocabulary histogram.

[0030] The application further provides a BOW graph matching system based on spectral clustering, comprising:

[0031] a feature extraction module, used for extracting node features and topological features of the citation network graph;

[0032] a dictionary construction module, used for converting the node features and topological feature descriptors of the citation network graph into words by using an optimized K-means++ algorithm obtained by combining a spectral clustering algorithm with a genetic algorithm for K value optimization, so as to realize construction of a dictionary;

[0033] a feature coding module, used for coding the dictionary by using a local constraint coding manner, so as to obtain a visual word histogram;

[0034] a classification module, used for classifying the visual word histogram, so as to realize the BOW graph matching method based on spectral clustering.

[0035] The application further provides an electronic device, comprising:

[0036] one or more processors;

[0037] a storage device having one or more programs stored thereon;

[0038] When the one or more programs are executed by the one or more processors, the one or more processors realize the BOW graph matching method based on spectral clustering as described above.

[0039] The application further provides a storage medium having a computer program stored thereon, wherein the computer program is executed by a processor to realize the BOW graph matching method based on spectral clustering as described above.

[0040] Compared with the prior art, the application has the following beneficial effects:

[0041] The BOW graph matching method based on spectral clustering provided by the application utilizes a spectral clustering algorithm to reduce dimension and cluster high-dimensional data, and then uses a K-means++ algorithm optimized by a genetic algorithm for two-stage clustering. The method solves the problems of poor clustering effect of traditional K-means algorithm on high-dimensional data and random selection of initial clustering center. Compared with other algorithms, the application has significant improvement in accuracy and running efficiency. The application classifies graphs according to graph information, evaluates the classification results by referring to several indicators in the confusion matrix, sets the number of correct classification as TP, the number of incorrect classification as FP, the number of correct recognition of the number not belonging to the class as TN, and the number of the number belonging to the class but not classified as FN. Taking the public data sets Citeseer, Cora and Pub Med as examples, the algorithm is simulated and experimented, the classification accuracy of the data sets under the algorithm is analyzed, and the experimental results are compared with traditional algorithms. The recognition rates of the algorithm provided by the application on the three data sets are 66.7%, 77.5% and 75.3% respectively, which are higher than the recognition rates of traditional K-means algorithm, K-means++ algorithm and spectral clustering algorithm. Therefore, it is concluded that the algorithm effectively improves the accuracy of the classification results. BRIEF DESCRIPTION OF DRAWINGS

[0042] Figure 1 The BOW graph matching method based on spectral clustering provided by the application realizes a flowchart;

[0043] Figure 2 The genetic algorithm used in the application is a flowchart;

[0044] Figure 3 The optimized clustering algorithm used in the application is a flowchart;

[0045] Figure 4 The experimental results of the application are a comparison chart;

[0046] Figure 5 The experimental results of the application are a comparison chart;

[0047] Figure 6 The experimental results of the application are a comparison chart. DETAILED DESCRIPTION

[0048] The application will be further described in detail in combination with the drawings and examples:

[0049] Reference Figure 1 The process of the BOW graph matching method based on spectral clustering provided by the application includes the following steps:

[0050] (1) Feature extraction

[0051] The topological feature of a graph is the connection relationship between the points and edges in the graph, and a graph topological feature vector suitable for non-precise graph matching is constructed by using the idea of the space syntax theory.

[0052] (2) Dictionary construction

[0053] After feature extraction, the BOW model needs to generate a dictionary, and the dictionary construction is to convert the feature descriptors into words by a clustering algorithm, and the number of words is determined by the number of clustering centers obtained by clustering. The dictionary is used to construct a visual histogram and describe the graph information, so the quality of the dictionary is related to the accuracy of the graph information expression, and the quality of the dictionary depends on the clustering algorithm.

[0054] Compared with the traditional K-means algorithm, the spectral clustering algorithm has the following two advantages:

[0055] 1) The spectral clustering only needs to obtain the similarity matrix between data, so it is very effective for clustering sparse data. This is difficult to achieve by traditional clustering algorithms.

[0056] 2) The spectral clustering ultimately reduces the dimension of the data set, so the complexity of the high-dimensional data clustering is much lower than that of the traditional clustering algorithm.

[0057] Therefore, the two-stage clustering algorithm is used in the present application. Since the spectral clustering usually uses K-means clustering algorithm for two-stage clustering in a low-dimensional solution space, the K-means algorithm has randomness in selecting the clustering center, and there is a probability of generating an empty cluster, which affects the overall accuracy and stability of the spectral clustering algorithm.

[0058] In order to avoid introducing randomness and improve the overall stability of the spectral clustering algorithm, the K-means spectral clustering algorithm for two-stage clustering is used. The K-means++ algorithm optimized by the genetic algorithm is used as the two-stage clustering of the spectral clustering algorithm. This algorithm solves the uncertainty of the K value of the traditional K-means algorithm and optimizes the selection of the initial point.

[0059] By determining the coding mode, fitness function, selection strategy and genetic operator, the genetic algorithm is optimized for the K value. At the beginning of the genetic algorithm, some parameters need to be set in advance, including:

[0060] 1) N: population size, the population size is set to 6, 7 and 3 respectively according to the different number of categories of the three different graph databases.

[0061] 2) T: termination evolution number of genetic algorithm, generally taken as 100-500.

[0062] 3) pc crossover probability: generally taken as 0.4-0.9.

[0063] 4) pm mutation probability: generally taken as 0.0001-0.1.

[0064] The specific algorithm steps for optimizing K value by genetic algorithm are shown in Figure 2 .

[0065] 1) Set the value range of K value, and randomly generate initial population, set the current generation t = 1;

[0066] 2) According to the K value obtained by the chromosome, the BOW model is constructed. Then the number of correct classification of the model and the error, that is, the fitness function of the chromosome, are calculated.

[0067] 3) Select the winning individual, perform crossover and mutation operation, and get the next generation population.

[0068] 4) Set the current generation t = t + 1.

[0069] 5) Judge whether t is greater than the set generation T or the error function J m is equal to 0. If one of the conditions is met, go back to step 2, otherwise, the algorithm will proceed.

[0070] 6) Output a set of optimized K values, and the algorithm ends.

[0071] The overall algorithm flow of the optimized K-means++ is shown in Figure 3 :

[0072] 1) Input data, generate diagonal matrix D and n x n adjacency matrix A;

[0073] 2) Calculate the Laplacian matrix according to the formula:

[0074] 3) Calculate the eigenvalues of L rsym , sort the eigenvalues from small to large, take the first k eigenvalues, and calculate the eigenvectors u1, u2, … u k of the first k eigenvalues; form a matrix U = {u1, u2, … u k} from the k column vectors, U ∈ R n*k ;

[0075] 4) Let y i ∈ R k be the i-th row vector of U, where i = 1, 2, …, n, and then unitize y i ∈ R k in turn, so that |y i | = 1;

[0076] 5) Use the optimized K-means++ algorithm to classify the new sample points Y = {y1, y2, … yn} Clustering into clusters C1, C2, …, C k ;

[0077] 6) Input clusters A1, A2, …, A k , where A i = {j | y j ∈ C i}.

[0078] (3) Feature coding

[0079] In the graph matching, due to the limitation of technology, the graph features extracted so far still include a large amount of redundant information, which leads to no efficient and accurate classification results in graph matching. The research on feature coding is to solve this problem. The earliest algorithm used for coding is vector quantization (Vector Quantization, VQ), but the VQ algorithm does not consider the similarity of feature points and visual words, so the coding effect is not ideal. Then sparse coding (Sparse Coding, SC) and locality-constrained coding (Locality-constrained linear coding, LLC) appeared in succession. The application uses LLC for feature coding. The process of feature coding is as follows: X represents a set of Q-dimensional graph feature vectors, and K words are generated by clustering the X feature set through a dictionary construction algorithm, where D represents the dictionary. Feature coding mainly calculates the similarity of each feature point in the feature set X with the visual vocabulary, and records the feature point with the highest similarity. Then the frequency of the appearance of these words and the feature points with high similarity to them is counted, and the visual vocabulary histogram is constructed. These histograms are the description of the graph after coding.

[0080] (4) Classifier

[0081] When the SVM classifier algorithm is applied in graph matching, the graph data needs to be classified into two categories, namely the training graph set and the test graph set. The classifier is trained to generate a template using the training graph set, and then the test graph set is classified.

[0082] The BOW graph matching method based on spectral clustering provided by the application utilizes a spectral clustering algorithm to reduce dimension and cluster high-dimensional data, and then uses an optimized K-means++ algorithm for two-stage clustering. The method solves the problems of poor clustering effect of traditional K-means algorithm on high-dimensional data and random selection of initial clustering center. Taking the public data sets Citeseer, Cora and PubMed as examples, the algorithm is simulated, the classification accuracy of the data sets under the algorithm is analyzed, and the experimental results are compared with those of traditional algorithms. The recognition rates of the algorithm on the three data sets are 66.7%, 77.5% and 75.3% respectively, which are higher than those of traditional K-means algorithm, K-means++ algorithm and spectral clustering algorithm. Therefore, the algorithm effectively improves the accuracy of the classification results.

[0083] Verification test

[0084] The main innovation of the BOW matching method based on spectral clustering provided by the experiment is to combine the adjacency matrix generated by the node features with the structural information of the node features, and then use the two-stage clustering algorithm of spectral clustering combined with the K-means++ algorithm optimized by the genetic algorithm to realize the clustering of the features.

[0085] The experiment selects the data of the three libraries of Cora, Citeseer and Pub Med to detect the classification effect of the BOW graph matching algorithm based on spectral clustering designed by the experiment.

[0086] The experiment first uses the genetic algorithm to optimize the K-means++ algorithm to obtain the classification recognition rate, and compares it with the traditional K-means algorithm and the K-means++ algorithm without optimized parameters. The recognition rate of the improved K-means++ algorithm on the three data sets is better than that of the traditional algorithm, so it can be known that the K value optimized by the genetic algorithm is better. Among them, on the Citeseer data set, the K value of the traditional K-means algorithm and the K-means++ algorithm is 6, and the K value optimized by the genetic algorithm is 10, and the recognition rate has a significant increase. The comparison line chart is as shown in Figure 4 Then, the optimized clustering algorithm is compared with the traditional algorithm, and the comparison line chart is as shown in Figure 5The classification accuracy of the model after the genetic algorithm optimizes the K-means++ algorithm is compared with that of the traditional K-means++ algorithm, and it can be seen from the figure that the classification efficiency of each data set is improved by 3% on average; the classification efficiency of each data set is improved by 2% on average compared with the traditional spectral clustering algorithm by using the spectral clustering algorithm combined with the optimized K-means++ algorithm. The classification accuracy of the BOW graph matching algorithm model based on spectral clustering proposed in the application is between 65% and 76%, and the classification efficiency of each data set is improved by 7% on average compared with the traditional BOW model. The results show that the recognition accuracy of the algorithm proposed in the application is better than that of the traditional algorithm.

[0087] The running time of the improved algorithm and the traditional algorithm on each data set is shown in the following table. Figure 6 Although the complexity of the algorithm is increased by the optimization of the genetic algorithm, the running time is still better than that of the traditional algorithm, and a good accuracy is also achieved. The improvement of the accuracy is due to the good clustering effect of the spectral clustering algorithm on the graph data, and on the other hand, the overall accuracy and stability of the spectral clustering algorithm are greatly improved by using the genetic algorithm optimized K-means++ algorithm in the low-dimensional space. The running efficiency of the algorithm proposed in the application is lower than that of the traditional spectral clustering algorithm, but the running efficiency is much higher than that of the traditional K-means, K-means++ and improved K-means++ algorithm.

Claims

1. A BOW graph matching method based on spectral clustering, characterized in that, The process includes the following: Extract node features and topological features from the citation network graph; The spectral clustering algorithm combined with the optimized K-means++ algorithm obtained by optimizing the K value using a genetic algorithm is used to convert the node features and topological feature descriptors of the citation network graph into words, thereby constructing a dictionary; The optimized K-means++ algorithm, obtained by optimizing the K value using a genetic algorithm, includes the following steps: 1) Set the range of values ​​for K and randomly generate an initial population, assuming the current generation t=1; 2) Based on the K value obtained from the chromosomes, construct a BOW model, and then calculate the number of correctly classified cases and the error. 3) Select the best individuals and perform crossover and mutation operations to obtain the next generation population; 4) Let the current algebra be t = t + 1; 5) Determine if t is greater than the set algebraic value T or error function. If the value is equal to 0, and one of the conditions is met, jump back to step 2; otherwise, proceed to step 6. 6) Output a set of optimized K values ​​to optimize the K-means++ algorithm and obtain the optimized K-means++ algorithm; The computation process using spectral clustering combined with the optimized K-means++ algorithm includes the following steps: 1) Generate a diagonal matrix from the input data. and an n×n adjacency matrix ; 2) Using a diagonal matrix and an n×n adjacency matrix Calculate the Laplace matrix : 3) Calculation The eigenvalues ​​are sorted in ascending order, and the first k eigenvalues ​​are selected. The eigenvectors of the first k eigenvalues ​​are then calculated. Form a matrix from k column vectors. ; 4) Order yes The The vector of rows, where Then By successively normalizing, ; 5) The new sample points are processed using the optimized K-means++ algorithm. Clustering ; 6) Input Cluster ,in, ; The dictionary is feature-encoded using local constraint coding to obtain a visual vocabulary histogram; Classify visual vocabulary histograms and implement a BOW graph matching method based on spectral clustering; The process of extracting the topological features of the citation network graph includes: extracting the topological features of the citation network graph and constructing a graph topological feature vector using the topological features; The topological features are the connection relationships between points and edges in the citation network graph. Using the method of space syntax theory, a graph topological feature vector suitable for imprecise graph matching is constructed. The topological features include node betweenness, control value, connectivity value, average depth value, and integration degree. The SVM classifier algorithm is used to classify the visual vocabulary histogram.

2. A BOW graph matching system based on spectral clustering, characterized in that, include: Feature extraction module: used to extract node features and topological features of the citation network graph; the process of extracting the topological features of the citation network graph includes: extracting the topological features of the citation network graph and constructing a graph topological feature vector using the topological features; the topological features are the connection relationships between nodes and edges in the citation network graph. Using the method of space syntax theory, a graph topological feature vector suitable for inexact graph matching is constructed. The topological features include node betweenness, control value, connectivity value, average depth value, and integration degree. The dictionary construction module uses a combination of spectral clustering and an optimized K-means++ algorithm (obtained by optimizing the K-value using a genetic algorithm) to convert the node features and topological features of the citation network graph into words, thus constructing the dictionary. The optimized K-means++ algorithm, obtained by optimizing the K-value using a genetic algorithm, includes the following steps: 1) Set the range of values ​​for K and randomly generate an initial population, assuming the current generation t=1; 2) Based on the K value obtained from the chromosomes, construct a BOW model, and then calculate the number of correctly classified cases and the error. 3) Select the best individuals and perform crossover and mutation operations to obtain the next generation population; 4) Let the current algebra be t = t + 1; 5) Determine if t is greater than the set algebraic value T or error function. If the value is equal to 0, and one of the conditions is met, jump back to step 2; otherwise, proceed to step 6. 6) Output a set of optimized K values ​​to optimize the K-means++ algorithm and obtain the optimized K-means++ algorithm; The computation process using spectral clustering combined with the optimized K-means++ algorithm includes the following steps: 1) Generate a diagonal matrix from the input data. and an n×n adjacency matrix ; 2) Using a diagonal matrix and an n×n adjacency matrix Calculate the Laplace matrix : 3) Calculation The eigenvalues ​​are sorted in ascending order, and the first k eigenvalues ​​are selected. The eigenvectors of the first k eigenvalues ​​are then calculated. Form a matrix from k column vectors. ; 4) Order yes The The vector of rows, where Then By successively normalizing, ; 5) The new sample points are processed using the optimized K-means++ algorithm. Clustering ; 6) Input Cluster ,in, ; Feature encoding module: used to encode the features of the dictionary using local constraint encoding to obtain a visual vocabulary histogram; Classification module: Used to classify visual word histograms, implementing a BOW graph matching method based on spectral clustering, and using the SVM classifier algorithm for classification of visual word histograms.

3. An electronic device, characterized in that, include: One or more processors; A storage device on which one or more programs are stored; When the one or more programs are executed by the one or more processors, the one or more processors implement the BOW graph matching method based on spectral clustering as described in claim 1.

4. A storage medium, characterized in that, It stores a computer program, wherein the computer program, when executed by a processor, implements the BOW graph matching method based on spectral clustering as described in claim 1.

Citation Information

Patent Citations

  • Scientific and technological paper clustering analysis method based on variational diagram auto-encoder and K-Means

    CN112084328A