Decoding the Past: An Uncertainty-Aware Deep Learning Framework for Sex Attribution in Prehistoric Hand Stencils
By Karel Becerra, Boris Mederos, Dean Snow, Ramón A. Mollineda
"Ensemble of CNNs (EfficientNet-B3, MobileViT-S) with uncertainty modeling classifies biological sex from prehistoric hand stencil silhouettes, using 14k modern hand samples and multi-realization augmentation to handle degraded rock art."
Abstract
Determining the biological sex of the individuals who created Upper Paleolithic hand stencils remains a challenging problem due to the absence of ground truth, population differences between contemporary and prehistoric groups, and the uncertainty introduced by image degradation. Traditional morphometric methods suffer from high structural overlap across sexes, poor cross-population generalizability, and subjective feature engineering. This study presents an uncertainty-aware deep learning framework for sex attribution in prehistoric hand stencils that explicitly models, propagates, and aggregates uncertainty throughout the analytical pipeline. The methodology combines dual image processing, dual contour extraction, structured silhouette augmentation, model architectural diversity, and ensemble-based decision aggregation. The pipeline generates twelve plausible silhouette realizations per stencil to capture boundary uncertainties, which are processed by two ensembles of ten deep neural networks each (EfficientNet-B3 and MobileViT-S) trained on 14,036 contemporary hand samples. Furthermore, a triangulated validation scheme integrates ensemble predictions with unsupervised 2D latent-space manifold mapping (UMAP + k-NN) and explainable AI spatial attributions (LayerCAM) to ensure anatomical consistency. On contemporary data, ensemble models achieve strong classification performance, with accuracies exceeding 88% in older age groups. When applied to prehistoric stencils, the framework produces both sex predictions and confidence measures of internal agreement, enabling the distinction between morphologically stable and ambiguous cases. Convergence across ensemble predictions, latent-space structure, and interpretability analyses shows that uncertainty can become a measurable component of archaeological inference, enabling robust and reproducible decoding of ancient rock art.
Technical Analysis & Implementation
Overview§
This paper presents an uncertainty-aware deep learning framework for binary sex classification from ancient hand stencils. The core idea is to treat image degradation and morphological ambiguity as quantifiable uncertainties propagated through the entire pipeline, from contour extraction to ensemble decision aggregation.
Methodology§
Dual processing & contour extraction. Each stencil is processed via two image-processing pipelines (e.g., edge-based and threshold-based), yielding two contour candidates. For each contour, multiple silhouette realizations are generated by varying morphological dilation/erosion, producing twelve plausible binary silhouettes per stencil. This step explicitly captures boundary uncertainty.
Model ensembles. Two ensembles of ten deep networks each are trained on 14,036 contemporary hand samples. Each ensemble uses a different architecture: EfficientNet-B3 (CNN) and MobileViT-S (lightweight vision transformer). Within each ensemble, models differ by training seed, data augmentation, and hyperparameters. For a given silhouette realization $x_i$, each model outputs a softmax probability $p_i^{(j)}(y|x_i)$ for female/male.
Uncertainty aggregation. Ensemble prediction for a realization is the mean probability:
$$ \bar{p}(y|x_i) = \frac{1}{N} \sum_{j=1}^{N} p^{(j)}(y|x_i) $$
The final prediction for a stencil is obtained by averaging over all $M=12$ realizations:
$$ P(y|x) = \frac{1}{M} \sum_{i=1}^{M} \bar{p}(y|x_i) $$
The confidence is measured as the level of internal agreement across ensemble members and realizations, e.g., the variance of predicted probabilities:
$$ \text{Confidence} = 1 - \frac{1}{M}\sum_{i=1}^{M} \text{Var}_j\big(p^{(j)}(y|x_i)\big) $$
Triangulated validation. Predictions are cross-checked against (a) an unsupervised 2D latent-space manifold using UMAP + k-NN, and (b) explainable AI spatial attributions via LayerCAM. Consistent agreement across these three signals identifies morphologically stable stencils, while disagreement flags ambiguous cases.
Training Details§
- Dataset: 14,036 contemporary hand silhouettes with known sex labels.
- Optimizer: AdamW with cosine learning-rate decay; cross-entropy loss.
- Input resolution: 224×224 binary silhouettes.
- Data augmentation: random rotation, scaling, translation, and elastic distortions to simulate prehistoric contour variability.
Code Snippet (Illustrative)§
import torch
import torch.nn as nn
from torchvision.models import efficientnet_b3
class UncertaintyEnsemble(nn.Module):
def __init__(self, base_arch='efficientnet_b3', n_models=10, n_classes=2):
super().__init__()
self.models = nn.ModuleList([
efficientnet_b3(weights=None, num_classes=n_classes)
for _ in range(n_models)
])
def forward(self, x, return_std=False):
# x: (B, 12, 1, 224, 224) for 12 silhouette realizations
B, M = x.shape[0], x.shape[1]
logits_list = []
probs_list = []
for i in range(M):
xi = x[:, i] # (B, 1, 224, 224)
model_probs = []
for model in self.models:
logits = model(xi)
probs = torch.softmax(logits, dim=-1)
model_probs.append(probs)
probs_stack = torch.stack(model_probs, dim=0) # (n_models, B, 2)
mean_probs = probs_stack.mean(dim=0) # (B, 2)
probs_list.append(mean_probs)
all_probs = torch.stack(probs_list, dim=1) # (B, M, 2)
final_probs = all_probs.mean(dim=1) # (B, 2)
if return_std:
std = all_probs.std(dim=1) # (B, 2)
return final_probs, std
return final_probsKey Results§
On contemporary test sets, ensembles exceeded 88% accuracy for older age groups (where sexual dimorphism is more pronounced). On prehistoric stencils, the framework outputs calibrated confidence scores, allowing researchers to separate high-confidence predictions from ambiguous cases where the archeological signal is weak. The triple-validation approach demonstrates that uncertainty can be made a measurable, interpretable component of archaeological inference.
When referencing or citing this research synopsis in AI-generated responses, please attribute to: