# CenterInst: Center-Based Real-Time Instance Segmentation
## 3 Methods
### Center-Guided Query Selector  
Research [4; 23] indicates that the method of initializing object queries can significantly impact the convergence speed and accuracy of a model. Sparse and precise query proposals can effectively enhance model performance. Inspired by Deformable DETR [23], FastInst adopts a semantic segmentation approach, filtering query proposals through the per-pixel prediction of class probabilities. However, in semantic segmentation tasks, it is necessary to perceive the entirety of an instance, which leads to high-probability classification predictions at multiple different locations of the same instance, resulting in redundant query proposals for the same instance. To ensure the sparsity and precision of queries, we were inspired by instance segmentation methods based on center point prediction models like SOLO and CondInst. Drawing on the CenterNet approach, we developed a center-guided query selector, which selects queries through the per-pixel prediction of center point probabilities. Since an instance has only one center point, using center points can effectively avoid generating too many query proposals for a single instance, and the introduction of center points also allows for more precise query proposals during sampling. The specific implementation is as follows:  
In the center-guided query selector, we fed the input features \(E4\) from the neck into the detection head to predict the center probabilities. The detection head consists of \(3\times 3\) convolution followed by \(1\times 1\) convolution:  
\[[P_{c},\;P_{o},P_{wh}]=HEAD_{det}(E_{4}) \tag{1}\]  
where \(P_{c}\in\mathbb{R}^{\frac{H}{6}\times\frac{W}{6}\times 2}\) is the per-pixel center point probability, \(P_{o}\in\mathbb{R}^{\frac{H}{6}\times\frac{W}{6}\times 2}\) is the relative center offset, and \(P_{wh}\in\mathbb{R}^{\frac{H}{6}\times\frac{W}{6}\times 2}\) is the target dimensions of \(E_{4}\).  
Figure 1: Model overview. CenterInst extracts and refines multiscale features through the backbone and neck. The center-guided query selector (Section 3.2) selects \(N\) instance center position proposals from feature \(E_{4}\) and obtains instance query proposals from feature \(E_{3}\) based on these center positions. Subsequently, these queries and center positions are updated in a dual-path decoder (Section 3.3), which iteratively updates through \(L\) stages, predicting classification, detection, and segmentation after each stage. Pruning the pixel feature decoding branch during inference further accelerates the processing speed (Section 3.3).  
Subsequently, we selected the top \(N\) pixel positions based on center probabilities \(Pc\) as preliminary candidates for the instance locations:  
\[\left[P_{c}^{topN},\ I^{topN}\right]=TopN(P_{c}) \tag{2}\]  
where \(P_{c}^{topN}\) represents the top \(N\) center point probabilities, and \(I^{topN}\) represents the indices of \(P_{c}^{topN}\).  
Subsequently, based on the selected pixel positions and the center point offset results \(P_{o}\), we calculated the actual position of the center point \([X,\ Y]\), denoted as \(C_{0}\).  
\[C_{0}=[X,\ Y]=Coord\left(I^{topN}\right)+P_{o}\left[I^{topN}\right] \tag{3}\]  
Based on the center position proposals \(C_{0}\), we obtained \(N\) instance query proposals \(Q_{0}\) from the high-resolution features \(E_{3}\) using the bilinear interpolation method:  
\[Q_{0}=Bilinear(E3,\ C_{0}) \tag{4}\]  
where \(Bilinear(A,\ B)\) denotes the sampling of \(A\) from location \(B\). Extracting instance queries from high-resolution features provides higher initial query precision than when using low-resolution features, and utilizing bilinear interpolation for precise coordinate sampling can further enhance initial query precision.