# A Lightweight Model for 3D Point Cloud Object Detection
## 3 Method
### Loss Function  
The loss function for supervised training of the model is the knowledge distillation loss, because knowledge distillation is one of the techniques commonly used to improve the lightweight model. A teacher-student mode is used, where SECOND is used as the teacher model and the lightweight 3D point cloud object detection algorithm proposed in this paper is used as the student model. The overall training framework is shown in  
Figure 2: The overall framework of the algorithm. (**a**) Shows the workflow of the algorithm; (**b**) shows the architecture of the 3D backbone and the 2D backbone. \(C\) represents the channel of the feature map. \(\times n\) represents the number of repeats for the lightweight layer module. Figure 3, which contains three losses. \(L_{FSP}\) constrains the student model to simulate the process of feature map extraction in the teacher model. \(L_{\text{feature}}\) constrains the student model to simulate the feature map before sending it to the detect head in the teacher model. \(L_{\text{out}}\) constrains the student model to simulate the soft label in the teacher model. The detailed introduction is below. The calculation of the \(L_{FSP}\) needs to define the FSP matrix first. The FSP matrix is used to define the flow of feature information in the backbone. The FSP matrix is used to calculate the dot product of the feature map that is the input and the output in each stage of the backbone. According to [39], the FSP matrix for each stage of the backbone is calculated as follows:  
\[G_{i,j}=\sum_{p=1}^{h}\sum_{q=1}^{w}\sum_{r=1}^{d}(\frac{F^{1}_{p,q,r,j}\times F ^{2}_{p,q,r,j}}{h\times w\times d}), \tag{1}\]  
where \(i\) is the number of the channel; \(F^{1}_{p,q,r,i}\) is the value under the coordinate of \((h,w,d,i)\); \(F^{2}_{p,q,r,j}\) is the value under the coordinate of \((h,w,d,i)\); \(F^{1}\) is the input feature map of the sub-module; \(F^{2}\) is the output feature map of the sub-module; \((h,w,d)\) is the size of the feature map. \(L_{FSP}\) is to calculate the \(L_{2}\)[40] loss of the student model FSP matrix and the teacher model FSP matrix. The calculation is as follows:  
\[L_{FSP}=\frac{1}{2T}\sum_{x}\sum_{i=1}^{n}\lambda_{i}\times\left\|G^{T}_{i}-G^ {S}_{i}\right\|^{2}_{2}, \tag{2}\]  
where \(\lambda_{i}\) represents the weight for each loss term; \(T\) is the number of the data; \(x\) is the input data; \(n\) is the number of the FSP matrix; \(G^{T}_{i}\) indicates the FSP matrix of \(x\) for the teacher model; \(G^{S}_{i}\) indicates the FSP matrix of \(x\) for the student model. The feature map sent to the detect head can provide rich information for the final prediction. \(L_{\text{feature}}\) is to calculate the \(L_{2}\) loss of feature map between the student model and the teacher model. The purpose is to improve the quality of the feature map in the student model and provide better feature information for the final prediction. The calculation is as follows:  
\[L_{\text{feature}}=\frac{1}{2T}\sum_{t}\left\|u^{T}-u^{S}\right\|^{2}_{2}, \tag{3}\]  
Figure 3: The overall training framework of the algorithm: (**a**) is the teacher model; (**b**) is the student model; \(G^{T}\) represents the FSP matrix of the teacher model; \(G^{S}\) represents the FSP matrix of the student model; \(H\times W\times D\) represents the size of the raw point data; \(H\times W\times D\times C\) represents the size of the voxel feature. where \(t\) is the index number of the data; \(T\) is the number of the data; \(u^{S}\) indicates the feature map of the \(x^{t}\) in the student model; \(u^{T}\) indicates the feature map of the \(x^{t}\) in the teacher model. \(L_{\text{out}}\) constrains the student model to learn the soft label of the teacher model, including the boundary box regression of the region proposal network and the classification label of the region classification network.