# Building Function Recognition Using the Semi-Supervised Classification
## 3 Methodology
### Building Function Classification  
Semi-supervised classification model UniMP was used for building function classification. UniMP can aggregate the features and label information, which is helpful for graph node classification. UniMP is also a multi-layer Graph Transformer jointly using label embedding to transform nodes labels into the same vector space as nodes features, which can benefit in extracting the context information of buildings and improving the recognition ability of the model. Moreover, multi-head attentions were used as the transition matrix for propagating feature vectors so that each node could aggregate more information from its neighbors. The framework of the proposed method mainly included two parts (Figure 2): (1) representation of building graph network structure; (2) reasonable application of semi-supervised message passing network model to realize the recognition and classification of a single function of buildings in building groups. This model used multi-data and a semi-supervised model to mask the label of the building in order to avoid the leakage of node labels in the iterative process of the experimental model, resulting in inaccurate or even wrong prediction results. It can not only predict node labels according to node characteristics but also further integrate other node label information to predict the current node label. When recognizing the building function by the UniMP, the graph structure is crucial to represent the building. Additionally, it is also the key to describing the spatial distribution of buildings. By considering the properties of the edges, an undirected connected graph \(G=(V,E)\) was used in this paper, where \(V=(v_{1},v_{2},\ldots,v_{n})\) and \(E\in n*n\) is a finite set of \(|V|=n\) nodes and edges. The UniMP model applies the Graph Transformer and label embedding to learn the node features and node labels from the graph. In the Graph Transformer modular, graph multi-head attention (Figure 3) was used to extract more features from multiple dimensions. For given nodes features \(H^{(l)}=\left\{h_{1}^{(l)},h_{2}^{(l)},h_{3}^{(l)},\ldots,h_{n}^{(l)}\right\}\), multi-head attention for each edge from \(j\) to \(i\) can be calculated as follows:  
\[ \begin{array}{l}q_{c,i}^{(l)}=W_{c,d}^{(l)}h_{i}^{(l)}+b_{c,d}^{(l)}\\ k_{c,j}^{(l)}=W_{c,l}^{(l)}h_{i}^{(l)}+b_{c,k}^{(l)}\\ e_{c,ij}=W_{c,e}e_{ij}+b_{c,e}\\ \alpha_{c,ij}^{(l)}=\frac{\langle q_{c,i}^{(l)},h_{c,i}^{(l)}+e_{c,ij}\rangle} {\sum_{u\in V(i)}\langle q_{c,i}^{(l)},h_{c,u}^{(l)}+e_{c,iu}\rangle}\end{array}  \tag{7}\]  
where the \(\langle q,k\rangle=\exp(\frac{q^{T}k}{\sqrt{d}})\) represents the exponential scale dot-product function and \(d\) is the hidden size of each head. \(h_{i}^{(l)}\) is the source feature and \(h_{j}^{(l)}\) is the distant  
Figure 2: The framework of building function classification by UniMP. feature; \(q_{c,i}^{(I)}\in\mathbb{R}^{d}\) is the query vector and \(k_{c,i}^{(I)}\in\mathbb{R}^{d}\) is the key vector for the \(c\)-th head attention; \(W_{c,i}^{(I)}\), \(W_{c,k}^{(I)}\), \(b_{c,i}^{(I)}\) and \(b_{c,k}^{(I)}\) are the trainable parameters; \(e_{c,ij}\) is the edge features of the graph, which are encoded and added into the key vector as additional information for each layer. For each head attention, the source feature \(h_{i}^{(I)}\) and distant feature \(h_{j}^{(I)}\) are transformed into query vector \(q_{c,i}^{(I)}\) and key vector \(k_{c,j}^{(I)}\), respectively. In this study, we transformed and propagated the features of each layer of nodes to obtain the node feature information data of the next layer. After the graph multi-head attention, the information aggregation from \(l\)-th layer to \((l+1)\)-th layer is as follows:  
\[