# PSHNet: Hybrid Supervision and Feature Enhancement for Accurate Infrared Small-Target Detection
## 3 Proposed Method
### Position-Scale Heatmap Supervision with CloU Regularization  
Infrared small target detection presents a dual challenge: objects are often minute and visually ambiguous, demanding both dense spatial sensitivity and precise localization. Traditional anchor-based box regression offers geometric accuracy but suffers from sparse supervision and rigid templates. In contrast, segmentation-style heatmaps deliver dense supervision but lack center specificity and shape consistency. To address this, PSHNet employs a hybrid strategy that combines the spatial flexibility of heatmap prediction with geometric refinement through offset and size regression, followed by CloU-based regularization. This enables the model to first generate coarse center candidates via heatmaps, refine their positions and scales using learned regressors, and finally enforce alignment with ground-truth boxes using CloU loss. The structure of the multi-branch output head at the end of the decoder is shown in Figure 3. It consists of three parallel branches: a heatmap head for dense spatial localization, an offset head for offset refinement, and a size head for target scale estimation. These branches operate on the final decoded feature maps and share the same intermediate features to promote representation consistency. The Heatmap Head outputs a single-channel spatial probability map indicating the likelihood of target centers. Ground-truth annotations are encoded as 2D Gaussians centered at each object location. To emphasize confident activations and suppress noisy regions, we adopt a modified focal loss:  
\[\mathcal{L}_{\text{heat}}=\begin{cases}\ \  
Due to spatial downsampling, heatmap peaks may not align perfectly with object centers. To correct this, the offset head predicts a 2D shift vector at each candidate location, enabling sub-pixel refinement. The loss is defined by  
\[\mathcal{L}_{\text{offset}}=\frac{1}{N}\sum_{i=1}^{N}\hat{\lVert o_{i}}-o_{i}^{gt }\rVert_{1} \tag{6}\]  
where \(\hat{o_{i}}\) and \(o_{i}\) are the predicted and ground-truth offsets, and \(N\) is the number of positive locations. The Size Head branch estimates the width and height of each target based on the refined center. Unlike anchor-based approaches, PSHNet directly regresses size without predefined templates. The corresponding L1 loss is as follows:  
\[\mathcal{L}_{\text{size}}=\frac{1}{N}\sum_{i=1}^{N}\hat{\lVert s_{i}}-s_{i}^{ gt}\rVert_{1} \tag{7}\]  
where \(\hat{s_{i}}\) and \(s_{i}\) represent the predicted and true sizes, respectively. All three branches operate on shared decoder features and are jointly optimized by the following total supervision loss:  
\[\mathcal{L}_{\text{sup}}=\mathcal{L}_{\text{heat}}+\lambda_{\text{off}} \cdot\mathcal{L}_{\text{offset}}+\lambda_{\text{size}}\cdot\mathcal{L}_{\text{ size}} \tag{8}\]  
with default weights \(\lambda_{o}=\lambda_{s}=1.0\). To further enforce box-level consistency, we introduce CIoU loss as a global refinement mechanism. Once bounding boxes are reconstructed from heatmap peaks, offset vectors, and predicted sizes, we compute the following:  
\[\mathcal{L}_{\text{CIoU}}^{(i)}=1-\text{IoU}\hat{(b_{i},b_{i}^{gt})}+\frac{ \rho^{2}\hat{(c_{i},c_{i}^{gt})}}{c^{2}}+\alpha\upsilon \tag{9}\]  
* \(\rho^{2}\hat{(c_{i},c_{i}^{gt})}\) is the squared center distance;
* \(c^{2}\) is the squared diagonal length of the smallest enclosing box of \(\hat{b_{i}}\) and \(b_{i}^{gt}\);
* \(\upsilon\) measures aspect ratio inconsistency;
* \(\alpha\) is a dynamically adjusted weight defined by the original CIoU formulation. The CIoU loss thus simultaneously penalizes localization, scale, and aspect-ratio discrepancies, ensuring comprehensive geometric alignment. Unlike conventional detectors, where CIoU is treated as the primary localization objective, PSHNet adopts it solely as an auxiliary term:  
\[\mathcal{L}_{\text{total}}=\mathcal{L}_{\text{sup}}+\lambda_{\text{CIoU}} \cdot\frac{1}{N}\sum_{i=1}^{N}\mathcal{L}_{\text{CIoU}}(B_{i},B_{i}^{gt}), \tag{10}\]  
with \(\lambda_{\text{CIoU}}=1.0\) by default.