CN114996497A - Graph similarity retrieval method and device, storage medium and electronic equipment - Google Patents

Graph similarity retrieval method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN114996497A
CN114996497A CN202210654617.XA CN202210654617A CN114996497A CN 114996497 A CN114996497 A CN 114996497A CN 202210654617 A CN202210654617 A CN 202210654617A CN 114996497 A CN114996497 A CN 114996497A
Authority
CN
China
Prior art keywords
target
similar
graph
graphic
graphs
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210654617.XA
Other languages
Chinese (zh)
Inventor
姜凤祥
苏文礼
崔洪丽
孔琳琳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Blue Lantern Fish Intelligent Technology Co ltd
Original Assignee
Beijing Blue Lantern Fish Intelligent Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Blue Lantern Fish Intelligent Technology Co ltd filed Critical Beijing Blue Lantern Fish Intelligent Technology Co ltd
Priority to CN202210654617.XA priority Critical patent/CN114996497A/en
Publication of CN114996497A publication Critical patent/CN114996497A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/53Querying
    • G06F16/535Filtering based on additional data, e.g. user or group profiles
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/58Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Library & Information Science (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a graph similarity retrieval method and device, a storage medium and electronic equipment. The method comprises the following steps: responding to a similar retrieval instruction of a target picture, and extracting a plurality of target graphic features of the target picture; respectively determining associated graphic features corresponding to the target graphic features in a type feature library corresponding to each target graphic feature; searching a target similar graph related to the associated graph indicated by the associated graph characteristic in a graph database, wherein similar parameters between the target similar graph and the associated graph meet a similar threshold condition, and the graph database records the similar parameters between sample graphs; and displaying the target map under the condition that the searching of the target similar graphs corresponding to the characteristics of the target graphs is completed, wherein the target map comprises a plurality of associated graphs and a plurality of groups of target similar graphs. The method solves the technical problem of low precision rate of processing graph similarity retrieval by a single model.

Description

Graph similarity retrieval method and device, storage medium and electronic equipment
Technical Field
The invention relates to the field of graph retrieval, in particular to a graph similarity retrieval method and device, a storage medium and electronic equipment.
Background
The existing graph approximate searching technology generally extracts appointed graph features through an artificial intelligent visual neural network model, retrieves graph data with the extracted graph features, finds the most approximate feature picture through an algorithm, and relates to visual model, feature extraction and feature approximate searching. And in the whole process, the graph characteristics are extracted through the model so as to determine the classification number, and the label and the entity graph similar to the picture are found by taking the picture number as a reference.
Graphs used for query are usually stored in a database after being queried, and with the increase of the number of the graphs and the limitation of the algorithm accuracy rate, the situation of search omission occurs when a single model is used for graph similarity retrieval.
In view of the above problems, no effective solution has been proposed.
Disclosure of Invention
The embodiment of the invention provides a graph similarity retrieval method and device, a storage medium and electronic equipment, and aims to at least solve the technical problem of low precision rate of processing graph similarity retrieval by a single model.
According to an aspect of the embodiments of the present invention, there is provided a method for retrieving similarity of graphics, including: responding to a similar retrieval instruction of a target picture, and extracting a plurality of target graphic features of the target picture, wherein the plurality of target graphic features are graphic features of a plurality of element types of the target picture; respectively determining associated graphic features corresponding to the target graphic features in a type feature library corresponding to each target graphic feature, wherein the type feature library stores graphic features of element types corresponding to each sample graphic; searching a target similar graph related to the associated graph indicated by the associated graph characteristic in a graph database, wherein similar parameters between the target similar graph and the associated graph meet a similar threshold condition, and the graph database records the similar parameters between the sample graphs; and displaying a target map under the condition that the target similar graphs corresponding to the target graph features are searched, wherein the target map is a similar search result of the target graph and comprises the associated graphs and a plurality of groups of target similar graphs.
According to another aspect of the embodiments of the present invention, there is also provided a graph similarity retrieval apparatus, including: the image processing device comprises an extracting unit, a searching unit and a processing unit, wherein the extracting unit is used for responding to a similar searching instruction of a target image and extracting a plurality of target graphic features of the target image, and the target graphic features are graphic features of a plurality of element types of the target image; the determining unit is used for determining associated graphic features corresponding to the target graphic features in a type feature library corresponding to each target graphic feature, wherein the type feature library stores the graphic features of element types corresponding to each sample graphic; a searching unit, configured to search, in a graph database, a target similar graph related to the associated graph indicated by the associated graph feature, where a similar parameter between the target similar graph and the associated graph satisfies a similar threshold condition, and the graph database records a similar parameter between the sample graphs; and a display unit, configured to display a target map when the target similar graph corresponding to each of the multiple target graph features is found, where the target map is a result of similar search of the target graph, and the target map includes the multiple associated graphs and multiple sets of the target similar graphs.
According to another aspect of the embodiments of the present invention, there is also provided a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the above graph similarity retrieval method when running.
According to still another aspect of the embodiments of the present invention, there is also provided an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the similar retrieval method of the graph through the computer program.
In the embodiment of the invention, a similar retrieval instruction responding to a target picture is adopted to extract a plurality of target graphic features of the target picture, wherein the plurality of target graphic features are graphic features of a plurality of element types of the target picture; respectively determining associated graphic features corresponding to the target graphic features in a type feature library corresponding to each target graphic feature, wherein the type feature library stores the graphic features of the element types corresponding to each sample graphic; searching a target similar graph related to the associated graph indicated by the associated graph characteristic in a graph database, wherein similar parameters between the target similar graph and the associated graph meet a similar threshold condition, and the graph database records the similar parameters between sample graphs; under the condition that the searching of the target similar graphs corresponding to the characteristics of the target graphs is finished, the target graph is displayed, wherein the target graph is a similar searching result of the target graph, the target graph comprises a plurality of associated graphs and a plurality of groups of target similar graphs, the associated image characteristics corresponding to the characteristics of the target graph are searched in a plurality of type characteristic libraries corresponding to a plurality of graph element types respectively, the target similar graphs meeting similar threshold conditions are further determined through the associated image characteristics respectively, the target graph comprising the associated graphs and the plurality of groups of target similar graphs is used as a similar searching result, the purposes of constructing a type characteristic library and a graph database through a plurality of element types and further searching the similar graphs according to the type characteristic library and the graph database are achieved, and the technical effect of improving the precision rate of the graph similar searching through a model of a plurality of element types is achieved, and the technical problem that the precision rate of processing graph similarity retrieval by a single model is low is solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
FIG. 1 is a diagram illustrating an application environment of an alternative graph similarity search method according to an embodiment of the present invention;
FIG. 2 is a flow chart illustrating an alternative method for similarity search of graphics according to an embodiment of the present invention;
FIG. 3 is a flow chart illustrating an alternative method for similarity search of graphics according to an embodiment of the present invention;
FIG. 4 is a flow chart illustrating an alternative method for similarity search of graphics according to an embodiment of the present invention;
FIG. 5 is an alternative atlas schematic according to an embodiment of the invention;
FIG. 6 is a schematic structural diagram of an alternative graphical similarity retrieval apparatus according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of an alternative electronic device according to an embodiment of the invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
According to an aspect of the embodiments of the present invention, a method for retrieving similarity of graphics is provided, and the method for retrieving similarity of graphics is widely applied to application scenarios of graph similarity retrieval. Alternatively, in the present embodiment, the graph similarity retrieval method may be applied to a hardware environment formed by the terminal device 102 and the server 104 as shown in fig. 1. As shown in fig. 1, the server 104 is connected to the terminal device 102 through a network, and may be configured to provide a service (e.g., an application service) for the terminal or a client installed on the terminal, provide a database on or independent of the server for providing a data storage service for the server 104, and configure a cloud computing and/or edge computing service on or independent of the server for providing a data operation service for the server 104.
The terminal device 102 performs data interaction with the server 104 through the network to achieve similar retrieval of the target graph. The terminal apparatus 102 transmits the target graphic to the server 104 through the network, and the server 104 is not limited to obtaining the similar retrieval result by executing S102 to S108. S102, extracting a plurality of target graphic features. And in response to the similarity retrieval instruction of the target picture, extracting a plurality of target graphic features of the target picture, wherein the plurality of target graphic features are graphic features of a plurality of element types of the target picture. And S104, determining the associated graphic features. And respectively determining associated graphic features corresponding to the target graphic features in a type feature library corresponding to each target graphic feature, wherein the type feature library stores the graphic features of the element types corresponding to each sample graphic. S106, searching a target similar graph. And searching a target similar graph related to the associated graph indicated by the associated graph characteristic in a graph database, wherein similar parameters between the target similar graph and the associated graph meet a similar threshold condition, and the graph database records the similar parameters between sample graphs. And S108, displaying the target map. And displaying a target map under the condition that the searching of the target similar graphs corresponding to the characteristics of the target graphs is completed, wherein the target map is a similar searching result of the target graphs and comprises a plurality of associated graphs and a plurality of groups of target similar graphs.
The server may be a single server, a server cluster composed of a plurality of servers, or a cloud server. The network may include, but is not limited to, at least one of: wired network, wireless network. The wired network may include, but is not limited to, at least one of: wide area networks, metropolitan area networks, local area networks, which may include, but are not limited to, at least one of the following: WIFI (Wireless Fidelity), bluetooth. The terminal device 102 may not be limited to any device having a requirement for image similarity search, and a specific device form of the terminal device is not limited in this embodiment.
As an alternative embodiment, as shown in fig. 2, the method for retrieving similarity of graphs includes:
s202, responding to a similar retrieval instruction of the target picture, and extracting a plurality of target graphic features of the target picture, wherein the plurality of target graphic features are graphic features of a plurality of element types of the target picture;
s204, determining associated graphic features corresponding to the target graphic features in a type feature library corresponding to each target graphic feature, wherein the type feature library stores graphic features of element types corresponding to each sample graphic;
s206, searching a target similar graph related to the associated graph indicated by the associated graph characteristic in a graph database, wherein similar parameters between the target similar graph and the associated graph meet a similar threshold condition, and the graph database records the similar parameters between sample graphs;
and S208, displaying a target map under the condition that the searching of the target similar graphs corresponding to the characteristics of the target graphs is completed, wherein the target map is a similar searching result of the target graphs and comprises a plurality of associated graphs and a plurality of groups of target similar graphs.
The extraction of the multiple target graphic features of the target picture and the graphic features of the sample graphics stored in the multiple type feature library is not limited to be realized by utilizing multiple graphic models, and the target graphics and/or the sample graphics are/is respectively input into the multiple graphic models, so that the graphic features respectively output by the multiple graphic models are obtained. The feature extraction of a plurality of element type features of the same graph is realized by utilizing the feature extraction of different graph models corresponding to different element types, and the feature extraction is not limited to extracting the graph into feature data and referring to the graph by utilizing the graph features.
As an optional implementation manner, the extracting of multiple target graphic features of the target picture in S202 includes: and respectively utilizing the plurality of graphic visual models to extract graphic element features of the target picture to obtain a plurality of target graphic features of the target picture.
And storing the features of the same element type into a corresponding type feature library. The storage of the graphic features is not limited to the storage in the form of the graphic identifiers corresponding to the features, and the features of different element types corresponding to the same graphic are searched in each type feature library through the graphic identifiers.
The element type is not limited to a preset graphic element type such as a contour type, a local type, a background type, a character type, etc., but may be a graphic element type such as a tetrad, a star, a water drop, a water bloom, a character, etc.
The associated graphic feature is determined in the type feature library, and is not limited to the graphic feature which is stored in the type feature library and is most similar to the target graphic feature as the associated graphic feature. The similarity between the features in the type features is not limited to be determined by the distance between the features, the graphic feature with the minimum feature distance from the target graphic feature is determined as the most similar associated graphic feature, and the associated graphic identifier corresponding to the associated graphic feature is determined. And searching the target similar graph in the graph database according to the associated graph identifier.
And under the condition that the type feature library is multiple, determining an associated graphic feature in the corresponding type feature library by each target graphic feature. And sequentially searching target similar graphs with similar characteristics of each associated graph in a graph database. The number of the target similar graphs corresponding to each associated graph feature is not limited herein, and may be one or more, and only the similarity threshold condition is satisfied.
The graph database stores similarity parameters between every two graphs, and the similarity parameters are determined according to the graph features of multiple element types between every two graphs and are not the similarity of a single graph feature.
In the embodiment of the application, a similar retrieval instruction responding to a target picture is adopted to extract a plurality of target graphic features of the target picture, wherein the plurality of target graphic features are graphic features of a plurality of element types of the target picture; respectively determining associated graphic features corresponding to the target graphic features in a type feature library corresponding to each target graphic feature, wherein the type feature library stores the graphic features of the element types corresponding to each sample graphic; searching a target similar graph related to the associated graph indicated by the associated graph characteristic in a graph database, wherein similar parameters between the target similar graph and the associated graph meet a similar threshold condition, and the graph database records the similar parameters between sample graphs; under the condition that the searching of the target similar graphs corresponding to the characteristics of a plurality of target graphs is finished, displaying a target graph, wherein the target graph is a similar searching result of the target graph, the target graph comprises a plurality of associated graphs and a plurality of groups of target similar graphs, searching the associated image characteristics corresponding to the characteristics of the target graph in a plurality of type characteristic libraries corresponding to a plurality of graphic element types respectively, further determining the target similar graphs meeting the similar threshold condition through the plurality of associated image characteristics respectively, taking the target graph comprising the associated graphs and the plurality of groups of target similar graphs as the similar searching result, achieving the purposes of constructing a type characteristic library and a graph database through a plurality of element types and further searching the similar graphs according to the type characteristic library and the graph database, and further realizing the technical effect of improving the precision rate of the graph similar searching through the model of the plurality of element types for conducting the graph similar searching, and the technical problem that the precision rate of processing graph similarity retrieval by a single model is low is solved.
As an optional implementation manner, before the extracting, in response to the similarity retrieval instruction of the target picture, a plurality of target graphic features of the target picture, the method further includes:
s11, respectively carrying out graphic feature extraction training on the plurality of initial graphic models by using graphic elements of the sample graphics to obtain a plurality of graphic visual models, wherein the plurality of graphic visual models are respectively used for extracting graphic features of a plurality of element types of the input picture;
s12, respectively carrying out graphic feature extraction on the sample graphics by using the plurality of graphic visual models to obtain sample graphic features of a plurality of types of the sample graphics;
and S13, respectively storing the sample graphic features of each element type into a type feature library of the corresponding element type.
The graphic model for extracting the graphic features is not limited to the graphic visual model obtained for training, and the initial graphic model is trained through the sample graphics to obtain the graphic visual model. The initial graphics model is not limited to open source models such as OsNet (a novel deep CNN, called full scale network), ResNet, EfficentNet, CoAtet, etc. The training process of the model is not limited to:
1. creating a graphics loader;
2. constructing a model example;
3. creating a neural network training example: the method comprises specific parameters such as a model instance, a graph loader, a defined loss function, an activation function and the like;
4. searching for a proper learning rate;
5. iteration is carried out until the model converges; each iteration can set a new learning rate to achieve a better learning effect.
The activating function can be selected from functions of mish, ReLU and the like, the model convergence condition is not limited to that the learning rate is lower than 0.00001 or the train _ loss and the valid _ loss after each iteration are less than 0.8, and therefore the model training is determined, and the graphic visual model is obtained.
In the graphic feature storage, it is not limited to determining a corresponding graphic identifier for each sample image, so that the graphic identifier and the graphic feature are stored in a corresponding relationship in the type feature library, and the similar parameters are stored in a graphic database in a manner of including the graphic identifier. In the process of similarity retrieval, the graphics are referred to by graphic identifiers to improve the retrieval efficiency.
As an optional implementation manner, before the extracting, in response to the similarity retrieval instruction of the target picture, a plurality of target graphic features of the target picture, the method further includes:
s21, calculating the feature distance between every two sample graphic features in each type feature library;
s22, determining characteristic similar parameters corresponding to the characteristic distance according to the characteristic distance and the similar parameter definition corresponding to the graphic visual model;
s23, determining the similarity parameters between every two sample graphs according to the feature similarity parameters of every two sample graphs in the multiple graph feature libraries;
and S24, constructing a graph database according to the similar parameters between every two sample graphs, wherein the similar parameters between every two sample graphs are recorded in the graph database.
And under the condition that a plurality of graphic features corresponding to the plurality of sample graphics are obtained, obtaining similar parameters between every two sample graphics according to the feature distance of the graphic features in each element type so as to construct a graphic database.
Specifically, the method is not limited to performing cyclic similarity calculation on the plurality of characteristic similarity parameters of every two sample graphs in the plurality of sample graphs, so as to obtain the similarity parameter between every two sample graphs.
After the graph identification corresponding to the sample graph is determined, a plurality of graph features corresponding to each sample graph are determined. The plurality of graphic features may be diagnostic diagnoses with different data volumes, and for example, table 1 gives graphic features corresponding to 5 models.
TABLE 1
Figure BDA0003688833340000091
Figure BDA0003688833340000101
In table 1, the graphic code is used as the graphic identifier, and the data amount of the graphic feature is used to refer to the graphic feature, which are all examples and are not intended to limit the model and the graphic feature.
In each type feature library, the euclidean distance between every two graphic features is calculated, and the feature distance between every two graphic features is obtained by taking table 2 as an example.
TABLE 2
Figure BDA0003688833340000102
The feature distances between the graphic features in table 2 are only examples and are not intended to limit the model, the graphic features, and the feature distances.
And obtaining the characteristic similarity parameter between every two image characteristics according to the characteristic distance between every two image characteristics. The correspondence between the feature distance and the feature similarity parameter is not limited to be determined based on a parameter threshold preset for each element type.
The parameter threshold settings for different element types may be different. The similar definition of each graphic visual model is not limited to that shown in table 3.
TABLE 3
Similar parameters 95% similar Is 90% similar 80% similar .., self-definition
Model A 0.0~0.02 0.02~0.25 0.25~0.35 ...
Model B 0.0~0.04 0.04~0.08 0.08~0.25 ...
Model C 0.0~0.03 0.03~0.06 0.06~0.11 ...
Model D 0.0~0.12 0.12~0.22 0.22~0.32 ...
Model E 0.0~0.05 0.05~0.08 0.08~0.15 ...
...
The similar definitions of the respective models in table 3 are only examples and do not limit the models, the graphic features, and the similar parameters.
The feature similarity parameter between the features of the respective types between each two figures is determined based on the feature distance and the similarity definition, and is not limited to the one shown in table 4.
TABLE 4
Figure BDA0003688833340000111
The characteristic similarity parameters and parameter values of each two graphs are displayed in the characteristic similarity parameters, so that the similarity parameters of each two graphs are determined according to the characteristic similarity parameters of each element type of each two graphs.
The determination of the similar parameters is not limited to performing similar calculation according to the characteristic similar parameters or performing calculation determination through different weights of the model. The weights of different models are not limited to be determined according to the retrieval requirements corresponding to the similarity retrieval, and when the element types corresponding to the models are different, the calculation weights of the feature similarity parameters corresponding to the models are increased under the condition that the element types correspond to the retrieval requirements.
As an alternative embodiment, the step S24 of constructing the graph database according to the similarity parameters between each two sample graphs includes:
s24-1, converting the graph identifiers and the similar parameters of every two sample graphs and determining the similar numerical values of the similar parameters according to a preset format;
and S24-2, constructing a graph database by using the graph identifiers, the similar parameters and the similar numerical values of every two sample graphs in a preset format.
The data converted according to the preset format is not limited to the following:
entity: no. 0001 and No. 0002
Relationship, 90% similar, similarity value 0.01832, classification, other relationships.
Entity: no. 0001 and No. 0003
Relationship, 95% similar, similarity value 0.01132, classification, other relationships.
....
Entity: number 0001, number 0005
Relationship, 95% similar, similarity value 0.00132, classification, other relationships.
....
Entity: no. 0005, No. 0001
Relationship, 95% similar, similarity value 0.00132, classification, other relationships.
....
Entity: nos. 0005 and 0009
Relationship, 90% similar, similarity value 0.01132, classification, other relationships.
As an alternative embodiment, the step S208 of displaying the target map includes: and displaying the atlas in which the target similar graphs related to the associated graphs are dispersed around the associated graphs by taking each associated graph as a center, and connecting the target similar graphs and the associated graphs by using similar connecting lines, wherein the length of the similar connecting lines is inversely proportional to the numerical value of the similar parameter.
In the target map of the similar retrieval result corresponding to the target graph, the plurality of associated graphs are taken as the center, the similar graphs associated with the associated graphs are distributed around the associated graphs, and the associated graphs and the similar graphs are connected in a connecting line mode, the similar parameters are not limited to be marked on the connecting line, the size of the numerical value of the similar parameters is marked according to the length of the connecting line, the larger the numerical value of the similar parameters is, the shorter the connecting line is, and therefore the distance relation between the graphs is visually displayed.
As an alternative embodiment, the step S208 of displaying the target map includes: and displaying the similarity connecting line between the target similar graph and the non-relevant associated graph under the condition that the similarity parameter between the target similar graph and the non-relevant associated graph meets the similarity threshold condition.
In the case where the similarity parameter between the associated figure and the non-corresponding similar figure also satisfies the similarity threshold condition, it is not limited to being connected by a connection line to designate the degree of similarity between the two figures. Specifically, the map is not limited to that shown in fig. 5. Wherein, the pictures a1, b2, E2 and C2 are associated graphics respectively determined by 4 element types, and taking the picture b2 as an example, the pictures b1, b3, b4, b5 and b6 with connecting lines are associated similar graphics, and similar parameters are respectively marked on the connecting lines. And the similarity parameter between the picture b6 and the picture C2 is 70%, and the satisfied similarity threshold is labeled in the form of a connecting line in the atlas.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the invention. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required by the invention.
According to another aspect of the embodiment of the invention, a graph similarity searching device for implementing the graph similarity searching method is further provided. As shown in fig. 6, the apparatus includes:
an extracting unit 602, configured to extract, in response to a similarity retrieval instruction of a target picture, a plurality of target graphical features of the target picture, where the plurality of target graphical features are graphical features of a plurality of element types of the target picture;
a determining unit 604, configured to determine, in a type feature library corresponding to each target graphic feature, an associated graphic feature corresponding to the target graphic feature, where the type feature library stores graphic features of element types corresponding to each sample graphic;
the searching unit 606 is configured to search, in the graph database, a target similar graph related to the associated graph indicated by the associated graph feature, where similar parameters between the target similar graph and the associated graph meet a similar threshold condition, and the graph database records the similar parameters between the sample graphs;
the display unit 608 is configured to display a target map when the target similar graph corresponding to each of the multiple target graph features is found, where the target map is a similar retrieval result of the target graph, and the target map includes multiple associated graphs and multiple groups of target similar graphs.
Optionally, the graph similarity retrieval device further includes an extraction storage unit, configured to perform, before extracting multiple target graph features of the target picture in response to a similarity retrieval instruction of the target picture, graph feature extraction training on multiple initial graph models by using graph elements of the sample graph, so as to obtain multiple graph visual models, where the multiple graph visual models are respectively used to extract graph features of multiple element types of the input picture; respectively extracting the graph characteristics of the sample graph by using a plurality of graph visual models to obtain sample graph characteristics of a plurality of types of sample graphs; and respectively storing the sample graphic features of each element type into a type feature library of the corresponding element type.
Optionally, the graph similarity retrieval device further includes a construction unit, configured to calculate a feature distance between every two sample graph features in each type feature library before extracting multiple target graph features of the target picture in response to a similarity retrieval instruction of the target picture; determining feature similarity parameters corresponding to the feature distances according to the feature distances and the similar parameter definitions corresponding to the graphic visual model; determining the similar parameters between every two sample graphs according to the characteristic similar parameters of every two sample graphs in the multiple graph characteristic libraries; and constructing a graph database according to the similar parameters between every two sample graphs, wherein the similar parameters between every two sample graphs are recorded in the graph database.
Optionally, the constructing unit constructs a graph database according to the similarity parameter between each two sample graphs, and further includes: converting the graph identifiers and the similar parameters of every two sample graphs and the similar numerical values of the determined similar parameters according to a preset format; and constructing a graph database by utilizing the graph identifiers, the similar parameters and the similar numerical values of every two sample graphs in a preset format.
Optionally, the extracting unit 602 of the graph similarity searching apparatus includes: and respectively utilizing the plurality of graphic visual models to extract graphic element features of the target picture to obtain a plurality of target graphic features of the target picture.
Optionally, the display unit 608 of the graph similarity retrieval device includes: and displaying the atlas in which the target similar graphs related to the associated graphs are dispersed around the associated graphs by taking each associated graph as a center, and connecting the target similar graphs and the associated graphs by using similar connecting lines, wherein the length of the similar connecting lines is inversely proportional to the numerical value of the similar parameter.
Optionally, the display unit 608 of the similar searching apparatus for graphics includes: and displaying the similarity connecting line between the target similar graph and the non-relevant associated graph under the condition that the similarity parameter between the target similar graph and the non-relevant associated graph meets the similarity threshold condition.
In the embodiment of the application, a similar retrieval instruction responding to a target picture is adopted to extract a plurality of target graphic features of the target picture, wherein the plurality of target graphic features are graphic features of a plurality of element types of the target picture; respectively determining associated graphic features corresponding to the target graphic features in a type feature library corresponding to each target graphic feature, wherein the type feature library stores the graphic features of the element types corresponding to each sample graphic; searching a target similar graph related to the associated graph indicated by the associated graph characteristic in a graph database, wherein similar parameters between the target similar graph and the associated graph meet a similar threshold condition, and the graph database records the similar parameters between sample graphs; under the condition that the searching of the target similar graphs corresponding to the characteristics of the target graphs is finished, the target graph is displayed, wherein the target graph is a similar searching result of the target graph, the target graph comprises a plurality of associated graphs and a plurality of groups of target similar graphs, the associated image characteristics corresponding to the characteristics of the target graph are searched in a plurality of type characteristic libraries corresponding to a plurality of graph element types respectively, the target similar graphs meeting similar threshold conditions are further determined through the associated image characteristics respectively, the target graph comprising the associated graphs and the plurality of groups of target similar graphs is used as a similar searching result, the purposes of constructing a type characteristic library and a graph database through a plurality of element types and further searching the similar graphs according to the type characteristic library and the graph database are achieved, and the technical effect of improving the precision rate of the graph similar searching through a model of a plurality of element types is achieved, and the technical problem that the precision rate of processing graph similarity retrieval by a single model is low is solved.
According to another aspect of the embodiment of the present invention, there is also provided an electronic device for implementing the similarity search method for graphics, where the electronic device may be a terminal device or a server shown in fig. 1. The present embodiment takes the electronic device as a server as an example for explanation. As shown in fig. 7, the electronic device comprises a memory 702 and a processor 704, the memory 702 having stored therein a computer program, the processor 704 being arranged to perform the steps of any of the above-described method embodiments by means of the computer program.
Optionally, in this embodiment, the electronic device may be located in at least one network device of a plurality of network devices of a computer network.
Optionally, in this embodiment, the processor may be configured to execute the following steps by a computer program:
s1, responding to a similar retrieval instruction of the target picture, and extracting a plurality of target graphic features of the target picture, wherein the plurality of target graphic features are graphic features of a plurality of element types of the target picture;
s2, determining associated graphic features corresponding to the target graphic features in a type feature library corresponding to each target graphic feature, wherein the type feature library stores the graphic features of the element types corresponding to each sample graphic;
s3, searching a target similar graph related to the associated graph indicated by the associated graph characteristic in a graph database, wherein similar parameters between the target similar graph and the associated graph meet a similar threshold condition, and the graph database records the similar parameters between sample graphs;
and S4, displaying a target map under the condition that the searching of the target similar graphs corresponding to the characteristics of the target graphs is completed, wherein the target map is a similar searching result of the target graphs and comprises a plurality of associated graphs and a plurality of groups of target similar graphs.
Alternatively, it can be understood by those skilled in the art that the structure shown in fig. 7 is only an illustration, and the electronic device may be any terminal device. Fig. 7 does not limit the structure of the electronic device. For example, the electronic device may also include more or fewer components (e.g., network interfaces, etc.) than shown in FIG. 7, or have a different configuration than shown in FIG. 7.
The memory 702 may be used to store software programs and modules, such as program instructions/modules corresponding to the monitoring method and apparatus for an intelligent device in the embodiments of the present invention, and the processor 704 executes various functional applications and data processing by running the software programs and modules stored in the memory 702, that is, implements the similar retrieval method for the above-mentioned graphs. The memory 702 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 702 can further include memory located remotely from the processor 704, which can be coupled to the terminal over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof. The memory 702 may be specifically, but not limited to, used for storing information such as a type feature library, a graph database, a target graph feature, an associated graph feature, a target similarity feature, a target map, and the like. As an example, as shown in fig. 7, the memory 702 may include, but is not limited to, an extracting unit 602, a determining unit 604, a searching unit 606, and a displaying unit 608 in the similarity retrieval device of the graph. In addition, other module units in the similar retrieval device of the above-mentioned figures may also be included, but are not limited to these, and are not described in detail in this example.
Optionally, the transmitting device 706 is used for receiving or sending data via a network. Examples of the network may include a wired network and a wireless network. In one example, the transmission device 706 includes a Network adapter (NIC) that can be connected to a router via a Network cable and other Network devices to communicate with the internet or a local area Network. In one example, the transmission device 706 is a Radio Frequency (RF) module, which is used to communicate with the internet in a wireless manner.
In addition, the electronic device further includes: a display 708 for displaying the target graph and the target map; and a connection bus 710 for connecting the respective module components in the above-described electronic apparatus.
In other embodiments, the terminal device or the server may be a node in a distributed system, where the distributed system may be a blockchain system, and the blockchain system may be a distributed system formed by connecting a plurality of nodes through a network communication. Nodes can form a Peer-To-Peer (P2P, Peer To Peer) network, and any type of computing device, such as a server, a terminal, and other electronic devices, can become a node in the blockchain system by joining the Peer-To-Peer network.
According to an aspect of the application, a computer program product or computer program is provided, comprising computer instructions, the computer instructions being stored in a computer readable storage medium. The computer instructions are read by a processor of a computer device from a computer-readable storage medium, and the computer instructions are executed by the processor to cause the computer device to perform the method provided in the various alternative implementations of the similarity retrieval aspect of the graphs described above. Wherein the computer program is arranged to perform the steps of any of the above method embodiments when executed.
Alternatively, in the present embodiment, the above-mentioned computer-readable storage medium may be configured to store a computer program for executing the steps of:
s1, responding to a similar retrieval instruction of the target picture, and extracting a plurality of target graphic features of the target picture, wherein the plurality of target graphic features are graphic features of a plurality of element types of the target picture;
s2, determining associated graphic features corresponding to the target graphic features in a type feature library corresponding to each target graphic feature, wherein the type feature library stores the graphic features of the element types corresponding to each sample graphic;
s3, searching a target similar graph related to the associated graph indicated by the associated graph characteristic in a graph database, wherein similar parameters between the target similar graph and the associated graph meet a similar threshold condition, and the graph database records the similar parameters between sample graphs;
and S4, displaying a target map under the condition that the searching of the target similar graphs corresponding to the characteristics of the target graphs is completed, wherein the target map is a similar searching result of the target graphs and comprises a plurality of associated graphs and a plurality of groups of target similar graphs.
Alternatively, in this embodiment, a person skilled in the art may understand that all or part of the steps in the methods of the foregoing embodiments may be implemented by a program instructing hardware associated with the terminal device, where the program may be stored in a computer-readable storage medium, and the storage medium may include: flash disks, Read-Only memories (ROMs), Random Access Memories (RAMs), magnetic or optical disks, and the like.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
The integrated unit in the above embodiments, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in the above computer-readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing one or more computer devices (which may be personal computers, servers, network devices, etc.) to execute all or part of the steps of the method according to the embodiments of the present invention.
In the above embodiments of the present invention, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the several embodiments provided in the present application, it should be understood that the disclosed client may be implemented in other ways. The above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one type of logical functional division, and other divisions may be implemented in practice, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed coupling or direct coupling or communication connection between each other may be an indirect coupling or communication connection through some interfaces, units or modules, and may be electrical or in other forms.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (10)

1. A method for retrieving similarity of graphics, comprising:
in response to a similar retrieval instruction of a target picture, extracting a plurality of target graphic features of the target picture, wherein the plurality of target graphic features are graphic features of a plurality of element types of the target picture;
respectively determining associated graphic features corresponding to the target graphic features in a type feature library corresponding to each target graphic feature, wherein the type feature library stores graphic features of element types corresponding to each sample graphic;
searching a target similar graph related to the associated graph indicated by the associated graph characteristic in a graph database, wherein similar parameters between the target similar graph and the associated graph meet a similar threshold condition, and the graph database records the similar parameters between the sample graphs;
and displaying a target map under the condition that the target similar graphs corresponding to the target graph features are searched, wherein the target map is a similar retrieval result of the target graph and comprises a plurality of associated graphs and a plurality of groups of target similar graphs.
2. The method according to claim 1, before extracting a plurality of target graphic features of a target picture in response to a similarity retrieval instruction of the target picture, further comprising:
respectively carrying out graphic feature extraction training on a plurality of initial graphic models by using the graphic elements of the sample graphic to obtain a plurality of graphic visual models, wherein the plurality of graphic visual models are respectively used for extracting the graphic features of a plurality of element types of the input picture;
respectively extracting the graphic features of the sample graphic by using the graphic visual models to obtain the sample graphic features of the sample graphic in multiple types;
and respectively storing the sample graphic features of each element type into the type feature library of the corresponding element type.
3. The method according to claim 2, before extracting a plurality of target graphic features of a target picture in response to a similarity retrieval instruction of the target picture, further comprising:
in each type feature library, calculating the feature distance between every two sample graphic features;
determining a characteristic similar parameter corresponding to the characteristic distance according to the characteristic distance and the similar parameter definition corresponding to the graphic visual model;
determining similarity parameters between every two sample graphs according to a plurality of feature similarity parameters of every two sample graphs in a plurality of graph feature libraries;
and constructing the graph database according to the similar parameters between every two sample graphs, wherein the similar parameters between every two sample graphs are recorded in the graph database.
4. The method according to claim 3, wherein the constructing the graph database according to the similarity parameter between each two sample graphs comprises:
converting the graphic identifications of every two sample graphics, the similar parameters and the similar numerical values of the determined similar parameters according to a preset format;
and constructing the graph database by using the graph identifiers, the similar parameters and the similar numerical values of the two sample graphs in the preset format.
5. The method of claim 2, wherein the extracting the plurality of target graphic features of the target picture comprises:
and respectively utilizing the plurality of graphic visual models to extract graphic element features of the target picture to obtain the plurality of target graphic features of the target picture.
6. The method of claim 2, wherein displaying the target atlas comprises:
and displaying a map which takes each associated graph as a center, disperses the target similar graphs related to the associated graphs around the associated graphs, and connects the target similar graphs and the associated graphs by using similar connecting lines, wherein the length of the similar connecting lines is in inverse proportion to the numerical value of the similar parameter.
7. The method of claim 6, wherein displaying the target atlas comprises:
and displaying a similarity connecting line between the target similar graph and the non-associated graph under the condition that the similarity parameter between the target similar graph and the non-associated graph meets the similarity threshold condition.
8. An apparatus for similarity search of graphics, comprising:
the extraction unit is used for responding to a similar retrieval instruction of a target picture and extracting a plurality of target graphic features of the target picture, wherein the plurality of target graphic features are graphic features of a plurality of element types of the target picture;
the determining unit is used for determining associated graphic features corresponding to the target graphic features in a type feature library corresponding to each target graphic feature, wherein the type feature library stores the graphic features of element types corresponding to each sample graphic;
the searching unit is used for searching a target similar graph related to the associated graph indicated by the associated graph characteristic in a graph database, wherein similar parameters between the target similar graph and the associated graph meet a similar threshold condition, and the graph database records the similar parameters between the sample graphs;
and the display unit is used for displaying a target map under the condition that the target similar graphs corresponding to the target graph features are searched, wherein the target map is a similar retrieval result of the target graph, and the target map comprises a plurality of associated graphs and a plurality of groups of target similar graphs.
9. A computer-readable storage medium, comprising a stored program, wherein the program when executed performs the method of any one of claims 1 to 7.
10. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to execute the method of any of claims 1 to 7 by means of the computer program.
CN202210654617.XA 2022-06-10 2022-06-10 Graph similarity retrieval method and device, storage medium and electronic equipment Pending CN114996497A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210654617.XA CN114996497A (en) 2022-06-10 2022-06-10 Graph similarity retrieval method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210654617.XA CN114996497A (en) 2022-06-10 2022-06-10 Graph similarity retrieval method and device, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN114996497A true CN114996497A (en) 2022-09-02

Family

ID=83033174

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210654617.XA Pending CN114996497A (en) 2022-06-10 2022-06-10 Graph similarity retrieval method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN114996497A (en)

Similar Documents

Publication Publication Date Title
CN111310074B (en) Method and device for optimizing labels of interest points, electronic equipment and computer readable medium
CN110209809B (en) Text clustering method and device, storage medium and electronic device
CN108737491B (en) Information pushing method and device, storage medium and electronic device
CN112559631A (en) Data processing method and device of distributed graph database and electronic equipment
CN110399564B (en) Account classification method and device, storage medium and electronic device
CN115129883B (en) Entity linking method and device, storage medium and electronic equipment
CN109819002B (en) Data pushing method and device, storage medium and electronic device
CN110795558B (en) Label acquisition method and device, storage medium and electronic device
CN116384109A (en) Novel power distribution network-oriented digital twin model automatic reconstruction method and device
CN113162787B (en) Method for fault location in a telecommunication network, node classification method and related devices
CN111177481B (en) User identifier mapping method and device
CN110019400B (en) Data storage method, electronic device and storage medium
CN110276283B (en) Picture identification method, target identification model training method and device
CN114385821A (en) Resource retrieval method and device, storage medium and electronic equipment
CN114996497A (en) Graph similarity retrieval method and device, storage medium and electronic equipment
CN112487251A (en) User ID data association method and device
CN111723872B (en) Pedestrian attribute identification method and device, storage medium and electronic device
CN115114441A (en) Query graph construction method and device, storage medium and electronic equipment
CN114691880A (en) Knowledge graph construction method and device and electronic equipment
CN112749711A (en) Video acquisition method and device and storage medium
CN113672816A (en) Account feature information generation method and device, storage medium and electronic equipment
CN111611981A (en) Information identification method and device and information identification neural network training method and device
CN117874498B (en) Intelligent forestry big data system, method, equipment and medium based on data lake
CN106997330B (en) Random forest model conversion method and device
CN116932838B (en) Database-based data query, update and storage method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination