## 4 Discussion  
The group sparsity regularization has the largest impact on the model accuracy as shown in Figure 3. For \(\lambda_{L}>10\) model performance starts to decrease significantly due to the diminishing effect of sparsity resulting in decreasing generalization. Nevertheless, the effect of the hypergraph regularization cannot be neglected, as can be seen in Figure 3, where the MSE starts to decrease for values of \(\lambda_{L}>0.1\). The \(L_{2}\) regularization results in the desirable property of uniqueness of the solution. However, at higher values of \(\lambda_{R}\) the accuracy and MSE start to decrease as a result of reduced sparsity. Figure 5: The learning curve obtained from training the model with the optimal hyperparameters. Figure 6: A medial, anterior, lateral, posterior, and distal view of the directions of the \(\beta_{\text{g}}\) vectors for the vertices with non-zero coefficients. During the optimizer's iterations the amount of sparsity increases while the model's MSE decreases, resulting in model interpretability (Figure 5). The final solution has small clusters of points above the patellofemoral articular cartilage, on the femoral posterior condyles, on the femoral distal condylar area, and around the medial and lateral rim of the femoral distal cartilage layer are selected by the model. These regions also hold important anatomical information for determining femoral implant size. For example, the points selected on the anterior femoral shaft above the patellofemoral articular surface determine whether femoral implant notching might occur due to undersizing, where the implant undercuts the femoral cortical bone surface. Femoral notching is associated with an increased likelihood of supracondular fracture [34]. Therefore, these regions are likely taken into account by the model. One interesting observation is that vertices in the model are very often present in small clusters of neighbours. This is most likely due to the hypergraph regularization which has a smoothing effect, trying to force neighbouring vertices to have similar model coefficients. These clusters seem to increase the model's generalization. Our hypothesis is that they make the algorithm more robust against errors in the non-linear registration performed after the SSM fit. In Figure 6, the directions of bone shape variation which are predictive of the femoral implant size are visualized. All of these directions point outward from the bone indicating, that larger bones result in larger implant sizes, as expected. At first glance, these arrows seem to point normal to the surface of the bone mesh. However, at closer inspection, some \(\beta_{\mathbf{g}}\) directions deviate up to 67.8\({}^{\circ}\) from the direction of the surface normal. For example, the vertices selected by the model on the distal lateral condyle point significantly more posterior in comparison with the direction of the surface normal at these points. This indicates that the anteroposterior variation in bone shape at the femoral condyles causes a change in femoral implant size, which is conform with clinical knowledge. Practical implementation of our method could be through a software application which starts from the patient's MRI scan, and subsequently automatically segments it using previously investigated methods [35]. Next, the application could propose implant size based on the prediction from our proposed model. Alternatively, the model can be integrated in 3D templating software from an implant manufacturer. Our method is compatible with current generation implants with fixed increments between sizes. Several studies have investigated the accuracy of 2D templating (Table 2) [3; 4; 5; 6; 7]. In the table, bold values indicate the best performance per metric. Although 2D templating is frequently performed, it has relatively low accuracy (48-64%). Furthermore, 2D templating is a manual procedure. On the other hand, manual 3D templating shows far greater accuracy of 93.9-100% [4; 7; 8].