Mammography screening reduces breast cancer mortality by approximately 40%, but the manual analysis of mammograms is time-consuming and burdens a limited specialist workforce. About 15 in every 1,000 women screened are referred for biopsy, yet 10-13 of those biopsies show no malignancy - highlighting the persistent problem of false positives in current screening practice.
Convolutional neural networks improved computer-aided detection but remain limited by their local receptive fields. They cannot efficiently capture long-range spatial dependencies across the full mammogram, making it harder to detect diffuse architectural distortions or subtle asymmetries that span large image regions.
Radiologists routinely compare current and prior mammograms to identify subtle changes over time - tumor growth, new calcifications, emerging asymmetries. Deep learning models trained only on current images cannot replicate this temporal reasoning, which is a key diagnostic advantage of experienced clinicians.
This paper introduces a CNN-Transformer hybrid model that processes pairs of current and prior mammograms simultaneously, mimicking how radiologists detect change over time. The model integrates positional encoding, multi-head self-attention, channel attention, and focal loss to achieve superior classification performance.
The proposed model uses a shared-weight modified ResNet50 to extract features independently from both the current and prior mammogram images. Sharing weights ensures the model learns a consistent feature representation for both time points, which is essential for meaningful comparison.
After feature extraction, the prior and current feature vectors are concatenated and enriched with positional encoding (PE) to incorporate spatial location information. This combined feature sequence is then processed through two Transformer Encoder (TE) blocks, which use multi-head self-attention to dynamically weigh relationships between image regions across both time points.
A novel position-wise feed-forward network (FFN) within each transformer block processes features on a position-by-position basis, enabling the model to detect subtle spatial changes that standard FFNs might miss. Residual connections and layer normalization stabilize training throughout the deep architecture.
A channel attention (CA) block then highlights the most diagnostically relevant feature channels while suppressing less informative ones. A global pooling step compresses spatial dimensions into a channel descriptor, and sigmoid gating selectively amplifies features that indicate cancerous tissue before the final fully connected classification layer.
The model's ResNet50 backbone was pretrained on a composite dataset of four public mammography sources: DDSM, CMMD, BCS-DBT, and VinDr-Mammo, totaling over 14,500 cancer cases. This domain-specific pretraining adapted the backbone to the unique characteristics of mammographic imaging before fine-tuning.
For evaluation, a private UCHC dataset of 1,442 paired mammograms from 381 patients was used, containing paired prior and current images for each patient. Cancer cases (627 pairs) were biopsy-confirmed BI-RADS 4-5; normal cases (815 pairs) were BI-RADS 1-2 with no abnormalities. All four standard mammographic views (LCC, RCC, LMLO, RMLO) were included for both time points.
Preprocessing included breast region segmentation, CLAHE contrast enhancement, median filtering, and unsharp masking to improve the visibility of microcalcifications and masses while reducing noise. Images were standardized to 1024x1024 pixels for model input.
A composite focal loss function combined focal loss (to prioritize hard-to-classify samples), L1 regularization, and squared L2 regularization. Focal loss reduces the weight of easy correct predictions, forcing the model to focus learning on the challenging borderline cases that are most important for clinical accuracy.
The proposed model achieved an accuracy of 90.80%, sensitivity of 90.80%, specificity of 90.88%, F1-score of 90.95%, and AUC of 92.58% on the UCHC dataset - outperforming all eight baseline models across every metric. Models using only current images (ResNet50 and Sarker et al.) achieved maximum AUC of 86.11%, confirming the value of temporal comparison.
Among prior-and-current models, the strongest baselines were Xia et al. (AUC 90.26%) and Lee et al. Prime+ (AUC 89.94%). The proposed model improved AUC by more than 2 percentage points over the best prior-and-current baseline, a clinically meaningful gain given the high volume of breast cancer screening examinations performed annually.
Error rate analysis showed the proposed model had the lowest false discovery rate (FDR) and false negative rate (FNR) across all three abnormality types: masses (FDR 0.14, FNR 0.09), calcifications (FDR 0.20, FNR 0.08), and architectural distortions (FDR 0.48, FNR 0.22). Architectural distortions remain the most challenging category due to their subtle, diffuse appearance.
Ablation studies confirmed that two transformer encoder layers provide the optimal balance, with one layer yielding 87.91% accuracy and three or more layers showing no further improvement or slight decline due to overfitting. Focal loss outperformed standard cross-entropy loss by 0.82 percentage points.
Grad-CAM heatmaps were applied to both prior and current mammogram images to visualize which regions most strongly influenced the model's classification decisions. Cancer cases showed distinct high-activation (red) zones corresponding to radiologist-annotated cancerous regions, while normal cases showed no activated zones - confirming the model focuses on clinically relevant areas.
By comparing heatmaps from prior and current mammograms simultaneously, the model demonstrates an ability to track spatial changes over time - mirroring the radiologist's workflow of comparing sequential exams. This temporal interpretability increases clinical trust and helps identify when and where subtle lesion progression occurred.
The model's ability to minimize false negatives - missed cancers - is particularly important in a screening context. Every missed cancer represents a delayed diagnosis and potentially worse patient outcome. The model's FNR of 0.09 for masses and 0.08 for calcifications represents a significant improvement over single-image and simpler dual-image baselines.
Integrating temporal mammogram comparison through a CNN-Transformer hybrid with positional encoding, channel attention, and focal loss achieves substantially better accuracy than single-image or simpler dual-image approaches, validating the value of mimicking the radiologist's change-detection workflow in AI systems.
The model's consistent performance across masses, calcifications, and architectural distortions suggests broad applicability across mammographic abnormality types. Architectural distortions remain the most difficult category, reflecting the genuine challenge these subtle patterns pose even for experienced radiologists.
Future work should focus on external validation on independent datasets from diverse clinical settings, expanding the private UCHC dataset to improve generalizability, and investigating the model's performance on 3D digital breast tomosynthesis (DBT) data, where temporal comparison is even more computationally demanding.