# Unbiased 3D Semantic Scene Graph Prediction in Point Cloud Using Deep Learning
## 3 Methods
### Network Design
#### 3.2.2 ENA-GNN: Node and Edge Cross-Attention  
Some global relational inference methods for GNNs have recently emerged [13; 32; 33; 34; 35] that apply GCNs [16] for node-wise message propagation to obtain their evolved node features based on graph-based reasoning [10]. Our model is inspired by graph-wise message propagation and graph-based reasoning to obtain the evolved node features and apply them to the scene graph tasks [36]. This paper is inspired by these methods and uses the gate recurrent unit (GRU) [37] to deliver the node and edge messages layer by layer. Moreover, node and edge cross-attention are added to the message delivery process to propose the ENA-GNN network (Figure 3). ENA-GNN can realize joint graph inference and node classification prediction of a 3D scene graph node and edge features. The graph inference network is mainly deployed in the prior knowledge learning process with the final inference process of the 3D scene graph. As in Figure 4, at the level of the graph neural network design for relational inference, we adapted the message-passing mechanism to a directed graph structure [37; 38], combined with the edge cross-attention mechanism [13] where \(A_{\varepsilon}\in R^{M\times C_{point}}\) and \(A_{V}\in R^{M\times(M-1)\times C_{point}}\) are the edge cross-attention score and the node cross-attention score, respectively. The \(W_{\varphi}\) is a neural network transformation matrix, and \(A_{i}(\cdot)\) and \(A_{j}(\cdot)\) denote the channel aggregation functions executed along the row direction and column direction, respectively. Thus, as shown in Figure 5, the overall edge cross-attention to node \(V\), \(A_{\epsilon}\in R^{N\times C_{point}}\) and the attention score to one of the elements can be expressed as:  
\[a_{E}^{i}=\sigma\left(a_{E_{(i,\cdot)}}^{i}\odot\ a_{E_{(i,\cdot)}}^{j}\right), \tag{4}\]  
where \(\odot\) stands for the Hadamard product and \(\sigma\) denotes the nonlinear activation function. (2) Edge Feature Fusion Node Attention. Similarly, after the network messaging at the current layer, the feature information between nodes \(M_{n}\) through another node cross-attention \(A_{v}\) simulates the interaction, and the \(A_{v}\) is configured on the edge after the message-passing process on the \(E(i,\ j)\). For the two nodes \(V_{i}\) and \(V_{j}\) and the directional edge \(E(i,\ j)\), the potential feature \(X_{v_{i}}\) and \(X_{v_{j}}\) of the corresponding node can be determined by an edge to obtain their node cross-attention score \(a_{v}^{(i,j)}\in R^{1\times C_{point}}\), which is calculated as follows:  
\[a_{V}^{(i,j)}=\sigma\left(W_{\theta}^{T}\ f\left(W_{\varphi}^{T}X_{V_{i}}^{l^ {\prime}}+W_{\varphi}^{T}X_{V_{j}}^{l^{\prime}}\right)\right), \tag{5}\]  
where \(W_{\theta}\) and \(W_{\varphi}\) represent the learnable weight matrices and are also used to transform the node features to the same number of channels. Furthermore, \(\sigma(\cdot)\) and \(f\left(\cdot\right)\) denote the nonlinear activation functions. (3) Message Propagation. For the core layer of ENA-GNN, each layer of the network messaging is partly based on the connection relationship between the nodes. In the triad (subject, predicate and object) of the scene graph inference, the features of \(X_{V}\), respectively, are connected according to the index of the subject and object, corresponding to the nodes \(V_{i}\) and \(V_{j}\) to obtain the potential features of \(X_{v_{i}}\) and \(X_{v_{j}}\).