# Self-Supervised Keypoint Learning for the Geometric Analysis of Road-Marking Templates
## 4 Results
### Keypoint-Matching Comparison vs. SIFT/ORB
#### 4.2.5 Effect of the Number of Keypoints (K) and Class-Specific Performances  
The number of keypoints (K) is a critical hyperparameter that determines the granularity of the geometric representation learned by the model. We evaluated the impact of using different values for K (\(K\in\{3,4,5\}\)) on the key performance metrics: the IMR and ARE. The overall average results for different K values and backbones are presented in Table 3 (the overall IMR) and Table 5 (the overall ARE).  
Table 3 shows that the overall average IMR increases as K increases from 3 to 4, for both the ResNet-50 and VGG-16 backbones, but then drops slightly for K = 5 with ResNet-50 and increases further with VGG-16. This suggests that a higher number of keypoints enables the model to capture the template structure better and localize the keypoints within its mask; however, the optimal K value may depend on the backbone.  
Similarly, Table 5 shows the impact of K on the overall average ARE. For both backbones, the average ARE appears to increase significantly as K increases from 3 to 4 and then decreases somewhat for K = 5 (with ResNet-50) or increases further (with VGG-16, data are missing). This supports the observation that while increasing K might improve the structural coverage (IMR), it can negatively impact the overall alignment accuracy (ARE). Compared to higher K values, K = 3 provides the best overall balance for accurate alignment, despite potentially lower IMRs for some classes.  
The per-class IMR and ARE tables (Tables 4, 6, and 7) provide a more detailed view, highlighting significant variations in performances across different template classes and configurations. Consistent with the overall trends, increasing K to 4 and 5 appears to benefit the IMR for classes 3 and 4 with both backbones. However, for the ARE, while K = 3 shows consistent performance for most classes where alignment is possible, K = 4 and K = 5 show much sparser data (more NaNs) and higher ARE values (when calculated), indicating decreased reliability in achieving successful alignment with higher K values, despite potential IMR improvements.  
The Class 2 (straight arrow) template geometry presents a particular challenge. While the model is often successful in detecting keypoints corresponding to the prominent top and bottom parts of the arrow, capturing sufficient additional distinct keypoints (i.e., the 3 rd, 4 th, and 5 th keypoints) proves to be difficult. If these additional keypoints are predicted too close to the initial two, attempting alignment based on these nearly collinear points can lead to a degenerate transformation, resulting in a messed up and unrecognizable reconstructed template (e.g., three keypoints forming a degenerate rectangle that looks like a straight line), despite the model successfully identifying the basic structure's top and bottom. This inherent geometric challenge contributes to the low IMRs and high/NaN AREs observed for Class 2, particularly with configurations like ResNet-50 with K = 3, where the ARE is NaN. Addressing the specific difficulty of reliably localizing more than two distinct keypoints for simple, elongated structures, such as that in Class 2, is a focus for future work.