Convolutional neural networks (CNNs) achieve state-of-the-art performance in medical image analysis yet remain opaque, limiting adoption in high-stakes clinical settings. Existing approaches face a fundamental trade-off: post-hoc methods provide unfaithful approximate explanations, while inherently interpretable architectures are faithful but often sacrifice predictive performance. We introduce TTE-CAM, a test-time framework that bridges this gap by converting pretrained black-box CNNs into self-explainable models via a convolution-based replacement of their classification head, initialized from the original weights. The resulting model preserves black-box predictive performance while delivering built-in faithful explanations competitive with post-hoc methods, both qualitatively and quantitatively. The code is available at https://github.com/kdjoumessi/Test-Time-Explainability
Figures & tables
Figure 1: Qualitative explanations comparison. The first column shows a DR fundus with clinical annotations (green markers) and a pneumonia CXR with ground-truth bounding boxes (green). Columns 2-6 show post-hoc saliency maps; the last column shows TTE-CAM explanations. CXR scores indicate activation precision. Both samples were randomly selected from their corresponding disease classes.
Metrics
CAM
S. CAM
L. CAM
G. CAM
IG
TTE-CAM
Fundus
Topk Prec. ↑
.33±.29
.28±.22
.31±.26
.39±.28
.39±.28
.33±.28
Topk Sens. ↓
0.629
0.668
0.644
0.629
0.605
0.629
CXR
Acti. Prec. ↑
.12±.09
.13±.10
.12±.09
.13±.10
.12±.09
.12±.09
Topk Sens. ↓
0.953
0.959
0.955
0.953
0.963
0.953
Table 1: Quantitative explanation comparison. ↑ higher is better; ↓ lower is better.