Abstract
Machine learning has achieved remarkable success across diverse domains. Nevertheless, concerns about interpretability in black-box models, especially within Deep Neural Networks (DNNs), have become pronounced in safety-critical fields like healthcare and finance. Classical machine learning (ML) classifiers, known for their higher interpretability, are preferred in these domains. Similar to DNNs, classical ML classifiers can exhibit bugs that could lead to severe consequences in practice. Test input prioritization has emerged as a promising approach to ensure the quality of an ML system, which prioritizes potentially misclassified tests so that such tests can be identified earlier with limited manual labeling costs. However, when applying to classical ML classifiers, existing DNN test prioritization methods are constrained from three perspectives: 1) Coverage-based methods are inefficient and time-consuming; 2) Mutation-based methods cannot be adapted to classical ML models due to mismatched model mutation rules; 3) Confidence-based methods are restricted to a single dimension when applying to binary ML classifiers, solely depending on the model's prediction probability for one class. To overcome the challenges, we propose MLPrior, a test prioritization approach specifically tailored for classical ML models. MLPrior leverages the characteristics of classical ML classifiers (i.e., interpretable models and carefully engineered attribute features) to prioritize test inputs. The foundational principles are: 1) tests more sensitive to mutations are more likely to be misclassified, and 2) tests closer to the model's decision boundary are more likely to be misclassified. Building on the first concept, we design mutation rules to generate two types of mutation features (i.e., model mutation features and input mutation features) for each test. Drawing from the second notion, MLPrior generates attribute features of each test based on its attribute values, which can indirectly reveal the proximity between the test and the decision boundary. For each test, MLPrior combines all three types of features of it into a final vector. Subsequently, MLPrior employs a pre-trained ranking model to predict the misclassification probability of each test based on its final vector and ranks tests accordingly. We conducted an extensive study to evaluate MLPrior based on 185 subjects, encompassing natural datasets, mixed noisy datasets, and fairness datasets. The results demonstrate that MLPrior outperforms all the compared test prioritization approaches, with an average improvement of 14.74% to 66.93% on natural datasets, 18.55% to 67.73% on mixed noisy datasets, and 15.34% to 62.72% on fairness datasets.
Introduction
In safety-critical industries such as healthcare and finance, classical machine learning models (e.g., Decision Trees, XGBoost, Logistic Regression) remain the gold standard due to their interpretability. However, ensuring the reliability of these models requires extensive testing, which typically involves manual labeling—a process that is both expensive and time-consuming. Test input prioritization aims to mitigate this by ranking test cases so that those most likely to be misclassified are checked first. While prioritization methods for Deep Neural Networks (DNNs) are well-documented, they often fail to translate effectively to classical ML architectures due to differences in model structure and feature engineering.
The MLPrior Framework
To address these gaps, we introduce MLPrior, a novel framework designed specifically for classical ML classifiers. MLPrior operates on the hypothesis that sensitivity to change is a primary indicator of model uncertainty. If a minor perturbation in the model or the input data causes a prediction to flip, that input is likely near a decision boundary and prone to error.
As shown in the framework above, MLPrior constructs a "suspicion profile" for every test input by extracting and combining three distinct types of features:
- Model Mutation Features (MMF): The system generates "mutant" versions of the model by tweaking internal parameters (e.g., changing thresholds in a Decision Tree). Inputs that produce inconsistent results across these mutants are flagged as suspicious.
- Input Mutation Features (IMF): The system applies small perturbations to the input data itself (e.g., modifying a specific attribute). High sensitivity to these changes suggests the input resides in a region of low model confidence.
- Original Attribute Features (OAF): Unlike DNN methods that often ignore raw input data, MLPrior leverages expert-engineered attribute features. These provide critical spatial context regarding where the test case sits relative to the training distribution.
Feature Combination and Ranking
Once these features are extracted, MLPrior concatenates them into a single high-dimensional vector. This vector is then processed by a pre-trained Learning-to-Rank model (specifically an XGBoost ranker) to determine the final prioritization order.
Experimental Evaluation
We evaluated MLPrior across 185 subjects using five primary natural datasets (Adult, Bank, Stroke, Diabetes, and Heartbeat), as well as synthetic noisy and fairness-focused datasets.
Key Results
- Superior Performance: MLPrior consistently outperformed existing DNN-based methods like DeepGini and Entropy-based ranking. It improved fault detection rates by up to 66.93% on natural datasets and 67.73% on noisy datasets.
- Efficiency: The prioritization process is highly efficient, typically completing in approximately 20 seconds, making it suitable for integration into active development pipelines.
- Robustness: The approach proved effective even in scenarios involving data corruption (noisy datasets) and algorithmic bias (fairness datasets).
Conclusion and Future Work
MLPrior demonstrates that exploiting the "white-box" nature of classical ML models—specifically through model mutation and attribute analysis—yields significantly better testing outcomes than adapting black-box DNN techniques. While currently focused on classification, future work will explore extending these mutation rules to regression tasks and developing automated mutation rule generation for exotic model architectures.
Summary updated