Table 2 Different distance matrices used in the customized loss function
Matrix | Distance matrix | Application |
---|---|---|
Linear Distance Matrix | \(\begin{bmatrix} 0 & 1 & 2 & 3 & 4 \\ 1 & 0 & 1 & 2 & 3 \\ 2 & 1 & 0 & 1 & 2 \\ 3 & 2 & 1 & 0 & 1 \\ 4 & 3 & 2 & 1 & 0 \\ \end{bmatrix}\) | Enforces a linear penalty structure, assigning greater penalties as class distances increase, encouraging the model to avoid distant misclassifications. |
Refined Proximity Penalty Matrix | \(\begin{bmatrix} 0 & 2 & 1 & 0.5 & 0.2 \\ 2 & 0 & 2 & 1 & 0.5 \\ 1 & 2 & 0 & 2 & 1 \\ 0.5 & 1 & 2 & 0 & 2 \\ 0.2 & 0.5 & 1 & 2 & 0 \\ \end{bmatrix}\) | Applies higher penalties for closer class misclassifications and lower penalties for more distant ones, refining the model’s ability to distinguish closely related classes. |