scieee AI-readable full text Open interactive document viewer

Classification of Red Blood Cells in the Kendall Space of Reflection Shapes

Gual-Arnau, Ximo; Gual Vayà, Lluïsa

Abstract

The classification of red blood cells (RBCs) or erythrocytes into three categories based on their shape, normal, sickle-shaped, and those with other deformations, has proven to be a crucial tool in diagnosing and managing sickle cell disease (SCD). Manual classification techniques have evolved into automated tools, with numerous classification methods being applied based on different ways of representing the cells. In this work, we propose a novel methodology for representing RBCs, defined by selecting k landmarks along the cell boundaries and characterizing shapes as points in the Kendall space of reflection shapes, Ωk2. Using this representation, we applied an embedding of the Kendall space Ωk2 into a Euclidean space, which allowed for the use of machine learning classification algorithms. We also compared our results with those obtained using other classification methods applied to the same dataset in the literature, highlighting the strong performance of our approach in terms of classification accuracy.

Full text

Citation: Gual-Arnau, X.; Gual-Vayà, L. Classification of Red Blood Cells in the Kendall Space of Reflection Shapes. Math. Comput. Appl. 2024,29, 122. https://doi.org/10.3390/ mca29060122 Academic Editor: Leonardo Trujillo Received: 1 October 2024 Revised: 12 December 2024 Accepted: 17 December 2024 Published: 19 December 2024 Copyright: © 2024 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ 4.0/). Article Classification of Red Blood Cells in the Kendall Space of Reflection Shapes Ximo Gual-Arnau 1,*,† and Lluïsa Gual-Vayà 2,† 1Departament de Matemàtiques, Institute of New Imaging Technologies, Universitat Jaume I, 12071 Castelló, Spain 2Departament de Matemàtiques, Institute of Mathematics and Applications, Universitat Jaume I, 12071 Castelló, Spain; [email protected] *Correspondence: [email protected] †The authors contributed equally to this work. Abstract: The classification of red blood cells (RBCs) or erythrocytes into three categories based on their shape, normal, sickle-shaped, and those with other deformations, has proven to be a crucial tool in diagnosing and managing sickle cell disease (SCD). Manual classification techniques have evolved into automated tools, with numerous classification methods being applied based on different ways of representing the cells. In this work, we propose a novel methodology for representing RBCs, defined by selecting k landmarks along the cell boundaries and characterizing shapes as points in the Kendall space of reflection shapes, Ωk 2 . Using this representation, we applied an embedding of the Kendall space Ωk 2 into a Euclidean space, which allowed for the use of machine learning classification algorithms. We also compared our results with those obtained using other classification methods applied to the same dataset in the literature, highlighting the strong performance of our approach in terms of classification accuracy. Keywords: erythrocytes; Kendall space; machine learning algorithms; shape classification 1. Introduction Sickle cell disease (SCD) is a severe genetic blood disorder characterized by the presence of an abnormal form of hemoglobin, hemoglobin S (HbS), which causes red blood cells (RBCs) to adopt a rigid crescent or sickle shape. RBCs, which are normally circular and flexible, play a vital role in transporting oxygen throughout the body by moving easily through tiny blood vessels. However, in individuals with SCD, the deformed sickle-shaped cells obstruct normal blood flow, leading to pain and other complications in various parts of the body. While there are many blood abnormalities, SCD stands out due to its significant impact on millions of people worldwide. Diagnosing SCD relies on the classification of RBCs based solely on their shape, distinguishing between normal cells, sickle cells, and other deformed shapes, without consideration of the cell size. This shape-based classification is essential for identifying the presence of sickle cells, assessing disease severity, monitoring progression, and guiding timely interventions to improve the quality of life for affected individuals. The automatic classification of red blood cells based on their shape in images of peripheral blood smear samples is a field that has developed significantly in recent years through various mathematical and computational approaches. One of the approaches involves using simple descriptors such as the circularity, ellipticity, or bending energy [ 1 , 2 ] to describe the shape of the cells, and then applying classification methods based on these descriptors. The utilization of descriptors based on Fourier series or the template matching technique has also been proposed [ 3 ]. Artificial neural networks have been employed [ 4 ], as well as shape features based on integral geometry [ 5 ]. In [ 6 ], a review of segmentation and classification methods for red blood cells can be found. A recent model for classifying Math. Comput. Appl. 2024,29, 122. https://doi.org/10.3390/mca29060122 https://www.mdpi.com/journal/mca Math. Comput. Appl. 2024,29, 122 2 of 15 red blood cells that we want to highlight involves considering the contour of each cell as a parametrized curve in R2 . In this way, metrics in the shape space, which is formed by all closed parametrized curves and has the structure of a Riemannian manifold, have been used for classification [ 7 , 8 ]. However, in this model, where each shape is represented by a parametrized curve, achieving the invariance of the curve (shape) to motions and scaling is more feasible, while obtaining shape invariance against changes in parametrization is a much more mathematically and computationally expensive process. Therefore, considering that when working with databases, the boundary curves of erythrocytes are discrete (formed by a finite number of points), in this work, we introduce the representation of shapes using a set of landmarks from the boundary curve. This approach achieves excellent classification results while reducing the computational cost. At present, both machine learning and deep learning are two mainstream approaches for classification. Regarding deep learning, transfer learning models such as lightweight models, ResNet-50, AlexNet, and VGG have been implemented for RBC classification [ 9 , 10 ]. In this work, as we will explain below, we present a novel representation of the red blood cell shape that allows us to apply machine learning classification algorithms. We also compare our classification results with those obtained using other methods, including deep learning approaches, applied to the same dataset. All the previous studies highlight the growing use of advanced machine learning algorithms in cell classification tasks, demonstrating promising results in automated analysis and diagnostic support. Our work introduces a theory that, although well known, is entirely novel in the classification of red blood cells. This theory enables the introduction of new mathematical tools and SVM classification methods tailored to the specific challenges of red blood cell morphology. In numerous applications, planar shapes are characterized by a finite number of points along their contours, and the required geometric information in a shape must also be invariant under reflections of the landmark set. In this work, we represented each planar shape (cell) using a set of digitized points that described its contour, provided directly by the dataset. These points were evenly distributed along the cell boundary, ensuring a detailed and uniform representation of each shape. To define the landmarks required for working in Kendall’s reflection shape space [ 11 ], we adopted a mathematical approach based on the geometry of the cell. Specifically, the mathematical landmarks were defined as the two boundary points that determined the cell’s diameter (the pair of points with the maximum Euclidean distance between them). The remaining points, referred to as pseudo-landmarks, were distributed consistently along the boundary relative to the identified diameter. This approach ensured a systematic correspondence between points across different shapes, even in the absence of anatomical homology. In our application, we aimed to classify red blood cells into three categories: normal, sickle-shaped, and those with other deformations. Each cell was thus described by k landmarks in R2 , which corresponded consistently across all cells. The reason we considered invariance to reflections and, consequently, worked in the Kendall space of reflection shapes is that the blood images used were taken from samples prepared by smearing or spreading. As a result, the same red blood cell in the three-dimensional blood sample, if rotated 180 degrees around an axis, can produce a two-dimensional projection that is a reflection shape of the one obtained without rotating the red blood cell. Therefore, the 2D reflections do not alter the shape of the cell. We analyzed a dataset comprising 202 normal cells, 210 sickle cells, and 211 cells with other cellular deformations. These cells with other deformations, although they also exhibit morphological alterations, are not directly relevant to sickle cell disease and their specific identification does not provide additional information for the diagnosis, monitoring, or treatment of the disease. Therefore, they were grouped into a generic category of “other deformations”. In line with the results of [ 12 ], but considering shape invariance with respect to the orthogonal group O( 2 ) instead of the special orthogonal group SO( 2 ) , we considered the embedding of the Kendall space of reflection shapes Ωk 2 into the Euclidean Math. Comput. Appl. 2024,29, 122 3 of 15 space Rk(k−1)/2 . Then, we considered the extrinsic distance induced by the Euclidean distance of this embedding and the Euclidean distance transformed by the kernel, resulting from the embedding of Ω2 k into a reproducing kernel Hilbert space. Using these distances, we applied various machine learning algorithms to perform the supervised classification and unsupervised clustering of the dataset and conduct a classification evaluation. On the other hand, we present a new identification of the submanifold M= i (Ω2 k) within Rk(k−1)/2 . Additionally, we defined a new sample mean on M , derived from the extrinsic sample mean in Rk(k−1)/2 using the Euclidean distance. The corresponding shape was then obtained via the inverse function i−1. This paper is organized as follows. In Section 2, we present an overview of the Kendall space of reflection shapes Ωk 2 and introduce the new methodology we used for the classification of red blood cells. This methodology involved an embedding and a novel characterization of the Ωk 2space. We also explain how each cell in the database was represented as a point in Ωk 2 and detail the classification algorithms applied in both supervised classification and unsupervised clustering. Finally, in Sections 3and 4, we discuss the classification results obtained and present the conclusions of the study, respectively. 2. Materials and Methods In this section, we begin by reviewing Kendall’s reflection shape space Ωk 2 [ 11 ]. Next, in Theorem 1, we define an embedding of Ωk 2 into a Euclidean space, inspired by [ 12 ], but also considering invariance under reflections. The main novelty is in Proposition 1, which provides a new characterization of the space Ωk 2 , from which we define a new extrinsic mean. Finally, we detail the cell dataset used in this work and the proposed classification methods. 2.1. Kendall Spaces Although the erythrocyte size is important in various blood pathologies, in the case of sickle cell disease, the detection of sickle cells primarily depends on their shape. Therefore, the classification of red blood cells into the three categories was based solely on the shape of the cells, without considering their size. Initially, a 2 D shape is represented by a configuration matrix X of size k× 2, consisting of the Cartesian coordinates of the k landmarks outlining a 2 D planar domain. However, as the object’s shape encompasses all geometric information invariant to translations, rotations, and changes in scale (similarity transformations), we eliminate translations and scale changes from X by multiplying it with the Helmert submatrix, H [ 11 ], and normalizing it by its Frobenius norm. Thus, the pre-shape of the configuration matrix X is given by a (k−1)×2 matrix: Z=HX ||HX|| (1) The pre-shape space Sk 2 , defined as the set of all possible pre-shapes, is a hypersphere of unit radius in R2(k−1) . Finally, to eliminate rotations and reflections, the 2 D shape is obtained by taking the quotient of ZX over all possible orthogonal transformations of the plane. Thus, the 2 D shape space, Ωk 2 , is the quotient space of Sk 2 under orthogonal transformations, i.e., Ωk 2=Sk 2/O(2). (2) Therefore, if π denotes the natural projection to the equivalence class, π:Sk 2→Ωk 2 , a shape [X]R is an orbit associated with the action of the orthogonal group O( 2 ) on the pre-shape; therefore, a shape is invariant under isometries in R2[11]. On the other hand, given a configuration matrix X representing a shape [X]R , another matrix belonging to the same equivalence class [X]Ris given by HTZ. The space of reflection planar shapes, Ωk 2 , like the space of planar shapes, Σk 2 , is a smooth manifold of dimension 2k−4. Math. Comput. Appl. 2024,29, 122 4 of 15 2.2. A Kernel Method in Ωk 2 In [ 12 ], an embedding of the Kendall space Σk 2 into a Euclidean space is defined. When reflection invariance is considered, this embedding leads to the following embedding, i :Ωk 2→Rk(k−1) 2 , from which we will introduce an extrinsic distance and a kernel method in Ωk 2. Theorem 1. Let Z be a (k− 1 )× 2pre-shape of a given reflection shape [X]R and v={v1v2··· vk−1} with vi∈R2, i ∈ {1, ··· ,k−1}, the set of vectors defining Z. Then, the map is i : Ωk 2−→ Rk(k−1) 2 [X]R7−→ i([X]R) = <vi,vj>,(3) where i,j=1, . . . , k−1, i ≤j and <,>, which denotes the scalar product, is injective. Proof. This is similar to the proof presented in [ 12 ] for the case of shapes in the Kendall space Σk m , but notes that the generating set of polynomials invariant under the action of the group O(n), unlike the group SO(n), contains only scalar products and not determinants. The extrinsic distance between two shapes, [X1]and [X2], is given by the equation de([X1]R,[X2]R):=∥i([X2]R)−i([X1]R)∥, (4) where ∥·∥denotes the norm in Rk(k−1)/2. Finally, we consider the embedding of the Euclidean space Rk(k−1)/2 into a reproducing kernel Hilbert space (RKHS) and work with the distance defined by the kernel, in addition to the Euclidean distance. Proposition 1. Let K :RM×RM→Rbe a positive definite kernel. Then, e K:Ωk m×Ωk 2→R,([X]R,[Y]R)7→ e K([x]R,[Y]R):=K(i([X]R), i([Y]R)) is a positive definite kernel on Ωk 2. In this paper, we use the Gaussian kernel K:Ωk 2×Ωk 2−→ R, defined as K([X1]R,[X2]R) = exp−γd2 e([X1]R,[X2]R). (5) The Gaussian kernels defined in the shape space Σk 2 are the Procrustes Gaussian kernel [ 13 ] and the Projection Gaussian kernel [ 14 ], considering the 2D Kendall shape space Σk 2as a Grassmannian manifold. 2.3. An Extrinsic Mean Shape In this section, we introduce a characterization of the submanifold M= i (Ωk 2) in Rk(k−1)/2 . Subsequently, we define the extrinsic mean as the projection onto M of the usual arithmetic mean in Rk(k−1)/2. Proposition 2. Let M ⊂Rk(k−1)/2 be given by the vectors ai,bij∈Rk(k−1)/2, (6) where i <j with i,j∈ {1, 2, ··· ,k−1}, such that 1. ∑k−1 i=1ai=1, and ai>0for i =1, . . . , k−1. 2. a1bij =b1jb1i+q(a1aj−b2 1j)(a1ai−b2 1i), i =2, . . . , k−1, i<j. Math. Comput. Appl. 2024,29, 122 5 of 15 Then M =i(Ωk 2). Proof. Firstly, we observe that the dimension of M is dim(M) = 2 k− 4, therefore coinciding with the dimension of Ωk 2. We need to demonstrate that Im(i) = M. Let V=x2 i+y2 i,xixj+yiyj=⟨vi,vi⟩,⟨vi,vj⟩∈Im(i). (7) Let us define ai=x2 i+y2 i . Then, ai≥ 0, and since none of the Helmertized landmark coordinates coincide with the origin (Equation (3.7) of [11]), we have ai>0. Moreover, since the pre-shape Z∈Sk 2, we have ∑k−1 i=1ai=1. Let bij =⟨vi,vj⟩=⟨(xi,yi)),(xj,yj)⟩=||vi||||vj||cos θij. (8) Since cos θij =cos(θ1j−θ1i), we obtain bij =√aipajcos(θ1j−θ1i). Using the expression for the cosine of the difference of angles, we obtain bij =√aipaj(cos(θ1j)cos(θ1i) + sin(θ1j)sin(θ1i)) =√aipajcos(θ1j)cos(θ1i) + q(1−cos2(θ1j))(1−cos2(θ1i)). From Equation (8), we have bij =√aipaj b1j √a1√aj b1i √a1√ai +v u u t 1−b2 1j a1aj! 1−b2 1i a1ai! , and then condition 2. Therefore, V∈M , and we have demonstrated that Im( i )⊂M . Now, let V=ai,bij∈M , which satisfies conditions 1 and 2. We look for [X]∈Ωk 2 such that i ([X]) = V . We suppose that the pre-shape of Xis defined as Z=         √a10 b12 √a1 √a1a2−b2 12 √a1 . . .. . . b1k−1 √a1qa1ak−1−b2 1k−1 √a1         . (9) Then, ||Z|| =1 and i([X]) = V, so M⊂Im(i). Next, we define a new extrinsic mean in space Ωk 2. Consider a sample of shapes, [X1]R , . . . , [Xn]R∈Ωk 2 , and denote i ([X1]R) = V1 , . . . , i([Xn]R) = Vn∈M∈Rk(k−1)/2. The Euclidean sample mean ¯ V=∑n i=1Vi n={¯ ai,¯ bij} does not belong, in general, to M. To define a sample mean shape in Ωk 2 , we first consider the following minimization problem: Minimize d2 E(¯ V , M) ; that is, minW∈Md2 E(¯ V , W) , where dE denotes the Euclidean distance in Rk(k−1)/2. Math. Comput. Appl. 2024,29, 122 6 of 15 We aim to minimize the function f(ai,bij) = k−1 ∑ i=1 (ai−¯ ai)2+ k−1 ∑ i=1 i<j (bij −¯ bij)2, subject to conditions 1 and 2 of Proposition 2. Once we have obtained W∈M , which gives the minimum, the pre-shape Z of X is obtained from Equation (9), and the corresponding sample mean shape will be the shape [X]∈Ωk 2such that X=HTZ. 2.4. Image Database Our approach was applied to the erythrocytesIDB image database (accessible at http://erythrocytesidb.uib.es). This dataset consists of images of peripheral blood smear samples obtained from patients with sickle cell disease in the Special Hematology Department of the General Hospital “Dr. Juan Bruno Zayas Alfonso” in Santiago de Cuba. The database provides the contours of 623 red blood cells, each represented by 295 points in R2 , distributed approximately equidistantly along the boundary of each cell. A first-grade specialist in the Clinical Laboratory analyzed the images and classified them as circular, elongated, or cells with other deformations. We utilized the contours provided in the database, as optimizing the segmentation process was not the purpose of this study. Additional details about the sample preparation, image acquisition, segmentation, and other procedures are available on the image database homepage. The dataset contains 202 images of normal cells, 210 of sickle cells, and 211 of cells with various other deformations. Figure 1 presents three sample images from the database. It is important to note that the class of erythrocytes with other deformations includes cells with minor irregularities and shapes resembling both normal and sickle cells, which could lead to misclassification and reduced interpretability. Deformations of red blood cells are associated with several significant diseases. In some of these conditions, such as thalassemias, the presence of microcytic (small) and hypochromic erythrocytes is a central characteristic, significantly impairing oxygen transport. Therefore, in these diseases, the size of the erythrocytes plays a crucial role. However, in the case of sickle cell anemia, it is the sickle-shaped form of the erythrocytes that primarily impacts the disease’s progression. The contours of all 623 cells in the database were uniformly characterized by 295 points in R2 . To determine the major axis of each cell, we calculated the maximum distance among all pairs of the 295 points defining the contour of each cell. Among the two points defining this major axis, the one with the largest x -coordinate was chosen as the first landmark, ensuring a consistent reference point for all cells. Using this initial landmark as the starting reference, the remaining points were treated as pseudo-landmarks, thereby establishing correspondence between the landmarks of all cells. This approach, combined with the distinctive shapes of normal and sickle cells and their consistent representation, allowed each cell to be regarded as a shape in the Kendall reflection shape space Ωk 2. As we will discuss in Section 3, we performed a comparison between the classification results obtained using 295 landmarks per cell and those obtained using 295 / 5 = 59 landmarks per cell (i.e., once the first landmark was selected from the major axis of the cell, we only considered 59 equidistant points from this landmark, disregarding the rest). Since the difference in the classification results was not significant, we used k= 59 landmarks in the classification process. Math. Comput. Appl. 2024,29, 122 7 of 15 Figure 1. Examples of erythrocytes categorized as normal (left), sickle (center), and exhibiting other deformations (right). Top: the original cell; bottom: the perimeter of segmented regions (depicted in blue). 2.5. Supervised Classification To perform the supervised classification, we used the default parameters provided by the R package, as our primary goal was not to optimize the models but rather to treat erythrocytes as shapes in Kendall’s shape space and, for the first time, apply machine learning classification models by embedding Kendall’s space into a Euclidean space. In this context, we did not use a validation dataset. Consistent with other studies using the same dataset, the set of 623 cells was randomly divided such that 80% of the cells in each class were used for training and 20% for testing. Consequently, the test set consisted of 40 normal cells, 42 sickle cells, and 42 cells with other deformations. Although in this paper we used the default parameters for each classification method, we performed a 5-fold cross-validation process to ensure the reliability of the results. Additionally, for the SVM method, we repeated the classification by modifying the parameters to further strengthen the robustness of the results. For the classification, we considered the four machine learning algorithms outlined below. For all algorithms, we calculated the pre-shapes: Zi=HXi ∥HXi∥, where the Helmert submatrix is obtained using the R command helm(k) . Next, we obtained the vectors i([Xi]R)in Rk(k−1)/2 from Equation (3). 2.5.1. Algorithm 1: k-Nearest Neighbors (k-NN) k-Nearest Neighbors (k-NN) is a simple, non-parametric supervised learning algorithm used for classification tasks. It works by identifying the k -nearest data shapes (neighbors) to a given observation based on the Euclidean distance. The algorithm assigns a class label to the observation based on the majority class of its nearest neighbors. In our case, the algorithm looked at the 5 closest neighbors. However, in Section 3, we will justify this choice by presenting a graph of the error rate, i.e., the proportion of incorrect predictions, for different values of the number of neighbors k. 2.5.2. Algorithm 2: Support Vector Machine (SVM) The Support Vector Machine (SVM) is a supervised learning algorithm used for classification tasks. It works by finding the hyperplane that best separates different classes in the feature space. The goal is to maximize the margin between the closest shapes of the Math. Comput. Appl. 2024,29, 122 8 of 15 classes (support vectors) and the hyperplane. In our case, we considered the SVM function in R (from the e1071 package) with the radial basis function (RBF) kernel and the default parameters of the cost ( C= 1) and γ= 0.0005844535. These parameter values suggest that the model aims for a balance between generalization and fitting the training data. In the Results Section, Section 3, we will analyze how variations in these parameters have little effect on the classification accuracy, as long as γremains within certain limits. 2.5.3. Algorithm 3: Naive Bayes Naive Bayes is a probabilistic classification algorithm based on Bayes’ theorem, which assumes that the features used for classification are independent of each other given the class label. The model calculates the probability of each class given the input features and assigns the class with the highest probability to the observation. The default parameter values used in the model are as follows: Laplace Smoothing ( laplace ): This parameter, set to zero by default, controls the degree of smoothing applied to avoid zero probabilities. Kernel Usage ( usekernel ): Set to FALSE by default, this parameter determines whether kernel-based estimations are used for the distributions of continuous variables. When set to FALSE, it assumes the variables follow normal (Gaussian) distributions. The Distribution Weighting Factor ( fL ): Set to 1 by default, this parameter affects the weight of observed data in the estimation of distributions. 2.5.4. Algorithm 4: Random Forest Random Forest is an ensemble learning method primarily used for classification tasks. It works by constructing a multitude of decision trees during training and outputting the mode of the individual trees for classification. In our case, 100 trees were grown in the forest to ensure a robust model. We used the R library randomForest ( library(randomForest) ). The remaining default values used in the model are as follows: The number of variables per split ( mtry ), set to 41: this parameter determines how many variables are considered when searching for the best split at each tree node. The minimum node size ( nodesize ), set to 1: this parameter specifies the minimum number of observations required in a node for it to be eligible for further splitting. Finally, the maximum number of nodes ( maxnodes ) was set to NULL (default); this parameter defines an upper limit on the total number of nodes a tree can have. When left as NULL (the default value), no explicit limit is imposed. 2.6. Unsupervised Clustering Since we had an embedding of the space Ωk 2 into a Euclidean space, based on the distances defined in Section 2.2, we proposed using three k-means algorithms to perform the unsupervised clustering of the cells into three groups: normal cells, sickle cells, and cells with other deformations. Therefore, the number of clusters considered in the algorithms was k=3. 2.6.1. Algorithm 1: Extrinsic Distance In the first algorithm, once we had all the cells characterized by the landmarks defined based on their diameter, we calculated the pre-shapes Zi and we obtained the vectors i ([Xi]R) in Rk(k−1)/2 from Equation (3). Finally, we used the extrinsic distance defined in Equation (4) and applied the standard Rfunctions for k-means clusters (kmeans) [15]. Note that in this algorithm, we used the Euclidean sample mean ¯ V=∑n i=1Vi n instead of its projection onto the manifold M. 2.6.2. Algorithm 2: Classification Using Known Templates In the second algorithm, since normal cells approximate a circle and elongated cells an ellipse, we calculated the extrinsic distances considered in the second algorithm from the 623 cells to a circle and to an ellipse whose major axis was three times the minor axis. We then associated each cell with these two values and performed k-means clustering. Math. Comput. Appl. 2024,29, 122 9 of 15 In the two previous algorithms, the parameters used in the k-means method included, in addition to the number of clusters set to k= 3, the initialization parameter ( nstart ), which was set to its default value of 25. This parameter specifies how many times the algorithm initializes with different configurations of centroids. Additionally, the maximum number of iterations was also set to its default value of 100. This parameter defines the maximum number of iterations the algorithm performs to adjust the centroids and assign data points to clusters. 2.6.3. Algorithm 3: Kernel k-Means In the third algorithm, we considered the embedding of the shape space into a reproducing kernel Hilbert space (RKHS) [ 12 ], and we operated with the distance defined by the kernel instead of the Euclidean distance. This approach offered several advantages, including the enhanced separability of classes in the transformed feature space, thereby facilitating the classification task. Additionally, it allowed for flexibility in kernel selection, although we specifically proposed the default kernel ( rbfdot ), which corresponds to a Gaussian kernel, with the kernel parameter γset to 8 in Equation (5). Therefore, once we obtained the vectors i ([Xi]R) in Rk(k−1)/2 , we applied the kkmeans function of the kernlab package in R. The rest of the parameters used in this case were the number of clusters set to 3, initialization (nstart) set to 1, and the number of iterations set to 100. All Rscripts used in this work are available upon request. 3. Results First, we will verify that the results obtained when using 295 landmarks along the contour of each cell (Table 1) and those obtained with 59 landmarks (Table 2) are similar. This will be demonstrated through the representation of the confusion matrix for the three classes {N , S , OD} and the accuracy for each supervised classification algorithm. The accuracy results in both tables highlight that the Random Forest method is the most sensitive to a high number of landmarks, as being a tree-based model, it increases the complexity and the likelihood of overfitting. Therefore, given the reduced computational cost associated with using 59 landmarks, we will proceed with this smaller number of landmarks for subsequent analyses. Table 1. Confusion matrix and measures for supervised classification with k= 3 and 295 landmarks. Alg. 1 Alg. 2 Alg. 3 Alg. 4 N S OD N S OD N S OD N S OD b N40 0 10 39 0 2 39 0 3 38 0 3 b S0 42 1 0 40 0 0 42 1 0 42 1 d OD 0 0 31 1 2 40 1 0 38 2 0 36 Acc 91.12 95.97 95.97 95.16 The metrics used to evaluate the results were the sensitivity or True Positive Rate (TPR), the precision (P), the specificity or True Negative Rate (TNR), and the F1 score (F1). The TPR is the number of correct positive predictions for each class divided by the total number of objects in that class. The precision is the number of objects correctly classified in a class divided by the total number of instances classified as positive in that class. The TNR is the number of correct negative predictions for each class divided by the total number of objects that do not belong to that class. The F1 score is the harmonic mean of the precision and sensitivity, providing a balanced measure between both metrics. Moreover, the accuracy metric (Acc) measures the proportion of correct predictions made by the model out of the total number of predictions. The SDS score, introduced in [ 16 ], is calculated as the ratio of the sum of true positives across the three classes and the