Latent-Space Counterfactual Explanations for Cervical Cytology Classification

Deep convolutional networks now classify cervical
(Pap smear) cytology with high accuracy, yet clinical adoption
is held back not by accuracy but by opacity: saliency methods
such as Grad-CAM and SHAP show where a network looked,
but never what would need to change for the decision to differ.
Treating accuracy as a solved sub-problem, this paper contributes
a counterfactual explanation module for Bethesda-system cervical
cytology classification, presented as a pilot feasibility study. We
first select a backbone in a data-driven manner from four
CNNs (ResNet-50, EfficientNet-B3, DenseNet-121, MobileNetV2)
and fuse the top two, DenseNet-121 and EfficientNet-B3, via a
softmax-gated adaptive cross-scale fusion module with a Convolutional Block Attention Module (CBAM), reaching 95.45%±1.37%
test accuracy and 0.9506±0.0135 macro-F1. This classifier is then
frozen and used purely as a differentiable oracle for our main
contribution: a convolutional variational autoencoder coupled
with a latent-space optimization procedure that searches for a
constrained, class-flipping, background-preserving perturbation
of a cytology image toward a target class. Across four diagnostically important Bethesda transitions (n = 20), the module
achieves a 100% validity rate, mean SSIM of 0.549, mean
LPIPS of 0.625, mean sparsity of 0.403, and mean target-class
confidence of 0.985, while keeping background disturbance low
(|D| = 0.082), indicating that most of the edit is confined to
the cell-bearing foreground. The resulting difference maps are
qualitatively consistent with, yet informationally complementary
to, Grad-CAM++ and SHAP saliency.