# CPDet: Circle-Permutation-Aware Object Detection for Heat Exchanger Cleaning
## 3 Materials and Methods
### The Interval Prior Extract Module  
Based on the dataset analysis in Figure 1, the circle objects exhibited a regular arrangement pattern along the vertical and horizontal directions, the horizontal interval size was maintained at 25 to 35 pixels, and the vertical interval was maintained at 8 to 12 pixels, which means that the circles could be extracted row by row and column by column, with the interval prior between the circles in each row and column. Specifically, we selected \(k\) annotation files randomly from the dataset of the heat exchanger, and each annotation file contained the coordinates of the circle center point \((x,y)\) and the width and height \((w,h)\) of the bounding box. We extracted the interval information of circles within the same rows or columns by checking if the difference in the \(y\) coordinate or \(x\) coordinate \begin{table}
\begin{tabular}{c l l} \hline
**Detector Type** & **Advantages** & **Disadvantages** \\ \hline One-Stage Detector & Fast detection speed, easy to deploy & Detection accuracy is relatively poor compared to two-stage detectors \\ \hline Two-Stage Detector & Detection accuracy is relatively higher compared to one-stage detectors & Detection speed is relatively slower compared to one-stage detectors, and it is difficult to deploy. \\ \hline Specific Industrial Scenarios Detector & Improved for special scenarios, with high detection accuracy in specific scenarios. & Limited to specific scenarios; performs well in its specific scenarios but has poor generalizability. \\ \hline Circle Object Detection & Represented for circular targets; more suitable for the detection of circle objects. & Improved based on two-stage detectors, with slower detection speed and poor portability. \\ \hline Our Detector & Fully utilizes prior information in the dataset, achieving the best performance in the scenario of detecting circle holes in heat exchangers compared to the aforementioned methods. & Dependent on the arrangement of prior information in the dataset, with poor generalizability. \\ \hline \end{tabular}
\end{table} 
Table 1: Comparison of different detectors. Figure 3: Heat exchanger dataset. values between the center points of two circles was within the \(r\) range, which is shown in Figure 4. \(d_{h}=|x_{i+1}-x_{i}|\) represents the vertical deviation between two adjacent circles in the same column, while \(d_{w}=|y_{i+1}-y_{i}|\) signifies the horizontal deviation between two adjacent circles in the same row. We determined whether the circles belonged to the same row by examining if both \(d_{w}\) and \(d_{h}\) fell within the radius \(r\), and \(w_{inte_{i}}\), \(h_{inte_{i}}\) were used to represent the horizontal and vertical intervals, respectively. Subsequently, we sorted the central coordinates of circles in the same row or column by \(y\) or \(x\), calculating the horizontal intervals \(w_{inte_{i}}\) and vertical intervals \(h_{inte_{i}}\) between each pair of circles within each row and column. \[ \begin{split} w_{inte_{i}}&=x_{i+1}-x_{i}-(r_{i+1}+ r_{i})\\ h_{inte_{i}}&=y_{i+1}-y_{i}-(r_{i+1}+r_{i}),\end{split}  \tag{1}\]  
where \(i=0,1,2,\ldots\), and \(r_{i}=\frac{1}{2}min(w_{i},h_{i})\). \(w_{inte_{i}}\) and \(h_{inte_{i}}\) donate the single interval along the horizontal and vertical, respectively, so this process was repeated to compute the entire interval set of one annotation file written as \(w_{k}=[w_{inte_{i}},w_{inte_{2}},w_{inte_{3}},\ldots,w_{inte_{n}}]\), and \(h_{k}=[h_{inte_{1}},h_{inte_{2}},h_{inte_{3}},\ldots,h_{inte_{n}}]\), and then we further calculated the entire intervals of the \(k\) annotation files, shown in Equation (2). Furthermore, to ensure the robustness of the interval priors, the interval set \(w_{i_{k}}\) and \(h_{i_{k}}\) were standardized using mathematical-statistical methods to obtain the final interval prior \(\Delta w\) and \(\Delta h\) of one annotation file. \[ \begin{split}\Delta w&=F(w_{index})\\ \Delta h&=F(h_{index}),\end{split}