Abstract
Sex estimation is a fundamental component of forensic biological profiling, yet primary markers such as the pelvis and skull are frequently fragmented or absent due to taphonomic factors. This study investigates the diagnostic efficacy of the first and second atypical ribs for sex estimation within a Northern Thai population using advanced machine learning (ML). Osteometric variables, 15 for the first rib and 14 for the second were recorded from 200 right side ribs (100 males, 100 females) and 177 left side ribs (100 males, 77 females) at Chiang Mai University. Twelve ML algorithms, including ensemble stacking and voting classifiers, were refined via recursive feature elimination with cross-validation (RFECV) and hyperparameter optimization through the Optuna framework. Results demonstrated pronounced sexual dimorphism, with male dimensions consistently exceeding those of females across nearly all variables (P<0.05). Optimized models exhibited superior predictive performance; specifically, quadratic discriminant analysis for the right first rib yielded a hold-out accuracy of 85%. Notably, the stacking model applied to the right second rib achieved an accuracy of 90%, equivalent to the performance of models utilizing both ribs combined. In conclusion, ML integrated rib morphometry provides a highly accurate and robust alternative for sex estimation in the Northern Thai population, particularly in cases where standard skeletal markers are compromised.
Keywords: Forensic anthropology, Sex estimation, First and second rib, Machine learning, Thai population
Introduction
Personal identification is a critical goal in forensic science. It is especially vital when remains show extensive degradation from decomposition, incineration, or skeletonization. Under these circumstances, conventional identification methods are often untenable, making osteological analysis essential for reconstructing a biological profile [1, 2].
Estimating sex is the first step in building a biological profile, and it is the most important one. Beyond its role in identity restoration, accurate sexing can reduce the search parameters for missing persons by up to fifty percent, significantly streamlining forensic investigations. It also serves as a prerequisite for precise age and stature estimations, given that osteological development and growth trajectories vary significantly between males and females [3, 4].
The pelvis and skull are the gold standard for sex estimation, with accuracy rates near 95%. However, their utility is often limited in the field because they are easily damaged or lost [5, 6]. Exposure to natural disasters, prolonged burial, or animal scavenging often results in the fragmentation or loss of these primary elements, rendering them unusable. Consequently, there is a compelling need to develop and validate alternative skeletal markers that remain resilient and identifiable under adverse taphonomic conditions [7].
Previous studies by Işcan [8] established the use of typical ribs, particularly the fourth rib, as effective indicators of sexual dimorphism, proving that ribs serve as a viable substitute for sex estimation. However, identifying specific typical ribs within forensic contexts involving commingled or fragmented remains is inherently challenging. Consequently, the first and second ribs offer a significant diagnostic advantage. As atypical ribs, they possess distinct morphological characteristics that allow for reliable identification even when commingled with other skeletal elements [9].
Previous investigations have primarily focused on the first rib due to its prominent muscle attachment sites and clear sexual dimorphism. Given that skeletal sex estimation is fundamentally population specific, studies across diverse groups including American and European populations have confirmed that rib dimensions are significantly correlated with biological sex [10-14]. Recently, the second rib has also emerged as a subject of increasing scholarly attention, further expanding the potential for alternative skeletal markers in biological profiling [15].
In the past, sex estimation from skeletal fragments has primarily utilized traditional statistical frameworks, such as discriminant analysis, to derive population-specific linear equations. However, machine learning (ML) has increasingly superseded these conventional approaches due to its superior capacity for modeling complex, non-linear patterns and enhanced predictive accuracy. Recent literature underscores the efficacy of this transition. Bidmos et al. [16] demonstrated that an ensemble stacking ML technique achieved an accuracy of 90.8% for sex estimation using patella measurements in a South African cohort, significantly outperforming traditional methods ranging from 81.9% to 84%. Furthermore, Küchler et al. [17] successfully applied logistic regression (LR) to mandibular and dental variables in a Brazilian population, reaching 84% accuracy, while Şenol et al. [18] attained 88% accuracy using random forest (RF) and Naïve Bayes (NB) models on the mandibular lingula in a Turkish sample. Of particular relevance to the current study, Monum et al. [15] utilized post-mortem computed tomography (PMCT) to analyze the first and second ribs, confirming that ML-based LR (83.6%) yielded higher precision than traditional statistical techniques (79.1%) in a Japanese population.
Wiredu et al. [10] utilized a Ghanaian cohort of known age, sex, and ancestry to investigate the sexual dimorphism of the fourth rib’s sternal end through stepwise discriminant function analysis. While the generated functions demonstrated high reliability for Black African populations, the application of models previously established for White American populations led to significant misclassifications, particularly the misidentification of males as females. Such results underscore the critical requirement for population specific sex estimation models. However, to date, no research has explored the efficacy of the first and second ribs for sexing within the Northern Thai population using direct osteometric measurements coupled with ML techniques. Consequently, this study aims to construct a highly accurate sex estimation model for the Northern Thai demographic by applying various ML algorithms, thereby offering a practical diagnostic tool for forensic anthropology in Thailand for cases where primary skeletal markers are missing or compromised.
Materials and Methods
Sample
The research methodology was examined and approved by the Faculty of Medicine’s Research Ethics Committee, Chiang Mai University (FOR-2568-0007). To represent the Northern Thai population, this study used first and second rib samples from the Osteology Research and Training Center, Faculty of Medicine, Chiang Mai University, Chiang Mai, Thailand. There were 200 ribs on the right side (100 males, 100 females) and 177 skeletons on the left side (100 males, 77 females). All individuals were 20 years of age or older and had complete fusion. The specimens were excluded if the first and second ribs were incomplete, damaged (e.g., exhibiting fractures or porosity with obscured measurement boundaries), displayed clearly visible deformities or pathological findings, or originated from cadavers without documented ethnicity information.
Measurements
Fifteen variables for the first rib and fourteen for the second rib were obtained using a digital vernier caliper and a flexible measuring tape (all recorded in millimeters). The specific measurement landmarks and protocols are illustrated in Figs. 1, 2.
Fig. 1.

The measurement of the first rib. SI1, superior-inferior; AP1, anterior-posterior; EE1, exterior edge length; IE1, interior edge length; C1, chord; TLR1, total length of the rib; NMnCCD1, neck minimum cranio-caudal diameter; NTh1, neck thickness; LN1, length of the neck; VD, ventral-dorsal diameter; LTSt, length from tubercle to scalene tubercle; LHSt, length from head to scalene tubercle.
Fig. 2.

The measurement of the second rib. SI2, superior-inferior; AP2, anterior-posterior; EE2, exterior edge length; IE2, interior edge length; C2, chord; TLR2, total length of the rib; NMnCCD2, neck minimum cranio-caudal diameter; NTh2, neck thickness; LN2, length of the neck; LHM, length from head to mid; LMSe, length from mid to sternal end.
Shared variables (measured on both first and second ribs)
Twelve variables were consistently measured across both atypical ribs, including nine linear dimensions and three calculated indices:
1. Superior-inferior (SI): the greatest distance between the upper and lower points of the rib’s sternal end [8].
2. Anterior-posterior (AP): the longest distance between the most anterior and posterior points at the sternal end [8].
3. Exterior edge length (EE): the total outer edge distance from the head to the rib’s end [11].
4. Interior edge length (IE): the total inner edge distance from the head to the rib’s end [11].
5. Chord (C): the distance between the interior edge of the rib’s head to the interior edge of the rib’s sternal end [11].
6. Total length of the rib (TLR): the distance between the exterior edge of the rib’s head to the exterior edge of the rib’s sternal end [13].
7. Neck minimum cranio-caudal diameter (NMnCCD): the minimum diameter on the neck (measured perpendicular to the longitudinal axis of the neck) [13].
8. Neck thickness (NTh): the minimum diameter on the neck [13].
9. Length of the neck (LN): the length between the head and the tubercle in the neck (measured from the lower end of the head to the upper end of the tubercle) [13].
10. Ratio of AP to SI (AP/SI): AP divided by SI.
11. Ratio of IE to EE (IE/EE): IE divided by EE.
12. Ratio of C to TLR (C/TLR): C divided by TLR.
Specific variables for the first rib
Three additional variables unique to the first rib were recorded:
1. Ventral-dorsal diameter (VD): the diameter at 1/3 of the IE [12].
2. Length from tubercle to scalene tubercle (LTSt): the length between the tubercle in the neck and the scalene tubercle (measured from the upper end of the tubercle in the neck to the scalene tubercle) (present study).
3. Length from head to scalene tubercle (LHSt): the length between the head region and the scalene tubercle (measured from the lower tip of the head to the scalene tubercle) (present study).
Specific variables for the second rib
Two additional variables were uniquely defined for the second rib:
1. Length from head to mid (LHM): the length between the head region and the midpoint of the rib (measured from the head to 1/2 of the IE) (present study).
2. Length from mid to sternal end (LMSe): the length between the midpoint of the rib cage and the inner end of the rib (measured from 1/2 of the IE to the inner end of the rib) (present study).
Statistical analysis
To ensure the precision and replicability of osteometric data, inter-observer and intra-observer reliability were rigorously evaluated using the technical error of measurement (TEM), relative TEM (rTEM), and the coefficient of reliability (R). Inter-observer error was assessed through a representative subsample of 20 ribs (10 males and 10 females), independently measured by the primary researcher and a research assistant. Intra-observer reliability was established using a test-retest protocol with a two-week interval between measurements to minimize recall bias. Subsequent statistical analyses were conducted on the full dataset (n=200 for the right side and n=177 for the left side). Paired t-tests were employed to investigate directional asymmetry between the left and right sides, while Independent t-tests were utilized to assess sexual dimorphism across all variables (P<0.05). Finally, descriptive statistics including the mean, standard deviation, and range (maximum and minimum values) were calculated for each variable to provide a comprehensive morphometric profile.
Machine learning model development
Model development was executed using Python (version 3.12; Python), beginning with comprehensive data preprocessing to ensure integrity and identify potential redundancies. Exploratory principal component analysis (PCA) was subsequently performed to elucidate the underlying structural relationships among the morphometric variables.
Feature selection was conducted via recursive feature elimination with cross-validation (RFECV) using a 5-fold approach and a LR estimator. To mitigate potential underfitting where RFECV might select an insufficiently small feature set the minimum number of features was constrained by the number of components required to capture 95% of the variance in the PCA. All data were normalized using StandardScaler to ensure uniform feature scaling.
The preprocessed dataset was partitioned into an 80% training set and a 20% independent holdout test set. Within the training framework, hyperparameter optimization was performed using Optuna, an automated framework designed to search for optimal model parameters through efficient sampling and pruning algorithms, across a 10-fold cross-validation scheme (optimization parameters were detailed in Table 1). Ten distinct classification algorithms were evaluated: LR, support vector machines (SVM), K–nearest neighbors (KNN), NB, decision tree (DT), RF, linear discriminant analysis (LDA), quadratic discriminant analysis (QDA), artificial neural network (ANN), and gradient boosting (GB).
Table 1.
The adjusting details for the hyperparameters of each model
| Model | Hyperparameters | Range for Optuna |
|---|---|---|
| LR | solver C penalty |
{liblinear, lbfgs, saga} [1e-4, 1e2] (log–uniform) {l1, l2} |
| SVM | C kernel gamma degree |
[1e-2, 1e3] (log–uniform) {linear, rbf, poly} {scale, auto} [2, 5] (integer) |
| KNN | n_neighbors weights metric |
[3, 50] (integer) {uniform, distance} {euclidean, manhattan, minkowski} |
| NB | var_smoothing | [1e-10, 1e-3] (log–uniform) |
| DT | criterion max_depth min_samples_split min_samples_leaf |
{gini, entropy} [2, 32] (integer) [2, 20] (integer) [1, 20] (integer) |
| RF | n_estimators max_depth min_samples_split min_samples_leaf criterion |
[50, 500] (integer) [2, 32] (integer) [2, 14] (integer) [1, 14] (integer) {gini, entropy} |
| LDA | solver shrinkage |
{svd, lsqr, eigen} [1e-4, 1.0] (log–uniform) |
| QDA | reg_param | [1e-4, 1.0] (log–uniform) |
| ANN (MLP) | n_layers n_units activation solver alpha learning_rate_init |
[1, 2] (integer) [16, 128] (integer) {relu, tanh} {adam, sgd} [1e-5, 1e-1] (log–uniform) [1e-4, 1e-2] (log–uniform) |
| GB | n_estimators learning_rate max_depth min_samples_split min_samples_leaf subsample |
[50, 500] (integer) [1e-3, 0.3] (log–uniform) [2, 10] (integer) [2, 14] (integer) [1, 14] (integer) [0.5, 1.0] (uniform) |
| Stacking and voting | ||
| 1st rib | base learner meta learner |
NB, GB, ANN QDA |
| 2nd rib | base learner meta learner |
NB, KNN, ANN RF |
| 1st and 2nd rib | base learner meta learner |
GB, QDA RF |
LR, logistic regression; SVM, support vector machine; KNN, K–nearest neighbors; NB, Naïve Bayes; DT, decision tree; RF, random forest; LDA, linear discriminant analysis; QDA, quadratic discriminant analysis; ANN (MLP), artificial neural network (multilayer perceptron); GB, gradient boosting.
Furthermore, ensemble learning techniques, specifically stacking and voting classifiers, were integrated to enhance predictive performance. Final model efficacy was rigorously assessed using standardized metrics, including accuracy, precision, recall, and the F1-score.
Results
Observer agreement
As detailed in Table 2, the R exceeded 0.99 for nearly all variables, demonstrating exceptional consistency across both intra- and inter-observer measurements. Furthermore, the rTEM for inter-observer variation ranged from 0.30% to 1.79%, while intra-observer variation was recorded between 0.10% and 1.11%. These values strictly adhere to the established thresholds in forensic anthropology, remaining below the 2.0% limit for inter-observer error and the 1.5% limit for intra-observer error, thereby confirming the high precision and replicability of the osteometric data [19].
Table 2.
TEM, rTEM, and coefficient of reliability (n=20)
| Inter-observer | Intra-observer | ||||||
|---|---|---|---|---|---|---|---|
| Correlation | TEM | rTEM (%) | Correlation | TEM | rTEM (%) | ||
| First rib | |||||||
| SI1 | 0.9946 | 0.1840 | 1.04 | 0.9994 | 0.0621 | 0.35 | |
| AP1 | 0.9936 | 0.1278 | 1.32 | 0.9953 | 0.1083 | 1.11 | |
| EE1 | 0.9949 | 0.6892 | 0.56 | 0.9984 | 0.3873 | 0.32 | |
| IE1 | 0.9809 | 0.6325 | 0.78 | 0.9953 | 0.3162 | 0.39 | |
| C1 | 0.9934 | 0.2738 | 0.54 | 0.9982 | 0.1421 | 0.28 | |
| TLR1 | 0.9958 | 0.2754 | 0.37 | 0.9987 | 0.1512 | 0.21 | |
| NMnCCD1 | 0.9830 | 0.0758 | 1.69 | 0.9961 | 0.0354 | 0.79 | |
| NTh1 | 0.9947 | 0.1163 | 1.67 | 0.9997 | 0.0292 | 0.42 | |
| LN1 | 0.9874 | 0.2314 | 1.01 | 0.9972 | 0.1086 | 0.47 | |
| VD | 0.9851 | 0.2647 | 1.44 | 0.9989 | 0.0712 | 0.39 | |
| LTSt | 0.9807 | 0.4010 | 1.01 | 0.9943 | 0.2163 | 0.54 | |
| LHSt | 0.9923 | 0.2679 | 0.67 | 0.9918 | 0.2766 | 0.69 | |
| Second rib | |||||||
| SI2 | 0.9834 | 0.1397 | 1.16 | 0.9935 | 0.0897 | 0.75 | |
| AP2 | 0.9913 | 0.1215 | 1.70 | 0.9983 | 0.0533 | 0.74 | |
| EE2 | 0.9976 | 0.6708 | 0.32 | 0.9986 | 0.5000 | 0.24 | |
| IE2 | 0.9966 | 0.6708 | 0.38 | 0.9991 | 0.3536 | 0.20 | |
| C2 | 0.9982 | 0.2666 | 0.30 | 0.9993 | 0.1642 | 0.18 | |
| TLR2 | 0.9994 | 0.1559 | 0.14 | 0.9997 | 0.1043 | 0.10 | |
| NMnCCD2 | 0.9845 | 0.1054 | 1.79 | 0.9974 | 0.0427 | 0.73 | |
| NTh2 | 0.9973 | 0.0542 | 0.99 | 0.9991 | 0.0309 | 0.57 | |
| LN2 | 0.9871 | 0.2684 | 1.11 | 0.9974 | 0.1200 | 0.49 | |
| LHM | 0.9934 | 0.3880 | 0.59 | 0.9982 | 0.2018 | 0.31 | |
| LMSe | 0.9809 | 0.7335 | 0.89 | 0.9883 | 0.5745 | 0.70 | |
rTEM, relative technical error of measurement; TEM, technical error of measurement; SI, superior-inferior; AP, anterior-posterior; EE, exterior edge length; IE, interior edge length; C, chord; TLR, total length of the rib; NMnCCD, neck minimum cranio-caudal diameter; NTh, neck thickness; LN, length of the neck; VD, ventral-dorsal diameter; LTSt, length from tubercle to scalene tubercle; LHSt, length from head to scalene tubercle; LHM, length from head to mid; LMSe, length from mid to sternal end.
Bilateral variation and sexual dimorphism
An assessment of bilateral variation (Tables 3 and 4) revealed that significant differences between the left and right sides were present in only a minimal number of variables. This high degree of bilateral symmetry in both males and females suggests that directional asymmetry is negligible in the first and second ribs, thereby justifying the interchangeable use of either side as a reliable proxy for the other in forensic contexts.
Table 3.
Descriptive statistics of the first rib variables
| First rib | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Features (mm) | Male | Female |
P-value (sex difference) |
||||||||||||
| Right (n=100) | Left (n=100) | P-value (paired t-test) | Right (n=100) | Left (n=77) |
P-value (paired t-test) |
||||||||||
| Min–Max | Mean±SD | Min–Max | Mean±SD | Min–Max | Mean±SD | Min–Max | Mean±SD | Right | Left | ||||||
| SI1 | 13.7–24.9 | 19.1±2.35 | 10.8–25.8 | 18.9±2.56 | 0.132 | 12.3–26.7 | 17.1±2.31 | 10.4–22.3 | 16.8±2.12 | 0.553 | <0.001 | <0.001 | |||
| AP1 | 7.36–13.6 | 10.3±1.40 | 6.27–12.8 | 10.2±1.41 | 0.100 | 4.71–12.6 | 8.99±1.53 | 2.63–12.3 | 8.74±1.73 | 0.253 | <0.001 | <0.001 | |||
| EE1 | 98.0–150 | 125±10.1 | 103–154 | 126±10.1 | 0.055 | 87.0–147 | 116±10.7 | 97.0–139 | 118±9.33 | 0.007 | <0.001 | <0.001 | |||
| IE1 | 68.0–105 | 83.0±6.86 | 71.0–100 | 83.2±6.68 | 0.610 | 60.0–97.0 | 79.1±6.35 | 69.0–95.0 | 79.9±6.16 | 0.148 | <0.001** | <0.001 | |||
| C1 | 43.5–61.8 | 52.6±3.91 | 43.7–64.7 | 52.7±4.38 | 0.616 | 42.8–63.3 | 50.9±4.19 | 44.4–60.5 | 51.3±4.32 | 0.680 | 0.004 | 0.036 | |||
| TLR1 | 66.5–88.7 | 77.3±4.66 | 65.4–90.7 | 77.2±4.84 | 0.951 | 61.1–87.3 | 73.2±5.25 | 58.5–87.3 | 73.7±5.31 | 0.074 | <0.001 | <0.001 | |||
| NMnCCD1 | 3.60–6.40 | 4.76±0.641 | 3.49–6.31 | 4.73±0.630 | 0.580 | 3.05–5.62 | 4.08±0.587 | 2.30–6.07 | 3.96±0.648 | 0.061 | <0.001** | <0.001 | |||
| NTh1 | 3.91–10.2 | 6.85±1.47 | 3.28–9.70 | 7.37±1.30 | <0.001 | 1.82–9.72 | 5.93±1.30 | 3.71–10.2 | 6.64±1.29 | <0.001 | <0.001 | <0.001 | |||
| LN1 | 17.7–28.1 | 22.6±2.11 | 16.8–27.7 | 22.6±2.25 | 0.982 | 12.6–26.5 | 21.2±2.28 | 15.2–25.0 | 20.7±2.06 | 0.028 | <0.001 | <0.001 | |||
| VD | 13.3–29.4 | 19.1±2.64 | 12.5–26.6 | 19.0±2.59 | 0.470 | 10.6–24.8 | 17.2±2.25 | 12.8–21.8 | 17.1±1.87 | 0.984 | <0.001 | <0.001 | |||
| LTSt | 32.0–47.3 | 40.0±3.17 | 31.3–48.3 | 40.5±3.55 | 0.091 | 32.4–46.5 | 39.3±2.96 | 34.5–47.6 | 40.1±3.24 | 0.014 | 0.112 | 0.416** | |||
| LHSt | 34.3–49.3 | 41.7±3.41 | 34.5–53.3 | 41.7±3.35 | 0.925 | 32.1–48.3 | 38.9±3.10 | 31.8–45.8 | 39.6±3.17 | 0.038 | <0.001 | <0.001 | |||
| AP/SI1 | 0.350–0.780 | 0.548±0.0917 | 0.300–0.770 | 0.546±0.0919 | 0.777 | 0.290–0.790 | 0.532±0.105 | 0.250–0.900 | 0.525±0.119 | 0.107 | 0.256 | 0.140** | |||
| IE/EE1 | 0.590–0.840 | 0.667±0.0373 | 0.540–0.810 | 0.663±0.0403 | 0.204 | 0.600–0.790 | 0.681±0.0352 | 0.620–0.780 | 0.679±0.0330 | 0.523* | 0.004** | 0.001** | |||
| C/TLR1 | 0.600–0.760 | 0.680±0.0352 | 0.560–0.780 | 0.683±0.0406 | 0.301* | 0.570–0.790 | 0.696±0.0375 | 0.610–0.820 | 0.696±0.0384 | 0.214* | 0.003** | 0.060** | |||
Min, minimum; Max, maximum; SI, superior-inferior; AP, anterior-posterior; EE, exterior edge length; IE, interior edge length; C, chord; TLR, total length of the rib; NMnCCD, neck minimum cranio-caudal diameter; NTh, neck thickness; LN, length of the neck; VD, ventral-dorsal diameter; LTSt, length from tubercle to scalene tubercle; LHSt, length from head to scalene tubercle; AP/SI, ratio of AP to SI; IE/EE, ratio of IE to EE; C/TLR, ratio of C to TLR. *Wilcoxon W test. **Mann–Whitney U test.
Table 4.
Descriptive statistics of the second rib variables
| Second rib | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Features (mm) | Male | Female | P-value(sex difference) | ||||||||||||
| Right (n=100) | Left (n=100) | P-value (paired t-test) | Right (n=100) | Left (n=77) |
P-value (paired t-test) |
||||||||||
| Min–Max | Mean±SD | Min–Max | Mean±SD | Min–Max | Mean±SD | Min–Max | Mean±SD | Right | Left | ||||||
| SI2 | 9.09–18.3 | 13.1±1.54 | 9.35–16.6 | 13.2±1.48 | 0.826 | 8.68–14.3 | 11.4±1.17 | 7.88–14.2 | 11.3±1.11 | 0.444 | <0.001** | <0.001 | |||
| AP2 | 5.10–12.5 | 7.90±1.24 | 4.42–10.3 | 7.73±1.10 | 0.059 | 3.77–9.43 | 6.43±1.06 | 3.53–8.85 | 6.35±1.12 | 0.925* | <0.001 | <0.001 | |||
| EE2 | 164–250 | 212±17.4 | 176–258 | 215±17.3 | <0.001* | 154–231 | 198±14.3 | 154–230 | 200±14.0 | 0.006* | <0.001 | <0.001 | |||
| IE2 | 142–214 | 177±15.1 | 139–224 | 177±16.3 | 0.261* | 122–202 | 167±14.2 | 128–198 | 168±13.2 | 0.410 | <0.001 | <0.001 | |||
| C2 | 74.3–113 | 92.1±8.02 | 77.1–113 | 93.4±8.10 | 0.010 | 67.7–114 | 89.5±7.99 | 63.6–117 | 90.9±9.15 | 0.088* | 0.019 | 0.030** | |||
| TLR2 | 92.4–134 | 113±8.05 | 94.7–136 | 114±8.58 | 0.003* | 82.3–131 | 108±8.42 | 80.2–136 | 109±9.81 | 0.046* | <0.001 | <0.001 | |||
| NMnCCD2 | 4.65–8.10 | 6.25±0.783 | 4.85–8.90 | 6.35±0.882 | 0.085 | 3.85–7.35 | 5.36±0.749 | 4.22–6.94 | 5.44±0.671 | 0.044* | <0.001 | <0.001 | |||
| NTh2 | 3.58–7.77 | 5.76±0.962 | 3.35–8.14 | 5.81±0.969 | 0.496 | 2.80–7.50 | 5.02±0.869 | 3.14–7.53 | 5.08±0.850 | 0.022 | <0.001 | <0.001 | |||
| LN2 | 19.4–30.7 | 25.2±2.09 | 21.2–29.7 | 25.3±1.98 | 0.195 | 18.3–26.6 | 22.3±1.81 | 18.7–26.8 | 22.6±1.63 | <0.001 | <0.001 | <0.001 | |||
| LHM | 54.6–82.3 | 67.6±5.90 | 55.1–83.8 | 67.9±6.11 | 0.266 | 47.6–75.4 | 63.5±5.80 | 45.5–77.3 | 64.3±5.41 | 0.011 | <0.001 | <0.001 | |||
| LMSe | 68.7–103 | 83.5±7.55 | 66.7–106 | 83.7±7.65 | 0.147* | 49.8–92.6 | 79.1±7.06 | 62.1–92.7 | 80.0±5.95 | 0.069* | <0.001 | <0.001 | |||
| AP/SI2 | 0.400–0.820 | 0.605±0.0883 | 0.410–0.860 | 0.591±0.0858 | 0.019* | 0.340–0.860 | 0.569±0.0972 | 0.320–0.820 | 0.564±0.0978 | 0.992 | 0.006** | 0.082** | |||
| IE/EE2 | 0.740–0.920 | 0.831±0.0237 | 0.750–0.890 | 0.824±0.0254 | 0.008* | 0.760–0.890 | 0.843±0.0220 | 0.790–0.890 | 0.840±0.0204 | 0.043 | <0.001** | <0.001** | |||
| C/TLR2 | 0.760–0.890 | 0.818±0.0222 | 0.770–0.860 | 0.817±0.0193 | 0.979* | 0.780–0.870 | 0.831±0.0186 | 0.740–0.880 | 0.832±0.0218 | 0.591 | <0.001** | <0.001** | |||
Min, minimum; Max, maximum; SI, superior-inferior; AP, anterior-posterior; EE, exterior edge length; IE, interior edge length; C, chord; TLR, total length of the rib; NMnCCD, neck minimum cranio-caudal diameter; NTh, neck thickness; LN, length of the neck; LHM, length from head to mid; LMSe, length from mid to sternal end; AP/SI, ratio of AP to SI; IE/EE, ratio of IE to EE; C/TLR, ratio of C to TLR. *Wilcoxon W test, **Mann–Whitney test.
Furthermore, descriptive statistics (Tables 3 and 4) highlighted a pronounced sexual dimorphism within the sample. Male dimensions consistently exceeded those of females across nearly all variables for both the first and second ribs. Inferential analysis confirmed that these sex-based differences were statistically significant (P<0.05) for the vast majority of measurements, reinforcing the efficacy of these atypical ribs as robust indicators for sex estimation in the Northern Thai population.
Principal component analysis
As illustrated in Fig. 3, the PCA for the first rib identified primary vectors of variation. PC1 was predominantly characterized by high loadings for SI1, EE1, IE1, TLR1, VD, and LHSt, representing the overall size of the first rib. This component aligns with the fundamental principles of sexual dimorphism, where size serves as the primary differentiator between males and females. PC2 captured variables related to arc morphology (C1, IE/EE1, and C/TLR1), describing the degree of curvature or expansion of the rib. Finally, PC3 reflected the morphology of the sternal end (AP1 and AP/SI1), specifically differentiating between various cross-sectional thicknesses at the rib’s terminus. Collectively, nine components were required to explain over 95% of the total variance.
Fig. 3.

(A) Heatmaps showing factor loadings for the first three principal components (PC1, PC2, PC3). PC1 primarily reflects overall rib size, while PC2 and PC3 represent arc morphology and thickness. (B) Cumulative variance explained across datasets. The 95% variance threshold (red dotted line) is reached at 9, 8, and 15 components for the first rib, second rib, and combined models, respectively.
The PCA results for the second rib (Fig. 3) revealed that PC1 was defined by EE2, IE2, C2, TLR2, LHM, and LMSe, indicating general size variation similar to the first rib. Notably, the high and comparable loadings of LHM and LMSe suggest a symmetrical growth pattern across the longitudinal axis of the second rib. PC2 highlighted an inverse relationship between cortical thickness and curvature, where variables representing thickness (AP2 and NTh2) showed positive loadings, while curvature-related variables (IE/EE2 and C/TLR2) displayed negative loadings. This suggests that increased rib thickness is generally associated with a less pronounced curvature. PC3 accounted for the cross-sectional profile of the sternal end (AP/SI2), distinguishing between flattened and rounded morphological variations. Eight components accounted for over 95% of the variance in the second rib dataset.
Variables from both the first (SI1, EE1, IE1, TLR1, VD, LHSt) and second ribs (EE2, IE2, TLR2, LHM, LMSe, C2). This strong clustering indicates a high correlation in skeletal robusticity; individuals with larger first ribs consistently exhibit larger second ribs, reflecting overall body size. Interestingly, PC2 (thickness/shape of the second rib) and PC3 (thickness/shape of the first rib) emerged as independent components. This separation suggests that while size is isometric across both ribs, the specific morphological nuances (thickness and curvature) of each rib are independent of each other and the individual’s overall body size. Approximately 15 components were necessary to explain 95% of the cumulative variance in the combined model.
Feature selection and model performance
The 5-fold RFECV process successfully optimized the feature space, as detailed in Table 5. From the initial 15 variables of the first rib, the algorithm remained 9 for the right side and 10 for the left. For the second rib, 10 and 8 features were selected for the right and left sides, respectively. In the combined rib model (29 initial variables), the feature set was reduced to 25 for the right and 20 for the left. Significantly, all novel morphometric variables introduced in this study, LTSt and LHSt for the first rib, and LHM and LMSe for the second rib were consistently selected across all ML models. This underscores their high discriminatory capacity and vital role in enhancing sex estimation accuracy using atypical ribs.
Table 5.
The selected features for machine learning using 5-fold RFECV
| First rib (15 features) | Second rib (14 features) | First and second rib (29 features) | |||||
|---|---|---|---|---|---|---|---|
| Right (9 features) | Left (10 features) | Right (10 features) | Left (8 features) | Right (25 features) | Left (20 features) | ||
| AP1, EE1, IE1, C1, NMnCCD1, NTh1, VD, LTSt, LHSt | SI1, AP1, EE1, IE1, NMnCCD1, NTh1, LN1, LTSt, LHSt, C/TLR1 | SI2, AP2, IE2, NMnCCD2, NTh2, LN2, LHM, LMSe, IE/EE2, C/TLR2 | SI2, AP2, EE2, NMnCCD2, NTh2, LN2, LHM, LMSe | SI1, AP1, EE1, IE1, NMnCCD1, NTh1, LN1, VD, LTSt , LHSt , IE/EE1, C/TLR1, SI2, AP2, EE2, IE2, C2, TLR2, NMnCCD2, NTh2, LN2, LHM, LMSe, IE/EE2, C/TLR2 | SI1, AP1, EE1, IE1, TLR1, NMnCCD1, NTh1, LTSt, LHSt, IE/EE1, C/TLR1, SI2, AP2, EE2, IE2, C2, LN2, LHM, LMSe, IE/EE2 | ||
SI, superior-inferior; AP, anterior-posterior; EE, exterior edge length; IE, interior edge length; C, chord; TLR, total length of the rib; NMnCCD, neck minimum cranio-caudal diameter; NTh, neck thickness; LN, length of the neck; AP/SI, ratio of AP to SI; IE/EE, ratio of IE to EE; C/TLR, ratio of C to TLR; VD, ventral-dorsal diameter; LTSt, length from tubercle to scalene tubercle; LHSt, length from head to scalene tubercle; LHM, length from head to mid; LMSe, length from mid to sternal end.
The performance of 12 ML algorithms without hyperparameter tunning for sex estimation was evaluated across three scenarios: the first rib, the second rib, and a combination of both ribs (Table 6). For the first rib, the highest accuracy on the right side was achieved by GB (0.819), while LR performed best on the left side with an accuracy of 0.851. For the second rib, LR emerged as the top performer for both the right (0.881) and left (0.880) sides. The most significant results were observed when combining the first and second ribs, where accuracies peaked at 0.900 for LR on the right side and reached a study high of 0.922 for LDA on the left side. Across all tests, the DT and ANN consistently yielded lower performance metrics, with accuracy often falling below 0.800. Additionally, the left-side ribs generally exhibited slightly higher accuracy, precision, and F1-scores compared to their right-side counterparts in most modeling scenarios.
Table 6.
The performance matrices of 12 machine learning algorithms from selected parameters without hyperparameter tuning
| Right | Left | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Accuracy | Precision | Recall | F1-score | Accuracy | Precision | Recall | F1-score | ||
| First rib | |||||||||
| LR | 0.800±0.100 | 0.783±0.123 | 0.791±0.131 | 0.782±0.127 | 0.851±0.068 | 0.867±0.056 | 0.853±0.066 | 0.844±0.068 | |
| SVM | 0.813±0.115 | 0.806±0.124 | 0.808±0.121 | 0.802±0.126 | 0.809±0.096 | 0.819±0.092 | 0.809±0.090 | 0.803±0.097 | |
| KNN | 0.769±0.153 | 0.759±0.161 | 0.761±0.160 | 0.756±0.163 | 0.794±0.113 | 0.812±0.112 | 0.792±0.108 | 0.786±0.111 | |
| NB | 0.763±0.108 | 0.755±0.108 | 0.759±0.110 | 0.749±0.114 | 0.794±0.082 | 0.798±0.074 | 0.804±0.081 | 0.791±0.080 | |
| DT | 0.681±0.110 | 0.687±0.121 | 0.683±0.110 | 0.668±0.114 | 0.702±0.068 | 0.705±0.060 | 0.693±0.068 | 0.683±0.075 | |
| RF | 0.800±0.128 | 0.795±0.140 | 0.793±0.132 | 0.789±0.138 | 0.802±0.097 | 0.806±0.096 | 0.802±0.106 | 0.795±0.104 | |
| LDA | 0.788±0.138 | 0.772±0.159 | 0.781±0.167 | 0.770±0.161 | 0.836±0.072 | 0.849±0.062 | 0.835±0.064 | 0.828±0.072 | |
| QDA | 0.794±0.122 | 0.784±0.139 | 0.797±0.138 | 0.778±0.143 | 0.781±0.080 | 0.795±0.075 | 0.780±0.079 | 0.771±0.079 | |
| ANN (MLP) | 0.738±0.092 | 0.741±0.095 | 0.743±0.106 | 0.725±0.103 | 0.695±0.128 | 0.719±0.177 | 0.669±0.132 | 0.641±0.165 | |
| GB | 0.819±0.106 | 0.815±0.120 | 0.816±0.111 | 0.809±0.119 | 0.773±0.061 | 0.783±0.054 | 0.779±0.065 | 0.767±0.059 | |
| Stacking | 0.806±0.106 | 0.803±0.117 | 0.812±0.116 | 0.797±0.118 | 0.823±0.057 | 0.844±0.049 | 0.829±0.050 | 0.816±0.055 | |
| Voting | 0.800±0.134 | 0.795±0.143 | 0.800±0.138 | 0.792±0.144 | 0.801±0.090 | 0.808±0.083 | 0.804±0.090 | 0.795±0.094 | |
| Second rib | |||||||||
| LR | 0.881±0.071 | 0.880±0.071 | 0.881±0.073 | 0.874±0.072 | 0.880±0.056 | 0.875±0.054 | 0.883±0.063 | 0.876±0.057 | |
| SVM | 0.863±0.061 | 0.862±0.072 | 0.862±0.065 | 0.854±0.067 | 0.865±0.075 | 0.864±0.076 | 0.865±0.077 | 0.862±0.077 | |
| KNN | 0.838±0.075 | 0.826±0.109 | 0.818±0.111 | 0.816±0.109 | 0.872±0.054 | 0.868±0.062 | 0.875±0.058 | 0.867±0.060 | |
| NB | 0.831±0.079 | 0.820±0.110 | 0.817±0.111 | 0.812±0.109 | 0.843±0.044 | 0.842±0.045 | 0.853±0.048 | 0.840±0.044 | |
| DT | 0.769±0.056 | 0.771±0.054 | 0.775±0.067 | 0.758±0.055 | 0.801±0.084 | 0.805±0.078 | 0.796±0.083 | 0.791±0.087 | |
| RF | 0.850±0.057 | 0.845±0.066 | 0.843±0.058 | 0.840±0.062 | 0.851±0.068 | 0.849±0.062 | 0.855±0.074 | 0.846±0.069 | |
| LDA | 0.869±0.059 | 0.864±0.064 | 0.869±0.061 | 0.860±0.064 | 0.872±0.043 | 0.868±0.040 | 0.879±0.048 | 0.869±0.042 | |
| QDA | 0.831±0.079 | 0.830±0.089 | 0.833±0.088 | 0.821±0.088 | 0.844±0.095 | 0.845±0.094 | 0.840±0.098 | 0.838±0.098 | |
| ANN (MLP) | 0.719±0.129 | 0.744±0.121 | 0.718±0.113 | 0.690±0.142 | 0.715±0.102 | 0.747±0.010 | 0.739±0.107 | 0.708±0.107 | |
| GB | 0.794±0.069 | 0.790±0.077 | 0.796±0.079 | 0.781±0.078 | 0.851±0.075 | 0.858±0.069 | 0.857±0.083 | 0.844±0.079 | |
| Stacking | 0.825±0.067 | 0.821±0.079 | 0.814±0.076 | 0.810±0.079 | 0.858±0.064 | 0.857±0.063 | 0.865±0.067 | 0.853±0.066 | |
| Voting | 0.838±0.075 | 0.826±0.109 | 0.818±0.111 | 0.816±0.109 | 0.851±0.051 | 0.848±0.051 | 0.859±0.054 | 0.847±0.051 | |
| First and second rib | |||||||||
| LR | 0.900±0.050 | 0.889±0.066 | 0.904±0.058 | 0.892±0.062 | 0.901±0.073 | 0.913±0.068 | 0.898±0.074 | 0.896±0.075 | |
| SVM | 0.869±0.059 | 0.865±0.068 | 0.858±0.075 | 0.856±0.070 | 0.893±0.058 | 0.900±0.062 | 0.890±0.055 | 0.890±0.058 | |
| KNN | 0.838±0.064 | 0.833±0.067 | 0.824±0.071 | 0.822±0.072 | 0.858±0.064 | 0.859±0.064 | 0.864±0.071 | 0.852±0.068 | |
| NB | 0.806±0.071 | 0.798±0.083 | 0.787±0.089 | 0.784±0.093 | 0.830±0.073 | 0.831±0.071 | 0.842±0.080 | 0.827±0.072 | |
| DT | 0.688±0.101 | 0.701±0.096 | 0.704±0.090 | 0.681±0.103 | 0.809±0.083 | 0.809±0.084 | 0.813±0.096 | 0.801±0.093 | |
| RF | 0.856±0.056 | 0.853±0.065 | 0.850±0.070 | 0.844±0.067 | 0.865±0.075 | 0.872±0.075 | 0.865±0.079 | 0.860±0.079 | |
| LDA | 0.881±0.099 | 0.880±0.101 | 0.893±0.090 | 0.876±0.107 | 0.922±0.050 | 0.928±0.052 | 0.920±0.050 | 0.920±0.050 | |
| QDA | 0.769±0.093 | 0.779±0.087 | 0.782±0.088 | 0.761±0.089 | 0.768±0.125 | 0.763±0.132 | 0.760±0.135 | 0.750±0.146 | |
| ANN (MLP) | 0.731±0.074 | 0.749±0.085 | 0.711±0.082 | 0.696±0.087 | 0.780±0.088 | 0.806±0.086 | 0.770±0.072 | 0.766±0.087 | |
| GB | 0.813±0.069 | 0.807±0.075 | 0.818±0.066 | 0.804±0.074 | 0.822±0.092 | 0.826±0.093 | 0.824±0.094 | 0.815±0.094 | |
| Stacking | 0.856±0.074 | 0.857±0.067 | 0.857±0.069 | 0.848±0.074 | 0.865±0.075 | 0.870±0.081 | 0.864±0.082 | 0.860±0.080 | |
| Voting | 0.781±0.070 | 0.786±0.072 | 0.784±0.068 | 0.770±0.067 | 0.859±0.062 | 0.875±0.062 | 0.849±0.070 | 0.850±0.068 | |
Values are presented as mean±SD. LR, logistic regression; SVM, support vector machine; KNN, K–nearest neighbors; NB, Naïve Bayes; DT, decision tree; RF, random forest; LDA, linear discriminant analysis; QDA, quadratic discriminant analysis; ANN (MLP), artificial neural network (multilayer perceptron); GB, gradient boosting.
Following hyperparameter optimization via Optuna, the predictive performance of the ML models across all skeletal categories demonstrated high accuracy and improved stability (Table 7). For the first rib, the highest accuracy on the right side was achieved by the QDA model at 0.813, while the left side reached a peak accuracy of 0.843 using LR. The second rib showed a significant performance increase on the right side, with the ANN/MLP achieving a study-high for single-bone estimation at 0.906 accuracy, whereas the left side peaked at 0.843 with LR. The combined first and second rib models yielded the most superior results, with right-side accuracy peaking at 0.913 (LR) and left side accuracy reaching the overall maximum of 0.922 using LDA. Across these optimized models, F1-scores remained consistently high and closely aligned with accuracy metrics, reflecting balanced classification performance between sexes.
Table 7.
The performance matrices of 12 machine learning algorithms from selected parameters with hyperparameter tuning
| Right | Left | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Accuracy | Precision | Recall | F1-score | Accuracy | Precision | Recall | F1-score | ||
| First rib | |||||||||
| LR | 0.800±0.108 | 0.785±0.129 | 0.791±0.135 | 0.783±0.132 | 0.843±0.071 | 0.858±0.063 | 0.843±0.067 | 0.836±0.071 | |
| SVM | 0.806±0.099 | 0.794±0.106 | 0.802±0.111 | 0.794±0.110 | 0.836±0.085 | 0.845±0.080 | 0.841±0.087 | 0.832±0.089 | |
| KNN | 0.769±0.143 | 0.768±0.151 | 0.769±0.148 | 0.758±0.152 | 0.822±0.125 | 0.832±0.115 | 0.824±0.126 | 0.816±0.129 | |
| NB | 0.763±0.108 | 0.755±0.108 | 0.759±0.110 | 0.749±0.114 | 0.794±0.082 | 0.798±0.074 | 0.804±0.081 | 0.791±0.080 | |
| DT | 0.750±0.128 | 0.761±0.139 | 0.762±0.137 | 0.741±0.137 | 0.752±0.156 | 0.756±0.162 | 0.742±0.156 | 0.741±0.153 | |
| RF | 0.794±0.115 | 0.793±0.127 | 0.791±0.120 | 0.784±0.126 | 0.795±0.091 | 0.803±0.091 | 0.797±0.103 | 0.786±0.102 | |
| LDA | 0.806±0.117 | 0.792±0.139 | 0.794±0.141 | 0.790±0.141 | 0.836±0.065 | 0.850±0.050 | 0.841±0.061 | 0.830±0.064 | |
| QDA | 0.813±0.108 | 0.810±0.119 | 0.816±0.116 | 0.802±0.119 | 0.802±0.082 | 0.813±0.076 | 0.804±0.076 | 0.796±0.079 | |
| ANN (MLP) | 0.781±0.109 | 0.771±0.108 | 0.779±0.115 | 0.769±0.114 | 0.772±0.064 | 0.790±0.064 | 0.785±0.064 | 0.766±0.063 | |
| GB | 0.806±0.149 | 0.804±0.164 | 0.802±0.166 | 0.796±0.167 | 0.823±0.091 | 0.835±0.087 | 0.823±0.095 | 0.816±0.096 | |
| Stacking | 0.775±0.123 | 0.775±0.124 | 0.779±0.119 | 0.767±0.126 | 0.759±0.091 | 0.777±0.090 | 0.761±0.089 | 0.746±0.097 | |
| Voting | 0.800±0.131 | 0.797±0.134 | 0.806±0.134 | 0.793±0.140 | 0.808±0.102 | 0.810±0.098 | 0.815±0.106 | 0.804±0.102 | |
| Second rib | |||||||||
| LR | 0.875±0.069 | 0.867±0.074 | 0.869±0.087 | 0.863±0.080 | 0.843±0.071 | 0.858±0.063 | 0.843±0.067 | 0.836±0.071 | |
| SVM | 0.881±0.065 | 0.877±0.068 | 0.874±0.086 | 0.869±0.079 | 0.836±0.085 | 0.845±0.080 | 0.841±0.087 | 0.832±0.089 | |
| KNN | 0.863±0.073 | 0.854±0.091 | 0.850±0.090 | 0.848±0.089 | 0.822±0.125 | 0.832±0.115 | 0.824±0.126 | 0.816±0.129 | |
| NB | 0.831±0.079 | 0.820±0.110 | 0.817±0.111 | 0.812±0.109 | 0.794±0.082 | 0.798±0.074 | 0.804±0.081 | 0.791±0.080 | |
| DT | 0.775±0.057 | 0.776±0.048 | 0.777±0.061 | 0.763±0.052 | 0.752±0.156 | 0.756±0.162 | 0.742±0.156 | 0.741±0.153 | |
| RF | 0.819±0.076 | 0.814±0.087 | 0.809±0.081 | 0.804±0.085 | 0.795±0.091 | 0.803±0.091 | 0.797±0.103 | 0.786±0.102 | |
| LDA | 0.894±0.049 | 0.889±0.050 | 0.896±0.054 | 0.887±0.052 | 0.836±0.065 | 0.850±0.050 | 0.841±0.061 | 0.830±0.064 | |
| QDA | 0.888±0.038 | 0.885±0.041 | 0.896±0.039 | 0.882±0.038 | 0.802±0.082 | 0.813±0.076 | 0.804±0.076 | 0.796±0.079 | |
| ANN (MLP) | 0.906±0.064 | 0.908±0.064 | 0.904±0.064 | 0.900±0.067 | 0.772±0.064 | 0.790±0.064 | 0.785±0.064 | 0.766±0.063 | |
| GB | 0.825±0.055 | 0.823±0.053 | 0.825±0.057 | 0.814±0.058 | 0.823±0.091 | 0.835±0.087 | 0.823±0.095 | 0.816±0.096 | |
| Stacking | 0.881±0.071 | 0.884±0.063 | 0.880±0.072 | 0.873±0.074 | 0.759±0.091 | 0.777±0.090 | 0.761±0.089 | 0.746±0.097 | |
| Voting | 0.844±0.085 | 0.833±0.116 | 0.826±0.117 | 0.823±0.116 | 0.808±0.102 | 0.810±0.098 | 0.815±0.106 | 0.804±0.102 | |
| First and second rib | |||||||||
| LR | 0.913±0.050 | 0.904±0.068 | 0.914±0.058 | 0.905±0.063 | 0.893±0.066 | 0.897±0.069 | 0.891±0.072 | 0.889±0.071 | |
| SVM | 0.894±0.040 | 0.888±0.048 | 0.889±0.053 | 0.884±0.048 | 0.908±0.056 | 0.919±0.054 | 0.904±0.062 | 0.903±0.059 | |
| KNN | 0.869±0.099 | 0.856±0.128 | 0.853±0.129 | 0.851±0.130 | 0.879±0.056 | 0.880±0.060 | 0.882±0.064 | 0.874±0.061 | |
| NB | 0.806±0.071 | 0.798±0.083 | 0.787±0.089 | 0.784±0.093 | 0.830±0.073 | 0.831±0.071 | 0.842±0.080 | 0.827±0.072 | |
| DT | 0.725±0.132 | 0.731±0.131 | 0.734±0.131 | 0.716±0.136 | 0.865±0.068 | 0.874±0.061 | 0.866±0.077 | 0.860±0.073 | |
| RF | 0.856±0.056 | 0.853±0.063 | 0.849±0.072 | 0.843±0.067 | 0.872±0.077 | 0.881±0.078 | 0.871±0.080 | 0.867±0.081 | |
| LDA | 0.900±0.050 | 0.889±0.064 | 0.906±0.058 | 0.893±0.061 | 0.922±0.050 | 0.928±0.052 | 0.920±0.050 | 0.920±0.050 | |
| QDA | 0.850±0.057 | 0.841±0.078 | 0.842±0.078 | 0.836±0.075 | 0.872±0.070 | 0.872±0.071 | 0.873±0.075 | 0.868±0.073 | |
| ANN (MLP) | 0.875±0.063 | 0.877±0.073 | 0.862±0.076 | 0.862±0.074 | 0.865±0.082 | 0.879±0.071 | 0.869±0.083 | 0.860±0.085 | |
| GB | 0.856±0.056 | 0.851±0.064 | 0.859±0.060 | 0.847±0.064 | 0.858±0.090 | 0.863±0.084 | 0.859±0.091 | 0.853±0.092 | |
| Stacking | 0.863±0.055 | 0.855±0.058 | 0.855±0.074 | 0.849±0.067 | 0.901±0.057 | 0.904±0.060 | 0.901±0.057 | 0.898±0.058 | |
| Voting | 0.869±0.052 | 0.867±0.060 | 0.870±0.056 | 0.860±0.058 | 0.887±0.079 | 0.896±0.078 | 0.886±0.075 | 0.884±0.078 | |
Values are presented as mean±SD. LR, logistic regression; SVM, support vector machine; KNN, K–nearest neighbors; NB, Naïve Bayes; DT, decision tree; RF, random forest; LDA, linear discriminant analysis; QDA, quadratic discriminant analysis; ANN (MLP), artificial neural network (multilayer perceptron); GB, gradient boosting.
The independent hold-out test results, visualized across the four heatmaps in Fig. 4, demonstrate that the right-side atypical ribs generally provide more robust sex classification metrics than the left side. For the first rib, the QDA model achieved a peak hold-out accuracy of 0.850 on the right side, significantly higher than the maximum accuracy of 0.750 observed for the left side across several models like SVM and LDA. In the second rib category, the Stacking ensemble emerged as the top performer on the right side with an accuracy of 0.900, while the left side peaked at 0.833 for LR and GB. When analyzing the combined first and second ribs, the right-side models maintained a peak accuracy of 0.900 (via QDA and stacking), whereas the left-side combined models reached a maximum of 0.833. Across all metrics, precision, recall, and F1-score the models for the right second rib and the combined right-side set consistently displayed values reaching or exceeding 0.900, particularly after Optuna-driven hyperparameter tuning.
Fig. 4.

Classification performance metrics for the independent hold-out dataset. (A) Accuracy, (B) precision, (C) recall, and (D) F1-score. LR, logistic regression; SVM, support vector machine; KNN, K–nearest neighbors; NB, Naïve Bayes; DT, decision tree; RF, random forest; LDA, linear discriminant analysis; QDA, quadratic discriminant analysis; ANN, artificial neural network; GB, gradient boosting.
In summary, independent validation confirms that models derived from either side of the rib cage are effective for sex estimation, though the right ribs demonstrated marginally higher predictive accuracy on unseen data. The systematic application of RFECV and Optuna ensured that nearly all models achieved accuracy rates exceeding 80%. These results indicate that feature selection effectively mitigated data noise and overfitting, while hyperparameter tuning improved model stability, collectively providing a highly reliable and practical framework for forensic anthropology.
Discussion
This study demonstrates that the first and second ribs in the Northern Thai population exhibit pronounced sexual dimorphism, with negligible bilateral variation between the left and right sides. In accordance with established patterns of human skeletal variation, male dimensions were significantly larger than those of females (P<0.05) across nearly all variables. The integration of ML architectures significantly enhanced the efficacy of sex classification. For the first rib, QDA achieved a peak hold-out accuracy of 85% on the right side, surpassing the maximum left-side of 75% (attained by SVM, LDA, and QDA). Regarding the second rib, the stacking ensemble model yielded a maximum hold-out accuracy of 90.0% on the right side, compared to 83.3% on the left (via LR and GB). Furthermore, the combined analysis of the right first and second ribs utilizing QDA and Stacking models achieved a high accuracy of 90.0%, while the combined left-side models reached 83.3% (utilizing LR, SVM, GB, and Stacking). These findings validate the synergy between multi-dimensional rib morphometrics and ML as a robust diagnostic framework for sex estimation in forensic anthropology, particularly in cases involving incomplete or fragmented remains.
Previously, forensic research has prioritized the first rib as a primary indicator for sex estimation, largely due to its pronounced sexual dimorphism linked to body mass and distinct musculoskeletal markers at muscle attachment sites [11-14]. However, our findings reveal that the right second rib, when analyzed through ML, achieves a superior classification accuracy of 90%, significantly outperforming the first rib (85%). Notably, the predictive efficacy of the second rib alone was equivalent to that of the combined rib model (90%), suggesting a high degree of diagnostic efficiency. This superior performance is likely attributed to the novel morphometric parameters introduced in this study: LHM and LMSe. By partitioning the second rib into its posterior and anterior segments, these variables elucidate sex-specific proportional differences in the longitudinal development of the rib arc. Such anatomical nuances provide a more refined capture of sexual dimorphism than traditional linear measurements, identifying the second rib as a robust and standalone forensic marker.
Comparative analysis reveals that the Northern Thai population possesses significantly smaller first and second rib dimensions compared to Western cohorts [11-14]. These reduced metrics likely result from a complex interplay of genetic ancestry, nutritional status, and environmental influences that dictate skeletal robusticity. Interestingly, even when compared to other Asian demographics, such as the Japanese population [15], the Thai sample exhibits slightly smaller average lengths and sizes. This highlights significant intra-continental variability, suggesting that geographic proximity does not guarantee morphometric uniformity. Such pronounced inter-population differences underscore the limitations of applying cross-ancestry models. Implementing sex estimation algorithms derived from Western or even other Asian populations for the Thai demographic may lead to substantial misclassification errors. Consequently, the development of an ancestry-specific model is imperative for ensuring diagnostic accuracy and reliability in Thai forensic contexts.
Previous research studying the first rib often utilized traditional discriminant analysis, which relies on normal distribution assumptions and linear relationships between variables [11-14]. Such statistics may not be suitable when skeletal variables exhibit non-linear relationships. This research therefore applied ML techniques, which do not require rigid parametric assumptions and can learn non-linear relationship patterns, resulting in increased stability and flexibility. Our optimized QDA model for the first rib reached an effective accuracy of 85%, outperforming studies on Japanese and African American populations. Nevertheless, it produced lower accuracy than traditional research for European populations, which often report benchmarks above 90%. This discrepancy is explained by ancestry, as European populations tend to have more significant sex differences, and variable selection, as high-accuracy European studies often concentrate on specific high-dimorphic features like the depth of the arc [11-13].
By applying ensemble stacking with feature selection and Optuna driven hyperparameter tuning (Table 7), this research examined the efficiency of the second rib and achieved an outstanding accuracy of 90%. This finding surpasses earlier bone measurement studies on other populations, including the Japanese and Spanish cohorts [13, 15]. The advantages of ensemble learning in this context include the ability to detect complex, non-linear morphological patterns that are difficult for a linear classifier to resolve. Although combining data from the first and second ribs resulted in higher accuracy in previous Japanese studies [15], the highest accuracy in the Thai population remained equal to that of the second rib alone. This suggests that data from the second rib is sufficient for sex classification in the Thai population, whereas other populations may require combined data to compensate for insufficient single-bone markers.
While the models such as Stacking and QDA provide high predictive power, their ‘black-box’ nature necessitates an investigation into the underlying morphological characteristics driving the results [20]. Using RFECV feature selection, we identified the key variables for sex estimation. Notably, all optimized ML models consistently selected the novel variables developed in this study: LTSt and LHSt for the first rib, and LHM and LMSe for the second rib. By partitioning the ribs into precise anterior and posterior segments, these variables effectively captured sex-specific dimorphism in the longitudinal growth of the rib’s arc. Consequently, the integration of these specific longitudinal and robustness metrics enabled our models to achieve high classification accuracy.
Although all subjects in this study were at least 20 years old with fully fused epiphyses, rib morphology remains dynamic throughout the adult lifespan [21]. Sternal costal cartilage frequently undergoes progressive ossification and calcification as part of the normal aging process [22]. These continuous structural changes can alter skeletal boundaries and objective measurements. Consequently, such skeletal metamorphosis may act as a confounding factor, potentially introducing morphometric bias into sex estimation models.
A critical observation in our hold-out testing was the performance gap between the right and left sides, which can be attributed to modeling approaches and sample size stability. The right rib dataset comprised a perfectly balanced 200 samples (100 males, 100 females). In contrast, the left rib dataset was smaller and imbalanced, containing 177 samples (100 males, 77 females). The right-side models consistently achieved higher accuracy, peaking at 90.0%, whereas the left-side models peaked at 83.3%. This discrepancy is directly attributed to sample size and class imbalance. In ML, training on an imbalanced dataset often introduces algorithmic bias, causing the model to disproportionately favor the majority class (males in this case). This bias inherently decreases the estimation ability and statistical stability of the model on unseen data. Consequently, the class imbalance in the left-side dataset serves as an important limitation of this study, highlighting the necessity of large, perfectly balanced cohorts for training robust forensic models. To fully utilize ML techniques and achieve stable accuracy across all skeletal elements, future sample sizes should be increased to more than 400 samples. Furthermore, the model should be tested with bone collection data from other regions of Thailand, such as the Siriraj Anatomical Anthropology Bone Research Center or the Bone Bank and Research Unit in Khon Kaen, to confirm its practical applicability and representation of the broader Thai population. Such cross-regional validation is critical because population-specific morphological standards have been proven essential for accurate forensic identification in contemporary Thai individuals across various skeletal elements [23, 24].
The next steps of this research will focus on developing software or an application to enhance the practical tool for forensic practitioners and field investigators to conveniently input osteometric measurements from recovered first or second ribs. These variables can be processed rapidly by the core ML models, especially the optimized Stacking ensemble, to produce a highly accurate, predictive sex classification, improving the biological profiling process in highly challenging forensic situations.
Acknowledgements
With respect to achieving medical research, the authors would like to express their appreciation and honor the people and families who kindly shared bodies and skeletal remains with the Faculty of Medicine. In addition, they express thankfulness to the Osteology Research and Training Center (ORTC) and Chiang Mai University’s Faculty of Medicine for their support of this research.
Footnotes
Author Contributions
Conceptualization: NP, TM. Data acquisition: NP. Data analysis or interpretation: NP, TM, SP. Drafting of the manuscript: NP, TM. Critical revision of the manuscript: TM, SP, PM. Approval of the final version of the manuscript: all authors.
Conflicts of Interest
No potential conflict of interest relevant to this article was reported.
Funding
None.
References
- 1.Komar D, Buikstra JE. Forensic anthropology: contemporary theory and practice. Oxford University Press; 2008.
- 2.Blau S, Ubelaker DH. Handbook of forensic anthropology and archaeology. 2nd ed. Routledge Taylor & Francis Group; 2016. 10.4324/9781315528939 [DOI]
- 3.Iscan MY, Steyn M, Krogman WM. The human skeleton in forensic medicine. 3rd ed. Charles C Thomas Publisher, LTD; 2013.
- 4.Christensen AM, Passalacqua NV, Bartelink EJ. Forensic anthropology: current methods and practice. Elsevier Academic Press; 2014. 10.1016/B978-0-12-418671-2.00005-7 [DOI]
- 5.Phenice TW. A newly developed visual method of sexing the os pubis. Am J Phys Anthropol. 1969;30:297–301. doi: 10.1002/ajpa.1330300214. [DOI] [PubMed] [Google Scholar]
- 6.Spradley MK, Jantz RL. Sex estimation in forensic anthropology: skull versus postcranial elements. J Forensic Sci. 2011;56:289–96. doi: 10.1111/j.1556-4029.2010.01635.x. [DOI] [PubMed] [Google Scholar]
- 7.Dirkmaat D. A companion to forensic anthropology. Wiley-Blackwell; 2012. 10.1002/9781118255377 [DOI]
- 8.Işcan MY. Osteometric analysis of sexual dimorphism in the sternal end of the rib. J Forensic Sci. 1985;30:1090–9. doi: 10.1520/JFS11050J. [DOI] [PubMed] [Google Scholar]
- 9.White TD, Folkens PA. The human bone manual. Elsevier Academic Press; 2005.
- 10.Wiredu EK, Kumoji R, Seshadri R, Biritwum RB. Osteometric analysis of sexual dimorphism in the sternal end of the rib in a West African population. J Forensic Sci. 1999;44:921–5. doi: 10.1520/JFS12017J. [DOI] [PubMed] [Google Scholar]
- 11.Kubicka AM, Piontek J. Sex estimation from measurements of the first rib in a contemporary Polish population. Int J Legal Med. 2016;130:265–72. doi: 10.1007/s00414-015-1247-6. [DOI] [PubMed] [Google Scholar]
- 12.Lynch JJ, Cross P, Heaton V. Sexual dimorphism of the first rib: a comparative approach using metric and geometric morphometric analyses. J Forensic Sci. 2017;62:1251–8. doi: 10.1111/1556-4029.13421. [DOI] [PubMed] [Google Scholar]
- 13.Partido Navadijo M, Fombuena Zapata I, Borja Miranda EA, Alemán Aguilera I. Discriminant functions for sex estimation using the rib necks in a Spanish population. Int J Legal Med. 2021;135:1055–65. doi: 10.1007/s00414-021-02537-8. [DOI] [PubMed] [Google Scholar]
- 14.Arlegi M, García-Sagastibelza A, Veschambre-Couture C, Gómez-Olivencia A. Sexual dimorphism in the first rib of Homo sapiens. J Anat. 2022;240:959–71. doi: 10.1111/joa.13594. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 15.Monum T, Makino Y, Yajima D, Inoguchi G, Chiba F, Torimitsu S, Yoshida M, Palee P, Hoshioka Y, Saito N, Iwase H. Sex estimation from the first and second ribs using 3D postmortem CT images in a Japanese population: a comparison of discriminant analysis and machine learning techniques. Forensic Sci Int Rep. 2024;10:100386. doi: 10.1016/j.fsir.2024.100386. [DOI] [Google Scholar]
- 16.Bidmos MA, Olateju OI, Latiff S, Rahman T, Chowdhury MEH. Machine learning and discriminant function analysis in the formulation of generic models for sex prediction using patella measurements. Int J Legal Med. 2023;137:471–85. doi: 10.1007/s00414-022-02899-7. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 17.Küchler EC, Kirschneck C, Marañón-Vásquez GA, Schroder ÂGD, Baratto-Filho F, Romano FL, Stuani MBS, Matsumoto MAN, de Araujo CM. Mandibular and dental measurements for sex determination using machine learning. Sci Rep. 2024;14:9587. doi: 10.1038/s41598-024-59556-9. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 18.Şenol D, Bodur F, Seçgin Y, Şencan D, Duman ŞB, Öner Z. Gender estimation from morphometric measurements of mandibular lingula by using machine learning algorithms and artificial neural networks. Niger J Clin Pract. 2024;27:732–8. doi: 10.4103/njcp.njcp_787_23. [DOI] [PubMed] [Google Scholar]
- 19.Perini TA, Oliveira GLD, Ornellas JDS, Oliveira FPD. Technical error of measurement in anthropometry. Rev Bras Med Esporte. 2005;11:81–5. doi: 10.1590/S1517-86922005000100009. [DOI] [Google Scholar]
- 20.Diac MM, Toma GM, Damian SI, Fotache M, Romanov N, Tabian D, Sechel G, Scripcaru A, Hancianu M, Iliescu DB. Machine learning models for prediction of sex based on lumbar vertebral morphometry. Diagnostics (Basel) 2023;13:3630. doi: 10.3390/diagnostics13243630. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 21.Işcan MY, Loth SR, Wright RK. Metamorphosis at the sternal rib end: a new method to estimate age at death in white males. Am J Phys Anthropol. 1984;65:147–56. doi: 10.1002/ajpa.1330650206. [DOI] [PubMed] [Google Scholar]
- 22.Monum T, Makino Y, Prasitwattanaseree S, Yajima D, Chiba F, Torimitsu S, Hoshioka Y, Yoshida M, Urabe S, Oya Y, Iwase H. Age estimation from ossification of sternum and true ribs using 3D post-mortem CT images in a Japanese population. Leg Med (Tokyo) 2020;43:101663. doi: 10.1016/j.legalmed.2019.101663. [DOI] [PubMed] [Google Scholar]
- 23.Jongmuenwai W, Boonpim M, Monum T, Sintubua A, Prasitwattanaseree S, Mahakkanukrauh P. Sex estimation using radius in a Thai population. Anat Cell Biol. 2021;54:321–31. doi: 10.5115/acb.20.319. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 24.Duangto P, Mahakkanukrauh P. Sex estimation from upper limb bones in a Thai population. Anat Cell Biol. 2020;53:36–43. doi: 10.5115/acb.19.179. [DOI] [PMC free article] [PubMed] [Google Scholar]
