A multi-layer feedforward deep neural network built in PyTorch to accurately analyze behavioral telemetry and forecast customer churn rates for SaaS platforms.
For modern SaaS and subscription services, retaining existing customers is significantly cheaper than acquiring new ones. Churn prediction acts as a critical early-warning mechanism: if a model can accurately identify accounts demonstrating early signs of disengagement, retention teams can deploy custom promotions before the user hits "Cancel".
We set out to build a highly specialized deep-learning classification pipeline. Rather than relying on simple linear regressions or standard decision trees, we engineered a deep feedforward network designed to learn non-linear patterns within complex behavioral profiles (e.g. usage decline, frequency drops, payment delays).
Core Challenge (Imbalanced Data): Subscription datasets are heavily skewed—usually 90%+ active users and under 10% churn instances. To prevent the neural network from taking a lazy shortcut (predicting "not churned" 100% of the time), we implemented advanced sampling techniques including **SMOTE** and custom class-weighted loss structures.
The network comprises five distinct dense linear layers, stabilized by modern normalization layers to prevent vanishing gradients:
Below is the structural training configuration written in PyTorch showing our layers, activation rules, and forward propagation logic:
To optimize the weights during backward propagation, we selected the **Adam** optimizer paired with a learning-rate scheduler (ReduceLROnPlateau). Training utilized a binary cross-entropy loss function weighted dynamically to offset class imbalances, monitored in real time using **Weights & Biases** dashboards.
The final model reached a validation accuracy of **91.8%** and an ROC-AUC score of **0.89**, signaling clean, generalized performance capable of being deployed straight to production systems.