Introduction
Deep learning models for skin cancer detection have demonstrated impressive performance in controlled settings, yet they remain notoriously susceptible to "shortcut learning." Instead of identifying the clinical characteristics of a melanoma, these models often learn to recognize spurious correlations—artifacts introduced during image acquisition such as rulers, purple ink markers, or dark corners. When these artifacts are correlated with specific labels in training data (e.g., rulers appearing more frequently in malignant cases), the model learns to associate the artifact with the disease, leading to catastrophic failure in real-world clinical environments where such correlations may not hold.
While existing research has focused on debiasing models during the training phase, these methods often struggle to outperform simple baselines or require complex architectural modifications. Furthermore, clinical practitioners require tools that are robust at the level of individual patients and do not necessitate a massive computational overhaul. To address this, we present Test-Time Selection (TTS), a human-in-the-loop method that steers model attention toward clinically relevant features during inference without requiring any retraining.
Methodology: Test-Time Selection (TTS)
TTS is an architecture-agnostic approach that modifies which features a model "listens to" for a specific image. Unlike traditional test-time adaptation methods that update model weights, TTS acts as a smart filter guided by human intuition.
The TTS Pipeline
- Keypoint Annotation: During inference, a human user (e.g., a dermatologist) provides a small number of "positive" keypoints on the lesion and "negative" keypoints on artifacts or the background.
- Feature Ranking: The image is processed through a pretrained feature extractor. TTS analyzes the activation units in the final layer, ranking them based on their affinity to the human-selected keypoints.
- Selective Masking: The method calculates a score for each feature channel. It then "mutes" (sets to zero) the bottom 90% of features—those that align more closely with artifacts or background noise—while preserving the top 10% that align with the lesion.
- Classification: These filtered, sparse features are then passed to the final classifier for the diagnostic prediction.
By forcing the model to rely on a narrow set of highly relevant signals, TTS prevents the "noise" of artifacts from drowning out the actual signal of the lesion.
Experimental Setup and Datasets
The study primarily utilized the ISIC 2019 dataset, a standard benchmark in skin lesion analysis. To rigorously test robustness, the researchers employed "trap sets" where the correlations between artifacts and labels were intentionally flipped between training and testing. For example, if a model learned that "ruler = cancer" during training, it would encounter a test set where rulers only appeared in benign cases.
The authors tested across various bias intensities (from 0 to 1.0) and manually annotated a subset of images with specific artifact locations (dark corners, rulers, ink, and patches) to facilitate the keypoint selection process.
Key Insights
- Frugal Interaction: Previous methods often required full segmentation masks (tracing the entire lesion), which is time-consuming for clinicians. TTS demonstrates that a single pair of dots (one positive, one negative) is often sufficient to effectively steer the model.
- Domain Knowledge as a Filter: The most significant improvements occurred when users provided "artifact-specific" negative keypoints. Specifically pointing at a ruler provides the model with much stronger debiasing information than pointing at generic background skin.
- Inference-Only Flexibility: Because TTS does not change model weights, it can be seamlessly integrated into existing, already-deployed models to enhance real-time robustness.
Results
TTS was compared against state-of-the-art test-time adaptation methods like Tent and T3A:
- Performance Gains: On the most challenging "trap test" (Bias = 1.0), the baseline model achieved an AUC of only 58.4. TTS significantly boosted this to 75.0 AUC.
- Efficiency vs. Accuracy: TTS outperformed NoiseCrop (72.7 AUC) despite using significantly less information (a few keypoints versus a 50,000+ pixel segmentation mask).
- Robustness to Sparsity: Even with only two keypoints (one positive, one negative), TTS achieved 68.2 AUC, a nearly 10-point improvement over the baseline.
- Visual Focus: Attention maps confirm that before TTS, model focus was often scattered across background artifacts. Post-TTS, the focus shifted exclusively to the lesion area.
Limitations and Future Outlook
While TTS offers a powerful way to mitigate bias, it currently relies on human-in-the-loop interaction, which may be a bottleneck in high-volume settings. Additionally, certain artifacts like hair or gel bubbles may be more difficult to isolate with single keypoints than rulers or ink marks.
Future work aims to automate this process by creating a "memory bank" of previously annotated concepts. This would allow the system to recognize and mute known artifacts automatically based on accumulated human feedback, moving toward a fully autonomous, robust diagnostic tool.
Summary updated