L EARNING D EEP G RAPH M ATCHING VIA C HANNELI NDEPENDENT E MBEDDING AND H UNGARIAN A TTENTION
A BSTRACT
Graph matching aims to establishing node-wise correspondence between two graphs, which is a classic combinatorial problem and in general NP-complete.
Until very recently, deep graph matching methods start to resort to deep networks to achieve unprecedented matching accuracy.
Along this direction, this paper makes two complementary contributions which can also be reused as plugin in existing works: i) a novel node and edge embedding strategy which stimulates the multihead strategy in attention models and allows the information in each channel to be merged independently.
In contrast, only node embedding is accounted in previous works; ii) a general masking mechanism over the loss function is devised to improve the smoothness of objective learning for graph matching.
Using Hungarian algorithm, it dynamically constructs a structured and sparsely connected layer, taking into account the most contributing matching pairs as hard attention.
Our approach performs competitively, and can also improve state-of-the-art methods as plugin, regarding with matching accuracy on three public benchmarks.
I NTRODUCTION
Without loss of generality, we consider the bijection problem for graph matching: given graph Gand G 2 of equal size n , graph matching seeks to ﬁnd the one-vs-one node correspondence 1 :
[Equation]
where x = vec ( X ) ∈ { 0 , 1 } n 2 which is the column-wise vectorized form of the permutation matrix X that encodes the node-to-node correspondence between two graphs, and K ∈ R n 2 × n 2 + is the so-called afﬁnity matrix 2 , respectively.
Note P is a selection matrix encoding the one-to-one correspondence constraint.
This problem is called Lawler’s QAP (Lawler, 1963) and has attracted enormous attention for its generally NP-complete (Hartmanis, 1982) challenge, as well as a wide spectrum of applications in computer vision, graphics, machine learning and operational research etc.
In particular, Koopmans-Beckmann’s QAP (Loiola et al., 2007) with objective tr( X (cid:62) F 1 XF 2 ) is a special case of Eq.
(1), which can be converted to Lawler’s QAP by K = F 2 ⊗ F 1 and F i refers to the weighted adjacency matrix.
A series of solvers haven been developed to solve graph matching problem (Leordeanu & Hebert, 2005; Cho et al., 2010; Bernard et al., 2018; Yan et al., 2015;
Yu et al., 2018).
All these methods are based on deterministic optimization, which are conditioned with pre-deﬁned afﬁnity matrix and no learning paradigm is involved.
This fact greatly limits the performance and broad application w.r.t.
different problem settings considering its NP-hard nature.
Recently, the seminal work namely deep graph matching (DGM) (Zanﬁr & Sminchisescu, 2018) is proposed to exploit the high capacity of deep networks for graph matching, which achieves stateof-the-art performance.
This is in contrast to some early works which incorporate learning strategy separately in local stages (Caetano et al., 2009; Cho et al., 2013).
On the other hand, Graph Convolutional Networks (GCN) (Kipf & Welling, 2017) brings about new capability on tasks over graph-like data, as it naturally integrates the intrinsic graph structure in a general updating rule:
[Equation]
where ˆ A is the normalized connectivity matrix.
H ( l ) and W ( l ) are the features and weights at layer l , respectively.
Node embedding is updated by aggregation from 1 -neighboring nodes, which is akin to the convolution operator in CNN.
By taking advantages of both DGM and GCN, Wang et al.
(2019) and Zhang & Lee (2019) incorporate permutation loss instead of displacement loss in (Zanﬁr & Sminchisescu, 2018), with notable improvement across both synthetic and real data.
Note that Eq.
(1) involves both node and edge information, which exactly correspond to the diagonal and off-diagonal elements in K , respectively.
Edges can carry informative multi-dimensional attributes (namely weights) which are fundamental to graph matching.
However existing embedding based graph matching methods (Wang et al., 2019; Xu et al., 2019) are focused on the explicit modeling of node level features, whereby the edges are only used as topological node connection for message passing in GCN.
Besides, edge attributes are neither well modeled in the embedding-free model (Zanﬁr & Sminchisescu, 2018) since the edge information is derived from the concatenation of node features.
To our best knowledge, there is no deep graph matching method explicitly incorporating edge attributes.
In contrast, edge attributes e.g. length and orientation are widely used in traditional graph matching models (Cho et al., 2010; Yan et al., 2015; Yu et al., 2018) for constructing the afﬁnity matrix K .
Such a gap shall be ﬁlled in the deep graph matching pipeline.
Another important consideration refers to the design of loss function.
There are mainly two forms in existing deep graph matching works: i) displacement loss (Zanﬁr & Sminchisescu, 2018) similar to the use in optical ﬂow estimation (Ren et al., 2017); ii) the so-called permutation loss (Wang et al., 2019) involving iterative Sinkhorn procedure followed by a cross-entropy loss.
Results in (Wang et al., 2019) show the latter is an effective improvement against the former regression based loss.
However, we argue that the continuous Sinkhorn procedure (in training stage) is yet an unnatural approximation to Hungarian sampling (in testing stage) for discretization.
If the network is equipped with a continuous loss function (e.g. cross-entropy), we argue that the training process will make a great “meaningless effort” to enforce some network output digits of the ﬁnal matching matrix into binary and neglect the resting digits which might have notable impact on accuracy.
This paper strikes an endeavor on the above two gaps and makes the following main contributions: i)
We propose a new approach for edge embedding via channel-wise operation, namely channelindependent embedding ( CIE ).
The hope is to effectively explore the edge attribute and simulate the multi-head strategy in attention models (Veli ˇ ckovi ´
c et al., 2018) by decoupling the calculations parallel and orthogonal to channel direction.
In fact, edge attribute information has not been considered in existing embedding based graph matching methods (Wang et al., 2019; Xu et al., 2019).
ii)
We devise a new mechanism to adjust the loss function based on the Hungarian method which is widely used for linear assignment problem, as termed by Hungarian attention .
It resorts to dynamically generating sparse matching mask according to Hungarian sampling during training, rather than approximating Hungarian sampling with a differentiable function.
As such, the Hungarian attention introduces higher smoothness against traditional loss functions to ease the training.
iii)
The empirical results on three public benchmarks shows that the two proposed techniques are orthogonal and beneﬁcial to existing techniques.
Speciﬁcally, on the one hand, our CIE module can effectively boost the accuracy by exploring the edge attributes which otherwise are not considered in state-of-the-art deep graph matching methods; on the other hand, our Hungarian attention mechanism also shows generality and it is complementary to existing graph matching loss.
R ELATED WORKS
Graph embedding.
To handle graph-like data, early works adopt recursive neural networks (RNNs) treating input as directed acyclic graphs (Sperduti & Starita, 1997; Frasconi et al., 1998).
Gori et al.
; Scarselli et al.
(2008) generalized early models to graph neural networks (GNNs) so as to be directly applied on cyclic, directed or undirected graphs.
Li et al.
(2016) further improved this line by the great success of convolutional neural networks (CNNs) (Simonyan & Zisserman, 2014;
He et al., 2016), researchers have made tremendous effort on applying convolution operator to graphs (Bruna et al., 2014; Kipf & Welling, 2017;
Gong & Cheng, 2019).
Bruna et al.
(2014) deﬁned a convolution operator in Fourier domain which is obtained by performing eigen-decomposition on graph Laplacian.
However, such convolution will affect the whole spatial domain once taking inverse Fourier transformation.
This method was improved by Chebyshev expansion to approximate ﬁlters (Defferrard et al., 2016).
Kipf & Welling (2017) propose a graph convolutional operator over 1-neighbor nodes derived from graph spectral theory, which is invariant to node permutation and achieved signiﬁcant performance on semi-supervised learning tasks.
There are series of works following GCN, such as GraphSAGE (Hamilton et al., 2017), GAT (Veliˇckovi´c et al., 2018) and MPNN (Gilmer et al., 2017).
Refer to (Cai et al., 2018) for a more comprehensive survey.
While the aforementioned models are focused on learning node state/embedding, a parallel line of work seek to learn edge embedding by taking into account the information carried on edges (Li et al., 2016;
Gilmer et al., 2017; Gong & Cheng, 2019).
Edges are intrinsic portion of graphs, and thus edge embedding can be essential to reveal the relation among nodes.
Gilmer et al.
(2017) introduce a general embedding network incorporating edge information and node-edge information merging, and a serious of works fall into this framework e.g. Gated GNN (Li et al., 2016), Tensor GNN (Sch ¨ utt et al., 2017) and EGNN (Gong & Cheng, 2019).
An improved version is devised in Chen et al.
by interpreting this framework as maximizing mutual information across layers.
learning.
For the relatively easy linear assignment problem, it has been known that Sinkhorn algorithm (Sinkhorn, 1964) is the approximate and differentiable version of
Hungarian algorithm (Mena et al., 2017).
The Sinkhorn Network (Adams & Zemel, 2011) is developed given known assignment cost, whereby doubly-stochastic regulation is performed on input non-negative square matrix.
Patrini et al.
(2018) devise the Sinkhorn AutoEncoder to minimize
Wasserstein distance, and Emami & Ranka (2018) propose to learning a linear assignment solver via reinforcement learning.
For permutation prediction, DeepPermNet (Santa Cruz et al., 2018) adopts the Sinkhorn layer on top of a deep convolutional network.
However this method cannot be directly applied for graph matching as it is not invariant to input permutations which is conditioned on a predeﬁned node permutation as reference.
In particular, existing supervised methods on combinatorial learning are generally cross-entropy-based.
Pointer Net (Vinyals et al., 2015) incorporates cross-entropy loss on learning heuristics for combinatorial problems.
Milan et al.
(2017) propose an objective-based loss, where the gradients are only updated if the objective improves after update.
Learning for graph matching.
The early effort (Caetano et al., 2009) aims to incorporate learning to graph matching.
The key is to learn a more effective afﬁnity function with given correspondence as supervision.
While the ability by only learning afﬁnity is limited, Cho et al.
(2013) propose a matching function learning paradigm using histogram-based attributes with Structured-SVM (Tsochantaridis et al., 2005).
A recent work (Zanﬁr & Sminchisescu, 2018) is a breakthrough to introduce deep learning paradigm into graph matching task, which utilizes a neural network to learn the afﬁnity function.
The learning procedure is explicitly derived from the factorization of afﬁnity matrix (Zhou & De la Torre, 2012), which makes the interpretation of the network behavior possible.
However, the displacement loss in (Zanﬁr & Sminchisescu, 2018) measures the pixel-wise translation which is similar to optical-ﬂow (Dosovitskiy et al., 2015), being essentially a regression task instead of combinaotiral optimization.
Seeing this limitation, Wang et al.
(2019) employ elementwise binary cross-entropy, termed as permutation loss.
This loss has proved capable of capturing the combinatorial nature rather than pixel offset, and achieves improvement over displacement loss.
Node embedding is also used in (Wang et al., 2019) to explore the structure information.
T HE PROPOSED LEARNING APPROACH FOR GRAPH MATCHING 3. A PPROACH O VERVIEW
An overall structure of our approach is illustrated in Fig.
In line with (Wang et al., 2019), we employ VGG16 (Simonyan & Zisserman, 2014) to extract features from input images and bi-linearly interpolate the features at key points (provided by datasets).
We concatenate lower-level (Relu4 2) and higher-level (Relu5 1) features to incorporate local and contextual information.
For an image with k key points, the feature is denoted as H ∈ R k × d , where d is the feature dimension.
Unless
[Figure]
otherwise speciﬁed, the adjacency matrix
A ∈ R k × k is consequentially constructed via Delaunay triangulation (Delaunay et al., 1934), which is a widely adopted strategy to produce sparsely connected graph.
To introduce more rich edge information, we also generate k × k m -dimensional edge features E ∈ R m × k × k .
E can be initialized with some basic edge information (e.g. length and angle and other attributes) or a commutative function E ij = p
( H i , H j ) =
p ( H j , H i ) ∈
R m , where
H i refers to the feature of node i .
Note for directed graph, the commutative property is not required.
The features H and E , together with the adjacency A , are then fed into GNN module.
Pairs of features are processed in a Siamese fashion (Bromley et al., 1994).
Standard GCN’s message passing rule simply updates node embedding as shown in Eq.
In contrast, each GNN layer in our model computes a new pair of node and edge embeddings simultaneously:
[Equation]
where W l 0 and W l 1 are the learnable parameters at layer l .
The edge information is essential to provide structural feature enhancing graph matching.
We initialize H (0) =
H and E (0)
=
E in our setting.
We will discuss the details of functions f
and g in Sec. 3.2.
Following state-of-the-art work (Wang et al., 2019), we also compute the cross-graph afﬁnity followed by a column/row-wise softmax activation and a Sinkhorn layer (Adams & Zemel, 2011):
[Equation]
Note here M ∈ R k × k is the node-level similarity matrix encoding similarity between two graphs, differing from the edege-level afﬁnity matrix K in Eq.
τ is the weighting parameter of similarity, Λ contains learnable parameters and H (1) i is the node i ’s embedding from graph G 1 .
The output
S ∈ [0 , 1] k × k , S1 = 1 , S (cid:62) 1 = 1 is a so-called doubly-stochastic matrix.
Here Sinkhorn( · ) denotes the following update iteratively to project M into doubly stochastic polygon:
[Equation]
The Sinkhorn layer is shown to be an approximation of Hungarian algorithm which produces discrete matching output (Kuhn, 1955).
As there are only matrix multiplication and normalization operators involved in Sinkhorn layer, it is differentiable.
In practice, Eq.
(5) converges rapidly withiniterations for decades of nodes.
Less iterations involved, more precise back-propagated gradients can be achieved.
We employ a cross-graph node embedding strategy following (Wang et al., 2019):
[Equation]
where f c is a network and cat( · , · ) is the concatenation operator.
H ( i ) is the node feature of graph i .
This procedure seeks to merge similar features from another graph into the node feature in current graph.
It is similar to the feature transfer strategy in (Aberman et al., 2018) for sparse correspondence, which employs a feature merging method analogous to style transfer (Li et al., 2017).
As Sinkhorn layer does not necessarily output binary digits, we employ Hungarian algorithm
(Kuhn, 1955) to discretize matching output S in testing.
The testing differs from the training due to the Hungarian discretization.
We introduce a novel attention-like mechanism termed as Hungarian attention , along with existing loss functions (will be detailed in Sec. 3.3).
The ﬁnal training loss is as follows, where S G and H correspond to binary true matching and Hungarian attention loss.
[Equation]
[Equation] [Figure]
Linear
Linear Γ ’ Γ ( 𝐄 (#)*) 𝐇 (#)*) 𝑚×𝑘×𝑘 [Figure] 𝜎 𝜎
3. C HANNEL - INDEPENDENT EMBEDDING
We detail the updating rule in Eq.
We propose a method to merge edge features into node features and perform matching on nodes.
Edge information acts an important role in modeling relational data, whereby such relation can be complex thus should be encoded with high-dimensional feature.
To this end, Gilmer et al.
(2017) introduce a general embedding layer, which takes node and edge features and outputs a message to node v , then fuses the message and the current embedding:
[Equation]
where E vw is the feature corresponding to edge ( v, w ) .
In the realization of Eq.
(8) (Gilmer et al., 2017), m ( l ) v and H ( l ) v are fed to GRU (Cho et al., 2014) as a sequential input.
There are several variants which take into account speciﬁc tasks (Li et al., 2016;
Sch ¨ utt et al., 2017; Chen et al., 2019).
Among these, Li et al.
(2016) generates a transformation matrix for each edge and Sch ¨ utt et al.
(2017) resorts to merge embedding via fully connected neural networks.
While edge-wise merging is straightforward, the representation ability is also limited.
On the other hand, fully connected merging strategy will result in high computational cost and instability for back-propagation.
To address these issues, we propose to merge embedding in a channel-wise fashion, which is termed as
Channel-Independent Embedding ( CIE ).
Concretely, the updating rule is written as:
[Equation]
where Γ N ( · ◦ · ) is a channel-wise operator/function (above the underbrace), and it performs calculation per-channel and the output channel dimension is the same as input.
The second σ ( · ) term is the message a node passes to itself, which is necessary in keeping the node information contextually consistent through each CIE layer.
In this fashion, CIE is thus a procedure to aggregate node and edge embedding in each channel independently, which requires the dimensions of node ( W ( l ) 2 H ( l ) w ) and edge ( W ( l ) 1 E ( l ) vw ) representations to be equal.
Similarly, we also propose an corresponding updating rule of edge embedding by substituting Eq.
[Equation]
11) where h ( · , · ) is commutative h ( X , Y )
=
h ( Y , X ) .
Eq.
(11) is supplementary to Eq.
Fig.
2 shows a schematic diagram of CIE layer, which is motivated from two perspectives.
First,
CIE is motivated by counterparts in CNN (Qiu et al., 2017; Tran et al., 2018) which decouple a 3D convolution into two 2D ones (e.g. a 3 × 3 × 3 convolution can be decomposed to a 1 × 3 × 3 and a 3 × 1 × 1 convolutions).
In this sense, the number of parameters can be signiﬁcantly reduced.
As shown in Fig.
2, node and edge embedding is ﬁrst manipulated along the channel direction via a linear layer, then operated via Γ N and Γ E orthogonal to the channel direction.
Instead of merging node and edge as a whole, CIE layer decouples it into two operations.
Second, CIE is also motivated by the triumph of multi-head structure (e.g. graph attention (Veliˇckovi´c et al., 2018)), the key of
[Table]
ground truth matrix 0 1 2 3 4a b c d e f 0.0 0.0 0.0 1.0 0.0 0.
attention activation 0 1 2 3 4a b c d e f 0.0 0.0 0.0 0.4 0.0 0. output matrix Sinkhorn
Hungarian Attention Pooling Hungarian Attention which is to conduct unit calculation multiple times and concatenate results. Multi-head proved effective to further improve the performance since it is capable of capturing information at different scales or aspects.
Traditional neural node-edge message passing algorithms (Gilmer et al., 2017; Li et al., 2016;
Sch ¨ utt et al., 2017) typically produce a uniﬁed transformation matrix for all the channels.
On the other hand, in Eq.
(9) (10) and (11), one can consider that the basic operator in each channel is repeated d times in a multi-head fashion.
The cross-channel information exchange, as signiﬁed in
Eq.
(9) (10) and (11), only happens before the channel-wise operator (i.e. weights W ( l ) i as the crosschannel matrices).
The main difference between CIE and traditional multi-head approaches e.g.
(Veli ˇ ckovi ´ c et al., 2018) is that CIE assumes the channel-independence of two embedded features (node and edge), while traditional ones only take one input under head-independence assumption.
3. H UNGARIAN ATTENTION MECHANISM
For most graph matching algorithms, the output is in a continuous domain.
Though there are some alternatives that deliver discrete solutions by adding more constraints or introducing numerical continuation (Zhou & De la Torre, 2012; Yu et al., 2018), the main line of methods is to incorporate a sampling procedure (e.g. winner-take-all and Hungarian).
Among them, the Hungarian algorithm (Kuhn, 1955) is a widely adopted, for its efﬁciency and theoretical optimality.
However, the Hungarian algorithm incurs a gap between training (loss function) and testing stages (Hungarian sampling).
We compare the permutation loss (Wang et al., 2019) for concrete analysis:
[Equation]
Note Eq.
(12) is an element-wise version of binary cross-entropy.
During training, this loss tends to drag the digits in S into binary format and is likely trapped to local optima.
This is because this loss will back-propagate the gradients of training samples that are easy to learn in the early training stage.
In later iterations, this loss is then hard to give up the digits that have become binary.
In fact, the similar phenomenon is also investigated in the focal loss (Lin et al., 2017) in comparison to the traditional cross-entropy loss.
During the testing stage, however, the Hungarian algorithm has no preference on the case if digits in S are close to 0 − 1 or not.
It binarizes S anyway.
Therefore, the effort of Eq.
(12) to drag S into binary might be meaningless.
This issue is likely to be solved by integrating Hungarian algorithm during the training stage.
Unfortunately, Hungarian algorithm is undifferentiable and its behavior is difﬁcult to mimic with a differentiable counterpart.
In this paper, instead of ﬁnding a continuous approximation of Hungarian algorithm, we treat it as a black box and dynamically generate network structure (sparse link) [Table] according to its output.
Concretely, the sparse link is calculated as:
[Equation]
13) where the attention mechanism Atten is fulﬁlled by an element-wise “logic OR” function.
Fig.shows an example of Hungarian attention procedure, and Eq.
(13) highlights the most contributing digit locations: positive digits P = S where Hungarian agrees with the ground-truth; negative digits
Q = Hungarian( S ) \ S G where Hungarian differs from ground-truth.
While GT (positive digits) naturally points out the digits that must be considered, negative ones indicate the digits that most hinder the matching (most impeding ones among all mis-matchings).
Thus we need only minimize the loss at Z , without considering the rest of digits.
As we note that this mechanism only focuses on a small portion of the matching matrix which is analogous to producing hard attention, we term it Hungarian attention .
Now that with the attention mask Z , the Hungarian attention loss becomes:
[Equation]
Note that Hungarian attention mechanism can also be applied to other loss functions once the matching score is calculated in an element-wise fashion.
Our experiment also studies Hungarian attention loss when casted on focal loss (Lin et al., 2017) and a speciﬁcally designed margin loss.
Finally we give a brief qualitative analysis on why Hungarian attention can improve matching loss.
As discrete graph matching problem is actually built upon Delta function over permutation vertices ( 1 at ground-truth matching and 0 otherwise)
(Yu et al., 2018), learning of graph matching with permutation loss is actually to approximate such functions with continuous counterparts.
Unfortunately, more precise approximation to Delta function will result in higher non-smoothness, as discussed in
Yu et al.
For highly non-smooth objective, the network is more likely trapped at local optima.
Hungarian attention, however, focuses on a small portion of the output locations, thus does not care about if most of the output digits are in { 0 , 1 } .
In this sense, Hungarian attention allows moderate smoothness of the objective, thus optimizer with momentum is likely to avoid local optima.
E XPERIMENTS
Experiments are conducted on three benchmarks widely used for learning-based graph matching:
CUB2011 dataset (Welinder et al., 2010) following the protocol in (Choy et al., 2016), Pascal VOC keypoint matching (Everingham et al., 2010; Bourdev & Malik, 2009) which is challenging and
Willow Object Class dataset (Cho et al., 2013). Mean matching accuracy is adopted for evaluation:
[Equation]
(cid:88)
[Equation]
The algorithm abbreviation is in the form “X-Y”, where “X” and “Y” refer to the network structure (e.g. CIE) and loss function (e.g. Hungarian attention loss), respectively
Peer methods.
We compare our method with the following selected counterparts: 1) HARG (Cho et al., 2013).
This shallow learning method is based on hand-crafted feature and Structured SVM; 2) GMN (Zanﬁr & Sminchisescu, 2018).
This is a seminal work incorporating graph matching and deep learning, and the solver is upon spectral matching (Leordeanu & Hebert, 2005).
While the loss of this method is displacement loss, we also report the results of GMN by replacing its loss with permutation loss ( GMN-P ); 3) PIA / PCA (Wang et al., 2019).
PCA and PIA correspond to the algorithms with and without cross-graph node embedding, respectively.
Readers are referred to Wang et al.
for more details; We further replace the GNN layer in our framework with: 4) GAT (Veliˇckovi´c et al., 2018).
Graph attention network is an attention mechanism on graphs, which reweights the embedding according to attention score; 5) EPN (Gong & Cheng, 2019).
This method exploits multi-dimensional edge embedding and can further be applied on directed graphs.
The edge dimension is set to 32 in our experiments.
Finally, we term our network structure CIE for short.
To investigate the capacity of edge embedding update, we also devise a version without edge embedding, in which connectivity is initialized as reciprocal of the edge length then normalized, rather than A .
This model is called PCA+ since the node embedding strategy follows PCA.
Implementation details.
As the node number of each graph might vary, we add dummy nodes for each graph pair such that the node number reaches the maximal graph size in a mini-batch in line with the protocol in (Wang et al., 2019).
In either training or testing stages, these dummy nodes will not be updated or counted.
The activation function in Eq.
(9) (10) and (11) is set as Relu (Nair &
Hinton, 2010) in all experiments.
Speciﬁcally, the node and edge embedding is implemented by:
[Equation]
(16b) where (cid:12) and (cid:9) refer to element-wise product and pairwise difference, respectively.
H · q is the q th channel of H .
In CIE 1 setting, only node-level merging Eq. (16a) is considered and the edge feature is updated as Eq.
In CIE 2 setting, we also replace the edge update Eq.
(11) with Eq.
(16b).
Note edge embedding is used in both CIE 1 and CIE 2 and note PCA-H can be regarded as the pure node embedding version of our approach.
The edge feature is initiated as reciprocal of the edge length.
For training, batch size is set to 8 .
We employ SGD optimizer (Bottou, 2010) with momentum 0 .
Two CIE layers are stacked after VGG16.
CUB2011 test CUB2011 consists of 11,788 images from 200 kinds of birds with 15 annotated parts.
We randomly sample image pairs from the dataset following the implementation released by
Choy et al.
We do not use the pre-alignment of poses during testing, because their alignment result is not publicly available.
Therefore, there exists signiﬁcant variation in pose, articulation and appearance across images, in both training and testing phase.
Images are cropped around bounding box and resized to 256 × 256 before fed into the network.
Instead of evaluating the performance in a retrieval fashion (Zanﬁr & Sminchisescu, 2018), we directly evaluate the matching accuracy since the semantic key-points are pre-given.
We test two settings: 1) intra-class .
During training, we randomly sample images, with each pair sampled from the same category (out of 200 bird categories).
In testing, 2,000 image pairs (100 pairs for each category) are sampled; 2) cross-class .
We analogously sample image pairs without considering the category information and 5,000 randomly sampled image pairs are employed for testing.
While the ﬁrst setting is for a class-aware situation, the second setting is considered for testing the class-agnostic case.
Results are shown in Table 3.
We see our method surpasses all the competing methods in terms of matching accuracy.
Besides, almost all the selected algorithms can reach over 90% accuracy, indicating that this dataset contains mostly “easy” learning samples.
In this case, the Hungarian attention can slightly improve the performance since easy gradients agree with descending trend of the loss on the whole dataset.
Pascal VOC test The Pascal VOC dataset with Key-point annotation (Bourdev & Malik, 2009) contains 7,020 training images and 1,682 testing images with 20 classes in total.
To the best of our knowledge, this is the largest and most challenging dataset for graph matching in computer vision.
Each image is cropped around its object bounding box and is resized to 256 × 256 .
The node
30 Epoch 0.
A cc u r ac y 0.
L o ss
Acc: CIE 1 -P Acc: CIE 1 -H
[Figure]
CIE
[Figure]
P
[Figure]
CIE
[Figure]
H
[Figure]
Focal Margin Perm [Figure]
[Figure]
[Figure]
[Figure] [Figure] [Figure]
y
[Figure] size of this dataset varies from 6 to 23 and there are various scale, pose and illumination perturbations.
Experimental results are summarized in Table 1.
We see in either setting, CIE signiﬁcantly outperforms all peer algorithms.
Speciﬁcally, CIE 1 -H achieves the best performance and has 0 .
8% improvement w.r.t.
average accuracy over CIE 1 -P. For each class, CIE 1 -H and CIE 1 -P carve up most of the top performance.
We also note that CIE 1 -H has a close performance on “table” compared with GMN-D. Since P-loss is naturally not as robust as D-loss on symmetric objects, P-loss showed great degradation over D-loss on “table” (as discussed in (Wang et al., 2019)).
However, with the help of Hungarian link, H-loss can maintain relatively high accuracy despite natural ﬂaw of P-loss.
This observation indicates that H-loss can focus on “difﬁcult” examples.
We also note that CIEproduces better results against CIE 2 , which implies that updating edge embedding is less effective compared to a singleton node updating strategy.
We can also see from Table 1 that PCA-P has much higher performance on training samples than CIE 1 -H, which is to the contrary of the result on testing samples.
This might indicate that PCA-P overﬁts the training samples.
Accuracy/loss vs. training epoch.
We further show the typical training behavior of P-loss and Hloss on Pascal VOC dataset in Fig.
30 epochs are involved in a whole training process.
Accuracy is evaluated on testing samples after each epoch while loss is the average loss value within each epoch.
In the early training stage, the loss of CIE 1 -P immediately drops.
On the other hand, CIE 1 -H hesitates for several epochs to ﬁnd the most effective descending direction.
On the late stage, we observe that even though P-loss (Eq.
(12)) calculates much more digits than H-loss (Eq.
, the loss values are opposite.
This counter-intuitive fact strongly indicates that P-loss makes meaningless effort, which is not helpful to improve the performance, at late stage.
The proposed H-loss, on the other hand, is capable of avoiding easy but meaningless gradients.
Effect of Hungarian attention mechanism.
We also conduct experiments to show the improvement of Hungarian attention over several loss functions (with and without Hungarian attention):
Hungarian attention is applied on Focal loss (Focal) (Lin et al., 2017) as:
[Equation]
(17) where controlling parameters α = 0 .
75 and γ = 2 in our setting.
We also design a margin loss (Margin) with Hungarian attention under a max-margin rule.
Note we insert the Hungarian attention mask Z ij into Eq.
(17) and Eq.
(18) based on the vanilla forms.
[Equation]
where we set the margin value β = 0 .
Loss of Eq.
(18) is valid because after Softmax and
Sinkhorn operations, S ij ∈ [0 , 1] .
We also show permutation loss (Perm) (Wang et al., 2019).
Result can be found in Fig.
4 (b) whereby the average accuracy on Pascal VOC is reported.
All the settings are under CIE 1 .
For either loss, the proposed Hungarian attention can further enhance the accuracy, which is further visualized by a pair of matching results under P-loss and H-loss in Fig.
[Figure]
The larger size of dot, the larger is the predicted value S ij .
(a) The reference image.
(b) Result on the target image from CIE 1 -P. (c) Result on the target image from CIE 1 -H.
We see though H-loss
i
[Table]
e. Hungarian attention loss outputs smaller predicted values, it delivers a more accurate matching.
[Table] [Table] Willow Object Class test We test the transfer ability on Willow Object Class (Cho et al., 2013).
It contains 256 images 3 of 5 categories in total, with three categories (face, duck and winebottle) collected from Caltech-256 and resting two (car and motorbike) from Pascal VOC 2007.
This dataset is considered to have bias compared with Pascal VOC since images in the same category are with relatively ﬁxed pose and background is much cleaner.
We crop the object inside its bounding box and resize it to 256 × 256 as CNN input.
While HARG is trained from scratch following the protocol in (Cho et al., 2013), all the resting counterparts are either directly pre-trained from the previous section or ﬁne-tuned upon the pre-trained models.
We term the method “X- V ” or “X- W ” to indicate pre-trained model on Pascal V OC or ﬁne-tuned on W illow, respectively.
CIE refers to CIE 1 -H for short.
Results in Table 2 suggest that our method is competitive to state-of-the-art.
C ONCLUSION
We have presented a novel and effective approach for learning based graph matching.
On one hand, the novelty of our method partially lies in the development of the Hungarian attention, which intrinsically adapts the matching problem.
It is further observed from the experiments that Hungarian attention can improve several matching-oriented loss functions, which might bring about potential for a series of combinatorial problems.
On the other hand, we also devise the channel independent embedding (CIE) technique for deep graph matching, which decouples the basic merging operations and is shown robust in learning effective graph representation.
Extensive experimental results on multiple matching benchmarks show the leading performance of our solver, and highlight the orthogonal contribution of the two proposed components on top of existing techniques. A CKNOWLEDGMENTS
Tianshu Yu and Baoxin Li were supported in part by a grant from ONR.
Any opinions expressed in this material are those of the authors and do not necessarily reﬂect the views of ONR.
Runzhong
Wang and Junchi Yan were supported in part by NSFC 61972250 and U19B2035.
A A PPENDIX A. S YNTHETIC TEST
Synthetic graphs are generated for training and testing following the protocol in (Cho et al., 2010).
Speciﬁcally, K pt keypoints are generated for a pair of graphs with a 1024 -dimensional random feature for each node, which is sampled from uniform distribution U ( − 1 , 1) .
Disturbance is also applied to graph pairs including: Gaussian node feature noise from N (0 , σ 2 ft ) ; random afﬁne transformation
[Equation]
with s ∼ U (0 . 8 , 1 . 2) , θ ∼ U ( − 60 , 60) , t x , t y ∼ U ( − 10 , 10) followed by Gaussian coordinate position noise N (0 , σ 2 co ) .
By default we assign K pt = 25 , σ ft = 1 . 5 , σ co = 5 .
Two graphs share the same structure.
We generate 10 random distributions for each test.
Results are shown in Fig.
The performance of PCA and CIE is reported.
We see our method signiﬁcantly outperformed PCA.
It can further be noticed that Hungarian attention can help to achieve an even higher accuracy.
Readers are referred to Wang et al.
(2019) for some other results on synthetic test.
However, we also notice that the way to generate synthetic graphs is much different from the distribution of real-world data.
For real-world data, on one hand, there is strong correlation on the [Figure] [Figure] [Figure]
[Figure]
[Figure]
[Figure] [Figure]
A cc u r ac y
PCA-PCIE 1 -P
CIE 1 -H        45 Node size 0.
A cc u r ac y
PCA-PCIE 1 -P
CIE 1 -H neighboring node features.
This is the reason why the message passing from nearby node features works. However, the features of synthetic data are randomly generated and there is no correlation between neighboring node features.
Therefore, message passing mechanism is not very effective to reveal the relation or pattern among local nodes for synthetic data.
On the other hand, features of real-world data typically lie on a manifold embedded in high dimensional space, hence is low dimensional.
However, randomly generated features will span the whole space and show no patterns.
Taking into account the aforementioned factors, we believe there is a demand for a novel strategy to generate more reasonable synthetic data.
This can be one of the future works.
A. C OMPARISON OF P ASCAL VOC AND W ILLOW
As we claim that Willow dataset is biased compared with Pascal VOC dataset, we qualitatively show some randomly selected examples in Fig.
We select several images with the same class “car” from both datasets.
We also choose images with “bird” from Pascal VOC and “duck” from Willow since they somewhat share similar semantic information.
We see in either case, Pascal VOC contains more variation and degradation compared with Willow in terms of pose, scale, appearance, etc.
In general,
Willow dataset is easier for algorithms to learn.
While there is a signiﬁcant performance gap of PCA over these two datasets, the performance of CIE on Willow without ﬁne-tune (Table 2) is consistent to the performance on Pascal VOC (Table 1).
As such, we infer the performance degradation of CIE on “duck” in Willow test (Table 2) is due to such bias.
The pre-trained CIE on Pascal VOC tends to produce more stable and higher average accuracy on all types of images , rather than focusing on “easy-to-learn” samples by PCA.
This is a different learning strategy from PCA.
[Figure]