CausalShift: A Modular, Plugin-Based Framework for Dataset Shift Handling in Machine Learning
Open Access
- 31 July 2026
- journal article
- research article
- Published by MDPI AG in Applied Sciences
- Vol. 16 (15) , 7604
Abstract
Machine learning models deployed under distribution shift suffer performance degradation whose root cause is rarely diagnosed before adaptation is attempted. Existing frameworks either lack a closed loop from shift diagnosis to method selection, require a fully specified causal graph, or depend on multiple heterogeneous training environments—conditions rarely met in practice. We propose CausalShift, a modular, plugin-based framework for end-to-end dataset shift handling. A universal statistical core remains fully functional without any causal assumption; four optional causal plugins are activated selectively by a four-level knowledge grading system that scales from a fully specified structural causal model (Level A) down to a single observational dataset (Level D). A three-path causal attribution module estimates the relative contributions of covariate and concept shift to the performance gap, and attribution-driven routing maps the diagnosis to an adaptation strategy grounded in minimax optimality. Proof-of-concept experiments on four benchmarks—a synthetic structural causal model (SCM), Colored Modified National Institute of Standards and Technology (MNIST), Benchmarking In-the-Wild Distribution Shifts (WILDS) Camelyon17, and five American Community Survey (ACS) geographic shift tasks—demonstrate that CausalShift reduces the in-distribution to out-of-distribution (ID–OOD) accuracy gap by 19.9 percentage points on the synthetic benchmark and 72.5 percentage points on the spurious correlation benchmark, while remaining competitive on real-world image shift and achieving performance parity with ERM on mild-shift tasks. A tiered causal evaluation suite, including Λ*-robustness bounds and distribution-induced shift decomposition of error (DISDE), reveals robustness differences that scalar accuracy metrics cannot detect.Keywords
This publication has 36 references indexed in Scilit:
- Software architecture description in original software publicationsSoftware Impacts, 2025
- Generalized Out-of-Distribution Detection: A SurveyInternational Journal of Computer Vision, 2024
- A causal perspective on dataset bias in machine learning for medical imagingNature Machine Intelligence, 2024
- A unified framework for dataset shift diagnosticsInformation Sciences, 2023
- From concept drift to model degradation: An overview on performance-aware drift detectorsKnowledge-Based Systems, 2022
- Implicit data crimes: Machine learning bias arising from misuse of public dataProceedings of the National Academy of Sciences, 2022
- Stable learning establishes some common ground between causal inference and machine learningNature Machine Intelligence, 2022
- Evaluation of domain generalization and adaptation on improving model robustness to temporal dataset shift in clinical medicineScientific Reports, 2022
- Shortcut learning in deep neural networksNature Machine Intelligence, 2020
- Limitations of the Application of Fourfold Table Analysis to Hospital Data.*,†International Journal of Epidemiology, 2014