# Point-Line-Aware Heterogeneous Graph Attention Network for Visual SLAM System
## 3 Methodology
### Point-Line Feature Extraction Network
#### 3.1.1 ORB-FPN Module  
As shown in Figure 2, an optimized residual block (ORB) is designed based on the Nesterov acceleration gradient (NAG) algorithm to enhance the expressive ability of target features [26]. Then, we have:  
\[y_{k+1}=x_{k}+\beta(x_{k}-x_{k-1}) \tag{1}\]  
\[x_{k+1}=y_{k+1}-\alpha\
abla f(y_{k+1}) \tag{2}\]  
where \(x_{k}\) and \(y_{k+1}\) denote the output and input of the first layer of the network, and \(\alpha\) and \(\beta\) represent the learning rate and momentum parameters, respectively. \(\
abla f(y_{k+1})\) is the gradient of the objective function \(f\) at \(y_{k+1}\), and \(f\) is a smooth function satisfying the Lipschitz property. When the momentum parameter \(\beta=0\), the NAG algorithm is equivalent to the standard gradient descent algorithm. When \(\beta>0\), it optimizes the combination of \(\alpha\) and \(\beta\) to accelerate convergence. Figure 1: System overview. The system has four components: 1. The point–line feature extraction network (PL-Net) extracts key points, line segment and their descriptors (Section 3.1). 2. A heterogeneous graph attention network (HAGNN) is added with the positional encoding, which has \(N\) EAGAT and GBGI layers (Section 3.2). 3. A greedy near iterative matching (GIPOT) module is used to match the transformed features, which computes the affinity matrix \(\tilde{\text{M}}_{eff}\) and the assignment matrix. (Section 3.3). 4. The backend optimization includes local mapping, loop detection, and mapping. In the neural network propagation process, the transmission of the signal from the first layer to the last layer is expressed as:  
\[L_{i+1}=\sigma(U_{i}L_{i}) \tag{3}\]  
where \(L_{i+1}\) is the features of the \(i+1\)th layer in the network, and \(\sigma\) represents the activation function. Suppose \(U\) is a symmetrical positive definite matrix; let \(V=\sqrt{U}\) and \(\mu=VL\); then, for the nonlinear activation function \(\sigma(\mu)\), there is a function \(g(\mu)\), when \(g^{\prime}(\mu)=\sigma(\mu)\). We have:  
\[\
abla\sum_{i}g\left(V_{j}^{T}\mu\right)=U\sigma\left(U^{T}L\right)=U\sigma( UL) \tag{4}\]  
The objective function \(f(\mu)\) is defined as:  
\[f(\mu)=\frac{\left\|\mu^{2}\right\|}{2}-\sum_{i}g\left(V_{j}^{T}\mu\right) \tag{5}\]  
Figure 2: The framework of our proposed network PL-Net. We input two images of size 512 \(\times\) 512 and then obtain key points, line segment, and their descriptors through the ORB-FPN, extraction module, and descriptor module. The gray box in the upper-right corner shows the structure of the ORB-FPN. The upper gray branch is responsible for extracting points and lines. The lower red branch is used to extract the point–line descriptor  
where \(V_{i}\) is the \(i\)th column of \(V\). Then,  
\[\
abla f(\mu_{i})=\beta_{i}-\ V\sigma(V\mu_{i}) \tag{6}\]  
Equation (2) can be expressed by:  
\[\mu_{i+1}=\mu_{i}+\beta(\mu_{i}-\mu_{i-1})-\alpha((1+\beta)\
abla f(\mu_{i})- \beta\
abla f(\mu_{i-1})) \tag{7}\]  
Recovering \(L\) by \(L=V^{-1}\mu\) leads to:  
\[L_{i+1}=((1+\beta)(1-\alpha)-\alpha\beta)L_{i}+\beta(1-\alpha)L_{i-1}+\alpha( 1+\beta)\sigma(UL_{i}) \tag{8}\]  
where \(\sigma(UL_{i})\) is the \(i\)th layer feed-forward network, and the ORB module structure is shown in \[x_{k+1}=y_{k+1}-\alpha\
abla f(y_{k+1}) \tag{2}\]0  
In order to aggregate the FPN multiscale feature information, a dual attention module (DAM) was designed to perform the feature aggregation. As shown in Figure 3, firstly, in order to obtain the position and channel information of the feature, the shallow feature map \(x\in\mathbb{R}^{W\times H\times D_{1}}\) was passed through a global pooling operation and compression to generate the position vector \(x_{p}\in\mathbb{R}^{W\times H\times 1}\) and the channel vector \(x_{c}\in\mathbb{R}^{1\times 1\times D_{1}}\), respectively.