Attn-ChurnNet: A Transformer-Based Sequential Framework for Customer Churn Prediction in Subscription Platforms with Focal Loss Training and Conformal Uncertainty Quantification
Didar Hossain, Mohiuddin Mehedi, Khandakar Rabbi Ahmed, Md Rafiul Mahmud, Mainul Islam Khan, Sakib Salam JameeCustomer churn is a critical challenge for subscription-based digital platforms, as customer activity patterns change dynamically over time. Traditional churn modeling methods fail to account for sequential dependencies across customer interaction histories. This paper presents Attn-ChurnNet, a novel attention-based Transformer architecture that effectively predicts customer churn by modeling sequential customer contact histories. The proposed methodology leverages multi-head self-attention with sinusoidal positional encodings and Pre-LN residual connections to highlight key interaction sequences and interpret the temporal dynamics of customer activity in subscription platforms. Experiments are conducted on the large-scale WSDM–KKBox Customer Churn Prediction dataset using a temporal train/validate/test split, incorporating transaction records, usage logs, and customer demographic information. Comprehensive comparison against established baselines—Logistic Regression (LR), Random Forest (RF), XGBoost, and Gated Recurrent Unit (GRU)—demonstrates that Attn-ChurnNet achieves a macro-averaged classification accuracy of 97.03% (±0.41%), precision of 95% (±0.5%), recall of 96% (±0.6%), F1-score of 95.50% (±0.5%), AUC of 0.98 (±0.004), Average Precision of 0.963, and log-loss of 0.15 (±0.007) under five-fold stratified cross-validation, outperforming all competing approaches with statistical significance (p<0.01, McNemar’s test). A comprehensive two-part ablation study (22 variants), calibration analysis (ECE = 0.031; Ts* = 1.08), attention entropy analysis with Jensen–Shannon divergence and two-sample t-test (t=18.4, p<0.001), Integrated Gradients attribution, conformal prediction (91.4% coverage, 88% singleton efficiency), precision–recall analysis, and computational complexity evaluation further validate the model’s design and production readiness.