Domain-Specific Transfer Learning for Spatiotemporal Thyroid Ultrasound Classification: A Methodology for Mitigating Trivial Convergence in Imbalanced Datasets
Abstract
The interpretation of thyroid ultrasound results is associated with a high degree of inter-observer variability, which drives research into computer-assisted methods for aiding in diagnosis. Deep learning has shown great potential in this field; nevertheless, applying deep learning on imbalanced clinical datasets presents an important problem that has not been given enough attention before.Under asymmetric loss weighting on datasets with a high benign-to-malignant ratio, models trained with standard initialization strategies can collapse to a degenerate all-positive prediction pattern, predicting every patient as malignant and yielding 100% sensitivity with 0% specificity. We term this trivial convergence, and a primary contribution of this paper is its explicit characterization under realistic experimental conditions. To address this failure mode, we propose a two-stage domain-specific transfer learning framework in which a ResNet-18 backbone is pretrained on the TN5000 thyroid ultrasound corpus (\~{}5,000 images), frozen, and used as a fixed feature extractor for a lightweight MLP classifier trained on Stanford AIMI cine ultrasound sequences. Patient-level predictions are obtained by mean-aggregating frame-level probabilities across up to 50 uniformly sampled frames per patient. Evaluation follows a strict patient-level Leave-One-Out Cross-Validation (LOOCV) protocol on all 192 patients (17 malignant, 175 benign). At the default threshold $(\mathrm{t}=0.50)$, both a randomly-initialized and an ImageNet-pretrained baseline exhibit trivial convergence, while the proposed domain-adapted model achieves 75.00% accuracy, AUC 0.891 (LOOCV), 94.12% sensitivity, and 73.14% specificity. At optimized thresholds, the proposed model $(\mathrm{t}=0.80)$ reaches 91.15% accuracy, 88.24% sensitivity, 91.43% specificity, and 50.00% precision - the highest performance across all metrics - demonstrating that domain-specific pretraining provides a representational advantage that persists independently of threshold calibration.