WO2023213233A1 - Task processing method, neural network training method, apparatus, device, and medium - Google Patents

Task processing method, neural network training method, apparatus, device, and medium Download PDF

Info

Publication number
WO2023213233A1
WO2023213233A1 PCT/CN2023/091356 CN2023091356W WO2023213233A1 WO 2023213233 A1 WO2023213233 A1 WO 2023213233A1 CN 2023091356 W CN2023091356 W CN 2023091356W WO 2023213233 A1 WO2023213233 A1 WO 2023213233A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
scale
matching
graph representation
node
Prior art date
Application number
PCT/CN2023/091356
Other languages
French (fr)
Chinese (zh)
Inventor
邰骋
汤林鹏
Original Assignee
墨奇科技(北京)有限公司
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
Priority claimed from CN202210488516.XA external-priority patent/CN117078977A/en
Priority claimed from CN202210488466.5A external-priority patent/CN117077751A/en
Application filed by 墨奇科技(北京)有限公司 filed Critical 墨奇科技(北京)有限公司
Publication of WO2023213233A1 publication Critical patent/WO2023213233A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/74Image or video pattern matching; Proximity measures in feature spaces
    • G06V10/75Organisation of the matching processes, e.g. simultaneous or sequential comparisons of image or video features; Coarse-fine approaches, e.g. multi-scale approaches; using context analysis; Selection of dictionaries

Definitions

  • Step 101 Obtain first data and second data.
  • the first data and second data are respectively one of image data, audio data, text data, molecular structure data and sequence data;
  • Step 104 Perform graph matching on the graph representation of the first scale of the first data and the graph representation of the first scale of the second data to obtain a first matching result;
  • FIG. 2 shows a schematic diagram of a multi-scale graph representation according to one embodiment of the present disclosure.
  • graph representations 202, 204, and 206 of three scales from high to low constitute a multi-scale graph representation.
  • Each graph representation includes multiple nodes, and the graph representation 206 includes multiple adjacent edges.
  • Graph representations 202, 204, 206 may be obtained by sparsifying dense data 208.
  • the dense data 208 includes three dense data corresponding to the three scales respectively.
  • the graph representations 202, 204, and 206 of the three scales can be obtained.
  • detection-based approaches may be used to determine nodes in dense data.
  • the detection-based method may include key point detection, target detection, or other types of detection, which are not limited here.
  • node sparsification can be performed through a node sparsification network, and the node sparsification network can include a detection network, a saliency network, etc.
  • the node sparse network is a detection network
  • the dense data is input into the detection network, and the sparse nodes corresponding to the dense data and the corresponding confidence of the nodes are obtained.
  • the node sparse network is a saliency network
  • the dense data and the feature vector corresponding to the dense data are input into the saliency network, and the saliency score of each dense node corresponding to the dense data is obtained.
  • the nodes of at least one scale may be obtained by merging low-scale nodes, and the low-scale nodes may be obtained by sparsifying dense data.
  • a clustering or graph neural network method may be used to cluster multiple low-scale nodes obtained by sparsification, or the package A subgraph containing multiple low-scale nodes is input into the graph neural network to obtain higher-scale nodes and/or node attributes.
  • Multiscale graphs can include adjacency edges when the relative relationships between nodes are helpful in characterizing the data. For example, the distance between two targets in the image, the role between the two targets in the image, the association between the preceding and following words in speech, and the interaction of different groups in the sequence.
  • the nodes at the second scale are obtained by clustering dense data
  • the nodes at the first scale are obtained by merging the nodes at the second scale, and then the merging is used to obtain the first
  • the attributes of the dependent edge may be determined based on the attributes of the two nodes connected to the dependent edge.
  • the attributes of the subordinate edge can be determined in various ways according to the vector type attributes and/or the scalar type attributes of the two nodes connected to the subordinate edge, which are not limited here.
  • Step 306 Based on the matching results of the candidate matching edge pairs, determine the matching results of the graph representation of the scale of the first data and the graph representation of the scale of the second data.
  • the graph representation of each scale in the multi-scale graph representation may include at least one node, the node may include attributes, and the attributes of the node may include scalar type attributes and vector type attributes.
  • the graph representation of at least one scale in the multi-scale graph representation may include at least one adjacent edge. Each of the at least one adjacent edge is used to characterize the relative relationship between two nodes of the same scale. The adjacent edge has an attribute. Properties include scalar type properties and vector type properties.
  • the Nth round of training means that the network has undergone at least one round of training and thus has a certain inference ability, but it is not intended to limit the specific number of training rounds of the network.
  • FIG. 10 shows a structural block diagram of a task processing device 1000 according to an embodiment of the present disclosure.
  • the device 1000 includes: a first acquisition unit 1010 configured to acquire first data and second data, the first data and the second data.
  • the two data are respectively one of image data, audio data, text data, molecular structure data, and sequence data;
  • the second acquisition unit 1020 is configured to acquire a first-scale graphic representation of each of the first data and the second data,
  • the graph representation of the first scale includes at least one node of the first scale, wherein the node of the first scale has attributes, and the attributes of the nodes of the first scale include attributes of vector type;
  • the third obtaining unit 1030 is configured to obtain the first A graph representation of a second scale respectively of the data and the second data, the second scale being lower than the first scale, the graph representation of the second scale including at least one node of the second scale, wherein the node of the second scale has an attribute, and the graph representation of the second scale
  • the attributes of the scale nodes include
  • Respective multi-scale graph representation wherein the multi-scale graph representation is determined using the graph representation extraction network, and the multi-scale graph representation includes a graph representation of the first scale and a graph representation of the second scale;
  • the third graph matching unit 1130 is configured To perform graph matching on the graph representation of the first scale of the first sample data and the graph representation of the first scale of the second sample data to obtain a first current matching result that represents the matching degree of the first scale;
  • the fourth graph matching Unit 1140 is configured to perform graph matching on the graph representation of the second scale of the first sample data and the graph representation of the second scale of the second sample data to obtain a second current matching result that represents the matching degree of the second scale.
  • FIG 12 illustrates an example configuration of an electronic device 1200 that may be used to implement the methods described herein.
  • Each of the above-described apparatus 1000 and apparatus 1100 may also be fully or at least partially implemented by an electronic device 1200 or similar device or system.
  • Electronic device 1200 may be a variety of different types of devices. Examples of electronic devices 1200 include, but are not limited to: desktop computers, server computers, laptop or netbook computers, mobile devices (e.g., tablet computers, cellular or other wireless phones (e.g., smartphones), notepad computers, mobile stations), Wearable devices (eg, glasses, watches), entertainment devices (eg, entertainment appliances, set-top boxes communicatively coupled to display devices, game consoles), televisions or other display devices, automotive computers, and the like.
  • mobile devices e.g., tablet computers, cellular or other wireless phones (e.g., smartphones), notepad computers, mobile stations
  • Wearable devices eg, glasses, watches
  • entertainment devices eg, entertainment appliances, set-top boxes communicatively coupled to display devices, game consoles
  • televisions or other display devices automotive computers, and the like.
  • a display device 1208, such as a monitor may be included for displaying information and images to a user.
  • Other I/O devices 1210 may be devices that receive various inputs from the user and provide various outputs to the user, and may include touch input devices, gesture input devices, cameras, keyboards, remote controls, mice, printers, audio input/ Output devices and so on.
  • a cloud includes and/or represents a platform for resources.
  • the platform abstracts the underlying functionality of the cloud's hardware (e.g., servers) and software resources.
  • Resources may include applications and/or data that may be used while performing computing processing on a server remote from electronic device 1200 .
  • Resources may also include services provided over the Internet and/or through subscriber networks such as cellular or Wi-Fi networks.
  • the platform can abstract resources and functionality to connect electronic device 1200 with other electronic devices. Therefore, implementation of the functionality described in this article can be distributed throughout the cloud. For example, functionality may be implemented partly on the electronic device 1200 and partly through a platform that abstracts the functionality of the cloud.

Abstract

A task processing method, a neural network training method, an apparatus, a device, and a medium. The task processing method comprises: obtaining first data and second data; obtaining respective graph representations of a first scale and respective graph representations of a second scale of the first data and the second data, the second scale being lower than the first scale, the graph representation of each scale comprising a node of the scale, the node of each scale comprising an attribute of a vector type, a node of at least one scale of each piece of data being obtained by sparsifying dense data corresponding to the data, and the graph representation of at least one scale of each piece of data comprising adjacent edges representing a relative relationship of the node of the scale; performing graph matching on the first scale and the second scale on the first data and the second data, respectively to obtain a first matching result and a second matching result; and determining a multi-scale matching result on the basis of the first matching result and/or the second matching result, and further determining a task processing result.

Description

任务处理方法、神经网络的训练方法、装置、设备和介质Task processing methods, neural network training methods, devices, equipment and media
相关申请的交叉引用Cross-references to related applications
本申请要求2022年05月06日提交的中国专利申请第202210488516X号以及2022年05月06日提交的中国专利申请第2022104884665号的优先权,其内容通过引用的方式整体并入本文。This application claims priority from Chinese Patent Application No. 202210488516X submitted on May 06, 2022 and Chinese Patent Application No. 2022104884665 submitted on May 06, 2022, the contents of which are incorporated herein by reference in their entirety.
技术领域Technical field
本公开涉及人工智能技术领域,具体涉及一种任务处理方法、神经网络的训练方法、任务处理装置、神经网络的训练装置、电子设备、计算机可读存储介质和计算机程序产品。The present disclosure relates to the field of artificial intelligence technology, and specifically relates to a task processing method, a neural network training method, a task processing device, a neural network training device, electronic equipment, a computer-readable storage medium, and a computer program product.
背景技术Background technique
在对图像、视频、语音、文本、分子结构、蛋白质序列等非结构化数据进行分析和处理时,这些数据的原始形态通常很难直接使用以产生有效结果,而更有效的方法为将非结构化数据转化为半结构化的中间表示,进而在中间表示上进行分析。因此,确定一种合适的非结构化数据的中间表示形式以及如何利用这样的中间表示对非结构化数据进行有效分析和处理成为了亟待解决的问题。When analyzing and processing unstructured data such as images, videos, voices, texts, molecular structures, and protein sequences, the original form of these data is often difficult to use directly to produce effective results. A more effective method is to convert the unstructured data into Transform data into semi-structured intermediate representations, and then perform analysis on the intermediate representations. Therefore, determining a suitable intermediate representation of unstructured data and how to use such intermediate representation to effectively analyze and process unstructured data has become an urgent problem to be solved.
在此部分中描述的方法不一定是之前已经设想到或采用的方法。除非另有指明,否则不应假定此部分中描述的任何方法仅因其包括在此部分中就被认为是现有技术。类似地,除非另有指明,否则此部分中提及的问题不应认为在任何现有技术中已被公认。The approaches described in this section are not necessarily those that have been previously envisioned or employed. Unless otherwise indicated, it should not be assumed that any method described in this section is prior art merely by virtue of its inclusion in this section. Similarly, unless otherwise indicated, the issues mentioned in this section should not be considered to be recognized in any prior art.
发明内容Contents of the invention
本公开提供了一种任务处理方法、神经网络的训练方法、任务处理装置、神经网络的训练装置、电子设备、计算机可读存储介质和计算机程序产品。The present disclosure provides a task processing method, a neural network training method, a task processing device, a neural network training device, electronic equipment, a computer-readable storage medium, and a computer program product.
根据本公开的一方面,提供了一种任务处理方法,包括:获取第一数据和第二数据,第一数据和第二数据分别为图像数据、音频数据、文本数据和序列数据中的一者;获取第一数据和第二数据各自的第一尺度的图表示,第一尺度的图表示包括至少一个第一尺度的节点,其中,第一尺度的节点具有属性,第一尺度的节点的属性包括向量类型的属 性;获取第一数据和第二数据各自的第二尺度的图表示,第二尺度低于第一尺度,第二尺度的图表示包括至少一个第二尺度的节点,其中,第二尺度的节点具有属性,第二尺度的节点的属性包括向量类型的属性,其中,第一数据和第二数据中的每一个数据的至少一个尺度的节点是通过对与该数据对应的稠密数据进行稀疏化而得到的,每一个数据的至少一个尺度的图表示包括至少一个邻接边,至少一个邻接边中的每一个邻接边用于表征同一尺度的两个节点的相对关系,邻接边具有属性;将第一数据的第一尺度的图表示和第二数据的第一尺度的图表示进行图匹配,以得到第一匹配结果;将第一数据的第二尺度的图表示和第二数据的第二尺度的图表示进行图匹配,以得到第二匹配结果;基于第一匹配结果和第二匹配结果,确定多尺度匹配结果;以及基于多尺度匹配结果,确定任务处理结果。According to an aspect of the present disclosure, a task processing method is provided, including: acquiring first data and second data, where the first data and the second data are respectively one of image data, audio data, text data and sequence data. ; Acquire a graph representation of the first scale of each of the first data and the second data. The graph representation of the first scale includes at least one node of the first scale, wherein the node of the first scale has attributes, and the attributes of the nodes of the first scale Contains attributes of vector type property; obtain a second-scale graph representation of each of the first data and the second data, the second scale is lower than the first scale, and the second-scale graph representation includes at least one second-scale node, wherein the second-scale node Having an attribute, the attribute of the node of the second scale includes an attribute of vector type, wherein the node of at least one scale of each of the first data and the second data is obtained by sparsifying the dense data corresponding to the data. Obtained, the graph representation of at least one scale of each data includes at least one adjacent edge, each of the at least one adjacent edge is used to represent the relative relationship between two nodes of the same scale, and the adjacent edges have attributes; the first Perform graph matching on the graph representation of the first scale of the data and the graph representation of the first scale of the second data to obtain a first matching result; combine the graph representation of the second scale of the first data with the graph representation of the second scale of the second data. The graph representation performs graph matching to obtain a second matching result; determines a multi-scale matching result based on the first matching result and the second matching result; and determines a task processing result based on the multi-scale matching result.
根据本公开的一方面,提供了一种神经网络的训练方法,方法包括:获取第一样本数据和第二样本数据,第一样本数据和第二样本数据分别为图像数据、音频数据、文本数据、分子结构数据和序列数据中的其中一者;获取第一样本数据和第二样本数据各自的多尺度图表示,其中,多尺度图表示是利用图表示提取网络确定的,多尺度图表示包括第一尺度的图表示和第二尺度的图表示;将第一样本数据的第一尺度的图表示和第二样本数据的第一尺度的图表示进行图匹配,以得到表征第一尺度的匹配程度的第一当前匹配结果;将第一样本数据的第二尺度的图表示和第二样本数据的第二尺度的图表示进行图匹配,以得到表征第二尺度的匹配程度的第二当前匹配结果;获取第一样本数据和第二样本数据的目标匹配结果和/或目标任务处理结果;根据目标匹配结果和/或目标任务处理结果、以及第一当前匹配结果和/或第二当前匹配结果,确定损失值;以及根据损失值,训练图表示提取网络。According to one aspect of the present disclosure, a neural network training method is provided. The method includes: acquiring first sample data and second sample data, where the first sample data and the second sample data are respectively image data, audio data, One of text data, molecular structure data and sequence data; obtain respective multi-scale graph representations of the first sample data and the second sample data, wherein the multi-scale graph representation is determined using a graph representation extraction network, and the multi-scale The graph representation includes a graph representation of the first scale and a graph representation of the second scale; graph matching is performed on the graph representation of the first scale of the first sample data and the graph representation of the first scale of the second sample data to obtain the representation of the first scale. The first current matching result of the matching degree of one scale; performing graph matching on the graph representation of the second scale of the first sample data and the graph representation of the second scale of the second sample data to obtain the matching degree characterizing the second scale. the second current matching result; obtain the target matching result and/or target task processing result of the first sample data and the second sample data; according to the target matching result and/or target task processing result, and the first current matching result and/or Or the second current matching result is used to determine the loss value; and based on the loss value, the training graph represents the extraction network.
根据本公开的另一方面,提供了一种任务处理装置,包括:第一获取单元,被配置为获取第一数据和第二数据,第一数据和第二数据分别为图像数据、音频数据、文本数据、分子结构数据和序列数据中的一者;第二获取单元,被配置为获取第一数据和第二数据各自的第一尺度的图表示,第一尺度的图表示包括至少一个第一尺度的节点,其中,第一尺度的节点具有属性,第一尺度的节点的属性包括向量类型的属性;第三获取单元,被配置为获取第一数据和第二数据各自的第二尺度的图表示,第二尺度低于第一尺度,第二尺度的图表示包括至少一个第二尺度的节点,其中,第二尺度的节点具有属性,第二尺度的节点的属性包括向量类型的属性,其中,第一数据和第二数据中的每一个数据 的至少一个尺度的节点是通过对与该数据对应的稠密数据进行稀疏化而得到的,每一个数据的至少一个尺度的图表示包括至少一个邻接边,至少一个邻接边中的每一个邻接边用于表征同一尺度的两个节点的相对关系,邻接边具有属性;第一图匹配单元,被配置为将第一数据的第一尺度的图表示和第二数据的第一尺度的图表示进行图匹配,以得到第一匹配结果;第二图匹配单元,被配置为将第一数据的第二尺度的图表示和第二数据的第二尺度的图表示进行图匹配,以得到第二匹配结果;第一确定单元,被配置为基于第一匹配结果和第二匹配结果,确定多尺度匹配结果;以及第二确定单元,被配置为基于多尺度匹配结果,确定任务处理结果。According to another aspect of the present disclosure, a task processing device is provided, including: a first acquisition unit configured to acquire first data and second data, where the first data and the second data are respectively image data, audio data, One of text data, molecular structure data, and sequence data; a second acquisition unit configured to acquire a first-scale graph representation of each of the first data and the second data, the first-scale graph representation including at least one first nodes of the scale, wherein the nodes of the first scale have attributes, and the attributes of the nodes of the first scale include vector type attributes; the third acquisition unit is configured to acquire the graphs of the second scale of the first data and the second data respectively. represents that the second scale is lower than the first scale, the graph representation of the second scale includes at least one node of the second scale, wherein the node of the second scale has attributes, and the attributes of the nodes of the second scale include attributes of vector type, where , each of the first data and the second data The nodes of at least one scale are obtained by sparsifying the dense data corresponding to the data. The graph representation of at least one scale of each data includes at least one adjacent edge, and each of the at least one adjacent edge is represented by In order to represent the relative relationship between two nodes of the same scale, the adjacent edges have attributes; the first graph matching unit is configured to graph the graph representation of the first scale of the first data and the graph representation of the first scale of the second data. matching to obtain the first matching result; the second graph matching unit is configured to perform graph matching on the graph representation of the second scale of the first data and the graph representation of the second scale of the second data to obtain the second matching result. ; The first determination unit is configured to determine the multi-scale matching result based on the first matching result and the second matching result; and the second determination unit is configured to determine the task processing result based on the multi-scale matching result.
根据本公开的另一方面,提供了一种神经网络的训练装置,方法包括:第四获取单元,被配置为获取第一样本数据和第二样本数据,第一样本数据和第二样本数据分别为图像数据、音频数据、文本数据、分子结构数据和序列数据中的其中一者;第五获取单元,被配置为获取第一样本数据和第二样本数据各自的多尺度图表示,其中,多尺度图表示是利用图表示提取网络确定的,多尺度图表示包括第一尺度的图表示和第二尺度的图表示;第三图匹配单元,被配置为将第一样本数据的第一尺度的图表示和第二样本数据的第一尺度的图表示进行图匹配,以得到表征第一尺度的匹配程度的第一当前匹配结果;第四图匹配单元,被配置为将第一样本数据的第二尺度的图表示和第二样本数据的第二尺度的图表示进行图匹配,以得到表征第二尺度的匹配程度的第二当前匹配结果;第七获取单元,被配置为获取第一样本数据和第二样本数据的目标匹配结果和/或目标任务处理结果;第三确定单元,被配置为根据目标匹配结果和/或目标任务处理结果、以及第一当前匹配结果和/或第二当前匹配结果,确定损失值;以及训练单元,被配置为根据损失值,训练图表示提取网络。According to another aspect of the present disclosure, a neural network training device is provided. The method includes: a fourth acquisition unit configured to acquire first sample data and second sample data, first sample data and second sample The data are respectively one of image data, audio data, text data, molecular structure data and sequence data; the fifth acquisition unit is configured to acquire the respective multi-scale graph representations of the first sample data and the second sample data, Among them, the multi-scale graph representation is determined using the graph representation extraction network, and the multi-scale graph representation includes a first-scale graph representation and a second-scale graph representation; the third graph matching unit is configured to convert the first sample data The graph representation of the first scale and the graph representation of the first scale of the second sample data are graph matched to obtain a first current matching result that represents the matching degree of the first scale; the fourth graph matching unit is configured to match the first The graph representation of the second scale of the sample data is graph matched with the graph representation of the second scale of the second sample data to obtain a second current matching result that represents the matching degree of the second scale; the seventh acquisition unit is configured as Obtain the target matching result and/or the target task processing result of the first sample data and the second sample data; the third determination unit is configured to calculate the target matching result and/or the target task processing result according to the first current matching result and /or the second current matching result determines the loss value; and the training unit is configured to train the graph representation extraction network according to the loss value.
根据本公开的另一方面,提供了一种存储有计算机指令的非瞬时计算机可读存储介质,其中,计算机指令用于使计算机执行上述的方法。According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause the computer to perform the above method.
根据本公开的另一方面,还提供了一种计算机程序产品,包括计算机程序,其中,计算机程序在被处理器执行时实现上述的方法。According to another aspect of the present disclosure, a computer program product is also provided, including a computer program, wherein the computer program implements the above method when executed by a processor.
应当理解,本部分所描述的内容并非旨在标识本公开的实施例的关键或重要特征,也不用于限制本公开的范围。本公开的其它特征将通过以下的说明书而变得容易理解。It should be understood that what is described in this section is not intended to identify key or important features of the embodiments of the disclosure, nor is it intended to limit the scope of the disclosure. Other features of the present disclosure will become readily understood from the following description.
附图说明 Description of the drawings
附图示例性地示出了实施例并且构成说明书的一部分,与说明书的文字描述一起用于讲解实施例的示例性实施方式。所示出的实施例仅出于例示的目的,并不限制权利要求的范围。在所有附图中,相同的附图标记指代类似但不一定相同的要素。The drawings illustrate exemplary embodiments and constitute a part of the specification, and together with the written description, serve to explain exemplary implementations of the embodiments. The embodiments shown are for illustrative purposes only and do not limit the scope of the claims. Throughout the drawings, the same reference numbers refer to similar, but not necessarily identical, elements.
图1示出了根据本公开的实施例的任务处理方法的流程图;Figure 1 shows a flowchart of a task processing method according to an embodiment of the present disclosure;
图2示出了根据本公开的实施例的多尺度图表示的示意图;Figure 2 shows a schematic diagram of a multi-scale graph representation according to an embodiment of the present disclosure;
图3示出了图1所示方法中每一尺度的图匹配过程的流程图;Figure 3 shows a flow chart of the graph matching process at each scale in the method shown in Figure 1;
图4示出了图3所示方法中确定候选匹配点对的匹配结果的流程图;Figure 4 shows a flow chart for determining the matching results of candidate matching point pairs in the method shown in Figure 3;
图5示出了图3所示方法中确定候选匹配边对的匹配结果的流程图;Figure 5 shows a flow chart for determining the matching results of candidate matching edge pairs in the method shown in Figure 3;
图6示出了根据本公开的实施例的神经网络的训练方法的流程图;Figure 6 shows a flow chart of a training method of a neural network according to an embodiment of the present disclosure;
图7示出了图6所示的方法中获取第一样本数据和第二样本数据的流程图;Figure 7 shows a flow chart for obtaining first sample data and second sample data in the method shown in Figure 6;
图8示出了图6所示的方法中确定损失值的流程图;Figure 8 shows a flow chart for determining the loss value in the method shown in Figure 6;
图9示出了根据本公开的实施例的神经网络的训练方法的流程图;Figure 9 shows a flow chart of a training method of a neural network according to an embodiment of the present disclosure;
图10示出了根据本公开的实施例的任务处理装置的结构框图;Figure 10 shows a structural block diagram of a task processing device according to an embodiment of the present disclosure;
图11示出了根据本公开的实施例的神经网络的训练装置的结构框图;以及Figure 11 shows a structural block diagram of a neural network training device according to an embodiment of the present disclosure; and
图12示出了根据本公开的实施例的服务器或客户端的电子设备的结构框图。FIG. 12 shows a structural block diagram of an electronic device of a server or a client according to an embodiment of the present disclosure.
具体实施方式Detailed ways
以下结合附图对本公开的示例实施例做出说明,其中包括本公开实施例的各种细节以助于理解,应当将它们认为仅仅是说明性的。同样,为了清楚和简明,以下的描述中省略了对公知功能和结构的描述。Example embodiments of the present disclosure are described below with reference to the accompanying drawings, in which various details of the embodiments of the present disclosure are included to facilitate understanding and should be considered as illustrative only. Also, descriptions of well-known functions and constructions are omitted from the following description for clarity and conciseness.
在本公开中,除非另有说明,否则使用术语“第一”、“第二”等来描述各种要素不意图限定这些要素的位置关系、时序关系或重要性关系,这种术语只是用于将一个元件与另一元件区分开。在一些示例中,第一要素和第二要素可以指向该要素的同一实例,而在某些情况下,基于上下文的描述,它们也可以指代不同实例。In this disclosure, unless otherwise stated, the use of the terms “first”, “second”, etc. to describe various elements is not intended to limit the positional relationship, timing relationship, or importance relationship of these elements. Such terms are only used for Distinguish one element from another. In some examples, the first element and the second element may refer to the same instance of the element, and in some cases, based on contextual description, they may refer to different instances.
在本公开中对各种示例的描述中所使用的术语只是为了描述特定示例的目的,而并非旨在进行限制。除非上下文另外明确地表明,如果不特意限定要素的数量,则该要素可以是一个也可以是多个。此外,本公开中所使用的术语“和/或”涵盖所列出的项目中的任何一个以及全部可能的组合方式。The terminology used in the description of various examples in this disclosure is for the purpose of describing the particular example only and is not intended to be limiting. Unless the context clearly indicates otherwise, if the number of elements is not specifically limited, the element may be one or more. Furthermore, the term "and/or" as used in this disclosure encompasses any and all possible combinations of the listed items.
下面将结合附图详细描述本公开的实施例。 Embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings.
图1示出了根据本公开一个实施例的一种任务处理方法100的流程图,该方法100包括:Figure 1 shows a flow chart of a task processing method 100 according to an embodiment of the present disclosure. The method 100 includes:
步骤101,获取第一数据和第二数据,第一数据和第二数据分别为图像数据、音频数据、文本数据、分子结构数据和序列数据中的一者;Step 101: Obtain first data and second data. The first data and second data are respectively one of image data, audio data, text data, molecular structure data and sequence data;
步骤102,获取第一数据和第二数据各自的第一尺度的图表示,第一尺度的图表示包括至少一个第一尺度的节点,其中,第一尺度的节点具有属性,第一尺度的节点的属性包括向量类型的属性;Step 102: Obtain a graph representation of the first scale of each of the first data and the second data. The graph representation of the first scale includes at least one node of the first scale, wherein the node of the first scale has attributes, and the node of the first scale The attributes include vector type attributes;
步骤103,获取第一数据和第二数据各自的第二尺度的图表示,第二尺度低于第一尺度,第二尺度的图表示包括至少一个第二尺度的节点,其中,第二尺度的节点具有属性,第二尺度的节点的属性包括向量类型的属性,其中,第一数据和第二数据中的每一个数据的至少一个尺度的节点是通过对与该数据对应的稠密数据进行稀疏化而得到的,每一个数据的至少一个尺度的图表示包括至少一个邻接边,至少一个邻接边中的每一个邻接边用于表征同一尺度的两个节点的相对关系,邻接边具有属性;Step 103: Obtain the graph representation of the second scale of each of the first data and the second data. The second scale is lower than the first scale. The graph representation of the second scale includes at least one node of the second scale, where the second scale of The nodes have attributes, and the attributes of the nodes of the second scale include attributes of vector type, wherein the nodes of at least one scale of each of the first data and the second data are obtained by sparsifying the dense data corresponding to the data. The obtained graph representation of at least one scale of each data includes at least one adjacent edge, each of the at least one adjacent edge is used to represent the relative relationship between two nodes of the same scale, and the adjacent edges have attributes;
步骤104,将第一数据的第一尺度的图表示和第二数据的第一尺度的图表示进行图匹配,以得到第一匹配结果;Step 104: Perform graph matching on the graph representation of the first scale of the first data and the graph representation of the first scale of the second data to obtain a first matching result;
步骤105,将第一数据的第二尺度的图表示和第二数据的第二尺度的图表示进行图匹配,以得到第二匹配结果;Step 105: Perform graph matching on the second-scale graph representation of the first data and the second-scale graph representation of the second data to obtain a second matching result;
步骤106,基于第一匹配结果和第二匹配结果,确定多尺度匹配结果;以及Step 106: Determine the multi-scale matching result based on the first matching result and the second matching result; and
步骤107,基于多尺度匹配结果,确定任务处理结果。Step 107: Determine the task processing result based on the multi-scale matching results.
根据本实施例的方法,通过提取第一数据和第二数据的多个尺度的解耦特征,能够获取到每一个数据的更通用、表征能力更强的多尺度图表示,进而通过多尺度图表示的图匹配以及根据图匹配结果确定任务处理结果,使得能够高效且充分利用数据所蕴含的丰富信息进行任务处理,以得到准确的任务处理结果。此外,多尺度图表示的图匹配能够增强稳健性,以更好地应对图像视角变换、文本表达方式转变、语音的发声者的不同等情况。According to the method of this embodiment, by extracting the decoupling features of multiple scales of the first data and the second data, a more general and stronger multi-scale graph representation of each data can be obtained, and then through the multi-scale graph The representation of graph matching and the determination of task processing results based on the graph matching results make it possible to efficiently and fully utilize the rich information contained in the data for task processing to obtain accurate task processing results. In addition, graph matching of multi-scale graph representation can enhance robustness to better cope with changes in image perspective, changes in text expression, and differences in speech speakers.
第一数据和第二数据可以分别为图像数据(包括图片、视频)、音频数据、文本数据、分子结构数据和序列数据中的一者。序列数据例如可以是蛋白质序列数据、基因序列数据,也可以是其他序列形式的数据。第一数据和第二数据的可以为同一类型的数据,也可以为不同类型的数据,在此不做限定。 The first data and the second data may respectively be one of image data (including pictures and videos), audio data, text data, molecular structure data and sequence data. Sequence data can be, for example, protein sequence data, gene sequence data, or data in other sequence forms. The first data and the second data may be the same type of data or may be different types of data, which is not limited here.
第一数据和第二数据可以原始数据,也可以是经过特定处理后得到的数据。在一些实施例中,图像数据可以是原始图像,也可以是对原始图像进行预处理后的预处理图像;音频数据可以是音频的原始采样数据,也可以为对原始采样数据进行预处理后的预处理数据(例如对原始采样数据进行预处理后得到的频谱图);文本数据可以是多个原始字符串,也可以是对文本数据进行预处理后得到的预处理数据,在此不做限定。The first data and the second data may be original data or data obtained after specific processing. In some embodiments, the image data may be an original image, or a pre-processed image after pre-processing the original image; the audio data may be the original sampling data of audio, or it may be a pre-processed image after pre-processing the original sampling data. Preprocessed data (such as a spectrogram obtained by preprocessing original sampling data); text data can be multiple original strings, or preprocessed data obtained by preprocessing text data, which is not limited here. .
在得到第一数据和第二数据后,可以获取每一数据对应的多尺度图表示。多尺度图表示中,每一个尺度的图表示可以包括至少一个节点。节点可以具有属性,节点的属性可以包括向量类型的属性,也可以包括标量类型的属性。其中,标量类型的属性可以进一步包括类别属性(例如为离散数值)和数值属性(例如为连续数值)。在一个示例实施例中,某一尺度的图表示中的节点例如可以为对原始数据(或如后文所具体描述的稠密数据,稠密数据例如是对原始数据进行特征提取后得到的特征图,对原始数据进行预处理得到的预处理数据)进行目标检测而得到的多个对象。节点的向量类型的属性例如可以包括与对象对应的特征向量,节点的数值属性例如可以包括对象的坐标、尺寸、对象所在邻域的方向场、梯度场、纹理密度以及节点的显著性,节点的类别属性例如可以包括对象的分类类别。可以理解的是,不同的节点可以包括不同的属性。After obtaining the first data and the second data, a multi-scale graph representation corresponding to each data can be obtained. In a multi-scale graph representation, each scale graph representation may include at least one node. Nodes can have attributes, and the attributes of nodes can include attributes of vector type or attributes of scalar type. The scalar type attributes may further include categorical attributes (for example, discrete values) and numerical attributes (for example, continuous values). In an example embodiment, the nodes in the graph representation of a certain scale may be, for example, original data (or dense data as described in detail below. The dense data may be, for example, a feature map obtained after feature extraction of the original data. Preprocessed data obtained by preprocessing the original data) multiple objects obtained by target detection. The vector type attributes of a node may include, for example, the feature vector corresponding to the object. The numerical attributes of the node may include, for example, the coordinates, size, direction field, gradient field, texture density and significance of the node of the object's neighborhood. The category attribute may include, for example, the classification category of the object. It is understood that different nodes may include different attributes.
根据一些实施例,多尺度图表示中,至少一个尺度的图表示还可以包括至少一个邻接边。邻接边可以用于表征同一尺度的两个节点的相对关系。邻接边可以具有属性,邻接边的属性可以包括向量类型的属性,也可以包括标量类型的属性。在一个示例实施例中,邻接边的向量类型的属性例如可以包括其对应的两个节点的特征向量和/或对这两个特征向量的进一步处理结果,邻接边的数值属性例如可以包括该邻接边的坐标、长度、角度等位置信息和/或几何信息,也可以包括该邻接边的显著性,邻接边的类别属性可以包括该邻接边的类别,例如不同类型的化学键、不同类型的力等等。According to some embodiments, in the multi-scale graph representation, at least one scale graph representation may further include at least one adjacent edge. Adjacency edges can be used to characterize the relative relationship between two nodes on the same scale. Adjacent edges can have attributes, and the attributes of adjacent edges can include attributes of vector type or scalar type. In an example embodiment, the vector type attribute of the adjacent edge may, for example, include the feature vectors of its two corresponding nodes and/or the further processing results of the two feature vectors, and the numerical attribute of the adjacent edge may, for example, include the adjacency The position information and/or geometric information such as the coordinates, length, and angle of the edge may also include the significance of the adjacent edge. The category attributes of the adjacent edge may include the category of the adjacent edge, such as different types of chemical bonds, different types of forces, etc. wait.
根据一些实施例,多尺度图表示还可以包括至少一个从属边。从属边可以用于表征不同尺度的两个节点的从属关系。从属边可以具有属性,从属边的属性可以包括向量类型的属性,也可以包括标量类型的属性。在一个示例实施例中,从属边例如可以为表征两个尺度下的目标检测对象间的关系,例如在第一尺度下检测到的车辆和在第二尺度下检测到的该车辆的车轮之间可以具有从属边。从属边的向量类型的属性例如可以包括其对应的两个节点的特征向量和/或对这两个特征向量的进一步处理结果,从属边的数值属性例如可以包括该从属边的坐标、长度、角度等位置信息和几何信息以及该从属边所连 接的节点之间的相关性,从属边的类别属性可以包括该从属边所连接的节点的类别属性。According to some embodiments, the multi-scale graph representation may also include at least one dependent edge. Dependent edges can be used to characterize the dependence relationship between two nodes at different scales. A dependent edge can have attributes, and the attributes of a subordinate edge can include attributes of vector type or scalar type. In an example embodiment, the dependent edge may, for example, represent a relationship between target detection objects at two scales, such as a vehicle detected at a first scale and a wheel of the vehicle detected at a second scale. Can have dependent edges. The vector type attributes of the subordinate edge may include, for example, the feature vectors of the two corresponding nodes and/or the further processing results of the two feature vectors. The numerical attributes of the subordinate edge may include, for example, the coordinates, length, and angle of the subordinate edge. Such as location information and geometric information as well as the subordinate edge connected to The correlation between connected nodes, the category attribute of the subordinate edge may include the category attribute of the node connected by the subordinate edge.
需要说明的是,本发明实施例所指的图(graph)是广义的图,可以包括单节点图或多节点图。图匹配可以为对图中所包含节点进行匹配,也可以也为对图中所包含的节点和边进行匹配。当一个尺度的图为单节点图时,图匹配指的是节点所对应的向量之间的匹配。当一个尺度的图为多节点图时,图匹配可以包括传统意义上的图匹配(graph matching),也可以是利用节点、边的属性(包括向量类型和标量类型的属性)的图匹配,还可以是包括节点/边配对检查(例如通过射影变换等进行几何关系求解的节点/边配对检查)以及上述几种的组合。其中,利用节点、边的属性的图匹配将在后文详细阐述。It should be noted that the graph referred to in the embodiment of the present invention is a generalized graph and may include a single node graph or a multi-node graph. Graph matching can be to match the nodes contained in the graph, or it can also be to match the nodes and edges contained in the graph. When a scale graph is a single-node graph, graph matching refers to the matching between vectors corresponding to nodes. When a scale graph is a multi-node graph, graph matching can include graph matching in the traditional sense, graph matching using attributes of nodes and edges (including attributes of vector type and scalar type), or graph matching. It can include node/edge pairing check (for example, node/edge pairing check for solving geometric relationships through projective transformation, etc.) and a combination of the above. Among them, graph matching using the attributes of nodes and edges will be explained in detail later.
图2示出了根据本公开一个实施例的多尺度图表示的示意图。如图2所示,由高到低的三个尺度的图表示202、204、206构成了多尺度图表示。其中,每一个图表示包括多个节点,图表示206包括多个邻接边。图表示202、204、206可以是通过对稠密数据208进行稀疏化而得到的。具体地,稠密数据208包括与三个尺度分别对应的三个稠密数据,通过对这三个稠密数据分别进行稀疏化,能够得到三个尺度的图表示202、204、206。Figure 2 shows a schematic diagram of a multi-scale graph representation according to one embodiment of the present disclosure. As shown in Figure 2, graph representations 202, 204, and 206 of three scales from high to low constitute a multi-scale graph representation. Each graph representation includes multiple nodes, and the graph representation 206 includes multiple adjacent edges. Graph representations 202, 204, 206 may be obtained by sparsifying dense data 208. Specifically, the dense data 208 includes three dense data corresponding to the three scales respectively. By sparsifying the three dense data respectively, the graph representations 202, 204, and 206 of the three scales can be obtained.
由此,通过在不同尺度下获取包括标量、向量、图(graph)等不同的特征的图表示,使得能够得到各类数据的更通用且表征能力更强大的中间表示,并且能够提升下游的匹配任务、检索任务、分类任务、识别任务、生成任务以及其他各类数据分析与处理相关任务的结果的准确性。此外,通过使用从属边,能够强化不同尺度的图表示之间的关联性,从而进一步丰富多尺度图表示所包括的信息。As a result, by obtaining graph representations of different features including scalars, vectors, graphs, etc. at different scales, a more versatile and powerful intermediate representation of various types of data can be obtained, and downstream matching can be improved. The accuracy of the results of tasks, retrieval tasks, classification tasks, recognition tasks, generation tasks, and other types of data analysis and processing related tasks. In addition, by using subordinate edges, the correlation between graph representations at different scales can be strengthened, thereby further enriching the information included in multi-scale graph representations.
可以理解的是,本公开并不限定多尺度图表示所包括的尺度的数量。在一些实施例中,多尺度图表示可以包括两个尺度、三个尺度、或更多尺度的图表示,在此不做限定。为便于表述,本公开使用第一尺度和低于第一尺度的第二尺度作为示例对多尺度图表示的形态、生成方式、匹配方式等内容进行说明,但并不意图限定本公开的范围。It will be appreciated that the present disclosure does not limit the number of scales included in a multi-scale graph representation. In some embodiments, the multi-scale graph representation may include two-scale, three-scale, or more-scale graph representations, which are not limited here. For ease of description, this disclosure uses the first scale and the second scale lower than the first scale as examples to illustrate the form, generation method, matching method, etc. of the multi-scale graph representation, but is not intended to limit the scope of the disclosure.
需要说明的是,尺度的高低可以理解为对应的图表示对数据整体或局部的侧重,例如可以通过图表示中的每个节点在原始数据中的对应部分的大小、该尺度的图表示中的节点的数量等方式对尺度的高低进行衡量。在示例中,高尺度的图表示的节点例如可以对应图像整体、文本段落,低尺度的图表示的节点例如可以对应图像的局部、文本中的字或词等等。It should be noted that the level of the scale can be understood as the corresponding graph representation's emphasis on the whole or part of the data. For example, the size of the corresponding part of each node in the graph representation in the original data, the size of the corresponding part of the graph representation of the scale, The level of scale is measured by the number of nodes and other methods. In the example, the nodes represented by the high-scale graph may correspond to the entire image and the text paragraph, and the nodes represented by the low-scale graph may correspond to parts of the image, words or words in the text, and so on.
如下将结合实施例对如何获取多尺度图表示进行描述。How to obtain a multi-scale graph representation will be described below with reference to embodiments.
根据一些实施例,至少一个尺度的节点可以是通过与对该数据对应的稠密数据进行 稀疏化而得到的。According to some embodiments, the nodes of at least one scale may be generated by dense data corresponding to the data. obtained by sparsification.
稠密数据,或者稠密图,例如可以包括稠密像素的原始图像、对原始图像进行卷积后得到的包括稠密特征向量的特征图、包括稠密采样点的音频数据(以及对该音频数据进行频谱化后得到的包括稠密像素的频谱图)、包括稠密字或词的文本段落、以及稠密的分子结构数据和序列数据等。通过对稠密数据进行稀疏化,能够得到多个节点,即稀疏图。其中,每个节点可以对应稠密数据中的一部分区域,并且具有属性。可以理解的是,稠密数据也可以包括多个节点,例如图像中的像素、音频数据中的采样点、文本数据中的字或词等等,每一个节点可以包括标签类型的属性(例如,在稠密数据中的位置、类别)和向量类型的属性(例如,特征向量)。Dense data, or dense graphs, may include, for example, original images with dense pixels, feature maps including dense feature vectors obtained by convolving the original images, audio data including dense sampling points (and spectralization of the audio data The obtained spectrogram includes dense pixels), text paragraphs including dense characters or words, and dense molecular structure data and sequence data, etc. By sparsifying dense data, multiple nodes can be obtained, that is, a sparse graph. Among them, each node can correspond to a part of the area in the dense data and has attributes. It can be understood that dense data may also include multiple nodes, such as pixels in images, sampling points in audio data, words or words in text data, etc., and each node may include a label type attribute (for example, in locations, categories in dense data) and vector-type attributes (e.g., feature vectors).
根据一些实施例,至少一个第一尺度的节点和至少一个第二尺度的节点可以是通过对同一稠密数据分别进行稀疏化而得到的。也就是说,可以对同一稠密数据进行不同程度的稀疏化,以得到不同尺度的节点。According to some embodiments, at least one node of the first scale and at least one node of the second scale may be obtained by sparsifying the same dense data respectively. In other words, the same dense data can be sparsified to different degrees to obtain nodes of different scales.
根据一些实施例,稠密数据可以包括多个尺度。包括多个尺度的稠密数据可以是特征金字塔中的多个尺度上的特征图。至少一个第一尺度的节点和至少一个第二尺度的节点可以是通过对稠密数据的两个尺度的中的每一个尺度分别进行稀疏化而得到的。也就是说,可以先获取多个不同尺度的稠密数据,进而分别对每一尺度的稠密数据进行稀疏化,以得到对应尺度的节点。在一个示例实施例中,可以对原始图像进行不同降采样倍数的卷积,以得到不同尺寸的特征图,即不同尺度的稠密数据。进而,可以分别对这些稠密数据进行稀疏化,以得到不同尺度的节点。上述两种方式均可以在得到稠密数据后并行生成多个尺度上的节点。According to some embodiments, dense data may include multiple scales. Dense data that includes multiple scales can be feature maps at multiple scales in a feature pyramid. At least one node of the first scale and at least one node of the second scale may be obtained by separately sparsifying each of the two scales of the dense data. In other words, you can first obtain multiple dense data of different scales, and then sparse the dense data of each scale separately to obtain nodes of the corresponding scale. In an example embodiment, the original image can be convolved with different downsampling multiples to obtain feature maps of different sizes, that is, dense data of different scales. Furthermore, these dense data can be sparsified separately to obtain nodes of different scales. Both of the above methods can generate nodes on multiple scales in parallel after obtaining dense data.
在一些实施例中,可以利用稠密节点的显著性在稠密数据中确定节点。稠密节点的标量类型的属性可以包括显著性。显著性表征稠密数据中的每一个稠密节点的重要性,其可以通过在所有稠密节点上的概率分布进行表示。在一些实施例中,稠密节点的显著性可以是根据稠密节点的特征向量而确定的。在一个示例实施例中,可以使用显著性网络对所有稠密节点的特征向量进行处理,以确定每一个稠密节点的显著性。In some embodiments, the saliency of dense nodes can be exploited to determine nodes in dense data. Properties of scalar type for dense nodes can include saliency. Salience represents the importance of each dense node in dense data, which can be represented by the probability distribution over all dense nodes. In some embodiments, the saliency of a dense node may be determined based on the feature vector of the dense node. In an example embodiment, the feature vectors of all dense nodes may be processed using a saliency network to determine the saliency of each dense node.
对稠密数据进行稀疏化例如可以包括将多个稠密节点中的至少一部分稠密节点中显著性满足第三预设条件的节点确定为稀疏化后的节点。可以理解的是,本领域技术人员可以根据需求自行设置第三预设条件,在此不做限定。在一个示例实施例中,第三预设条件可以为top-k,即选取显著性最高的k个稠密节点作为稀疏化后的节点,和/或,第三 预设条件可以是显著性大于显著性阈值的节点。Sparsifying the dense data may include, for example, determining nodes whose significance satisfies the third preset condition among at least a part of the plurality of dense nodes as the sparsified nodes. It can be understood that those skilled in the art can set the third preset condition according to needs, which is not limited here. In an example embodiment, the third preset condition may be top-k, that is, selecting the k dense nodes with the highest significance as the sparsified nodes, and/or the third The preset condition can be a node whose significance is greater than the significance threshold.
在一些实施例中,除显著性以外,还可以利用注意力机制生成的注意力分数或其他对稠密节点的重要性的度量方式作为稀疏化的过程中对节点进行筛选的依据,这些方式均在本公开的保护范围内。In some embodiments, in addition to saliency, the attention score generated by the attention mechanism or other measures of the importance of dense nodes can also be used as the basis for filtering nodes during the sparsification process. These methods are all in within the scope of this disclosure.
在一些实施例中,可以使用基于检测的方式在稠密数据中确定节点。基于检测的方式可以包括关键点检测,也可以包括目标检测,还可以包括其他类型的检测,在此不做限定。In some embodiments, detection-based approaches may be used to determine nodes in dense data. The detection-based method may include key point detection, target detection, or other types of detection, which are not limited here.
可以理解的是,节点稀疏化可通过节点稀疏化网络进行,节点稀疏化网络可以包括检测网络、显著性网络等。当节点稀疏化网络为检测网络时,将稠密数据输入检测网络,得到该稠密数据对应的稀疏化后的节点及节点对应的置信度。当节点稀疏化网络为显著性网络时,将稠密数据和稠密数据对应的特征向量输入显著性网络,得到该稠密数据对应的各稠密节点的显著性分数,将显著性分数大于显著性阈值和/或显著性分数最高的前k个稠密节点作为稀疏化后的节点。在一些实施例中,还可以联合考虑非极大抑制(non-maximal suppression)等条件综合筛选。It can be understood that node sparsification can be performed through a node sparsification network, and the node sparsification network can include a detection network, a saliency network, etc. When the node sparse network is a detection network, the dense data is input into the detection network, and the sparse nodes corresponding to the dense data and the corresponding confidence of the nodes are obtained. When the node sparse network is a saliency network, the dense data and the feature vector corresponding to the dense data are input into the saliency network, and the saliency score of each dense node corresponding to the dense data is obtained. The saliency score is greater than the saliency threshold and/ Or the top k dense nodes with the highest significance scores are used as the nodes after sparsification. In some embodiments, conditions such as non-maximal suppression (non-maximal suppression) can also be jointly considered for comprehensive screening.
根据一些实施例,至少一个尺度的节点可以是通过对稠密数据中与另一尺度的节点位置对应的部分进行稀疏化而得到的,另一尺度的节点可以有是通过对稠密数据进行稀疏化而得到的。在一个示例实施例中,第一尺度的节点例如可以是通过目标检测的方式确定的,每一个第一尺度的节点可以对应稠密数据中的一部分区域(即,目标检测输出的检测框),则可以通过对每一个第一尺度的节点在稠密数据中对应的部分进行稀疏化而得到第二尺度的节点,从而得到各第一尺度的节点各自对应的第二尺度的节点。通过这样的方式,能够得到更有价值的第二尺度的节点,从而提升后续匹配任务和下游任务的处理效率和准确率。According to some embodiments, the nodes of at least one scale may be obtained by sparsifying the part of the dense data corresponding to the node position of another scale, and the nodes of the other scale may be obtained by sparsifying the dense data. owned. In an example embodiment, the nodes of the first scale may be determined, for example, through target detection, and each node of the first scale may correspond to a part of the area in the dense data (ie, the detection frame output by target detection), then The nodes of the second scale can be obtained by sparsifying the corresponding part of the dense data of each node of the first scale, thereby obtaining the nodes of the second scale corresponding to each node of the first scale. In this way, more valuable second-scale nodes can be obtained, thereby improving the processing efficiency and accuracy of subsequent matching tasks and downstream tasks.
根据一些实施例,至少一个尺度的节点可以是通过对稠密数据进行归并而得到的。在一些示例实施例中,例如可以使用聚类或图神经网络的方法对稠密数据进行稀疏化,以得到低尺度的节点。进而可以对这些低尺度的节点进行进一步处理,以得到高尺度的节点。According to some embodiments, nodes of at least one scale may be obtained by merging dense data. In some example embodiments, for example, clustering or graph neural network methods may be used to sparse dense data to obtain low-scale nodes. These low-scale nodes can then be further processed to obtain high-scale nodes.
根据一些实施例,至少一个尺度的节点可以是通过对低尺度的节点进行归并而得到的,低尺度的节点可以是通过对稠密数据进行稀疏化而得到的。在一些示例实施例中,可以使用聚类或图神经网络的方法对稀疏化得到的多个低尺度节点进行聚类,或者将包 含多个低尺度节点的子图输入图神经网络,得到更高尺度的节点和/或节点的属性。According to some embodiments, the nodes of at least one scale may be obtained by merging low-scale nodes, and the low-scale nodes may be obtained by sparsifying dense data. In some example embodiments, a clustering or graph neural network method may be used to cluster multiple low-scale nodes obtained by sparsification, or the package A subgraph containing multiple low-scale nodes is input into the graph neural network to obtain higher-scale nodes and/or node attributes.
上述对节点的归并可以是基于节点的标量类型的属性的(例如,位置信息),也可以是基于节点的向量类型的属性的(例如,特征向量),还可以是基于图表示中的邻接边的标量、向量类型的属性的(例如,所连接的两个节点的共现概率、相关性等),在此不做限定。The above-mentioned merging of nodes can be based on the scalar type attributes of the nodes (for example, location information), or it can be based on the vector type attributes of the nodes (for example, feature vectors), or it can also be based on the adjacent edges in the graph representation. Scalar or vector type attributes (for example, co-occurrence probability, correlation, etc. of two connected nodes) are not limited here.
在确定了各个尺度下的节点的位置、与其他尺度的节点或稠密节点的对应关系之前、同时或之后,可以确定这些节点的属性。The attributes of nodes at each scale may be determined before, at the same time, or after determining the locations of the nodes at each scale and their correspondence with nodes at other scales or dense nodes.
根据一些实施例,稀疏化得到的节点的属性可以是根据多个稠密节点中与该节点对应的至少一部分稠密节点的属性确定的。在一些实施例中,可以根据稠密数据中与该节点位置对应的稠密节点的一定范围内的邻居节点的属性确定该节点的属性。例如,可以将这部分邻居节点输入特征提取网络得到该节点的特征向量,或可以将这部分邻居节点的特征向量的平均确定为该节点的特征向量,或将这部分邻居节点的特征向量基于显著性的加权平均确定为该节点的特征向量。在一个示例实施例中,该节点是通过目标检测的方式确定的,则可以将稠密数据中与该节点对应的检测框内的稠密节点输入特征提取网络提取出该节点对应的特征向量(向量类型的属性)。在另一个示例实施例中,该节点是通过归并的方式确定的,则可以根据用于归并得到该节点的所有低尺度节点的属性通过聚类或图神经网络等方式确定该节点的属性。According to some embodiments, the attributes of the node obtained by sparsification may be determined based on the attributes of at least a part of the dense nodes corresponding to the node among the plurality of dense nodes. In some embodiments, the attributes of the node may be determined based on the attributes of neighbor nodes within a certain range of the dense node corresponding to the node location in the dense data. For example, this part of neighbor nodes can be input into the feature extraction network to obtain the feature vector of the node, or the average of the feature vectors of this part of neighbor nodes can be determined as the feature vector of the node, or the feature vector of this part of neighbor nodes can be based on significant The weighted average of the properties is determined as the feature vector of the node. In an example embodiment, the node is determined through target detection, then the dense nodes in the detection frame corresponding to the node in the dense data can be input into the feature extraction network to extract the feature vector (vector type) corresponding to the node. properties). In another example embodiment, the node is determined through merging, and the attributes of the node can be determined through clustering or a graph neural network based on the attributes of all low-scale nodes used to merge to obtain the node.
根据一些实施例,至少一个尺度的节点可以是通过对稀疏化得到的另一尺度的节点归并得到的,归并得到的节点的属性可以是根据另一尺度的节点中与该节点具有从属关系的节点的属性确定的。According to some embodiments, the nodes of at least one scale may be obtained by merging nodes of another scale obtained by sparsification, and the attributes of the merged nodes may be nodes that have a subordinate relationship with the node among the nodes of another scale. properties are determined.
在一些实施例中,还可以对与该节点对应的至少一部分稠密节点或与该节点具有从属关系的节点的属性进行进一步处理,以得到该节点的属性。在一个示例实施例中,可以使用图神经网络对与该节点对应的这些节点的属性进行处理,以得到该节点的属性。除上述方法外,还可以通过其他方式确定节点的各类属性,在此不做限定。In some embodiments, the attributes of at least a part of the dense nodes corresponding to the node or the nodes having a subordinate relationship with the node may be further processed to obtain the attributes of the node. In an example embodiment, a graph neural network may be used to process the attributes of the nodes corresponding to the node to obtain the attributes of the node. In addition to the above methods, various attributes of nodes can also be determined through other methods, which are not limited here.
当节点之间的相对关系对刻画数据有帮助时,多尺度图可以包括邻接边。例如图像中两个目标之间的距离,图像中两个目标之间的作用,语音中前后词之间的关联,序列中不同基团的相互作用。Multiscale graphs can include adjacency edges when the relative relationships between nodes are helpful in characterizing the data. For example, the distance between two targets in the image, the role between the two targets in the image, the association between the preceding and following words in speech, and the interaction of different groups in the sequence.
根据一些实施例,至少一个邻接边可以是根据同一尺度的至少一个节点各自的属性确定的。通过对节点的属性进行分析,可以在单尺度的图表示中确定具有关联关系的节 点对,以生成相应的邻接边。According to some embodiments, at least one adjacent edge may be determined based on respective attributes of at least one node on the same scale. By analyzing the attributes of nodes, nodes with associated relationships can be determined in a single-scale graph representation. Point pairs to generate corresponding adjacent edges.
在一些实施例中,可以基于规则生成邻接边。在一些实施例中,可以在距离小于预设阈值和/或距离最近的前k个的节点对之间生成邻接边。在一些实施例中,可以仅沿特定方向生成邻接边。可以理解的是,本领域技术人员可以根据先验知识自行设定相应的邻接边生成规则,并根据所设定的规则生成邻接边,在此不做限定。In some embodiments, adjacency edges may be generated based on rules. In some embodiments, adjacency edges may be generated between the top k node pairs whose distance is less than a preset threshold and/or the closest distance. In some embodiments, adjoining edges may be generated only along specific directions. It can be understood that those skilled in the art can set corresponding adjacent edge generation rules by themselves based on prior knowledge, and generate adjacent edges according to the set rules, which is not limited here.
在一些实施例中,可以先生成候选邻接边,再从候选邻接边中筛选出邻接边。根据一些实施例,至少一个邻接边是通过执行如下步骤确定的:基于同一尺度的至少一个节点确定至少一个候选邻接边;基于同一尺度的至少一个节点各自的属性,确定至少一个候选邻接边各自的显著性;以及将至少一个候选邻接边中显著性满足第四预设条件的邻接边确定为至少一个邻接边。通过使用显著性生成邻接边,使得邻接边的生成过程可以通过训练进行优化,以提升生成的邻接边的有效性。可以理解的是,本领域技术人员可以根据需求设置相应的第四预设条件。在一个示例实施例中,第四预设条件可以为显著性大于显著性阈值和/或显著性最高的前k个。In some embodiments, candidate adjacency edges may be generated first, and then adjacency edges may be filtered out from the candidate adjacency edges. According to some embodiments, the at least one adjacent edge is determined by performing the following steps: determining at least one candidate adjacent edge based on at least one node of the same scale; determining the respective attributes of the at least one candidate adjacent edge based on at least one node of the same scale. significance; and determining the adjacent edge whose significance satisfies the fourth preset condition among the at least one candidate adjacent edge as at least one adjacent edge. By using saliency to generate adjacent edges, the generation process of adjacent edges can be optimized through training to improve the effectiveness of the generated adjacent edges. It can be understood that those skilled in the art can set corresponding fourth preset conditions according to needs. In an example embodiment, the fourth preset condition may be the top k items whose significance is greater than the significance threshold and/or the highest significance.
根据一些实施例,至少一个邻接边中的每一个邻接边的属性可以是根据该邻接边连接的两个节点各自的属性和该两个节点的相对关系中的至少一个确定的。在一个示例实施例中,可以根据两个节点各自的位置/属性,将连接两个节点的邻接边的位置、长度、角度、相互作用大小等内容确定为该邻接边的属性。在一些实施例中,可以利用先验知识基于规则判断两个节点的相对关系,并根据该相对关系确定邻接边的属性。According to some embodiments, the attributes of each of the at least one adjacent edge may be determined based on at least one of respective attributes of two nodes connected by the adjacent edge and a relative relationship between the two nodes. In an example embodiment, the position, length, angle, interaction size, etc. of the adjacent edge connecting the two nodes can be determined as attributes of the adjacent edge based on the respective positions/attributes of the two nodes. In some embodiments, a priori knowledge can be used to determine the relative relationship between two nodes based on rules, and the attributes of the adjacent edges can be determined based on the relative relationship.
根据一些实施例,至少一个从属边可以是根据两个尺度的节点之间的从属关系直接确定的。在一个示例实施例中,第一尺度的第一节点是通过对稠密数据进行目标检测而得到的,第二尺度的第二节点是通过对第一节点在稠密数据中对应的区域进行进一步目标检测而得到的,则第一节点和第二节点具有从属关系,可以在第一节点和第二节点之间生成从属边。在另一个示例实施例中,第二尺度的节点是通过对稠密数据进行聚类而得到的,第一尺度的节点通过对第二尺度的节点进行归并而得到的,则用于归并得到第一尺度的节点的第二尺度的节点和该第一尺度的节点之间具有从属关系,可以在这些第二尺度的节点和第一尺度的节点之间生成从属边。According to some embodiments, at least one affiliation edge may be directly determined based on affiliation relationships between nodes at two scales. In an example embodiment, the first node at the first scale is obtained by performing object detection on dense data, and the second node at the second scale is obtained by performing further object detection on the area corresponding to the first node in the dense data. And obtained, the first node and the second node have a subordinate relationship, and a subordinate edge can be generated between the first node and the second node. In another example embodiment, the nodes at the second scale are obtained by clustering dense data, and the nodes at the first scale are obtained by merging the nodes at the second scale, and then the merging is used to obtain the first There is a subordinate relationship between the nodes of the second scale and the nodes of the first scale, and subordinate edges can be generated between the nodes of the second scale and the nodes of the first scale.
根据一些实施例,从属边的属性可以是根据与该从属边相连的两个节点的属性确定的。如前文所描述的,可以以各种方式根据与从属边相连的两个节点的向量类型的属性和/或标量类型的属性确定该从属边的属性,在此不做限定。 According to some embodiments, the attributes of the dependent edge may be determined based on the attributes of the two nodes connected to the dependent edge. As described above, the attributes of the subordinate edge can be determined in various ways according to the vector type attributes and/or the scalar type attributes of the two nodes connected to the subordinate edge, which are not limited here.
根据一些实施例,第一数据和第二数据各自的第一尺度的图表示可以是利用第一网络生成的和/或第一数据和第二数据各自的第二尺度的图表示可以是利用第二网络生成的。在一些实施例中,上述节点、邻接边、从属边的生成过程以及节点、邻接边、从属边的属性的确定过程可以全部或部分是利用第一网络或第二网络进行的,也可以全部或部分是利用基于规则的方法进行的,还可以一部分环节是利用第一网络或第二网络进行的,另一部分环节是利用基于规则的方法进行的,在此不做限定。在利用网络进行节点、邻接边、从属边的生成和/或属性的确定时,可以在匹配结果中加入可微分的部分,从而使得能够通过训练对生成过程和/或属性的确定进行优化,以进一步提升图表示的表达能力。According to some embodiments, the graph representation of the first scale of each of the first data and the second data may be generated using the first network and/or the graph representation of the second scale of the first data and the second data may be generated using the first network. generated by the second network. In some embodiments, the above-mentioned generation process of nodes, adjacent edges, and subordinate edges and the determination process of attributes of nodes, adjacent edges, and subordinate edges may be performed entirely or partially using the first network or the second network, or may be performed entirely or partially. Part of it is performed using a rule-based method, part of the link may be performed using the first network or the second network, and another part of the link is performed using a rule-based method, which is not limited here. When using the network to generate nodes, adjacent edges, and subordinate edges and/or determine attributes, differentiable parts can be added to the matching results, so that the generation process and/or the determination of attributes can be optimized through training to Further improve the expressive ability of graph representation.
在获取到第一数据和第二数据的多尺度图表示后,可以分别对第一数据和第二数据的不同尺度的图表示进行图匹配,以得到与每个尺度对应的匹配结果,进而根据这些匹配结果确定多尺度匹配结果。After obtaining the multi-scale graph representations of the first data and the second data, graph matching can be performed on the graph representations of the first data and the second data at different scales to obtain matching results corresponding to each scale, and then according to These matching results determine the multi-scale matching results.
根据一些实施例,如图3所示,第一尺度和第二尺度中每一尺度的图匹配过程可以包括:According to some embodiments, as shown in Figure 3, the graph matching process for each of the first scale and the second scale may include:
步骤301,根据第一数据的该尺度的图表示所包括的至少一个节点和第二数据的该尺度的图表示所包括的至少一个节点确定候选匹配点对,其中,候选匹配点对包括属于第一数据的该尺度的图表示的第一候选匹配节点和属于第二数据的该尺度的图表示的第二候选匹配节点;Step 301: Determine a candidate matching point pair according to at least one node included in the graph representation of the scale of the first data and at least one node included in the graph representation of the scale of the second data, wherein the candidate matching point pair includes a node belonging to the first A first candidate matching node of the graph representation of the scale of one data and a second candidate matching node belonging to the graph representation of the scale of the second data;
步骤302,针对候选匹配点对,基于候选匹配点对所包括的第一候选匹配节点的特征向量和候选匹配点对所包括的第二候选匹配节点的特征向量,确定候选匹配点对的匹配结果;Step 302: For the candidate matching point pair, determine the matching result of the candidate matching point pair based on the feature vector of the first candidate matching node included in the candidate matching point pair and the feature vector of the second candidate matching node included in the candidate matching point pair. ;
步骤303,基于候选匹配点对的匹配结果,确定第一数据的该尺度的图表示和第二数据的该尺度的图表示的匹配结果。Step 303: Based on the matching results of the candidate matching point pairs, determine the matching results of the graph representation of the scale of the first data and the graph representation of the scale of the second data.
可以理解的是,第一数据的该尺度的图表示和第二数据的该尺度的图表示的匹配结果可以基于多个候选匹配点对的匹配结果确定,当该尺度的图表示包括邻接边时,还可基于多个候选匹配边对的匹配结果确定。It can be understood that the matching result of the graph representation of the scale of the first data and the graph representation of the scale of the second data can be determined based on the matching results of multiple candidate matching point pairs, when the graph representation of the scale includes adjacent edges. , can also be determined based on the matching results of multiple candidate matching edge pairs.
由此,通过在图表示中的节点构成的图结构和节点自身属性(例如特征向量)两个维度进行匹配,使得能够充分利用数据所包含的信息进行匹配,提升了匹配结果和后续任务的结果的准确性。As a result, matching is performed in two dimensions: the graph structure composed of nodes in the graph representation and the attributes of the nodes themselves (such as feature vectors), making it possible to make full use of the information contained in the data for matching, improving the matching results and the results of subsequent tasks. accuracy.
在步骤301中,可以利用不同数据的图表示中的节点(以及在示例中,节点之间的 邻接边)所呈现的结构的相似度信息,确定不同数据的图表示中的节点之间的匹配关系,以得到候选匹配点对。可以结合现有的匹配算法来进行不同数据的图表示之间的节点匹配,以得到候选匹配点对。In step 301, nodes in the graph representation of the different data (and in the example, between nodes The similarity information of the structure presented by adjacent edges) determines the matching relationship between nodes in the graph representation of different data to obtain candidate matching point pairs. Existing matching algorithms can be combined to perform node matching between graph representations of different data to obtain candidate matching point pairs.
在一些实施例中,可以使用逐点匹配的方式快速得到候选匹配点对。In some embodiments, point-by-point matching can be used to quickly obtain candidate matching point pairs.
在一个示例实施例中,可以在步骤302中确定候选匹配点对的匹配结果为匹配时,确定新的候选匹配点对(例如根据已确认匹配的匹配点对A和B,确定节点A的最近邻C和节点B的最近邻D为新的候选匹配点对),再对新候选匹配点对执行步骤302,直到新的候选匹配点对不匹配或无法确定新的候选匹配点对。进而在步骤303中,根据该尺度的图表示中历史所有候选匹配点对的匹配结果,确定第一数据的该尺度的图表示和第二数据的该尺度的图表示的匹配结果。In an example embodiment, when it is determined that the matching result of the candidate matching point pair is a match in step 302, a new candidate matching point pair may be determined (for example, based on the confirmed matching matching point pair A and B, determine the nearest node A Neighbor C and the nearest neighbor D of node B are new candidate matching point pairs), and then perform step 302 for the new candidate matching point pair until the new candidate matching point pair does not match or the new candidate matching point pair cannot be determined. Furthermore, in step 303, the matching results of the graph representation of the scale of the first data and the graph representation of the second data of the scale are determined based on the matching results of all historical candidate matching point pairs in the graph representation of the scale.
在一些示例实施例中,可以在每次得到新的候选匹配点对时执行步骤302和步骤303,进而根据当前得到的图表示的匹配结果确定是否继续搜索更多的候选匹配点对。如果此时图表示的匹配结果已经能够确定两个数据匹配(例如,匹配得分大于预设阈值),则可以停止搜索并返回结果;否则可以继续搜索,直至无法找到更多的候选匹配点对。In some example embodiments, steps 302 and 303 may be performed each time a new candidate matching point pair is obtained, and then it is determined whether to continue searching for more candidate matching point pairs based on the currently obtained matching result represented by the graph. If the matching results represented by the graph at this time can determine the two data matches (for example, the matching score is greater than the preset threshold), the search can be stopped and the results returned; otherwise, the search can be continued until no more candidate matching point pairs can be found.
在一些实施例中,通过结合树生长算法和束搜索,可以在递归的每一步在已经匹配到的节点构成的树上长出一个树枝,并且计算新生的树叶(即,所有可能生长出的树枝)的得分,筛选最好的k个树叶作为下一步的树枝,以实现逐点匹配。可以理解的是,还可以使用其他方法实现逐点匹配,在此不做限定。In some embodiments, by combining a tree growing algorithm and a beam search, a branch can be grown on the tree composed of the matched nodes at each step of the recursion, and the new leaves (i.e., all possible growing branches) can be calculated. Score, select the best k leaves as the next branches to achieve point-by-point matching. It is understandable that other methods can also be used to achieve point-by-point matching, which is not limited here.
在一些实施例中,可以使用全局匹配的方式(例如匈牙利算法)得到候选匹配点对。In some embodiments, a global matching method (such as the Hungarian algorithm) can be used to obtain candidate matching point pairs.
在一些实施例中,可以使用动态规划的方式得到候选匹配点对。动态规划的方式能够得到全局最优的匹配结果。在一个示例实施例中,匹配结果可以包括多个候选匹配点对,可以对其中的每一个候选匹配点对执行步骤302以得到对应的匹配结果,并在步骤303基于所有的候选匹配点对的匹配结果确定图表示的匹配结果。In some embodiments, dynamic programming may be used to obtain candidate matching point pairs. The dynamic programming method can obtain the globally optimal matching result. In an example embodiment, the matching result may include multiple candidate matching point pairs, step 302 may be performed for each candidate matching point pair to obtain the corresponding matching result, and in step 303, based on all candidate matching point pairs The match result determines the match result of the graph representation.
在步骤302中,可以使用多种方式基于第一候选匹配节点的属性和第二候选匹配节点的属性确定这两个节点的匹配结果。In step 302, various methods may be used to determine the matching results of the two nodes based on the attributes of the first candidate matching node and the attributes of the second candidate matching node.
在一些实施例中,候选匹配点对的匹配结果例如可以是第一候选匹配节点的特征向量和第二候选匹配节点的特征向量之间的相似度。在一些实施例中,候选匹配点对的匹配结果还可以是第一候选匹配节点的显著性、第二候选匹配节点的显著性、以及第一候选匹配节点的特征向量和第二候选匹配节点的特征向量之间的相似度的乘积。这样的数 值型的匹配结果也可以被称为节点的匹配得分。In some embodiments, the matching result of the candidate matching point pair may be, for example, the similarity between the feature vector of the first candidate matching node and the feature vector of the second candidate matching node. In some embodiments, the matching result of the candidate matching point pair may also be the saliency of the first candidate matching node, the saliency of the second candidate matching node, and the feature vector of the first candidate matching node and the second candidate matching node. The product of similarities between feature vectors. Such a number The matching result of value type can also be called the matching score of the node.
在一些实施例中,可以先利用节点的标量类型的属性确定第一点对匹配结果,再根据第一点对匹配结果判断是否需要进一步利用节点的向量类型的属性确定第二点对匹配结果。如图4所示,步骤302,确定候选匹配点对的匹配结果可以包括:步骤401,基于候选匹配点对所包括的第一候选匹配节点的标量类型的属性和候选匹配点对所包括的第二候选匹配节点的标量类型的属性,确定候选匹配点对的第一点对匹配结果;步骤402,响应于确定候选匹配点对的第一点对匹配结果满足第一预设条件,基于候选匹配点对所包括的第一候选匹配节点的特征向量和候选匹配点对所包括的第二候选匹配节点的特征向量,确定候选匹配点对的第二点对匹配结果;以及步骤403,基于第二点对匹配结果,确定候选匹配点对的匹配结果。通过这样的方式,一方面可以利用先验知识基于标量类型的属性进行匹配结果判断,另一方面能够降低计算量,提高匹配结果的计算速度。In some embodiments, the first point pair matching result can be determined using the scalar type attribute of the node, and then it is determined based on the first point pair matching result whether it is necessary to further use the vector type attribute of the node to determine the second point pair matching result. As shown in Figure 4, step 302, determining the matching result of the candidate matching point pair may include: step 401, based on the scalar type attribute of the first candidate matching node included in the candidate matching point pair and the third candidate matching point pair included in the candidate matching point pair. The scalar type attributes of the two candidate matching nodes determine the matching result of the first point pair of the candidate matching point pair; step 402, in response to determining that the matching result of the first point pair of the candidate matching point pair satisfies the first preset condition, based on the candidate matching The feature vector of the first candidate matching node included in the point pair and the feature vector of the second candidate matching node included in the candidate matching point pair determine the second point pair matching result of the candidate matching point pair; and step 403, based on the second Point pair matching results determine the matching results of candidate matching point pairs. In this way, on the one hand, prior knowledge can be used to judge the matching results based on the attributes of the scalar type. On the other hand, the amount of calculation can be reduced and the calculation speed of the matching results can be improved.
在步骤401中,例如可以将标量类型的属性所包括的类别属性的一致性或相关性确定为第一点对匹配结果,也可以将标量类型的属性所包括的数值属性的差值、比值或其他计算结果确定为第一点对匹配结果,还可以通过其他方式确定第一点对匹配结果,在此不做限定。In step 401, for example, the consistency or correlation of the category attributes included in the scalar type attributes may be determined as the first point pair matching result, or the difference, ratio, or difference of the numerical attributes included in the scalar type attributes may be determined. Other calculation results are determined as the first point pair matching results, and the first point pair matching results can also be determined through other methods, which are not limited here.
在步骤402中,第一预设条件可以和上述第一点对匹配结果对应,例如可以为类别属性一致,也可以为数值属性的差值小于阈值。可以理解的是,本领域技术人员可以自行根据需求设置第一预设条件,在此不做限定。第二点对匹配结果的确定方式与前文描述的利用两个节点各自的特征向量确定这两个节点的匹配结果的方式类似,在此不做赘述。In step 402, the first preset condition may correspond to the above-mentioned first point pair matching result, for example, it may be that the category attributes are consistent, or it may be that the difference between the numerical attributes is less than a threshold. It can be understood that those skilled in the art can set the first preset condition according to needs, which is not limited here. The method of determining the matching result of the second point is similar to the method of determining the matching result of the two nodes using their respective feature vectors described above, and will not be described again here.
在步骤403中,可以直接将第二点对匹配结果确定为候选匹配点对的匹配结果,也可以基于第一点对匹配结果和第二点对匹配结果确定候选匹配点对的匹配结果。在一个示例实施例中,第一点对匹配结果为候选匹配点对中的两个节点的数值属性的比值,第二点对匹配结果为这两个节点的特征向量的相似度,则可以将该比值和该相似度的综合计算结果确定为该候选匹配点对的匹配结果。In step 403, the second point pair matching result may be directly determined as the matching result of the candidate matching point pair, or the matching result of the candidate matching point pair may be determined based on the first point pair matching result and the second point pair matching result. In an example embodiment, the first point pair matching result is the ratio of the numerical attributes of the two nodes in the candidate matching point pair, and the second point pair matching result is the similarity of the feature vectors of the two nodes, then it can be The comprehensive calculation result of the ratio and the similarity is determined as the matching result of the candidate matching point pair.
在一些实施例中,也可以在得到候选匹配点对后利用节点的标量类型的属性对候选匹配点对进行筛选,从而能够过滤掉部分不匹配的点对以得到更准确的图表示匹配结果,并且能够降低图表示匹配结果计算过程的计算量。In some embodiments, after obtaining the candidate matching point pairs, the candidate matching point pairs can also be filtered using the scalar type attribute of the node, so that some unmatched point pairs can be filtered out to obtain a more accurate graph representation matching result. And it can reduce the calculation amount of the graph representation matching result calculation process.
回到图3。在一些实施例中,还可以利用第一候选匹配节点的邻居节点和邻居邻接边 以及第二候选匹配节点的邻居节点和邻居邻接边的属性确定这两个候选匹配节点的匹配结果。可以理解的是,当两个节点的邻居节点比较相似、连接两个节点各自的边比较相似时,这两个节点匹配的概率较高。Return to Figure 3. In some embodiments, the neighbor nodes and neighbor adjacency edges of the first candidate matching node may also be used. And the attributes of the neighbor nodes and neighbor adjacent edges of the second candidate matching node determine the matching results of the two candidate matching nodes. It can be understood that when the neighbor nodes of two nodes are relatively similar and the edges connecting the two nodes are relatively similar, the probability of matching between the two nodes is higher.
在步骤303中,第一数据和第二数据在该尺度下的图表示的匹配结果例如可以是所有候选匹配点对的匹配得分的总和。可以理解的是,还可以使用其他方式确定图表示的匹配结果。在一个实施例中,可以将匹配得分的综合和预设阈值的比较结果确定为最终匹配结果。在一个实施例中,每一个候选匹配点对可以具有权重,则最终匹配结果例如可以是所有候选匹配点对的匹配得分的加权总和。在一个实施例中,候选匹配点对的匹配结果指示该候选匹配点对的属性是否一致,则可以根据这些二元判断结果确定图表示的匹配结果。In step 303, the matching result of the graph representation of the first data and the second data at the scale may be, for example, the sum of the matching scores of all candidate matching point pairs. It will be appreciated that other means of determining the matching result of the graph representation may also be used. In one embodiment, a comparison result of a comprehensive matching score and a preset threshold may be determined as the final matching result. In one embodiment, each candidate matching point pair may have a weight, and the final matching result may be, for example, a weighted sum of matching scores of all candidate matching point pairs. In one embodiment, the matching result of the candidate matching point pair indicates whether the attributes of the candidate matching point pair are consistent, and then the matching result represented by the graph can be determined based on these binary judgment results.
在进行图匹配时,还可以对图表示所包括的邻接边进行匹配,并根据邻接边的匹配结果确定图表示的匹配结果。在一些实施例中,如果图表示中只有节点,则可以根据节点进行匹配;如果图表示中包括节点可邻接边,可以同时利用两者进行匹配。When performing graph matching, the adjacent edges included in the graph representation can also be matched, and the matching result of the graph representation can be determined based on the matching results of the adjacent edges. In some embodiments, if there are only nodes in the graph representation, matching can be performed based on the nodes; if the graph representation includes nodes that can be adjacent to edges, both can be used for matching at the same time.
根据一些实施例,如图3所示,第一尺度和第二尺度中每一尺度的图匹配过程还可以包括:According to some embodiments, as shown in Figure 3, the graph matching process for each scale in the first scale and the second scale may further include:
步骤304,根据第一数据的该尺度的图表示所包括的至少一个邻接边和第二数据的该尺度的图表示所包括的至少一个邻接边确定候选匹配边对,其中,候选匹配边对包括属于第一数据的该尺度的图表示的第一候选匹配邻接边和属于第二数据的该尺度的图表示的第二候选匹配邻接边;Step 304: Determine a candidate matching edge pair according to at least one adjacent edge included in the graph representation of the scale of the first data and at least one adjacent edge included in the graph representation of the scale of the second data, wherein the candidate matching edge pair includes a first candidate matching adjacency edge belonging to the graph representation of the scale of the first data and a second candidate matching adjacency edge belonging to the graph representation of the scale of the second data;
步骤305,针对候选匹配边对,基于候选匹配边对所包括的第一候选匹配邻接边的属性和候选匹配边对所包括的第二候选匹配邻接边的属性,确定候选匹配边对的匹配结果;以及Step 305: For the candidate matching edge pair, determine the matching result of the candidate matching edge pair based on the attributes of the first candidate matching adjacent edge included in the candidate matching edge pair and the attributes of the second candidate matching adjacent edge included in the candidate matching edge pair. ;as well as
步骤306,基于候选匹配边对的匹配结果,确定第一数据的该尺度的图表示和第二数据的该尺度的图表示的匹配结果。Step 306: Based on the matching results of the candidate matching edge pairs, determine the matching results of the graph representation of the scale of the first data and the graph representation of the scale of the second data.
由此,通过在图表示中的节点和邻接边构成的图结构和邻接边所包括的属性两个维度进行匹配,使得能够充分利用数据所包含的信息进行匹配,提升了匹配结果和后续任务的结果的准确性。Therefore, by matching the graph structure composed of nodes and adjacent edges in the graph representation and the attributes included in the adjacent edges, the information contained in the data can be fully utilized for matching, and the matching results and subsequent tasks are improved. accuracy of results.
在一些实施例中,步骤304可以和步骤301同时执行。也就是说,可以使用前文描述的方法同时得到候选匹配点对和候选匹配边对。在一些实施例中,可以先确定候选匹 配点对,进而根据这些候选匹配点对所包括的点之间的邻接边确定候选匹配边对。In some embodiments, step 304 may be performed simultaneously with step 301. In other words, the method described above can be used to obtain candidate matching point pairs and candidate matching edge pairs at the same time. In some embodiments, candidate matches may be determined first Match point pairs, and then determine candidate matching edge pairs based on the adjacent edges between the points included in these candidate matching point pairs.
可以理解的是,候选匹配边对的匹配结果的确定方式和上述候选匹配点对的匹配结果的确定方式类似,基于候选匹配边对的匹配结果确定图表示的匹配结果的方式和基于候选匹配点对的匹配结果确定图表示的方式类似,在此不做赘述。It can be understood that the method of determining the matching result of the candidate matching edge pair is similar to the method of determining the matching result of the candidate matching point pair. The method of determining the matching result of the graph representation based on the matching result of the candidate matching edge pair is the same as the method of determining the matching result of the candidate matching point pair. The method of determining the graph representation of the pair matching results is similar and will not be described in detail here.
在步骤305中,可以使用多种方式基于第一候选匹配邻接边的属性和第二候选匹配邻接边的属性确定这两个邻接边的匹配结果。In step 305, various methods may be used to determine the matching results of the two adjacent edges based on the attributes of the first candidate matching adjacent edge and the attributes of the second candidate matching adjacent edge.
在一些实施例中,候选匹配边对的匹配结果例如可以是第一候选匹配邻接边的特征向量和第二候选匹配邻接边的特征向量之间的相似度。在一些实施例中,候选匹配边对的匹配结果可以是第一候选匹配邻接边的显著性、第二候选匹配邻接边的显著性、以及第一候选匹配邻接边的特征向量和第二候选匹配邻接边的特征向量的相似度的乘积。In some embodiments, the matching result of the candidate matching edge pair may be, for example, the similarity between the feature vector of the first candidate matching adjacent edge and the feature vector of the second candidate matching adjacent edge. In some embodiments, the matching result of the candidate matching edge pair may be the saliency of the first candidate matching adjacent edge, the saliency of the second candidate matching adjacent edge, and the feature vector of the first candidate matching adjacent edge and the second candidate matching The product of the similarities of the eigenvectors of adjacent edges.
在一些实施例中,可以先利用邻接边的标量类型的属性确定第一边对匹配结果,再根据第一边对匹配结果判断是否需要进一步利用邻接边的向量类型的属性确定第二边对匹配结果。如图5所示,步骤305,确定候选匹配边对的匹配结果可以包括:步骤501,基于候选匹配边对所包括的第一候选匹配邻接边的标量类型的属性和候选匹配边对所包括的第二候选匹配邻接边的标量类型的属性,确定候选匹配边对的第一边对匹配结果;步骤502,响应于确定候选匹配边对的第一边对匹配结果满足第二预设条件,基于候选匹配边对所包括的第一候选匹配邻接边的特征向量和候选匹配边对所包括的第二候选匹配邻接边的特征向量,确定候选匹配边对的第二边对匹配结果;以及步骤503,基于第二边对匹配结果,确定候选匹配边对的匹配结果。In some embodiments, you can first use the scalar type attribute of the adjacent edge to determine the first edge pair matching result, and then determine whether it is necessary to further use the vector type attribute of the adjacent edge to determine the second edge pair matching based on the first edge pair matching result. result. As shown in Figure 5, step 305, determining the matching result of the candidate matching edge pair may include: step 501, based on the scalar type attribute of the first candidate matching adjacent edge included in the candidate matching edge pair and the scalar type attribute included in the candidate matching edge pair. The scalar type attribute of the second candidate matching adjacent edge determines the first edge pair matching result of the candidate matching edge pair; step 502, in response to determining that the first edge pair matching result of the candidate matching edge pair satisfies the second preset condition, based on The feature vector of the first candidate matching adjacent edge included in the candidate matching edge pair and the feature vector of the second candidate matching adjacent edge included in the candidate matching edge pair determine the second edge pair matching result of the candidate matching edge pair; and step 503 , based on the second edge pair matching result, determine the matching result of the candidate matching edge pair.
可以理解的是,步骤501-步骤503对候选匹配边对的操作分别和步骤401-步骤403对候选匹配点对的操作类似,在此不做赘述。本领域技术人员可以根据需求自行设置第二预设条件,在此不做限定。It can be understood that the operations on the candidate matching edge pairs in steps 501 to 503 are similar to the operations on the candidate matching point pairs in steps 401 to 403, respectively, and will not be described again here. Those skilled in the art can set the second preset condition according to their needs, which is not limited here.
回到图3。在一些实施例中,还可以利用第一候选匹配邻接边的邻居节点以及第二候选匹配邻接边的邻居节点确定这两个候选匹配邻接边的匹配结果。Return to Figure 3. In some embodiments, the neighbor nodes of the first candidate matching adjacent edge and the neighbor nodes of the second candidate matching adjacent edge may also be used to determine the matching results of the two candidate matching adjacent edges.
在步骤303中,第一数据和第二数据在该尺度下的图表示的匹配结果可以是所有候选匹配点对的匹配得分和/或所有候选匹配边对的匹配的分的总和,还可以是利用其他方式基于候选匹配点对的匹配结果和/或候选匹配边对的匹配结果得到的,在此不做限定。In step 303, the matching result of the graph representation of the first data and the second data at this scale may be the sum of the matching scores of all candidate matching point pairs and/or the matching scores of all candidate matching edge pairs, or it may be It is obtained by using other methods based on the matching results of the candidate matching point pairs and/or the matching results of the candidate matching edge pairs, and is not limited here.
在一些实施例中,除了匹配得分外,匹配结果还可以根据节点//边的配对检查结果确定。例如,节点/边配对检查包括通过射影变换等进行几何关系求解的节点/边配对检查。 可理解的是,不同图表示中的节点的匹配还可以对应数据之间几何空间中的变换关系,其中,显式的变换可以包括场景匹配中的射影变换、指纹匹配中的等距变换,而隐式的变换可以包括语音相关任务中说话人和环境的改变。节点//边的配对检查结果可通过两种方式影响匹配结果:第一种,在进行节点匹配以得到候选匹配点对的过程中,可以加入约束条件,将满足约束条件的点对/边对作为候选匹配点对/边对,从而将先验知识带入到匹配过程中,并且能够加速匹配过程。第二种:在根据候选匹配点对/边对的匹配结果得到初始图匹配结果后,可对节点//边的配对检查结果确定检查结果,根据初始图匹配结果和检查结果共同确定最终的图匹配结果。例如,初始图匹配结果表明匹配度80%,检查结果表明不匹配,可加权得到最终图匹配结果例如70%。In some embodiments, in addition to the match score, the match result may also be determined based on the pairing check results of the node // edge. For example, node/edge pairing checking includes node/edge pairing checking for solving geometric relationships through projective transformation, etc. It is understandable that the matching of nodes in different graph representations can also correspond to the transformation relationship in the geometric space between data. Explicit transformations can include projective transformation in scene matching and isometric transformation in fingerprint matching. Implicit transformations can include changes in speakers and environments in speech-related tasks. The pairing check results of nodes//edges can affect the matching results in two ways: First, in the process of node matching to obtain candidate matching point pairs, constraints can be added to match the point pairs/edge pairs that satisfy the constraints. Match point/edge pairs as candidates, thereby bringing prior knowledge into the matching process and speeding up the matching process. The second type: after obtaining the initial graph matching result based on the matching result of the candidate matching point pair/edge pair, the check result can be determined based on the pairing check result of the node//edge pair, and the final graph can be determined based on the initial graph matching result and the check result. Matching results. For example, if the initial graph matching result shows that the matching degree is 80%, and the inspection result shows that it does not match, the final graph matching result can be weighted to obtain, for example, 70%.
在进行多尺度图表示的图匹配过程中,每一个尺度的图匹配可以是独立进行的,也可以是先在某一尺度进行图匹配,进而根据该尺度的匹配结果确定是否进行其他尺度的图匹配,或者调整其他尺度的图匹配策略或图匹配参数。In the process of graph matching for multi-scale graph representation, graph matching at each scale can be performed independently, or graph matching at a certain scale can be performed first, and then whether to perform graph matching at other scales is determined based on the matching results at that scale. matching, or adjust graph matching strategies or graph matching parameters at other scales.
根据一些实施例,步骤105,将第一数据的第二尺度的图表示和第二数据的第二尺度的图表示进行图匹配,以得到第二匹配结果可以包括:响应于确定第一匹配结果为成功匹配,将第一数据的第二尺度的图表示和第二数据的第二尺度的图表示进行图匹配,以得到第二匹配结果。由此,通过先进行体现整体信息(信息量较少)的第一尺度的图匹配,再根据第一尺度的图匹配结果判断是否进行体现局部信息(信息量较大)的第二尺度的图匹配,使得能够减少第二尺度的图匹配的次数,从而在不影响匹配结果和后续任务处理结果的情况下降低匹配过程的整体耗时,提升任务处理效率。According to some embodiments, step 105, performing graph matching on the graph representation of the second scale of the first data and the graph representation of the second scale of the second data to obtain the second matching result may include: in response to determining the first matching result For successful matching, graph matching is performed on the graph representation of the first data at the second scale and the graph representation at the second scale of the second data to obtain a second matching result. Therefore, by first performing the first-scale graph matching that reflects the overall information (less information), and then judging whether to perform the second-scale graph that embodies local information (larger information) based on the first-scale graph matching results. Matching enables the number of second-scale graph matching to be reduced, thereby reducing the overall time-consuming of the matching process and improving task processing efficiency without affecting the matching results and subsequent task processing results.
根据一些实施例,步骤105,将第一数据的第二尺度的图表示和第二数据的第二尺度的图表示进行图匹配,以得到第二匹配结果可以包括:响应于确定第一匹配结果为成功匹配,将第一数据的第二尺度的第一子图和第二数据的第二尺度的第二子图进行匹配。其中,第一匹配结果指示第一数据的第一尺度的图表示中的第一节点和第二数据的第一尺度的图表示中的第二节点成功匹配,第一子图可以包括第一数据的第二尺度的图表示中与第一节点具有从属关系的节点,第二子图可以包括第二数据的第二尺度的图表示中与第二节点具有从属关系的节点。According to some embodiments, step 105, performing graph matching on the graph representation of the second scale of the first data and the graph representation of the second scale of the second data to obtain the second matching result may include: in response to determining the first matching result For successful matching, the first sub-image of the second scale of the first data is matched with the second sub-image of the second scale of the second data. Wherein, the first matching result indicates that the first node in the graph representation of the first scale of the first data and the second node in the graph representation of the first scale of the second data successfully match, and the first subgraph may include the first data The second subgraph may include nodes having a subordinate relationship with the second node in the second scale graph representation of the second data.
由此,通过先进行第一尺度的图匹配,再对第一尺度的图匹配结果指示成功匹配的节点的子图进行匹配,使得无需对图表示中大概率不匹配的部分进行匹配,从而能够降低需要计算匹配结果的节点和/或邻接边的数量,并且能够在不影响匹配结果和后续任务 处理结果的情况下进一步降低匹配过程的整体耗时,提升任务处理效率。Therefore, by first performing graph matching at the first scale, and then matching subgraphs of nodes whose graph matching results at the first scale indicate successful matching, there is no need to match parts of the graph representation that have a high probability of mismatch, and thus it is possible to Reduce the number of nodes and/or adjacent edges that need to be calculated for matching results without affecting the matching results and subsequent tasks. In the case of processing results, the overall time-consuming of the matching process is further reduced and the task processing efficiency is improved.
根据一些实施例,步骤105,将第一数据的第二尺度的图表示和第二数据的第二尺度的图表示进行图匹配,以得到第二匹配结果可以包括:基于当前节点的属性、与当前节点有从属关系的第一尺度的节点是否成功匹配,确定当前节点的匹配结果,其中,当前节点为第二尺度的节点。通过在低尺度的图匹配过程中考虑纵向关系,将与该节点具有从属关系的高尺度节点的匹配结果作为参考要素,使得能够提升低尺度的图匹配结果的准确性。According to some embodiments, step 105, performing graph matching on the graph representation of the second scale of the first data and the graph representation of the second scale of the second data to obtain the second matching result may include: based on the attributes of the current node, and Whether the node of the first scale to which the current node has a subordinate relationship is successfully matched determines the matching result of the current node, where the current node is a node of the second scale. By considering vertical relationships in the low-scale graph matching process and using the matching results of high-scale nodes that have a subordinate relationship with the node as reference elements, the accuracy of the low-scale graph matching results can be improved.
在步骤106中,可以根据需求设置相应的基于第一匹配结果和第二匹配结果确定多尺度匹配结果的方式和逻辑。在一些实施例中,当第一匹配结果和第二匹配结果均为成功匹配时,确定多尺度匹配结果为成功匹配。在一些实施例中,当低尺度的第二匹配结果成功匹配时,确定多尺度匹配结果为成功匹配。在一些实施例中,第一匹配结果和第二匹配结果例如可以为第一尺度和第二尺度下的图表示的匹配程度,则多尺度匹配结果可以为基于两个尺度下的图表示的匹配程度的计算结果,例如两个尺度下的图表示的匹配程度的平均值。可以理解的是,还可以以其他方式确定多尺度匹配结果,在此不做限定。In step 106, a corresponding method and logic for determining the multi-scale matching result based on the first matching result and the second matching result can be set according to requirements. In some embodiments, when both the first matching result and the second matching result are successful matches, the multi-scale matching result is determined to be a successful match. In some embodiments, when the low-scale second matching result successfully matches, the multi-scale matching result is determined to be a successful match. In some embodiments, the first matching result and the second matching result may be, for example, the matching degree of the graph representations at the first scale and the second scale, and the multi-scale matching result may be the matching based on the graph representations at the two scales. The calculation result of the degree, such as the average of the matching degree represented by the graph at two scales. It can be understood that the multi-scale matching results can also be determined in other ways, which are not limited here.
根据一些实施例,任务为匹配任务,步骤107,基于多尺度匹配结果,确定任务处理结果可以包括:将多尺度匹配结果作为最终任务的结果。According to some embodiments, the task is a matching task, and step 107, determining the task processing result based on the multi-scale matching result may include: using the multi-scale matching result as the result of the final task.
根据一些实施例,第二数据可以是从数据库中获取的。步骤107,基于多尺度匹配结果,确定任务处理结果可以包括:基于第一数据和数据库中的多个第二数据的多尺度匹配结果,确定与第一数据匹配的至少一个第二数据;以及基于至少一个第二数据,确定任务处理结果。由此,通过上述方式,能够将基于多尺度图表示的其他类型的任务转换为多尺度图表示的匹配任务。在一个示例实施例中,最终任务可以为通过匹配手段实现的识别任务、匹配任务、搜索任务,则可以直接将匹配到的至少一个第二数据作为搜索结果。在一个示例实施例中,最终任务为分类任务,可以将则可以将第一数据和匹配到的至少一个第二数据全部输入用于分类任务的模型,从而使该模型将至少一个第二数据作分类的参考以完成对第一数据的分类。在一个示例实施例中,最终任务可以为生成任务(例如,文本或图像的填空),则可以将局部空缺的第一数据和匹配到的至少一个第二数据全部输入用于生成任务的模型,从而使该模型将至少一个第二数据作为生成的参考以完成对第一数据的生成。如此,可借助与第一数据相似的数据完成任务,相比于仅将 第一数据输入模型为模型提供了更为丰富的信息,在不增加模型复杂度的情况下更为准确的获得分类、生成任务的结果。According to some embodiments, the second data may be obtained from a database. Step 107: Determining the task processing result based on the multi-scale matching result may include: determining at least one second data that matches the first data based on the multi-scale matching result of the first data and multiple second data in the database; and based on the multi-scale matching result. At least one second data determines the task processing result. Therefore, through the above method, other types of tasks based on multi-scale graph representation can be converted into matching tasks represented by multi-scale graphs. In an example embodiment, the final task may be a recognition task, a matching task, or a search task implemented by matching means, and then the matched at least one second data may be directly used as the search result. In an example embodiment, the final task is a classification task, and the first data and the matched at least one second data can all be input into a model for the classification task, so that the model can use the at least one second data as a A reference for classification to complete the classification of the first data. In an example embodiment, the final task may be a generation task (for example, filling in the blanks of text or images), then the partially vacant first data and the matched at least one second data may all be input into a model for the generation task, Thus, the model uses at least one second data as a generated reference to complete the generation of the first data. In this way, the task can be completed with the help of data similar to the first data, compared to just using The first data input model provides the model with richer information, and can more accurately obtain the results of classification and generation tasks without increasing the complexity of the model.
以下将结合实施例对不同类型的数据的多尺度图表示、图匹配、以及任务处理进行说明。Multi-scale graph representation, graph matching, and task processing of different types of data will be described below with reference to embodiments.
在一个示例实施例中,第一数据和第二数据均可以为图像数据,稠密数据可以为基于对应的图像数据而得到的特征图,稠密数据中的多个稠密节点可以为特征图中的多个像素。通过对第一数据进行稀疏化(例如,基于显著性)可以得到多个第二尺度的节点。这些节点的属性可以包括节点在第一数据中的位置,以及节点对应的特征向量(例如,根据节点在特征图中邻域确定节点的特征向量,或者,根据节点在第一数据中对应的局部图像确定节点的特征向量,节点的特征向量可以用于描述节点所在邻域的属性,例如方向场、如果第一数据为指掌纹数据,节点的特征向量可用于描述节点所在邻域的纹理密度等)。类似地,可以得到第二数据的第二尺度的节点。通过对第一数据的第二尺度的节点进行归并可以得到多个第一尺度的节点。这些第一节点的属性同样可以包括节点在第一数据中的位置,以及节点对应的特征向量。类似地,可以得到第二数据的第一尺度的节点。第二尺度上还可以包括邻接边,用于在与同一个第一尺度的节点具有从属关系的多个第二尺度的节点之间建立连接,而具有从属关系的第一尺度的节点和第二尺度的节点之间还可以具有从属边。邻接边和从属边的属性例如可以包括边与其对应节点之间的相对位置、角度、边的长度(例如用于描述其所连接节点的作用力大小)等。In an example embodiment, both the first data and the second data may be image data, the dense data may be a feature map obtained based on the corresponding image data, and the multiple dense nodes in the dense data may be multiple nodes in the feature map. pixels. A plurality of nodes at the second scale may be obtained by sparsifying the first data (eg, based on saliency). The attributes of these nodes may include the location of the node in the first data, and the corresponding feature vector of the node (for example, the feature vector of the node is determined based on the node's neighborhood in the feature map, or based on the node's corresponding local location in the first data). The image determines the feature vector of the node. The feature vector of the node can be used to describe the attributes of the neighborhood where the node is located, such as the direction field. If the first data is finger print data, the feature vector of the node can be used to describe the texture density of the neighborhood where the node is located. wait). Similarly, nodes of the second scale of the second data can be obtained. Multiple nodes of the first scale can be obtained by merging the nodes of the second scale of the first data. The attributes of these first nodes may also include the location of the node in the first data, and the feature vector corresponding to the node. Similarly, the nodes of the first scale of the second data can be obtained. The second scale may also include adjacent edges for establishing connections between multiple nodes of the second scale that have a subordinate relationship with the same node of the first scale, and the nodes of the first scale that have a subordinate relationship and the second scale Scale nodes can also have dependent edges between them. The attributes of adjacent edges and subordinate edges may include, for example, the relative position, angle, and length of the edge (for example, used to describe the force of the node it is connected to) between the edge and its corresponding node.
图像数据的多尺度图结构能够提取出图像中目标的几何信息(例如,图像中的多个目标的位置关系,或同一目标的不同部分之间的位置关系),同时保留了丰富的细节信息(例如,节点的特征向量)。而不同尺度的图表示兼顾整体和局部,对于残缺、变形、视角变换、遮挡、攻击样本等更具有鲁棒性,可解释性也更强。通过使用这样的多尺度图表示进行图匹配,并利用图匹配的方式解决下游复杂任务(下游任务例如是图像匹配,图像搜索,图像分类,图像生成),能够得到更加精准可靠的结果。此外,由于具有多尺度的特性,因此在进行图像数据检索、比对等任务时,可以根据高尺度的图表示进行初步筛选,再使用低尺度的图表示进行精确地检索和比对,同时基于先验知识进行约束(例如,几何约束)以得到准确结果。The multi-scale graph structure of image data can extract the geometric information of the target in the image (for example, the positional relationship of multiple targets in the image, or the positional relationship between different parts of the same target), while retaining rich detailed information ( For example, the feature vector of a node). The graph representation of different scales takes into account both the whole and the local part, and is more robust to defects, deformations, perspective changes, occlusions, attack samples, etc., and has stronger interpretability. By using such multi-scale graph representations for graph matching, and using graph matching to solve complex downstream tasks (downstream tasks such as image matching, image search, image classification, and image generation), more accurate and reliable results can be obtained. In addition, due to its multi-scale characteristics, when performing tasks such as image data retrieval and comparison, preliminary screening can be carried out based on high-scale graph representations, and then low-scale graph representations can be used for accurate retrieval and comparison. At the same time, based on Prior knowledge is used to constrain (e.g., geometric constraints) to obtain accurate results.
在一个示例实施例中,第一数据和第二数据均可以为文本数据,则稠密数据可以为文本段落,稠密数据中的节点可以为文本段落中的字/词。可以理解的是,稠密数据中的 节点也可以为这些字/词对应的文本特征。通过对第一数据和第二数据进行稀疏化,可以得到第一尺度和第二尺度的节点,这些节点可以对应文本段落中的句子、子句、短语、词汇等文本中的不同尺度的文本片段。这些节点的属性例如可以包括对应的文本片段的词嵌入,还可以包括其在文本段落中的位置。节点之间的邻接边例如可以用于体现不同文本片段之间的关系,而从属边可以用于体现不同尺度的文本片段之间的从属关系。In an example embodiment, both the first data and the second data may be text data, the dense data may be text paragraphs, and the nodes in the dense data may be words/words in the text paragraphs. Understandably, in dense data Nodes can also be text features corresponding to these words/words. By sparsifying the first data and the second data, nodes of the first scale and the second scale can be obtained. These nodes can correspond to sentences, clauses, phrases, vocabulary and other text fragments of different scales in the text paragraph. . The attributes of these nodes may include, for example, the word embedding of the corresponding text fragment, and may also include its position in the text paragraph. For example, the adjacency edges between nodes can be used to reflect the relationship between different text fragments, and the subordinate edges can be used to reflect the subordinate relationship between text fragments of different scales.
文本数据的多尺度图表示能够提取出文本段落中的字、词、短语、子句、句子、段落等不同尺度的文本片段之间的结构关系和/或逻辑关系,并且能够保留这些文本中的要素对应的文本特征向量,使得能够更好的处理各类自然语言处理任务。而不同尺度的图表示兼顾整体和局部,对于句子不完整、残缺、句子变形、不同语言等更具有鲁棒性。下游任务可以是文本翻译,文本续写,自动问答等。The multi-scale graph representation of text data can extract the structural relationships and/or logical relationships between text fragments of different scales such as words, words, phrases, clauses, sentences, paragraphs, etc. in the text paragraph, and can retain the structural relationships in these texts. The text feature vector corresponding to the element enables better processing of various natural language processing tasks. The graph representation of different scales takes into account both the whole and the part, and is more robust to incomplete sentences, incomplete sentences, sentence deformations, different languages, etc. Downstream tasks can be text translation, text continuation, automatic question and answer, etc.
在一个示例实施例中,第一数据和第二数据均可以为音频数据,则稠密数据可以为音频数据的频谱图,稠密数据中的节点为频谱图中的像素。第一尺度的节点例如可以是通过延时间方向对频谱图进行片段划分而得到的多个片段区域,而第二尺度的节点例如可以是从频谱图中提取出的特征点。第二节点之间可以具有邻接边,用于连接相邻的特征点。In an example embodiment, both the first data and the second data may be audio data, then the dense data may be a spectrogram of the audio data, and the nodes in the dense data may be pixels in the spectrogram. The nodes at the first scale may be, for example, multiple segment regions obtained by segmenting the spectrogram in the time-delay direction, and the nodes at the second scale may be, for example, feature points extracted from the spectrogram. There may be adjacent edges between the second nodes for connecting adjacent feature points.
音频数据的多尺度图表示能够延时间方向提取出多个片段,以及每个片段中的多个特征点和这些特征点之间的关联关系(例如,时间距离,频域距离),并且保留了和这些特征点对应的特征向量,使得在完成音频相关任务,尤其是语音相关任务时,能够解决不同语音、语调、说话方式、以及内容的随机性带来的问题。而不同尺度的图表示兼顾整体和局部,对于语音不完整、噪声等更具有鲁棒性。下游任务可以是语音翻译等。The multi-scale graph representation of audio data can extract multiple segments in the time direction, as well as multiple feature points in each segment and the correlation between these feature points (for example, time distance, frequency domain distance), and retain The feature vectors corresponding to these feature points enable the problem caused by the randomness of different voices, intonations, speaking methods, and content to be solved when completing audio-related tasks, especially speech-related tasks. The graph representation of different scales takes into account both the whole and the part, and is more robust to incomplete speech, noise, etc. Downstream tasks can be speech translation, etc.
在一些示例实施例中,第一数据和第二数据还可以为分子、基因、蛋白质、序列等各类复杂数据,则稠密数据中的节点可以为对应的数据类型下的最小单元,例如,原子、碱基对、氨基酸等。图表示的节点可以和稠密数据一致,也可以为更高尺度的单元,例如,原子团、官能团、多个碱基对构成的片段(例如,编码区和非编码区,或更低尺度下的增强子、启动子、外显子、内含子、终止子等)、蛋白质中氨基酸序列、肽链等等。节点间的邻接边和从属边可以用于体现同尺度的单元间的各类关系(例如,化学键、氢键)和不同尺度的单元间的各类关系(例如,从属关系)。此外,多尺度的图表示还能够体现这些数据在不同尺度下的结构,例如蛋白质的一级、二级、三级、四级结构。下游任务可以是分子结构数据、序列数据的性质/结构预测等。 In some example embodiments, the first data and the second data can also be various types of complex data such as molecules, genes, proteins, sequences, etc., then the nodes in the dense data can be the smallest units of the corresponding data types, for example, atoms. , base pairs, amino acids, etc. The nodes represented by the graph can be consistent with dense data, or they can be higher-scale units, such as atomic groups, functional groups, segments composed of multiple base pairs (for example, coding regions and non-coding regions, or enhancements at lower scales). (e.g., promoter, exon, intron, terminator, etc.), amino acid sequence in protein, peptide chain, etc. Adjacent edges and subordinate edges between nodes can be used to reflect various relationships between units of the same scale (for example, chemical bonds, hydrogen bonds) and various relationships between units of different scales (for example, subordinate relationships). In addition, multi-scale graph representation can also reflect the structure of these data at different scales, such as the primary, secondary, tertiary, and quaternary structures of proteins. Downstream tasks can be molecular structure data, property/structure prediction of sequence data, etc.
这些复杂数据的多尺度图表示能够表征其复杂的空间结构和细节信息,并且能够体现出复杂数据中的各类单元之间的不同关系,因此使用多尺度图表示使得能够充分利用复杂数据的上述信息以进行匹配任务或其他下游任务。The multi-scale graph representation of these complex data can represent its complex spatial structure and detailed information, and can reflect the different relationships between various types of units in the complex data. Therefore, the use of multi-scale graph representation can make full use of the above-mentioned features of complex data. information for matching tasks or other downstream tasks.
在一些实施例中,其他类型的数据可以先转换为图像数据,再根据转换后的图像数据生成多尺度图表示。在示例中,例如可以将音频数据、文本数据等其他类型的数据转换为图像数据,再根据图像数据提取多尺度图表示,进而根据该图表示完成下游的各类任务。In some embodiments, other types of data can be converted into image data first, and then a multi-scale graph representation is generated based on the converted image data. In an example, other types of data such as audio data and text data can be converted into image data, and then a multi-scale graph representation can be extracted based on the image data, and then various downstream tasks can be completed based on the graph representation.
在一些实施例中,也可以在不同类型的数据的图表示之间进行图匹配,以完成特定的跨模态任务。In some embodiments, graph matching can also be performed between graph representations of different types of data to accomplish specific cross-modal tasks.
图6示出了根据本公开一个实施例的一种神经网络的训练方法600的流程图,该方法600包括:Figure 6 shows a flow chart of a neural network training method 600 according to an embodiment of the present disclosure. The method 600 includes:
步骤601,获取第一样本数据和第二样本数据,第一样本数据和第二样本数据分别为图像数据、音频数据、文本数据、分子结构数据和序列数据中的一者;Step 601: Obtain first sample data and second sample data. The first sample data and the second sample data are respectively one of image data, audio data, text data, molecular structure data and sequence data;
步骤602,获取第一样本数据和第二样本数据各自的多尺度图表示,其中,多尺度图表示是利用图表示提取网络确定的,多尺度图表示包括第一尺度的图表示和第二尺度的图表示;Step 602: Obtain multi-scale graph representations of the first sample data and the second sample data, where the multi-scale graph representation is determined using the graph representation extraction network, and the multi-scale graph representation includes the graph representation of the first scale and the second scale graph representation. Graphical representation of scale;
步骤603,将第一样本数据的第一尺度的图表示和第二样本数据的第一尺度的图表示进行图匹配,以得到表征第一尺度的匹配程度的第一当前匹配结果;Step 603: Perform graph matching on the graph representation of the first scale of the first sample data and the graph representation of the first scale of the second sample data to obtain a first current matching result that represents the matching degree of the first scale;
步骤604,将第一样本数据的第二尺度的图表示和第二样本数据的第二尺度的图表示进行图匹配,以得到表征第二尺度的匹配程度的第二当前匹配结果;Step 604: Perform graph matching on the graph representation of the second scale of the first sample data and the graph representation of the second scale of the second sample data to obtain a second current matching result that represents the matching degree of the second scale;
步骤605,获取第一样本数据和第二样本数据的目标匹配结果和/或目标任务处理结果;Step 605: Obtain the target matching results and/or target task processing results of the first sample data and the second sample data;
步骤606,根据目标匹配结果和/或目标任务处理结果、以及第一当前匹配结果和/或第二当前匹配结果,确定损失值;以及Step 606: Determine the loss value based on the target matching result and/or the target task processing result, and the first current matching result and/or the second current matching result; and
步骤607,根据损失值,训练图表示提取网络。Step 607: Train the graph representation extraction network based on the loss value.
根据本实施例的方法,通过利用根据图匹配结果和目标匹配结果和/或目标任务处理结果确定的损失值训练图表示提取网络,使得在推理阶段能够利用图表示提取网络得到准确的、适于下游任务的多尺度图表示,从而能够帮助下游任务得到准确的任务处理结果。 According to the method of this embodiment, by using the loss value determined according to the graph matching result, the target matching result and/or the target task processing result to train the graph representation extraction network, the graph representation extraction network can be used to obtain accurate and suitable Multi-scale graph representation of downstream tasks can help downstream tasks obtain accurate task processing results.
可以理解的是,第一样本数据和第二样本数据与前文描述的第一数据和第二数据类似,步骤601-步骤604中的获取第一样本数据及其多尺度图表示、获取第二样本数据及其多尺度图表示以及对不同尺度的图表示进行图匹配的操作和图1中的步骤101-步骤105的操作类似,在此不做赘述。It can be understood that the first sample data and the second sample data are similar to the first data and the second data described above. In steps 601 to 604, the first sample data and its multi-scale graph representation are obtained, and the first sample data and the second sample data are obtained. The operation of two-sample data and its multi-scale graph representation and the graph matching of graph representations of different scales are similar to the operations of steps 101 to 105 in Figure 1 and will not be described again here.
根据一些实施例,多尺度图表示中的每一个尺度的图表示可以包括至少一个节点,节点可以包括属性,节点的属性可以包括标量类型的属性和向量类型的属性。多尺度图表示中的至少一个尺度的图表示可以包括至少一个邻接边,至少一个邻接边中的每一个邻接边用于表征同一尺度的两个节点的相对关系,邻接边具有属性,邻接边的属性包括标量类型的属性和向量类型的属性。According to some embodiments, the graph representation of each scale in the multi-scale graph representation may include at least one node, the node may include attributes, and the attributes of the node may include scalar type attributes and vector type attributes. The graph representation of at least one scale in the multi-scale graph representation may include at least one adjacent edge. Each of the at least one adjacent edge is used to characterize the relative relationship between two nodes of the same scale. The adjacent edge has an attribute. Properties include scalar type properties and vector type properties.
根据一些实施例,根据一些实施例,节点的标量类型的属性可以包括节点的显著性、标签、其他属性,节点的向量类型的属性包括节点的特征向量;邻接边的标量类型的属性包括邻接边的显著性、标签、其他属性,邻接边的向量类型的属性包括邻接边的特征向量。According to some embodiments, the scalar type attributes of a node may include the node's saliency, label, and other attributes, the vector type attributes of the node may include feature vectors of the node, and the scalar type attributes of the adjacent edges may include adjacent edges. The saliency, label, and other attributes of the adjacent edge include the feature vector of the adjacent edge.
图匹配的结果可以是两个图表示的相似度。两个图表示的相似度可以是各节点/边相似度的和,各节点/边显著性*相似度的和,在示例中,节点/边的相似度可以根据其属性确定。如此,可产生针对每个局部特征(节点/边的属性)的监督信号,单独对某个局部特征进行训练。The result of graph matching can be the similarity of two graph representations. The similarity represented by two graphs can be the sum of the similarity of each node/edge, the sum of the significance of each node/edge * the similarity. In the example, the similarity of the node/edge can be determined according to its attributes. In this way, a supervision signal for each local feature (attribute of node/edge) can be generated, and a certain local feature can be trained separately.
目标匹配结果可以为匹配或不匹配的匹配结果,也可以为表征匹配程度的结果(例如匹配度99%);目标任务可以为匹配任务、检索任务、分类任务、识别任务、生成填空任务以及其他各类数据分析与处理相关任务。当目标任务为匹配任务时,目标任务的结果即为目标匹配结果。The target matching result can be a matching or non-matching result, or a result that represents the degree of matching (for example, a matching degree of 99%); the target task can be a matching task, a retrieval task, a classification task, a recognition task, a fill-in-the-blank task, and others. Various data analysis and processing related tasks. When the target task is a matching task, the result of the target task is the target matching result.
在一个具体实施方式中,目标匹配结果和/或目标任务处理结果可以是根据针对样本数据的标注确定的。例如,例如标注是两个样本数据互为正样本,也就是标注了目标匹配结果为“匹配”。例如,目标任务是对样本图像进行分类的分类任务,可标注目标任务处理结果为类别“1”。如此,可对匹配结果和/或最终任务结果进行标注,无需标注具体的图表示提取网络提取出的图表示。In a specific implementation, the target matching result and/or the target task processing result may be determined based on the annotation of the sample data. For example, if the two sample data are marked as positive samples of each other, the target matching result is marked as "matching". For example, if the target task is a classification task of classifying sample images, the target task processing result can be marked as category "1". In this way, the matching results and/or the final task results can be annotated without the need to annotate the specific graph representation extracted by the graph representation extraction network.
根据一些实施例,目标匹配结果和/或目标任务处理结果可以是根据以下中的一项确定的:基于人工标注、基于教师模型和/或预训练的模型、基于辅助约束信息、基于规则的方式。 According to some embodiments, the target matching result and/or the target task processing result may be determined according to one of the following: based on manual annotation, based on teacher model and/or pre-trained model, based on auxiliary constraint information, based on rules. .
具体的,可以对目标匹配结果和/或目标任务处理结果进行人工标注。可以理解的是,人工标注可以是数据维度而非尺度维度,例如,可标注第一数据和第二数据是否匹配,而无需标注第一数据中某个尺度和第二数据中某个尺度是否匹配。事实上,已知第一第二数据是否匹配,也就知道了各个尺度的是否匹配。如此,可根据数据维度的标签得到尺度维度的标签,大大增加了监督信号的数量。Specifically, the target matching results and/or target task processing results can be manually annotated. It can be understood that manual annotation can be a data dimension rather than a scale dimension. For example, it can be marked whether the first data and the second data match, without marking whether a certain scale in the first data matches a certain scale in the second data. . In fact, if we know whether the first and second data match, we also know whether the various scales match. In this way, the label of the scale dimension can be obtained based on the label of the data dimension, which greatly increases the number of supervision signals.
另一具体实施方式中,可以根据教师模型和/或预训练的模型确定目标匹配结果和/或目标任务处理结果。其中,教师模型和预训练模型可以是在先利用大量数据训练得到的具有一定推理能力的模型,也可以利用这样的模型进行知识蒸馏,以实现对图表示提取网络的训练。例如,使用教师模型/预训练模型提取第一数据和第二尺度的多尺度图表示,基于该多尺度图表示判断匹配结果和/或任务处理结果,根据基于该多尺度图表示判断的匹配结果和/或任务处理结果确定目标匹配结果和/或目标任务处理结果(例如从中筛选置信度高的匹配结果或任务处理作为目标匹配结果和/或目标任务处理结果)。In another specific implementation, the target matching result and/or the target task processing result may be determined according to the teacher model and/or the pre-trained model. Among them, the teacher model and the pre-training model can be models with certain reasoning capabilities that have been previously trained using a large amount of data. Such models can also be used to perform knowledge distillation to train the graph representation extraction network. For example, use the teacher model/pre-training model to extract multi-scale graph representations of the first data and the second scale, judge the matching results and/or task processing results based on the multi-scale graph representation, and judge the matching results based on the multi-scale graph representation. and/or the task processing result determines the target matching result and/or the target task processing result (for example, filtering the matching results or task processing with high confidence as the target matching result and/or the target task processing result).
另一具体实施方式中,可以基于规则确定目标匹配结果和/或目标任务处理结果。基于规则的方式中的规则可以是根据先验知识确定的。例如,基于特定的规则提取第一数据和第二尺度的多尺度图表示,基于该多尺度图表示判断匹配结果和/或任务处理结果,将匹配结果和/或任务处理结果作为目标匹配结果和/或目标任务处理结果。In another specific implementation, the target matching result and/or the target task processing result may be determined based on rules. The rules in the rule-based approach can be determined based on prior knowledge. For example, a multi-scale graph representation of the first data and the second scale is extracted based on a specific rule, the matching result and/or the task processing result are judged based on the multi-scale graph representation, and the matching result and/or the task processing result is used as the target matching result and /or target task processing results.
可以理解的是,还可以使用其他方式得到目标匹配结果和/或目标任务处理结果,在此不做限定。It can be understood that other methods can also be used to obtain the target matching results and/or the target task processing results, which are not limited here.
根据一些实施例,目标匹配结果可以是利用经过第N轮训练的网络确定的,目标匹配结果可以是根据经过第N轮训练的网络确定的。如图7所示,步骤601,获取第一样本数据和第二样本数据可以包括:According to some embodiments, the target matching result may be determined using the network that has undergone the Nth round of training, and the target matching result may be determined based on the network that has undergone the Nth round of training. As shown in Figure 7, step 601, obtaining the first sample data and the second sample data may include:
步骤701,利用经过第N轮训练的网络提取第一未标注数据和第二未标注数据各自的多尺度图表示;Step 701: Use the network that has undergone the Nth round of training to extract the respective multi-scale graph representations of the first unlabeled data and the second unlabeled data;
步骤702,将第一未标注数据的第一尺度的图表示和第二未标注数据的第一尺度的图表示进行图匹配,以得到表征第一尺度的匹配程度的第一未标注数据匹配结果;Step 702: Perform graph matching on the graph representation of the first scale of the first unlabeled data and the graph representation of the first scale of the second unlabeled data to obtain a first unlabeled data matching result that represents the matching degree of the first scale. ;
步骤703,将第一未标注数据的第二尺度的图表示和第二未标注数据的第二尺度的图表示进行图匹配,以得到表征第二尺度的匹配程度的第二未标注数据匹配结果;Step 703: Perform graph matching on the graph representation of the second scale of the first unlabeled data and the graph representation of the second scale of the second unlabeled data to obtain a second unlabeled data matching result that represents the matching degree of the second scale. ;
步骤704,根据第一未标注数据匹配结果和/或第二未标注数据匹配结果,确定未标注数据匹配结果; Step 704: Determine the unlabeled data matching result based on the first unlabeled data matching result and/or the second unlabeled data matching result;
步骤705,响应于确定第一未标注数据和第二未标注数据满足第一条件,将第一未标注数据和第二未标注数据确定为互为正样本的第一样本数据和第二样本数据,其中,第一未标注数据和第二未标注数据满足第一条件包括未标注数据匹配结果满足第一匹配条件,正样本的目标匹配结果指示对应的第一样本数据和第二样本数据匹配;和/或Step 705: In response to determining that the first unlabeled data and the second unlabeled data satisfy the first condition, determine the first unlabeled data and the second unlabeled data as the first sample data and the second sample that are mutually positive samples. Data, wherein the first unlabeled data and the second unlabeled data satisfy the first condition, including the unlabeled data matching result satisfying the first matching condition, and the target matching result of the positive sample indicates the corresponding first sample data and second sample data match; and/or
步骤706,响应于确定第一未标注数据和第二未标注数据满足第二条件,将第一未标注数据和第二未标注数据确定为互为负样本的第一样本数据和第二样本数据,其中,第一未标注数据和第二未标注数据满足第二条件包括未标注数据匹配结果满足第二匹配条件,负样本的目标匹配结果指示对应的第一样本数据和第二样本数据不匹配。Step 706: In response to determining that the first unlabeled data and the second unlabeled data satisfy the second condition, determine the first unlabeled data and the second unlabeled data as the first sample data and the second sample that are negative samples of each other. data, wherein the first unlabeled data and the second unlabeled data satisfy the second condition, including the unlabeled data matching result satisfying the second matching condition, and the target matching result of the negative sample indicates the corresponding first sample data and second sample data Mismatch.
未标注数据的匹配结果可以是浮点数或整数,例如,第一未标注数据匹配结果为相似度,为浮点数;第二未标注数据的匹配结果为匹配上了几个节点/边,为整数。The matching result of unlabeled data can be a floating point number or an integer. For example, the first matching result of unlabeled data is similarity, which is a floating point number; the matching result of the second unlabeled data is how many nodes/edges were matched, which is an integer. .
第一条件、第二条件、第一匹配条件和第二匹配条件可由用户设置,例如第一匹配条件可以为第一未标注数据匹配结果大于80%且第二未标注数据匹配结果大于5个节点/边。可以理解的是,第一匹配条件和第二匹配条件设置的越严苛,由未标注数据生成的正样本/负样本对应的目标匹配结果更为可靠。The first condition, the second condition, the first matching condition and the second matching condition can be set by the user. For example, the first matching condition can be that the first unlabeled data matching result is greater than 80% and the second unlabeled data matching result is greater than 5 nodes. /side. It can be understood that the more stringent the first matching condition and the second matching condition are set, the more reliable the target matching results corresponding to the positive samples/negative samples generated from the unlabeled data will be.
除了匹配条件的要求外,在将第一未标注数据和第二未标注数据确定为样本数据时,第一条件和第二条件还可以有辅助条件要求。辅助条件可以为时间地点条件,专家二次确认条件等。例如,当第一未标注数据和第二未标注数据为图像数据时,可将其拍摄时空信息作为辅助条件,用来判断其是否为正样本/负样本。例如,两张图像的相似度较高、匹配上的节点/边的数量较多,且拍摄时间、地点接近,则二者包含同一对象的概率更大,二者互为正样本的概率更大。In addition to the requirements of matching conditions, when determining the first unlabeled data and the second unlabeled data as sample data, the first condition and the second condition may also have auxiliary condition requirements. Auxiliary conditions can be time and place conditions, expert secondary confirmation conditions, etc. For example, when the first unlabeled data and the second unlabeled data are image data, their shooting spatio-temporal information can be used as an auxiliary condition to determine whether they are positive samples/negative samples. For example, if the similarity between two images is high, the number of matching nodes/edges is large, and the shooting time and location are close, the probability that the two images contain the same object is greater, and the probability that the two images are positive samples of each other is greater. .
由此,通过上述方式利用经过第N轮的网络生成正样本和/或负样本,使得图表示提取网络能够用这些样本进行第N+1轮的训练,只需标注少量样本数据得到第N轮训练后的模型,即可利用第N轮训练后的模型得到更多的样本数据进行进一步的训练,大大减少了模型训练过程中对标注量的要求。并且,在同时生成正样本和负样本的情况下,能够利用这样的正样本和负样本进行对比学习以具备提取准确图表示的能力,同时降低了样本的获取成本。Therefore, the network that has passed the Nth round is used to generate positive samples and/or negative samples in the above way, so that the graph representation extraction network can use these samples for the N+1th round of training, and only needs to label a small amount of sample data to obtain the Nth round. After training, the model can use the model after the Nth round of training to obtain more sample data for further training, which greatly reduces the requirements for the amount of annotation during the model training process. Moreover, when positive samples and negative samples are generated at the same time, such positive samples and negative samples can be used for comparative learning to have the ability to extract accurate graph representation, while reducing the cost of obtaining samples.
在一个示例实施例中,在图表示提取网络生成的多尺度图表示中,某一个节点上的特征不如其他的特征(稳健性不足),则在正样本的图匹配中,匹配的误差将主要来源于这个节点的特征,则训练时监督信号会集中于这个节点的特征,以强化该特征的稳健性。 In an example embodiment, in the multi-scale graph representation generated by the graph representation extraction network, the features on a certain node are not as good as other features (insufficient robustness), then in the graph matching of positive samples, the matching error will be mainly From the features of this node, the supervision signal will focus on the features of this node during training to enhance the robustness of this feature.
可以理解的是,图7中的步骤701-步骤703中的提取第一未标注数据和第二未标注数据各自的多尺度图表示、以及将第一未标注数据和第二未标注数据的不同尺度的图表示进行图匹配1的操作和图1中的步骤101-步骤105的操作类似,在此不做赘述。It can be understood that steps 701 to 703 in Figure 7 extract the respective multi-scale graph representations of the first unlabeled data and the second unlabeled data, and combine the differences between the first unlabeled data and the second unlabeled data. The operation of graph matching 1 based on the scale representation is similar to the operation of steps 101 to 105 in Figure 1 and will not be described again here.
在步骤704中,可以根据第一未标注数据匹配结果和第二未标注数据匹配结果中的一者或两者确定未标注数据匹配结果。在对数据质量相对严格的实施例中,响应于确定第一未标注数据匹配结果和第二未标注数据匹配结果均指示成功匹配,将未标注数据匹配结果确定为匹配。在一些实施例中,可设置第一尺度和第二尺度满足特定的匹配条件时,将未标注数据匹配结果确定为匹配。例如,如果第一尺度相似度大于80%且第二尺度匹配上5个节点,则将未标注数据匹配结果确定为匹配。在一些情况下,可以在不同尺度之间进行交叉验证,以产生更多的监督信号。在一些实施例中,由于较低尺度的图表示匹配结果涉及更多细节特征,可信度较宏观特征更高,在较低尺度的图表示匹配结果指示成功匹配时即可将未标注数据匹配结果确定为匹配。在一些实施例中,当多尺度图表示包括三个或更多尺度时,可以在最高和最低尺度的图表示匹配结果指示成功匹配时将未标注数据匹配结果确定为匹配。在对数据更为宽容的实施例中,可以在较高尺度的图表示匹配结果指示成功匹配时将未标注数据匹配结果确定为匹配。In step 704, the unlabeled data matching result may be determined based on one or both of the first unlabeled data matching result and the second unlabeled data matching result. In an embodiment that is relatively strict on data quality, in response to determining that both the first unlabeled data matching result and the second unlabeled data matching result indicate a successful match, the unlabeled data matching result is determined to be a match. In some embodiments, when the first scale and the second scale meet specific matching conditions, the unlabeled data matching result is determined to be a match. For example, if the first scale similarity is greater than 80% and the second scale matches 5 nodes, the unlabeled data matching result is determined as a match. In some cases, cross-validation can be performed between different scales to generate more supervisory signals. In some embodiments, since the lower-scale graph representation matching results involve more detailed features and have higher credibility than macroscopic features, the unlabeled data can be matched when the lower-scale graph representation matching results indicate a successful match. The result is determined to be a match. In some embodiments, when the multi-scale graph representation includes three or more scales, the unlabeled data matching results may be determined as a match when the highest and lowest scale graph representation matching results indicate a successful match. In a more data-forgiving embodiment, unlabeled data matching results may be determined to be a match when the higher scale graph representation matching result indicates a successful match.
可以理解的是,还可以以其他方式在不同尺度之间进行交叉验证,以产生监督信号,在此不做限定。It is understood that cross-validation between different scales can also be performed in other ways to generate supervision signals, which is not limited here.
可以理解的是,“第N轮训练”表示该网络经过了至少一轮的训练,从而具备了一定的推断能力,但并不意图限定该网络的具体训练轮数。It can be understood that "the Nth round of training" means that the network has undergone at least one round of training and thus has a certain inference ability, but it is not intended to limit the specific number of training rounds of the network.
根据一些实施例,损失值可以包括匹配损失值和/或任务损失值。如图8所示,步骤606,根据目标匹配结果和/或目标任务处理结果、以及第一当前匹配结果和/或第二当前匹配结果,确定损失值可以包括:步骤801,根据第一当前匹配结果和/或第二当前匹配结果,确定匹配损失值;和/或,步骤802,根据第一当前匹配结果和/或第二当前匹配结果,确定当前任务结果,以及根据目标任务处理结果和当前任务结果,确定任务损失值。According to some embodiments, the loss value may include a match loss value and/or a task loss value. As shown in Figure 8, step 606, determining the loss value according to the target matching result and/or the target task processing result, and the first current matching result and/or the second current matching result may include: Step 801, according to the first current matching result result and/or the second current matching result, determine the matching loss value; and/or, step 802, determine the current task result according to the first current matching result and/or the second current matching result, and determine the current task result according to the target task processing result and the current Task results, determine the task loss value.
在一些实施例中,能够直接获取到某个或某些尺度的目标匹配结果,或者多尺度图表示之间的目标匹配结果,则可以根据目标匹配结果和第一当前匹配结果和/或第二当前匹配结果确定相应的匹配损失值,从而产生监督信号以训练网络。In some embodiments, it is possible to directly obtain the target matching result at a certain or certain scales, or the target matching result between multi-scale graph representations, and then the target matching result and the first current matching result and/or the second The current matching result determines the corresponding matching loss value, thereby generating a supervision signal to train the network.
在一些实施例中,例如在填空任务中,能够获取到相应的目标任务处理结果,则可以根据第一当前匹配结果和/或第二当前匹配结果确定当前任务处理结果,进而根据目标 任务处理结果和当前任务处理结果确定相应的任务损失值,从而产生相应的监督信号以训练网络。例如,有多个第二数据,根据第一当前匹配结果和/或第二当前匹配结果确定第一数据和第二数据的当前匹配结果,将第一数据以及多个第二数据中和第一数据的当前匹配结果为匹配的第二数据输入填空网络,得到任务处理结果。此时可能并不知晓目标匹配结果,而是知道目标任务处理结果,则可根据目标任务处理结果确定监督信号。In some embodiments, for example, in a fill-in-the-blank task, if the corresponding target task processing result can be obtained, the current task processing result can be determined according to the first current matching result and/or the second current matching result, and then the current task processing result can be determined according to the target task. The task processing result and the current task processing result determine the corresponding task loss value, thereby generating the corresponding supervision signal to train the network. For example, if there is a plurality of second data, the current matching results of the first data and the second data are determined according to the first current matching result and/or the second current matching result, and the first data and the plurality of second data are neutralized by the first The current matching result of the data is the matched second data input into the fill-in-the-blank network to obtain the task processing result. At this time, the target matching result may not be known, but the target task processing result is known, and the supervision signal can be determined based on the target task processing result.
根据一些实施例,步骤801,根据第一当前匹配结果和/或第二当前匹配结果,确定匹配损失值可以包括:根据第一当前匹配结果和/或第二当前匹配结果,确定当前匹配结果;以及根据当前匹配结果和目标匹配结果,确定匹配损失值。According to some embodiments, step 801, determining the matching loss value according to the first current matching result and/or the second current matching result may include: determining the current matching result according to the first current matching result and/or the second current matching result; And determine the matching loss value based on the current matching result and the target matching result.
在一些实施例中,能够直接获取到多尺度图表示直接的目标匹配结果,则可以先根据第一当前匹配结果和/或第二当前匹配结果确定当前匹配结果,进而根据当前匹配结果和目标匹配结果确定相应的匹配损失值,从而产生相应的监督信号以训练网络。In some embodiments, if the multi-scale graph can be directly obtained to represent the direct target matching result, the current matching result can be determined based on the first current matching result and/or the second current matching result, and then the current matching result can be determined based on the target matching result. The result determines the corresponding matching loss value, thereby generating the corresponding supervision signal to train the network.
根据一些实施例,图表示提取网络可以包括用于提取第一尺度的图表示的第一网络。在一些实施例中,步骤606,根据第一当前匹配结果和/或第二当前匹配结果,确定匹配损失值可以包括:根据目标匹配结果和第一当前匹配结果,确定第一尺度匹配损失值。步骤607,根据损失值,训练图表示提取网络可以包括:根据第一尺度匹配损失值,训练第一网络。According to some embodiments, the graph representation extraction network may include a first network for extracting a graph representation at a first scale. In some embodiments, step 606, determining the matching loss value according to the first current matching result and/or the second current matching result may include: determining the first scale matching loss value according to the target matching result and the first current matching result. Step 607: Training the graph representation extraction network according to the loss value may include: matching the loss value according to the first scale and training the first network.
根据一些实施例,图表示提取网络可以包括用于提取第二尺度的图表示的第二网络。在一些实施例中,步骤606,根据第一当前匹配结果和/或第二当前匹配结果,确定匹配损失值可以包括:根据目标匹配结果和第二当前匹配结果,确定第二尺度匹配损失值。步骤607,根据损失值,训练图表示提取网络可以包括:根据第二尺度匹配损失值,训练第二网络。由此,可以分别计算第一尺度和第二尺度的损失值,并分别训练对应的网络模型。According to some embodiments, the graph representation extraction network may include a second network for extracting a graph representation at a second scale. In some embodiments, step 606, determining the matching loss value according to the first current matching result and/or the second current matching result may include: determining the second scale matching loss value according to the target matching result and the second current matching result. Step 607, training the graph representation extraction network according to the loss value may include: matching the loss value according to the second scale, and training the second network. From this, the loss values of the first scale and the second scale can be calculated separately, and the corresponding network models can be trained respectively.
根据一些实施例,图表示提取网络可以包括以下中的至少一个:用于确定节点的标量类型的属性的网络模块;用于确定节点的向量类型的属性的网络模块;用于确定邻接边的标量类型的属性的网络模块;以及用于确定邻接边的向量类型的属性的网络模块。可以理解的是,图表示提取网络还可以包括由原始数据得到稠密数据的特征提取网络模块。损失值可以作用于与这些网络模块对应的可微分的部分,从而实现对这些网络模块的训练。According to some embodiments, the graph representation extraction network may include at least one of the following: a network module for determining a scalar-type attribute of a node; a network module for determining a vector-type attribute of a node; and a scalar module for determining adjacent edges. A network module for properties of a type; and a network module for determining properties of a vector type of an adjacent edge. It can be understood that the graph representation extraction network may also include a feature extraction network module that obtains dense data from raw data. The loss value can act on the differentiable parts corresponding to these network modules, thereby achieving the training of these network modules.
根据一些实施例,前述对稠密数据进行稀疏化得到稀疏化后的节点的稀疏化模块、 对稀疏化得到的低尺度的节点进行归并得到高尺度节点也是通过神经网络实现的,相应的,图表示提取网络包括以下中的至少一个:用于对稠密数据进行稀疏化得到稀疏化后的节点的稀疏化模块;对稀疏化得到的低尺度的节点进行归并得到高尺度节点的归并模块。According to some embodiments, the aforementioned sparsification module for sparsifying dense data to obtain sparse nodes, Merging low-scale nodes obtained by sparsification to obtain high-scale nodes is also implemented through neural networks. Correspondingly, the graph representation extraction network includes at least one of the following: used to sparse dense data to obtain sparse nodes. The sparsification module; the merging module that merges the low-scale nodes obtained by sparsification to obtain high-scale nodes.
根据一些实施例,根据稀疏化模块得到节点,将节点连接形成邻接边,通过用于确定邻接边的显著性属性的网络模块将显著性大于阈值的邻接边确定为保留的邻接边,根据确定节点/边向量类型属性的模块提取节点/边向量类型的属性。According to some embodiments, nodes are obtained according to the sparsification module, the nodes are connected to form adjacent edges, and the adjacent edges whose significance is greater than the threshold are determined as retained adjacent edges through the network module used to determine the significance attribute of the adjacent edges. According to the determined nodes The module for /edge vector type attributes extracts attributes of node/edge vector type.
根据一些实施例,节点和边均包括确定模块和属性提取的模块。确定模块用于确定出节点/边,节点确定模块可以包括稀疏化模块(例如可以为检测模块、显著性模块)或归并模块,边确定模块可以包括显著性模块;属性提取的模块可以为确定出显著性以外其他属性的模块。根据一些实施例,这些模块均为网络模块。According to some embodiments, both nodes and edges include determination modules and attribute extraction modules. The determination module is used to determine nodes/edges. The node determination module may include a sparsification module (for example, it may be a detection module or a saliency module) or a merging module. The edge determination module may include a saliency module; the attribute extraction module may be a determination module. Modules with properties other than salience. According to some embodiments, these modules are network modules.
在一个实施例中,可以基于两个图表示的匹配度得到当前匹配结果。图表示的匹配度可以表示为:所有的候选匹配点对的匹配度和所有的候选匹配邻接边对的匹配度的总和,其中,候选匹配点对的匹配度为第一候选匹配点的显著性、第二候选匹配点的显著性、以及第一候选匹配点的特征向量和第二候选匹配点的特征向量的相似度的乘积,候选匹配邻接边对的匹配度为第一候选匹配邻接边的显著性、第二候选匹配邻接边的显著性、以及第一候选匹配邻接边的特征向量和第二候选匹配邻接边的特征向量的相似度的乘积。由此,通过上述方式,匹配不上的节点/边会被弱化,从而能够在不同尺度保留稳定、可靠的局部特征。In one embodiment, the current matching result can be obtained based on the matching degree of the two graph representations. The matching degree represented by the graph can be expressed as: the sum of the matching degrees of all candidate matching point pairs and the matching degrees of all candidate matching adjacent edge pairs, where the matching degree of the candidate matching point pair is the significance of the first candidate matching point. , the significance of the second candidate matching point, and the product of the similarity between the feature vector of the first candidate matching point and the feature vector of the second candidate matching point. The matching degree of the candidate matching adjacent edge pair is the first candidate matching adjacent edge pair. The product of the saliency, the saliency of the second candidate matching adjacent edge, and the similarity of the feature vector of the first candidate matching adjacent edge and the feature vector of the second candidate matching adjacent edge. Therefore, through the above method, unmatched nodes/edges will be weakened, so that stable and reliable local features can be retained at different scales.
根据一些实施例,图表示提取网络可以包括规则模块和网络模块。规则模块例如可以是利用先验知识的基于规则的模块。这样的模块无需训练即可使用,但是准确度相比于训练好的网络模块较差,并且鲁棒性差、局限性强、通常很难训练或优化。虽然训练好的网络模块能够输出准确的结果,并且适应范围更大、鲁棒性强,但是在训练难度较大时很难快速收敛。According to some embodiments, the graph representation extraction network may include a rule module and a network module. The rule module may be, for example, a rule-based module that utilizes prior knowledge. Such modules can be used without training, but their accuracy is poor compared to trained network modules, and they have poor robustness, strong limitations, and are usually difficult to train or optimize. Although the trained network module can output accurate results, has a wider adaptability range and is robust, it is difficult to converge quickly when the training is difficult.
根据一些实施例,如图9所示,训练方法900还包括以下步骤中的至少一个:步骤901,响应于确定满足第五预设条件,将规则模块中的第一规则模块替换为网络模块;以及步骤902,响应于确定满足第六预设条件,在图表示提取网络中增加网络模块。图9中的步骤903-步骤909的操作和图6中的步骤601-步骤607的操作类似,在此不做限定。步骤909,根据损失值,训练图表示提取网络可以包括:根据损失值,训练网络模块。 According to some embodiments, as shown in Figure 9, the training method 900 further includes at least one of the following steps: Step 901, in response to determining that the fifth preset condition is met, replace the first rule module in the rule module with a network module; And step 902, in response to determining that the sixth preset condition is met, add a network module to the graph representation extraction network. The operations of steps 903 to 909 in Figure 9 are similar to the operations of steps 601 to 607 in Figure 6, and are not limited here. Step 909, training the graph representation extraction network according to the loss value may include: training the network module according to the loss value.
在一些实施例中,在训练的初始阶段,可以在图表示提取网络中的部分环节使用规则模块,在另一部分环节使用网络模块,以对这些网络模块进行训练。在这部分网络模块收敛后,可以额外加入更多的网络模块,或者将规则模块替换为网络模块并继续训练,以提升网络的表现。如此,既能充分利用先验知识,又能提示网络训练速度和效果。In some embodiments, in the initial stage of training, rule modules can be used in some links in the graph representation extraction network, and network modules can be used in other parts of the network to train these network modules. After this part of the network module converges, you can add more network modules, or replace the rule module with a network module and continue training to improve the performance of the network. In this way, it can not only make full use of prior knowledge, but also prompt the speed and effect of network training.
在一些实施例中,第五预设条件和第六预设条件例如可以是特定的训练轮数,也可以是网络当前的匹配准确率,还可以是其他的预设条件例如收敛速度、趋势等。可以理解的是,本领域技术人员可以根据需求自行确定第五预设条件和第六预设条件,在此不做限定。In some embodiments, the fifth preset condition and the sixth preset condition may be, for example, a specific number of training rounds, the current matching accuracy of the network, or other preset conditions such as convergence speed, trend, etc. . It can be understood that those skilled in the art can determine the fifth preset condition and the sixth preset condition by themselves according to needs, which are not limited here.
图10示出了根据本公开一个实施例的一种任务处理装置1000的结构框图,该装置1000包括:第一获取单元1010,被配置为获取第一数据和第二数据,第一数据和第二数据分别为图像数据、音频数据、文本数据、分子结构数据和序列数据中的一者;第二获取单元1020,被配置为获取第一数据和第二数据各自的第一尺度的图表示,第一尺度的图表示包括至少一个第一尺度的节点,其中,第一尺度的节点具有属性,第一尺度的节点的属性包括向量类型的属性;第三获取单元1030,被配置为获取第一数据和第二数据各自的第二尺度的图表示,第二尺度低于第一尺度,第二尺度的图表示包括至少一个第二尺度的节点,其中,第二尺度的节点具有属性,第二尺度的节点的属性包括向量类型的属性,其中,第一数据和第二数据中的每一个数据的至少一个尺度的节点是通过对与该数据对应的稠密数据进行稀疏化而得到的,每一个数据的至少一个尺度的图表示包括至少一个邻接边,至少一个邻接边中的每一个邻接边用于表征同一尺度的两个节点的相对关系,邻接边具有属性;第一图匹配单元1040,被配置为将第一数据的第一尺度的图表示和第二数据的第一尺度的图表示进行图匹配,以得到第一匹配结果;第二图匹配单元1050,被配置为将第一数据的第二尺度的图表示和第二数据的第二尺度的图表示进行图匹配,以得到第二匹配结果;第一确定单元1060,被配置为基于第一匹配结果和第二匹配结果,确定多尺度匹配结果;以及第二确定单元1070,被配置为基于多尺度匹配结果,确定任务处理结果。Figure 10 shows a structural block diagram of a task processing device 1000 according to an embodiment of the present disclosure. The device 1000 includes: a first acquisition unit 1010 configured to acquire first data and second data, the first data and the second data. The two data are respectively one of image data, audio data, text data, molecular structure data, and sequence data; the second acquisition unit 1020 is configured to acquire a first-scale graphic representation of each of the first data and the second data, The graph representation of the first scale includes at least one node of the first scale, wherein the node of the first scale has attributes, and the attributes of the nodes of the first scale include attributes of vector type; the third obtaining unit 1030 is configured to obtain the first A graph representation of a second scale respectively of the data and the second data, the second scale being lower than the first scale, the graph representation of the second scale including at least one node of the second scale, wherein the node of the second scale has an attribute, and the graph representation of the second scale The attributes of the scale nodes include attributes of vector type, wherein at least one scale node of each of the first data and the second data is obtained by sparsifying the dense data corresponding to the data, each The graph representation of at least one scale of the data includes at least one adjacent edge, each of the at least one adjacent edge is used to characterize the relative relationship between two nodes of the same scale, and the adjacent edge has attributes; the first graph matching unit 1040 is Configured to perform graph matching on the graph representation of the first scale of the first data and the graph representation of the first scale of the second data to obtain a first matching result; the second graph matching unit 1050 is configured to graph the first data The graph representation of the second scale and the graph representation of the second data at the second scale are graph matched to obtain a second matching result; the first determination unit 1060 is configured to determine multiple scale matching results; and the second determination unit 1070 is configured to determine the task processing result based on the multi-scale matching results.
可以理解的是,装置1000中的单元1010-单元1070的操作和方法100中的步骤101-步骤107的操作类似,在此不做赘述。It can be understood that the operations of units 1010 to 1070 in the device 1000 are similar to the operations of steps 101 to 107 in the method 100, and will not be described again.
图11示出了根据本公开一个实施例的一种神经网络的训练装置1100的结构框图,该装置1100包括:第四获取单元1110,被配置为获取第一样本数据和第二样本数据,第 一样本数据和第二样本数据分别为图像数据、音频数据、文本数据、分子结构数据和序列数据中的一者;第五获取单元1120,被配置为获取第一样本数据和第二样本数据各自的多尺度图表示,其中,多尺度图表示是利用图表示提取网络确定的,多尺度图表示包括第一尺度的图表示和第二尺度的图表示;第三图匹配单元1130,被配置为将第一样本数据的第一尺度的图表示和第二样本数据的第一尺度的图表示进行图匹配,以得到表征第一尺度的匹配程度的第一当前匹配结果;第四图匹配单元1140,被配置为将第一样本数据的第二尺度的图表示和第二样本数据的第二尺度的图表示进行图匹配,以得到表征第二尺度的匹配程度的第二当前匹配结果;第七获取单元1150,被配置为获取第一样本数据和第二样本数据的目标匹配结果和/或目标任务处理结果;第三确定单元1160,被配置为根据目标匹配结果和/或目标任务处理结果、以及第一当前匹配结果和/或第二当前匹配结果,确定损失值;以及训练单元1170,被配置为根据损失值,训练图表示提取网络。Figure 11 shows a structural block diagram of a neural network training device 1100 according to an embodiment of the present disclosure. The device 1100 includes: a fourth acquisition unit 1110 configured to acquire first sample data and second sample data, No. The first sample data and the second sample data are respectively one of image data, audio data, text data, molecular structure data, and sequence data; the fifth acquisition unit 1120 is configured to acquire the first sample data and the second sample data. Respective multi-scale graph representation, wherein the multi-scale graph representation is determined using the graph representation extraction network, and the multi-scale graph representation includes a graph representation of the first scale and a graph representation of the second scale; the third graph matching unit 1130 is configured To perform graph matching on the graph representation of the first scale of the first sample data and the graph representation of the first scale of the second sample data to obtain a first current matching result that represents the matching degree of the first scale; the fourth graph matching Unit 1140 is configured to perform graph matching on the graph representation of the second scale of the first sample data and the graph representation of the second scale of the second sample data to obtain a second current matching result that represents the matching degree of the second scale. ; The seventh obtaining unit 1150 is configured to obtain the target matching result and/or the target task processing result of the first sample data and the second sample data; the third determining unit 1160 is configured to obtain the target matching result and/or target task processing result according to The task processing result, and the first current matching result and/or the second current matching result determine the loss value; and the training unit 1170 is configured to train the graph representation extraction network according to the loss value.
可以理解的是,装置1100中的单元1111-单元1170的操作和方法600中的步骤601-步骤607的操作类似,在此不做赘述。It can be understood that the operations of units 1111 to 1170 in the device 1100 are similar to the operations of steps 601 to 607 in the method 600, and will not be described again here.
根据本公开的实施例,还提供了一种电子设备、一种可读存储介质和一种计算机程序产品。According to embodiments of the present disclosure, an electronic device, a readable storage medium, and a computer program product are also provided.
在下文中,结合图12描述这样的电子设备、非瞬时计算机可读存储介质和计算机程序产品的说明性示例。Illustrative examples of such electronic devices, non-transitory computer-readable storage media, and computer program products are described below in conjunction with FIG. 12 .
图12示出了可以被用来实施本文所描述的方法的电子设备1200的示例配置。上述装置1000以及装置1100中的每一个也可以全部或至少部分地由电子设备1200或类似设备或系统实现。Figure 12 illustrates an example configuration of an electronic device 1200 that may be used to implement the methods described herein. Each of the above-described apparatus 1000 and apparatus 1100 may also be fully or at least partially implemented by an electronic device 1200 or similar device or system.
电子设备1200可以是各种不同类型的设备。电子设备1200的示例包括但不限于:台式计算机、服务器计算机、笔记本电脑或上网本计算机、移动设备(例如,平板电脑、蜂窝或其他无线电话(例如,智能电话)、记事本计算机、移动台)、可穿戴设备(例如,眼镜、手表)、娱乐设备(例如,娱乐器具、通信地耦合到显示设备的机顶盒、游戏机)、电视或其他显示设备、汽车计算机等等。Electronic device 1200 may be a variety of different types of devices. Examples of electronic devices 1200 include, but are not limited to: desktop computers, server computers, laptop or netbook computers, mobile devices (e.g., tablet computers, cellular or other wireless phones (e.g., smartphones), notepad computers, mobile stations), Wearable devices (eg, glasses, watches), entertainment devices (eg, entertainment appliances, set-top boxes communicatively coupled to display devices, game consoles), televisions or other display devices, automotive computers, and the like.
电子设备1200可以包括能够诸如通过系统总线1214或其他适当的连接彼此通信的至少一个处理器1202、存储器1204、(多个)通信接口1206、显示设备1208、其他输入/输出(I/O)设备1210以及一个或更多大容量存储设备1212。Electronic device 1200 may include at least one processor 1202 , memory 1204 , communication interface(s) 1206 , display device 1208 , other input/output (I/O) devices capable of communicating with each other, such as through system bus 1214 or other suitable connections. 1210 and one or more mass storage devices 1212.
处理器1202可以是单个处理单元或多个处理单元,所有处理单元可以包括单个或多 个计算单元或者多个核心。处理器1202可以被实施成一个或更多微处理器、微型计算机、微控制器、数字信号处理器、中央处理单元、状态机、逻辑电路和/或基于操作指令来操纵信号的任何设备。除了其他能力之外,处理器1202可以被配置成获取并且执行存储在存储器1204、大容量存储设备1212或者其他计算机可读介质中的计算机可读指令,诸如操作系统1216的程序代码、应用程序1218的程序代码、其他程序1220的程序代码等。Processor 1202 may be a single processing unit or multiple processing units, and all processing units may include single or multiple computing unit or multiple cores. Processor 1202 may be implemented as one or more microprocessors, microcomputers, microcontrollers, digital signal processors, central processing units, state machines, logic circuits, and/or any device that manipulates signals based on operating instructions. Among other capabilities, processor 1202 may be configured to retrieve and execute computer-readable instructions, such as program code for operating system 1216 , applications 1218 , stored in memory 1204 , mass storage device 1212 , or other computer-readable media. program codes, program codes of other programs 1220, etc.
存储器1204和大容量存储设备1212是用于存储指令的计算机可读存储介质的示例,所述指令由处理器1202执行来实施前面所描述的各种功能。举例来说,存储器1204一般可以包括易失性存储器和非易失性存储器二者(例如RAM、ROM等等)。此外,大容量存储设备1212一般可以包括硬盘驱动器、固态驱动器、可移除介质、包括外部和可移除驱动器、存储器卡、闪存、软盘、光盘(例如CD、DVD)、存储阵列、网络附属存储、存储区域网等等。存储器1204和大容量存储设备1212在本文中都可以被统称为存储器或计算机可读存储介质,并且可以是能够把计算机可读、处理器可执行程序指令存储为计算机程序代码的非瞬时介质,所述计算机程序代码可以由处理器1202作为被配置成实施在本文的示例中所描述的操作和功能的特定机器来执行。Memory 1204 and mass storage device 1212 are examples of computer-readable storage media for storing instructions executed by processor 1202 to implement the various functions previously described. For example, memory 1204 may generally include both volatile memory and non-volatile memory (eg, RAM, ROM, etc.). Additionally, mass storage devices 1212 may generally include hard drives, solid state drives, removable media including external and removable drives, memory cards, flash memory, floppy disks, optical disks (e.g., CDs, DVDs), storage arrays, network attached storage , storage area network, etc. Memory 1204 and mass storage device 1212 may both be collectively referred to herein as memory or computer-readable storage media, and may be non-transitory media capable of storing computer-readable, processor-executable program instructions as computer program code, so The computer program code described may be executed by processor 1202 as a particular machine configured to perform the operations and functions described in the examples herein.
多个程序可以存储在大容量存储设备1212上。这些程序包括操作系统1216、一个或多个应用程序1218、其他程序1220和程序数据1222,并且它们可以被加载到存储器1204以供执行。这样的应用程序或程序模块的示例可以包括例如用于实现以下部件/功能的计算机程序逻辑(例如,计算机程序代码或指令):方法100、方法600和/或方法900(包括方法100、方法600、方法900的任何合适的步骤)、和/或本文描述的另外的实施例。Multiple programs may be stored on the mass storage device 1212. These programs include an operating system 1216, one or more applications 1218, other programs 1220, and program data 1222, and they may be loaded into memory 1204 for execution. Examples of such applications or program modules may include, for example, computer program logic (e.g., computer program code or instructions) for implementing the components/functions of: method 100 , method 600 , and/or method 900 (including method 100 , method 600 , any suitable step of method 900), and/or additional embodiments described herein.
虽然在图12中被图示成存储在电子设备1200的存储器1204中,但是模块1216、1218、1220和1222或者其部分可以使用可由电子设备1200访问的任何形式的计算机可读介质来实施。如本文所使用的,“计算机可读介质”至少包括两种类型的计算机可读介质,也就是计算机可读存储介质和通信介质。Although illustrated in FIG. 12 as being stored in memory 1204 of electronic device 1200 , modules 1216 , 1218 , 1220 , and 1222 , or portions thereof, may be implemented using any form of computer-readable media accessible by electronic device 1200 . As used herein, "computer-readable media" includes at least two types of computer-readable media, namely, computer-readable storage media and communication media.
计算机可读存储介质包括通过用于存储信息的任何方法或技术实施的易失性和非易失性、可移除和不可移除介质,所述信息诸如是计算机可读指令、数据结构、程序模块或者其他数据。计算机可读存储介质包括而不限于RAM、ROM、EEPROM、闪存或其他存储器技术,CD-ROM、数字通用盘(DVD)、或其他光学存储装置,磁盒、磁带、磁盘存储装置或其他磁性存储设备,或者可以被用来存储信息以供电子设备访问的任何其他非传送介质。与此相对,通信介质可以在诸如载波或其他传送机制之类的已调制数据信号 中具体实现计算机可读指令、数据结构、程序模块或其他数据。本文所定义的计算机可读存储介质不包括通信介质。Computer-readable storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information, such as computer-readable instructions, data structures, programs module or other data. Computer-readable storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disk (DVD), or other optical storage devices, magnetic cassettes, tapes, disk storage devices or other magnetic storage devices device, or any other non-transmission medium that can be used to store information for access by an electronic device. In contrast, a communication medium may consist of a modulated data signal such as a carrier wave or other transport mechanism Concretely implement computer readable instructions, data structures, program modules or other data. Computer-readable storage media, as defined herein, does not include communications media.
一个或更多通信接口1206用于诸如通过网络、直接连接等等与其他设备交换数据。这样的通信接口可以是以下各项中的一个或多个:任何类型的网络接口(例如,网络接口卡(NIC))、有线或无线(诸如IEEE 802.11无线LAN(WLAN))无线接口、全球微波接入互操作(Wi-MAX)接口、以太网接口、通用串行总线(USB)接口、蜂窝网络接口、BluetoothTM接口、近场通信(NFC)接口等。通信接口1206可以促进在多种网络和协议类型内的通信,其中包括有线网络(例如LAN、电缆等等)和无线网络(例如WLAN、蜂窝、卫星等等)、因特网等等。通信接口1206还可以提供与诸如存储阵列、网络附属存储、存储区域网等等中的外部存储装置(未示出)的通信。One or more communication interfaces 1206 are used to exchange data with other devices, such as over a network, direct connection, etc. Such communication interface may be one or more of the following: any type of network interface (e.g., Network Interface Card (NIC)), wired or wireless (such as IEEE 802.11 Wireless LAN (WLAN)) wireless interface, global microwave Access interoperability (Wi-MAX) interface, Ethernet interface, Universal Serial Bus (USB) interface, cellular network interface, BluetoothTM interface, Near Field Communication (NFC) interface, etc. Communication interface 1206 can facilitate communications within a variety of network and protocol types, including wired networks (eg, LAN, cable, etc.) and wireless networks (eg, WLAN, cellular, satellite, etc.), the Internet, and so on. Communication interface 1206 may also provide communication with external storage devices (not shown) such as in a storage array, network attached storage, storage area network, and the like.
在一些示例中,可以包括诸如监视器之类的显示设备1208,以用于向用户显示信息和图像。其他I/O设备1210可以是接收来自用户的各种输入并且向用户提供各种输出的设备,并且可以包括触摸输入设备、手势输入设备、摄影机、键盘、遥控器、鼠标、打印机、音频输入/输出设备等等。In some examples, a display device 1208, such as a monitor, may be included for displaying information and images to a user. Other I/O devices 1210 may be devices that receive various inputs from the user and provide various outputs to the user, and may include touch input devices, gesture input devices, cameras, keyboards, remote controls, mice, printers, audio input/ Output devices and so on.
本文描述的技术可以由电子设备1200的这些各种配置来支持,并且不限于本文所描述的技术的具体示例。例如,该功能还可以通过使用分布式系统在“云”上全部或部分地实现。云包括和/或代表用于资源的平台。平台抽象云的硬件(例如,服务器)和软件资源的底层功能。资源可以包括在远离电子设备1200的服务器上执行计算处理时可以使用的应用和/或数据。资源还可以包括通过因特网和/或通过诸如蜂窝或Wi-Fi网络的订户网络提供的服务。平台可以抽象资源和功能以将电子设备1200与其他电子设备连接。因此,本文描述的功能的实现可以分布在整个云内。例如,功能可以部分地在电子设备1200上以及部分地通过抽象云的功能的平台来实现。The techniques described herein may be supported by these various configurations of electronic device 1200 and are not limited to specific examples of the techniques described herein. For example, this functionality can also be implemented in whole or in part on the "cloud" through the use of distributed systems. A cloud includes and/or represents a platform for resources. The platform abstracts the underlying functionality of the cloud's hardware (e.g., servers) and software resources. Resources may include applications and/or data that may be used while performing computing processing on a server remote from electronic device 1200 . Resources may also include services provided over the Internet and/or through subscriber networks such as cellular or Wi-Fi networks. The platform can abstract resources and functionality to connect electronic device 1200 with other electronic devices. Therefore, implementation of the functionality described in this article can be distributed throughout the cloud. For example, functionality may be implemented partly on the electronic device 1200 and partly through a platform that abstracts the functionality of the cloud.
虽然在附图和前面的描述中已经详细地说明和描述了本公开,但是这样的说明和描述应当被认为是说明性的和示意性的,而非限制性的;本公开不限于所公开的实施例。通过研究附图、公开内容和所附的权利要求书,本领域技术人员在实践所要求保护的主题时,能够理解和实现对于所公开的实施例的变型。在权利要求书中,词语“包括”不排除未列出的其他元件或步骤,不定冠词“一”或“一个”不排除多个,术语“多个”是指两个或两个以上,并且术语“基于”应解释为“至少部分地基于”。在相互不同的从属权利要求中记载了某些措施的仅有事实并不表明这些措施的组合不能用来获益。 While the present disclosure has been illustrated and described in detail in the drawings and foregoing description, such illustration and description are to be considered illustrative and illustrative rather than restrictive; the disclosure is not limited to what is disclosed. Example. By studying the drawings, the disclosure, and the appended claims, those skilled in the art will be able to understand and implement variations to the disclosed embodiments in practicing the claimed subject matter. In the claims, the word "comprising" does not exclude other elements or steps not listed, the indefinite article "a" or "an" does not exclude a plurality, and the term "plurality" means two or more, and the term "based on" shall be construed to mean "based at least in part on." The mere fact that certain measures are recited in mutually different dependent claims does not indicate that a combination of these measures cannot be used to advantage.

Claims (36)

  1. 一种任务处理方法,包括:A task processing method including:
    获取第一数据和第二数据,所述第一数据和所述第二数据分别为图像数据、音频数据、文本数据、分子结构数据和序列数据中的一者;Obtain first data and second data, where the first data and the second data are respectively one of image data, audio data, text data, molecular structure data and sequence data;
    获取所述第一数据和所述第二数据各自的第一尺度的图表示,所述第一尺度的图表示包括至少一个第一尺度的节点,其中,所述第一尺度的节点具有属性,所述第一尺度的节点的属性包括向量类型的属性;Obtaining a graph representation of a first scale of each of the first data and the second data, the graph representation of the first scale including at least one node of the first scale, wherein the node of the first scale has an attribute, The attributes of the nodes of the first scale include attributes of vector type;
    获取所述第一数据和所述第二数据各自的第二尺度的图表示,所述第二尺度低于所述第一尺度,所述第二尺度的图表示包括至少一个第二尺度的节点,其中,所述第二尺度的节点具有属性,所述第二尺度的节点的属性包括向量类型的属性,Obtaining a graph representation of a second scale of each of the first data and the second data, the second scale being lower than the first scale, the graph representation of the second scale including at least one node of the second scale , wherein the nodes of the second scale have attributes, and the attributes of the nodes of the second scale include vector type attributes,
    其中,所述第一数据和所述第二数据中的每一个数据的至少一个尺度的节点是通过对与该数据对应的稠密数据进行稀疏化而得到的,所述每一个数据的至少一个尺度的图表示包括至少一个邻接边,所述至少一个邻接边中的每一个邻接边用于表征同一尺度的两个节点的相对关系,所述邻接边具有属性;Wherein, the nodes of at least one scale of each of the first data and the second data are obtained by sparsifying the dense data corresponding to the data, and the at least one scale of each of the data The graph representation includes at least one adjacent edge, each of the at least one adjacent edge is used to characterize the relative relationship between two nodes of the same scale, and the adjacent edge has an attribute;
    将所述第一数据的第一尺度的图表示和所述第二数据的第一尺度的图表示进行图匹配,以得到第一匹配结果;Perform graph matching on the graph representation of the first scale of the first data and the graph representation of the first scale of the second data to obtain a first matching result;
    将所述第一数据的第二尺度的图表示和所述第二数据的第二尺度的图表示进行图匹配,以得到第二匹配结果;Perform graph matching on the graph representation of the second scale of the first data and the graph representation of the second scale of the second data to obtain a second matching result;
    基于所述第一匹配结果和所述第二匹配结果,确定多尺度匹配结果;以及determining a multi-scale matching result based on the first matching result and the second matching result; and
    基于所述多尺度匹配结果,确定任务处理结果。Based on the multi-scale matching results, task processing results are determined.
  2. 根据权利要求1所述的方法,其中,每一个数据的多尺度图表示包括该数据的第一尺度的图表示和第二尺度的图表示,该数据的多尺度图表示包括至少一个从属边,所述至少一个从属边中的每一个从属边用于表征不同尺度的两个节点的从属关系,所述从属边具有属性。The method of claim 1, wherein each multi-scale graph representation of the data includes a graph representation of the first scale and a graph representation of the second scale, the multi-scale graph representation of the data including at least one dependent edge, Each subordinate edge in the at least one subordinate edge is used to represent a subordinate relationship between two nodes at different scales, and the subordinate edge has an attribute.
  3. 根据权利要求2所述的方法,其中,所述从属边的属性是根据与该从属边相连的两个节点的属性确定的。 The method of claim 2, wherein the attributes of the dependent edge are determined based on attributes of two nodes connected to the dependent edge.
  4. 根据权利要求1-3中任一项所述的方法,其中,每一个数据的所述第一尺度的图表示和所述第二尺度的图表示中的至少一个满足以下中的至少一项:The method according to any one of claims 1-3, wherein at least one of the graphical representation of the first scale and the graphical representation of the second scale of each data satisfies at least one of the following:
    该尺度的节点的属性包括标量类型的属性;The attributes of nodes of this scale include attributes of scalar type;
    该尺度的邻接边的属性包括标量类型的属性;The properties of the adjacent edges of this scale include properties of scalar type;
    该尺度的从属边的属性包括标量类型的属性;The attributes of the subordinate edges of this scale include attributes of scalar type;
    该尺度的邻接边的属性包括向量类型的属性;以及The attributes of the adjacent edges of the scale include attributes of vector type; and
    该尺度的从属边的属性包括向量类型的属性。The attributes of the subordinate edges of this scale include attributes of vector type.
  5. 根据权利要求1-4中任一项所述的方法,其中,所述第一数据和所述第二数据各自的第一尺度的图表示是利用第一网络生成的和/或所述第一数据和所述第二数据各自的第二尺度的图表示是利用第二网络生成的。The method according to any one of claims 1-4, wherein the graph representation of the first scale of each of the first data and the second data is generated using a first network and/or the first The second scale graph representation of each of the data and said second data is generated using a second network.
  6. 根据权利要求1-5中任一项所述的方法,其中,节点的向量类型的属性包括特征向量,其中,每一个尺度的图匹配过程包括:The method according to any one of claims 1-5, wherein the vector type attribute of the node includes a feature vector, and wherein the graph matching process of each scale includes:
    根据所述第一数据的该尺度的图表示所包括的至少一个节点和所述第二数据的该尺度的图表示所包括的至少一个节点确定候选匹配点对,其中,所述候选匹配点对包括属于所述第一数据的该尺度的图表示的第一候选匹配节点和属于所述第二数据的该尺度的图表示的第二候选匹配节点;A candidate matching point pair is determined based on at least one node included in the graph representation of the scale of the first data and at least one node included in the graph representation of the scale of the second data, wherein the candidate matching point pair comprising a first candidate matching node belonging to the graph representation of the scale of the first data and a second candidate matching node belonging to the graph representation of the scale of the second data;
    针对所述候选匹配点对,基于所述候选匹配点对所包括的第一候选匹配节点的特征向量和所述候选匹配点对所包括的第二候选匹配节点的特征向量,确定所述候选匹配点对的匹配结果;For the candidate matching point pair, the candidate matching is determined based on the feature vector of the first candidate matching node included in the candidate matching point pair and the feature vector of the second candidate matching node included in the candidate matching point pair. Matching results of point pairs;
    基于所述候选匹配点对的匹配结果,确定所述第一数据的该尺度的图表示和所述第二数据的该尺度的图表示的匹配结果;Based on the matching result of the candidate matching point pair, determine the matching result of the graph representation of the scale of the first data and the graph representation of the scale of the second data;
    和/或,and / or,
    根据所述第一数据的该尺度的图表示所包括的至少一个邻接边和所述第二数据的该尺度的图表示所包括的至少一个邻接边确定候选匹配边对,其中,所述候选匹配边对包括属于所述第一数据的该尺度的图表示的第一候选匹配邻接边和属于所述第二数据的该尺度的图表示的第二候选匹配邻接边;A candidate matching edge pair is determined based on at least one adjacent edge included in the graph representation of the scale of the first data and at least one adjacent edge included in the graph representation of the scale of the second data, wherein the candidate matching edge pair An edge pair includes a first candidate matching adjacency edge belonging to the graph representation of the scale of the first data and a second candidate matching adjacency edge belonging to the graph representation of the scale of the second data;
    针对所述候选匹配边对,基于所述候选匹配边对所包括的第一候选匹配邻接边的属 性和所述候选匹配边对所包括的第二候选匹配邻接边的属性,确定所述候选匹配边对的匹配结果;以及For the candidate matching edge pair, based on the attributes of the first candidate matching adjacent edge included in the candidate matching edge pair and the attribute of the second candidate matching adjacent edge included in the candidate matching edge pair to determine the matching result of the candidate matching edge pair; and
    基于所述候选匹配边对的匹配结果,确定所述第一数据的该尺度的图表示和所述第二数据的该尺度的图表示的匹配结果。Based on the matching result of the candidate matching edge pair, a matching result of the graph representation of the scale of the first data and the graph representation of the scale of the second data is determined.
  7. 根据权利要求6所述的方法,其中,节点的属性还包括标量类型的属性,其中,确定所述候选匹配点对的匹配结果包括:The method according to claim 6, wherein the attributes of the node further include attributes of a scalar type, and wherein determining the matching result of the candidate matching point pair includes:
    基于所述候选匹配点对所包括的第一候选匹配节点的标量类型的属性和所述候选匹配点对所包括的第二候选匹配节点的标量类型的属性,确定所述候选匹配点对的第一点对匹配结果;The first candidate matching point pair is determined based on the scalar type attribute of the first candidate matching node included in the candidate matching point pair and the scalar type attribute of the second candidate matching node included in the candidate matching point pair. One-point matching results;
    响应于确定所述候选匹配点对的第一点对匹配结果满足第一预设条件,基于所述候选匹配点对所包括的第一候选匹配节点的特征向量和所述候选匹配点对所包括的第二候选匹配节点的特征向量,确定所述候选匹配点对的第二点对匹配结果;以及In response to determining that the first point pair matching result of the candidate matching point pair satisfies the first preset condition, based on the feature vector of the first candidate matching node included in the candidate matching point pair and the feature vector included in the candidate matching point pair The feature vector of the second candidate matching node, determines the second point pair matching result of the candidate matching point pair; and
    基于所述第二点对匹配结果,确定所述候选匹配点对的匹配结果,Based on the second point pair matching result, determine the matching result of the candidate matching point pair,
    和/或and / or
    其中,邻接边的属性包括标量类型的属性和向量类型的属性,邻接边的向量类型的属性包括特征向量,其中,确定所述候选匹配边对的匹配结果包括:Wherein, the attributes of the adjacent edges include scalar type attributes and vector type attributes, and the vector type attributes of the adjacent edges include feature vectors, wherein determining the matching result of the candidate matching edge pair includes:
    基于所述候选匹配边对所包括的第一候选匹配邻接边的标量类型的属性和所述候选匹配边对所包括的第二候选匹配邻接边的标量类型的属性,确定所述候选匹配边对的第一边对匹配结果;The candidate matching edge pair is determined based on an attribute of a scalar type of a first candidate matching adjacent edge included in the candidate matching edge pair and an attribute of a scalar type of a second candidate matching adjacent edge included in the candidate matching edge pair. The first edge pair matching result;
    响应于确定所述候选匹配边对的第一边对匹配结果满足第二预设条件,基于所述候选匹配边对所包括的第一候选匹配邻接边的特征向量和所述候选匹配边对所包括的第二候选匹配邻接边的特征向量,确定所述候选匹配边对的第二边对匹配结果;以及In response to determining that the first edge pair matching result of the candidate matching edge pair satisfies the second preset condition, based on the feature vector of the first candidate matching adjacent edge included in the candidate matching edge pair and the candidate matching edge pair. including the feature vector of the second candidate matching adjacent edge, determining the second edge pair matching result of the candidate matching edge pair; and
    基于所述第二边对匹配结果,确定所述候选匹配边对的匹配结果。Based on the second edge pair matching result, a matching result of the candidate matching edge pair is determined.
  8. 根据权利要求6所述的方法,其中,节点的标量类型的属性包括节点的显著性,和/或邻接边的标量类型的属性包括邻接边的显著性。The method of claim 6, wherein the scalar-type attribute of a node includes the saliency of the node, and/or the scalar-type attribute of the adjacent edge includes the saliency of the adjacent edge.
  9. 根据权利要求8所述的方法,其中,确定所述候选匹配点对的匹配结果包括: The method according to claim 8, wherein determining the matching result of the candidate matching point pair includes:
    将所述候选匹配点对所包括的第一候选匹配节点的显著性、所述候选匹配点对所包括的第二候选匹配节点的显著性、以及所述第一候选匹配节点的特征向量和所述第二候选匹配结果的特征向量之间的相似度三者的乘积确定为所述候选匹配点对的匹配结果,和/或,The significance of the first candidate matching node included in the candidate matching point pair, the significance of the second candidate matching node included in the candidate matching point pair, and the feature vector of the first candidate matching node are summed The product of the three similarities between the feature vectors of the second candidate matching result is determined as the matching result of the candidate matching point pair, and/or,
    其中,确定所述候选匹配边对的匹配结果包括:Wherein, determining the matching result of the candidate matching edge pair includes:
    将所述候选匹配边对所包括的第一候选匹配邻接边的显著性、所述候选匹配边对所包括的第二候选匹配邻接边的显著性、以及所述第一候选匹配邻接边的特征向量和所述第二候选匹配邻接边的特征向量之间的相似度三者的乘积确定为所述候选匹配边对的匹配结果。The significance of the first candidate matching adjacent edge included in the candidate matching edge pair, the significance of the second candidate matching adjacent edge included in the candidate matching edge pair, and the characteristics of the first candidate matching adjacent edge The product of the similarity between the vector and the feature vector of the second candidate matching adjacent edge is determined as the matching result of the candidate matching edge pair.
  10. 根据权利要求1-9中任一项所述的方法,其中,将所述第一数据的第二尺度的图表示和所述第二数据的第二尺度的图表示进行图匹配,以得到第二匹配结果包括:The method according to any one of claims 1 to 9, wherein graph matching is performed on the graph representation of the second scale of the first data and the graph representation of the second scale of the second data to obtain the first Two matching results include:
    响应于确定所述第一匹配结果为成功匹配,将所述第一数据的第二尺度的图表示和所述第二数据的第二尺度的图表示进行图匹配,以得到第二匹配结果。In response to determining that the first matching result is a successful match, graph matching is performed on the graph representation of the second scale of the first data and the graph representation of the second scale of the second data to obtain a second matching result.
  11. 根据权利要求1-9中任一项所述的方法,其中,将所述第一数据的第二尺度的图表示和所述第二数据的第二尺度的图表示进行图匹配,以得到第二匹配结果包括:The method according to any one of claims 1 to 9, wherein graph matching is performed on the graph representation of the second scale of the first data and the graph representation of the second scale of the second data to obtain the first Two matching results include:
    响应于确定所述第一匹配结果为成功匹配,将所述第一数据的第二尺度的第一子图和所述第二数据的第二尺度的第二子图进行匹配,其中,所述第一匹配结果指示所述第一数据的第一尺度的图表示中的第一节点和所述第二数据的第一尺度的图表示中的第二节点成功匹配,所述第一子图包括第一数据的第二尺度的图表示中与所述第一节点具有从属关系的节点,所述第二子图包括第二数据的第二尺度的图表示中与所述第二节点具有从属关系的节点。In response to determining that the first matching result is a successful match, matching the first subgraph of the second scale of the first data and the second subgraph of the second scale of the second data, wherein: The first matching result indicates that the first node in the graph representation of the first scale of the first data and the second node in the graph representation of the first scale of the second data are successfully matched, and the first subgraph includes The second subgraph includes a node that has a subordinate relationship with the first node in the graph representation of the second scale of the first data, and the second subgraph includes a node that has a subordinate relationship with the second node in the graph representation of the second scale of the second data. node.
  12. 根据权利要求1-9中任一项所述的方法,其中,将所述第一数据的第二尺度的图表示和所述第二数据的第二尺度的图表示进行图匹配,以得到第二匹配结果包括:The method according to any one of claims 1 to 9, wherein graph matching is performed on the graph representation of the second scale of the first data and the graph representation of the second scale of the second data to obtain the first Two matching results include:
    基于当前节点的属性、以及与当前节点有从属关系的第一尺度的节点是否成功匹配,确定当前节点的匹配结果,其中,所述当前节点为第二尺度的节点。 The matching result of the current node is determined based on the attributes of the current node and whether the node of the first scale that has a subordinate relationship with the current node is successfully matched, wherein the current node is a node of the second scale.
  13. 根据权利要求1-12中任一项所述的方法,其中,所述至少一个第一尺度的节点和所述至少一个第二尺度的节点是通过对同一稠密数据分别进行稀疏化而得到的,The method according to any one of claims 1 to 12, wherein the at least one first scale node and the at least one second scale node are obtained by sparsifying the same dense data respectively,
    和/或,and / or,
    其中,稠密数据包括多个尺度,所述至少一个第一尺度的节点和所述至少一个第二尺度的节点是通过对所述稠密数据的多个尺度中的两个尺度分别进行稀疏化而得到的。Wherein, the dense data includes multiple scales, and the at least one first scale node and the at least one second scale node are obtained by respectively sparsifying two scales among the multiple scales of the dense data. of.
  14. 根据权利要求1-12中任一项所述的方法,其中,每一个数据的至少一个尺度的节点是通过对所述稠密数据中与另一尺度的节点位置对应的部分数据进行稀疏化而得到的,所述另一尺度的节点是通过对所述稠密数据进行稀疏化而得到的。The method according to any one of claims 1-12, wherein the nodes of at least one scale of each data are obtained by sparsifying part of the data in the dense data corresponding to the node position of another scale. , the nodes of another scale are obtained by sparsifying the dense data.
  15. 根据权利要求1-12中任一项所述的方法,其中,每一个数据的至少一个尺度的节点是通过对另一尺度的节点进行归并而得到的,所述另一尺度的节点是通过对所述稠密数据进行稀疏化而得到的。The method according to any one of claims 1 to 12, wherein nodes of at least one scale of each data are obtained by merging nodes of another scale, and the nodes of another scale are obtained by merging nodes of another scale. The dense data is obtained by sparsifying it.
  16. 根据权利要求13-15中任一项所述的方法,其中,所述稠密数据包括多个稠密节点,所述稠密节点具有属性,所述稠密节点的属性包括标量类型的属性和向量类型的属性,所述稠密节点的标量类型的属性包括显著性,所述稠密节点的向量类型的属性包括特征向量,The method according to any one of claims 13-15, wherein the dense data includes a plurality of dense nodes, the dense nodes have attributes, and the attributes of the dense nodes include scalar type attributes and vector type attributes. , the scalar type attribute of the dense node includes significance, and the vector type attribute of the dense node includes a feature vector,
    其中,所述稠密节点的显著性是根据所述稠密节点的特征向量确定的,并且其中,对所述稠密数据进行稀疏化包括将所述多个稠密节点中的至少一部分稠密节点中显著性满足第三预设条件的节点确定为稀疏化后的节点。Wherein, the significance of the dense node is determined according to the feature vector of the dense node, and wherein sparsifying the dense data includes making the significance of at least a part of the dense nodes among the plurality of dense nodes satisfy The nodes of the third preset condition are determined to be sparse nodes.
  17. 根据权利要求13-15中任一项所述的方法,其中,所述稠密数据包括多个稠密节点,所述稠密节点具有属性,The method according to any one of claims 13-15, wherein the dense data includes a plurality of dense nodes, the dense nodes have attributes,
    其中,稀疏化得到的节点的属性是根据所述多个稠密节点中与该节点对应的至少一部分稠密节点的属性确定的,Wherein, the attributes of the nodes obtained by sparsification are determined based on the attributes of at least a part of the dense nodes corresponding to the node among the plurality of dense nodes,
    和/或,and / or,
    其中,至少一个尺度的节点是通过对另一尺度的节点进行归并而得到的,归并得到的节点的属性是根据所述另一尺度的节点中与该节点具有从属关系的节点的属性确定的。 Wherein, the nodes of at least one scale are obtained by merging the nodes of another scale, and the attributes of the merged nodes are determined based on the attributes of nodes of the nodes of another scale that have a subordinate relationship with the node.
  18. 根据权利要求1-17中任一项所述的方法,其中,所述至少一个邻接边是根据同一尺度的至少一个节点各自的属性确定的,其中,所述至少一个邻接边中的每一个邻接边的属性是根据该邻接边连接的两个节点各自的属性和该两个节点的相对关系中的至少一个确定的。The method according to any one of claims 1 to 17, wherein the at least one adjacency edge is determined according to respective attributes of at least one node of the same scale, wherein each of the at least one adjacency edge The attributes of the edge are determined based on at least one of the attributes of the two nodes connected by the adjacent edge and the relative relationship between the two nodes.
  19. 根据权利要求18所述的方法,其中,所述至少一个邻接边是通过执行如下步骤确定的:The method of claim 18, wherein the at least one adjacent edge is determined by performing the following steps:
    基于所述同一尺度的至少一个节点确定至少一个候选邻接边;Determine at least one candidate adjacency edge based on at least one node of the same scale;
    基于所述同一尺度的至少一个节点各自的属性,确定所述至少一个候选邻接边各自的显著性;以及determining respective saliencies of the at least one candidate adjacent edge based on respective attributes of the at least one node of the same scale; and
    将所述至少一个候选邻接边中显著性满足第四预设条件的邻接边确定为所述至少一个邻接边。The adjacent edge whose significance satisfies the fourth preset condition among the at least one candidate adjacent edge is determined as the at least one adjacent edge.
  20. 根据权利要求1-19中任一项所述的方法,其中,所述第二数据是从数据库中获取的,其中,基于所述多尺度匹配结果,确定任务处理结果包括:The method according to any one of claims 1-19, wherein the second data is obtained from a database, wherein determining the task processing result based on the multi-scale matching result includes:
    基于所述第一数据和所述数据库中的多个第二数据的多尺度匹配结果,确定与所述第一数据匹配的至少一个第二数据;以及determining at least one second data that matches the first data based on a multi-scale matching result of the first data and a plurality of second data in the database; and
    基于所述至少一个第二数据,确定任务处理结果。Based on the at least one second data, a task processing result is determined.
  21. 根据权利要求1-20中任一项所述的方法,其中,所述第一数据、所述第二数据均为图像数据,所述稠密数据为基于对应的图像数据而得到的特征图,所述稠密数据中的多个稠密节点为所述特征图中的多个像素。The method according to any one of claims 1-20, wherein the first data and the second data are image data, and the dense data is a feature map obtained based on the corresponding image data, so The multiple dense nodes in the dense data are multiple pixels in the feature map.
  22. 一种神经网络的训练方法,所述方法包括:A neural network training method, the method includes:
    获取第一样本数据和第二样本数据,所述第一样本数据和所述第二样本数据分别为图像数据、音频数据、文本数据、分子结构数据和序列数据中的一者;Obtain first sample data and second sample data, where the first sample data and the second sample data are respectively one of image data, audio data, text data, molecular structure data and sequence data;
    获取所述第一样本数据和所述第二样本数据各自的多尺度图表示,其中,所述多尺度图表示是利用图表示提取网络确定的,所述多尺度图表示包括第一尺度的图表示和第 二尺度的图表示;Obtain a multi-scale graph representation of each of the first sample data and the second sample data, wherein the multi-scale graph representation is determined using a graph representation extraction network, and the multi-scale graph representation includes a first scale The figure represents the sum of Graphical representation of two scales;
    将所述第一样本数据的第一尺度的图表示和所述第二样本数据的第一尺度的图表示进行图匹配,以得到表征第一尺度的匹配程度的第一当前匹配结果;Perform graph matching on the graph representation of the first scale of the first sample data and the graph representation of the first scale of the second sample data to obtain a first current matching result that represents the matching degree of the first scale;
    将所述第一样本数据的第二尺度的图表示和所述第二样本数据的第二尺度的图表示进行图匹配,以得到表征第二尺度的匹配程度的第二当前匹配结果;Perform graph matching on the graph representation of the second scale of the first sample data and the graph representation of the second scale of the second sample data to obtain a second current matching result that represents the matching degree of the second scale;
    获取所述第一样本数据和所述第二样本数据的目标匹配结果和/或目标任务处理结果;Obtain the target matching results and/or target task processing results of the first sample data and the second sample data;
    根据所述目标匹配结果和/或所述目标任务处理结果、以及所述第一当前匹配结果和/或所述第二当前匹配结果,确定损失值;以及Determine a loss value according to the target matching result and/or the target task processing result, and the first current matching result and/or the second current matching result; and
    根据所述损失值,训练所述图表示提取网络。Based on the loss value, the graph representation extraction network is trained.
  23. 根据权利要求22所述的方法,其中,所述损失值包括匹配损失值和/或任务损失值,The method of claim 22, wherein the loss value includes a matching loss value and/or a task loss value,
    其中,根据所述目标匹配结果和/或所述目标任务处理结果、以及所述第一当前匹配结果和/或所述第二当前匹配结果,确定损失值包括:Wherein, determining the loss value according to the target matching result and/or the target task processing result, and the first current matching result and/or the second current matching result includes:
    根据所述第一当前匹配结果和/或所述第二当前匹配结果以及目标匹配结果,确定所述匹配损失值;Determine the matching loss value according to the first current matching result and/or the second current matching result and the target matching result;
    和/或,and / or,
    根据所述第一当前匹配结果和/或所述第二当前匹配结果,确定当前任务结果;以及Determine the current task result according to the first current matching result and/or the second current matching result; and
    根据所述目标任务处理结果和所述当前任务结果,确定所述任务损失值。The task loss value is determined based on the target task processing result and the current task result.
  24. 根据权利要求23所述的方法,其中,根据所述第一当前匹配结果和/或所述第二当前匹配结果,确定匹配损失值包括:The method according to claim 23, wherein determining the matching loss value according to the first current matching result and/or the second current matching result includes:
    根据所述第一当前匹配结果和/或所述第二当前匹配结果,确定当前匹配结果;以及Determine the current matching result according to the first current matching result and/or the second current matching result; and
    根据当前匹配结果和目标匹配结果,确定匹配损失值。Determine the matching loss value based on the current matching result and the target matching result.
  25. 根据权利要求23所述的方法,其中,所述图表示提取网络包括用于提取第一尺度的图表示的第一网络,其中,根据所述第一当前匹配结果和/或所述第二当前匹配结果,确定匹配损失值包括: The method according to claim 23, wherein the graph representation extraction network includes a first network for extracting a graph representation of a first scale, wherein according to the first current matching result and/or the second current Matching results, determining the matching loss value include:
    根据所述目标匹配结果和第一当前匹配结果,确定第一尺度匹配损失值;Determine a first scale matching loss value according to the target matching result and the first current matching result;
    其中,根据所述损失值,训练所述图表示提取网络包括:Wherein, according to the loss value, training the graph representation extraction network includes:
    根据所述第一尺度匹配损失值,训练所述第一网络,Train the first network according to the first scale matching loss value,
    和/或,and / or,
    其中,所述图表示提取网络包括用于提取第二尺度的图表示的第二网络,其中,根据所述第一当前匹配结果和/或所述第二当前匹配结果,确定匹配损失值包括:Wherein, the graph representation extraction network includes a second network for extracting a graph representation of a second scale, wherein determining the matching loss value according to the first current matching result and/or the second current matching result includes:
    根据所述目标匹配结果和第二当前匹配结果,确定第二尺度匹配损失值;Determine a second scale matching loss value according to the target matching result and the second current matching result;
    其中,根据所述损失值,训练所述图表示提取网络包括:Wherein, according to the loss value, training the graph representation extraction network includes:
    根据所述第二尺度匹配损失值,训练所述第二网络。The second network is trained according to the second scale matching loss value.
  26. 根据权利要求22-25任一项所述的方法,其中,所述目标匹配结果和/或所述目标任务处理结果是根据以下中的一项确定的:The method according to any one of claims 22-25, wherein the target matching result and/or the target task processing result is determined according to one of the following:
    基于人工标注、基于教师模型和/或预训练的模型、基于辅助约束信息、基于规则的方式。Based on manual annotation, teacher model and/or pre-trained model, auxiliary constraint information, rule-based approach.
  27. 根据权利要求22-26中任一项所述的方法,其中,所述目标匹配结果是利用经过第N轮训练的网络确定的,其中,获取第一样本数据和第二样本数据包括:The method according to any one of claims 22-26, wherein the target matching result is determined using a network that has undergone the Nth round of training, wherein obtaining the first sample data and the second sample data includes:
    利用所述经过第N轮训练的网络提取第一未标注数据和第二未标注数据各自的多尺度图表示;Using the network that has undergone the Nth round of training to extract the respective multi-scale graph representations of the first unlabeled data and the second unlabeled data;
    将所述第一未标注数据的第一尺度的图表示和所述第二未标注数据的第一尺度的图表示进行图匹配,以得到表征第一尺度的匹配程度的第一未标注数据匹配结果;Perform graph matching on the graph representation of the first scale of the first unlabeled data and the graph representation of the first scale of the second unlabeled data to obtain a first unlabeled data match that represents the matching degree of the first scale. result;
    将所述第一未标注数据的第二尺度的图表示和所述第二未标注数据的第二尺度的图表示进行图匹配,以得到表征第二尺度的匹配程度的第二未标注数据匹配结果;Perform graph matching on the graph representation of the second scale of the first unlabeled data and the graph representation of the second scale of the second unlabeled data to obtain a second unlabeled data match that represents the matching degree of the second scale. result;
    根据所述第一未标注数据匹配结果和/或所述第二未标注数据匹配结果,确定未标注数据匹配结果;Determine the unlabeled data matching result according to the first unlabeled data matching result and/or the second unlabeled data matching result;
    响应于确定所述第一未标注数据和所述第二未标注数据满足第一条件,将所述第一未标注数据和所述第二未标注数据确定为作为正样本的第一样本数据和第二样本数据,其中,所述第一未标注数据和所述第二未标注数据满足第一条件包括所述未标注数据匹配结果满足第一匹配条件,正样本的目标匹配结果指示对应的第一样本数据和第二样本 数据匹配;和/或In response to determining that the first unlabeled data and the second unlabeled data satisfy a first condition, determining the first unlabeled data and the second unlabeled data as first sample data that are positive samples and second sample data, wherein the first unlabeled data and the second unlabeled data satisfying the first condition include the matching result of the unlabeled data satisfying the first matching condition, and the target matching result of the positive sample indicates the corresponding The first sample data and the second sample Data matching; and/or
    响应于确定所述第一未标注数据和所述第二未标注数据满足第二条件,将所述第一未标注数据和所述第二未标注数据确定为作为负样本的第一样本数据和第二样本数据,其中,所述第一未标注数据和所述第二未标注数据满足第二条件包括所述未标注数据匹配结果满足第二匹配条件,负样本的目标匹配结果指示对应的第一样本数据和第二样本数据不匹配。In response to determining that the first unlabeled data and the second unlabeled data satisfy a second condition, determining the first unlabeled data and the second unlabeled data as first sample data as negative samples and second sample data, wherein the first unlabeled data and the second unlabeled data satisfying the second condition include the matching result of the unlabeled data satisfying the second matching condition, and the target matching result of the negative sample indicates the corresponding The first sample data and the second sample data do not match.
  28. 根据权利要求27所述的方法,其中,根据所述第一未标注数据匹配结果和/或所述第二未标注数据匹配结果,确定未标注数据匹配结果包括:The method according to claim 27, wherein determining the unlabeled data matching result according to the first unlabeled data matching result and/or the second unlabeled data matching result includes:
    响应于确定所述第二未标注数据匹配结果指示所述第一未标注数据的第二尺度的图表示和所述第二未标注数据的第二尺度的图表示成功匹配,将所述未标注数据匹配结果确定为匹配。In response to determining that the second unlabeled data matching result indicates that the graph representation of the second scale of the first unlabeled data and the graph representation of the second scale of the second unlabeled data are successfully matched, the unlabeled data is The data matching result is determined to be a match.
  29. 根据权利要求22-28中任一项所述的方法,其中,所述图表示提取网络包括规则模块和网络模块,其中,所述方法还包括以下步骤中的至少一个:The method according to any one of claims 22-28, wherein the graph representation extraction network includes a rule module and a network module, wherein the method further includes at least one of the following steps:
    响应于确定满足第五预设条件,将所述规则模块中的第一规则模块替换为网络模块;以及In response to determining that the fifth preset condition is met, replace the first rule module in the rule modules with a network module; and
    响应于确定满足第六预设条件,在所述图表示提取网络中增加网络模块,In response to determining that the sixth preset condition is met, adding a network module to the graph representation extraction network,
    其中,根据所述损失值,训练所述图表示提取网络包括:Wherein, according to the loss value, training the graph representation extraction network includes:
    根据所述损失值,训练所述网络模块。According to the loss value, the network module is trained.
  30. 根据权利要求22-29中任一项所述的方法,其中,所述多尺度图表示中的每一个尺度的图表示包括至少一个节点,所述节点包括属性,所述节点的属性包括标量类型的属性和向量类型的属性,The method of any one of claims 22-29, wherein each scale of the multi-scale graph representation includes at least one node, the node includes an attribute, the attribute of the node includes a scalar type properties and vector type properties,
    其中,所述多尺度图表示中的至少一个尺度的图表示包括至少一个邻接边,所述至少一个邻接边中的每一个邻接边用于表征同一尺度的两个节点的相对关系,所述邻接边具有属性,所述邻接边的属性包括标量类型的属性和向量类型的属性,Wherein, at least one scale graph representation in the multi-scale graph representation includes at least one adjacent edge, and each adjacent edge in the at least one adjacent edge is used to represent the relative relationship between two nodes of the same scale, and the adjacent edge Edges have attributes, and the attributes of adjacent edges include attributes of scalar type and attributes of vector type,
    其中,所述图表示提取网络包括以下中的至少一个:Wherein, the graph representation extraction network includes at least one of the following:
    用于确定节点的标量类型的属性的网络模块; Network module for determining properties of scalar types of nodes;
    用于确定节点的向量类型的属性的网络模块;Network module for determining attributes of vector types of nodes;
    用于确定邻接边的标量类型的属性的网络模块;以及a network module for determining properties of scalar type for adjacent edges; and
    用于确定邻接边的向量类型的属性的网络模块。Network module for determining properties of vector types of adjacent edges.
  31. 根据权利要求29所述的方法,其中,节点的标量类型的属性包括节点的显著性,和/或节点的向量类型的属性包括节点的特征向量,和/或邻接边的标量类型的属性包括邻接边的显著性,和/或邻接边的向量类型的属性包括邻接边的特征向量。The method according to claim 29, wherein the scalar type attribute of the node includes the significance of the node, and/or the vector type attribute of the node includes the feature vector of the node, and/or the scalar type attribute of the adjacent edge includes adjacency. Edge saliency, and/or vector-type properties of adjacent edges include eigenvectors of adjacent edges.
  32. 一种任务处理装置,包括:A task processing device including:
    第一获取单元,被配置为获取第一数据和第二数据,所述第一数据和所述第二数据分别为图像数据、音频数据、文本数据、分子结构数据和序列数据中的一者;A first acquisition unit configured to acquire first data and second data, where the first data and the second data are respectively one of image data, audio data, text data, molecular structure data, and sequence data;
    第二获取单元,被配置为获取所述第一数据和所述第二数据各自的第一尺度的图表示,所述第一尺度的图表示包括至少一个第一尺度的节点,其中,所述第一尺度的节点具有属性,所述第一尺度的节点的属性包括向量类型的属性;The second acquisition unit is configured to acquire a graph representation of a first scale of each of the first data and the second data, where the graph representation of the first scale includes at least one node of the first scale, wherein the The nodes of the first scale have attributes, and the attributes of the nodes of the first scale include attributes of vector type;
    第三获取单元,被配置为获取所述第一数据和所述第二数据各自的第二尺度的图表示,所述第二尺度低于所述第一尺度,所述第二尺度的图表示包括至少一个第二尺度的节点,其中,所述第二尺度的节点具有属性,所述第二尺度的节点的属性包括向量类型的属性,A third acquisition unit configured to acquire a graph representation of a second scale of each of the first data and the second data, the second scale being lower than the first scale, and the graph representation of the second scale including at least one node of a second scale, wherein the node of the second scale has attributes, and the attributes of the nodes of the second scale include attributes of a vector type,
    其中,所述第一数据和所述第二数据中的每一个数据的至少一个尺度的节点是通过对与该数据对应的稠密数据进行稀疏化而得到的,所述每一个数据的至少一个尺度的图表示包括至少一个邻接边,所述至少一个邻接边中的每一个邻接边用于表征同一尺度的两个节点的相对关系,所述邻接边具有属性;Wherein, the nodes of at least one scale of each of the first data and the second data are obtained by sparsifying the dense data corresponding to the data, and the at least one scale of each of the data The graph representation includes at least one adjacent edge, each of the at least one adjacent edge is used to characterize the relative relationship between two nodes of the same scale, and the adjacent edge has an attribute;
    第一图匹配单元,被配置为将所述第一数据的第一尺度的图表示和所述第二数据的第一尺度的图表示进行图匹配,以得到第一匹配结果;A first graph matching unit configured to perform graph matching on the graph representation of the first scale of the first data and the graph representation of the first scale of the second data to obtain a first matching result;
    第二图匹配单元,被配置为将所述第一数据的第二尺度的图表示和所述第二数据的第二尺度的图表示进行图匹配,以得到第二匹配结果;A second graph matching unit configured to perform graph matching on the graph representation of the second scale of the first data and the graph representation of the second scale of the second data to obtain a second matching result;
    第一确定单元,被配置为基于所述第一匹配结果和所述第二匹配结果,确定多尺度匹配结果;以及A first determining unit configured to determine a multi-scale matching result based on the first matching result and the second matching result; and
    第二确定单元,被配置为基于所述多尺度匹配结果,确定任务处理结果。 The second determination unit is configured to determine the task processing result based on the multi-scale matching result.
  33. 一种神经网络的训练装置,所述方法包括:A neural network training device, the method includes:
    第四获取单元,被配置为获取第一样本数据和第二样本数据,所述第一样本数据和所述第二样本数据分别为图像数据、音频数据、文本数据、分子结构数据和序列数据中的一者;The fourth acquisition unit is configured to acquire first sample data and second sample data, which are image data, audio data, text data, molecular structure data and sequence respectively. one of the data;
    第五获取单元,被配置为获取所述第一样本数据和所述第二样本数据各自的多尺度图表示,其中,所述多尺度图表示是利用图表示提取网络确定的,所述多尺度图表示包括第一尺度的图表示和第二尺度的图表示;The fifth acquisition unit is configured to acquire a multi-scale graph representation of each of the first sample data and the second sample data, wherein the multi-scale graph representation is determined using a graph representation extraction network, and the multi-scale graph representation is The scale graph representation includes the graph representation of the first scale and the graph representation of the second scale;
    第三图匹配单元,被配置为将所述第一样本数据的第一尺度的图表示和所述第二样本数据的第一尺度的图表示进行图匹配,以得到表征第一尺度的匹配程度的第一当前匹配结果;A third graph matching unit configured to perform graph matching on the graph representation of the first scale of the first sample data and the graph representation of the first scale of the second sample data to obtain a match representing the first scale. The first current matching result of degree;
    第四图匹配单元,被配置为将所述第一样本数据的第二尺度的图表示和所述第二样本数据的第二尺度的图表示进行图匹配,以得到表征第二尺度的匹配程度的第二当前匹配结果;A fourth graph matching unit configured to perform graph matching on the graph representation of the second scale of the first sample data and the graph representation of the second scale of the second sample data to obtain a match representing the second scale. The second current matching result of degree;
    第七获取单元,被配置为获取所述第一样本数据和所述第二样本数据的目标匹配结果和/或目标任务处理结果;A seventh acquisition unit configured to acquire target matching results and/or target task processing results of the first sample data and the second sample data;
    第三确定单元,被配置为根据所述目标匹配结果和/或所述目标任务处理结果、以及所述第一当前匹配结果和/或所述第二当前匹配结果,确定损失值;以及A third determination unit configured to determine a loss value according to the target matching result and/or the target task processing result, and the first current matching result and/or the second current matching result; and
    训练单元,被配置为根据所述损失值,训练所述图表示提取网络。A training unit configured to train the graph representation extraction network according to the loss value.
  34. 一种电子设备,包括:An electronic device including:
    至少一个处理器;以及at least one processor; and
    与所述至少一个处理器通信连接的存储器;其中a memory communicatively connected to the at least one processor; wherein
    所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行权利要求1-31中任一项所述的方法。The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform any one of claims 1-31 Methods.
  35. 一种存储有计算机指令的非瞬时计算机可读存储介质,其中,所述计算机指令用于使所述计算机执行根据权利要求1-31中任一项所述的方法。 A non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause the computer to execute the method according to any one of claims 1-31.
  36. 一种计算机程序产品,包括计算机程序,其中,所述计算机程序在被处理器执行时实现权利要求1-31中任一项所述的方法。 A computer program product comprising a computer program, wherein the computer program implements the method of any one of claims 1-31 when executed by a processor.
PCT/CN2023/091356 2022-05-06 2023-04-27 Task processing method, neural network training method, apparatus, device, and medium WO2023213233A1 (en)

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
CN202210488516.XA CN117078977A (en) 2022-05-06 2022-05-06 Task processing method, neural network training method, device, equipment and medium
CN202210488466.5 2022-05-06
CN202210488466.5A CN117077751A (en) 2022-05-06 2022-05-06 Training method, graph representation extraction method and task processing method of neural network
CN202210488516.X 2022-05-06

Publications (1)

Publication Number Publication Date
WO2023213233A1 true WO2023213233A1 (en) 2023-11-09

Family

ID=88646265

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/091356 WO2023213233A1 (en) 2022-05-06 2023-04-27 Task processing method, neural network training method, apparatus, device, and medium

Country Status (1)

Country Link
WO (1) WO2023213233A1 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020006961A1 (en) * 2018-07-03 2020-01-09 北京字节跳动网络技术有限公司 Image extraction method and device
EP3876114A2 (en) * 2020-12-25 2021-09-08 Baidu Online Network Technology (Beijing) Co., Ltd. Method for recommending a search term, method for training a target model, apparatus for recommending a search term, apparatus for training a target model, electronic device and program product
CN113536383A (en) * 2021-01-27 2021-10-22 支付宝(杭州)信息技术有限公司 Method and device for training neural network based on privacy protection
CN113609337A (en) * 2021-02-24 2021-11-05 腾讯科技(深圳)有限公司 Pre-training method, device, equipment and medium of graph neural network

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020006961A1 (en) * 2018-07-03 2020-01-09 北京字节跳动网络技术有限公司 Image extraction method and device
EP3876114A2 (en) * 2020-12-25 2021-09-08 Baidu Online Network Technology (Beijing) Co., Ltd. Method for recommending a search term, method for training a target model, apparatus for recommending a search term, apparatus for training a target model, electronic device and program product
CN113536383A (en) * 2021-01-27 2021-10-22 支付宝(杭州)信息技术有限公司 Method and device for training neural network based on privacy protection
CN113609337A (en) * 2021-02-24 2021-11-05 腾讯科技(深圳)有限公司 Pre-training method, device, equipment and medium of graph neural network

Similar Documents

Publication Publication Date Title
CN111581961B (en) Automatic description method for image content constructed by Chinese visual vocabulary
CN112269868B (en) Use method of machine reading understanding model based on multi-task joint training
Le et al. A system for recognizing online handwritten mathematical expressions and improvement of structure analysis
WO2019214289A1 (en) Image processing method and apparatus, and electronic device and storage medium
CN109034248B (en) Deep learning-based classification method for noise-containing label images
CN113033438B (en) Data feature learning method for modal imperfect alignment
JP2011198268A (en) Information processing apparatus, method, and program
US11803971B2 (en) Generating improved panoptic segmented digital images based on panoptic segmentation neural networks that utilize exemplar unknown object classes
CN114092742B (en) Multi-angle-based small sample image classification device and method
CN114564563A (en) End-to-end entity relationship joint extraction method and system based on relationship decomposition
CN112966088B (en) Unknown intention recognition method, device, equipment and storage medium
CN110334209A (en) File classification method, device, medium and electronic equipment
CN111538846A (en) Third-party library recommendation method based on mixed collaborative filtering
CN114612921B (en) Form recognition method and device, electronic equipment and computer readable medium
CN113434683A (en) Text classification method, device, medium and electronic equipment
CN114691864A (en) Text classification model training method and device and text classification method and device
CN112418320A (en) Enterprise association relation identification method and device and storage medium
CN115544303A (en) Method, apparatus, device and medium for determining label of video
KR102608867B1 (en) Method for industry text increment, apparatus thereof, and computer program stored in medium
Rajyagor et al. Tri-level handwritten text segmentation techniques for Gujarati language
CN111966798A (en) Intention identification method and device based on multi-round K-means algorithm and electronic equipment
CN115640401B (en) Text content extraction method and device
Ambili et al. Siamese Neural Network Model for Recognizing Optically Processed Devanagari Hindi Script
WO2023213233A1 (en) Task processing method, neural network training method, apparatus, device, and medium
CN115617666A (en) GPT2 model-based Chinese test case completion method

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23799219

Country of ref document: EP

Kind code of ref document: A1