# DAEOM: A Deep Attentional Embedding Approach for Biomedical Ontology Matching
## 2 Method
### Ontology Attentional Encoder
In order to measure the importance of various neighbors, different weights are given to the neighbor representations in our layer-wise graph attention strategy:  
\[z_{i}^{l+1}=\sigma\left(\sum_{j\in N_{i}}\alpha_{ij}Wz_{j}^{l}\right)\,. \tag{3}\]  
Here, \(z_{i}^{l+1}\) denotes the output representation of concept \(i\), and \(N_{i}\) denotes the neighbors of \(i\). \(\alpha_{ij}\) is the attention coefficient that indicates the importance of neighbor concept \(j\) to concept \(i\), and \(\sigma\) is a nonlinearity function. To calculate the attention coefficient \(\alpha_{ij}\), we measure the importance of neighbor concept \(j\) from both the aspects of the terminological description and topological distance. The attention coefficient \(\alpha_{ij}\) can be represented as a single-layer feedforward neural network on the addition of \(x_{i}\) and \(x_{j}\) with weight vector \(\overrightarrow{a}\in R^{d}\):  
\[c_{ij}=\overrightarrow{a}^{T}\left[Wx_{i}+Wx_{j}\right]\,. \tag{4}\]  
Topologically, neighbor concepts contribute towards the representation of a target concept through edges. GAT considers only the 1-hop neighboring concepts (parents and children) for graph attention. In this paper, we assume that two concepts from different ontologies with same parents, children, and siblings considered more similar than concepts that do not have these things in common. Four relationships were used to construct a neighborhood: \"self\", \"parent\", \"child\", and \"sibling\". For a given concept, its neighbors include itself, all direct parent and children, and sibling concepts. We obtain a proximity matrix by considering 1-order neighbor concepts (parents and children) and 2-order neighbor concepts (only siblings) in the ontology:  
\[P=\left(B+B^{2}\right)/2. \tag{5}\]  
Here \(B\) is the transition matrix where \(B_{ij}=1/d_{i}\) if \(r_{ij}\in R\) and \(B_{ij}=0\) otherwise. \(d_{i}\) is the degree of concept \(i\). Therefore \(P_{ij}\) denotes the topological relevance of concept \(j\) to concept \(i\) up to first or second orders. In this case, \(N_{i}\) means the neighboring concepts of \(i\) in \(P\). i.e., \(j\) is a neighbor of \(i\) if \(P_{ij}>0\). The attention coefficients are usually normalized across all neighborhoods \(j\in N_{i}\) with a softmax function to make them easily comparable across concepts:  
\[\alpha_{ij}=softmax_{j}\left(c_{ij}\right)=\frac{exp\left(c_{ij}\right)}{\sum _{r\in N_{i}}exp\left(c_{rj}\right)}. \tag{6}\]  
Adding the topological weights \(P\) and an activation function \(\sigma\) (here LeakyReLU is used), the coefficients can be expressed as:  
\[\alpha_{ij}=\frac{exp\left(\sigma P_{ij}\left(\overrightarrow{a}^{T}\left[ Wx_{i}+Wx_{j}\right]\right)\right)}{\sum_{r\in N_{i}}exp\left(\sigma P_{ir}\left( \overrightarrow{a}^{T}\left[Wx_{i}+Wx_{r}\right]\right)\right)}. \tag{7}\]  
We have \(x_{i}=z_{i}^{0}\) as the input for our problem, and stack two graph attention layers:  
Figure 1:0  
Figure 1:1  
In this way, our encoder encodes both the structure and terminological description of the concept into a hidden representation, i.e., we will have \(z_{i}=z_{i}^{(2)}\). We jointly optimize the ontology autoencoder embedding and matching learning, and define our total objective function as:  
Figure 1:2  
where \(L_{r}\) and \(L_{sg}\) are the reconstruction loss of source and target ontologies and matching loss respectively, and \(\gamma\geq 0\) is a coefficient that controls the balance in between. As our latent embedding already contains both content and structure information, we choose to adopt a simple inner product decoder to predict the relationships between concepts, which would be efficient and flexible:  
Figure 1:3  
Figure 1:4  
where \(\hat{A}^{s}\) is the reconstructed structure matrix of the source ontology \(O_{s}\), and \(\hat{A}^{t}\) is the reconstructed structure matrix of the target ontology \(O_{t}\).