# Semantic Lidar-Inertial SLAM for Dynamic Scenes
## 3 Our Method
### Semantic Segmentation Network  
We input \(\overline{S}_{j}\) into sematic segmentation network to classify it point by point. The semantic segmentation network in our SLAM system is based on PointConv network. The network defines a 3D convolution operation called PointConv:  
\[PointConv(S,W,F)_{xyz}=\iiint\limits_{(\delta_{x},\delta_{y},\delta_{z})\in G}S \big{(}\delta_{x},\delta_{y},\delta_{z}\big{)}W\big{(}\delta_{x},\delta_{y}, \delta_{z}\big{)}F\big{(}x+\delta_{x},y+\delta_{y},z+\delta_{z}\big{)}d\delta_{ x}\delta_{y}\delta_{z} \tag{3}\]  
where \(p=(x,y,z)\) is coordinate of reference point. \(\big{(}\delta_{x},\delta_{y},\delta_{z}\big{)}\) is the relative coordinate of any neighbor point from \(p\). \(S\big{(}\delta_{x},\delta_{y},\delta_{z}\big{)}\) is the inverse density of point \(\big{(}\delta_{x},\delta_{y},\delta_{z}\big{)}\). \(W\big{(}\delta_{x},\delta_{y},\delta_{z}\big{)}\) is the weight function. In addition, \(F\big{(}x+\delta_{x},y+\delta_{y},z+\delta_{z}\big{)}\) is the feature of point \(\big{(}\delta_{x},\delta_{y},\delta_{z}\big{)}\). The main idea of PointConv is using the relative coordinates of \(K\) neighbor points to simulate weight function by multi-layer perceptron (MLP). However, it does not take the features of these neighbor points into consideration.  
We import an attention mechanism to PointConv and build a graph \(G=(V,E)\) as shown in Figure 2. Given a local point set \(P=\{p_{0},p_{1},\ldots,p_{K}\}\), (\(f=\{f_{0},f_{1},\ldots,f_{K}\}\) represents the feature of each point), \(V\in{0,1,2,\ldots,K}\) and \(E\in|V|\times|V|\) denote the vertices and edges of the graph, respectively. For each point \(i\), the weight between point \(i\) and its neighbor point \(j\) can be computed by multilayer perceptron:  
\[\widetilde{a}_{ij}=MLP\big{(}\big{[}\Delta p_{ij}\big{]}\big{|}\Delta f_{ij} \big{]}\big{)} \tag{4}\]  
where \(\Delta p_{ij}=p_{j}-p_{i}\), \(\Delta f_{ij}=MLP_{g}(f_{j})-MLP_{g}(f_{i})\), and \(MLP_{g}\) is also a multilayer perceptron, whose function is mapping a feature from one dimension to another. \(||\) denotes the concatenation operation.  
Therefore, attention weight of the \(n\)-th feature channel between point \(i\) and its neighbor point \(j\) can be computed by:  
\[a_{ij,n}=\frac{\exp\big{(}\widetilde{a}_{ij,n}\big{)}}{\sum\limits_{l=0}^{K} \exp(\widetilde{a}_{il,n})} \tag{5}\]  
The attention feature of point \(i\) can be described as:  
\[f_{i}^{\prime}=\sum\limits_{j=0}^{K}a_{ij}*M_{g}\big{(}f_{j}\big{)}+b_{i} \tag{6}\]  
where \(a_{ij}\), \(M_{g}\), and \(b_{i}\) are learnable. \(*\) denotes the element-wise production.  
So, for a given local point set \(P=\{p_{0},p_{1},p_{2},\ldots,p_{K}\}\), we can obtain the attention features through Equation (4). Let \(C_{in}\) and \(C^{{}^{\prime}}_{in}\) be the number of channels of input feature \(f_{i}\) and output feature \(f_{i}^{\prime}\). PointConv only takes the relative coordinate of each point \((p_{i}-p_{0})\) as inputs to approximate weight function. We extend PointConv by concatenating attention  
Figure 2: Illustration of attention mechanism on a reference point. The weight function is a weighted combination of the neighbors.  
feature \(f_{i}^{\prime}\) with \((p_{i}-p_{0})\), and adopt MLP1 to simulate attention weight function \(W\), as shown in Figure 3. Therefore, the network can focus on the most relevant part of the neighbors to learn features. The entire process of attention PointConv network is shown in Figure 3.