TL;DR
This paper introduces QuantifyML, a novel tool that precisely quantifies the learnability, safety, and robustness of machine learning models by translating them into C programs and leveraging model checking techniques. This approach offers a more rigorous evaluation than traditional statistical metrics, revealing subtle vulnerabilities and performance discrepancies.
What Problem Does This Paper Address?
Evaluating machine learning models typically relies on accuracy metrics computed on test datasets. However, this can be misleading if the test data isn't representative of the real-world problem or if models are vulnerable to adversarial attacks or safety violations. It's often unclear how well a model has truly learned, generalized, or how robust it is to unexpected inputs. Existing methods like Model Counting meets Machine Learning (MCML) are limited to binary decision trees and cannot handle more complex, multi-class models or neural networks effectively. This paper addresses the need for a more precise and generalizable method to quantify ML model performance beyond simple accuracy.
Methods
QuantifyML's core innovation lies in its ability to translate trained machine learning models (decision trees and neural networks) into C programs. These C programs are then fed into the CBMC (C Bounded Model Checker) tool, which generates a formula in Conjunctive Normal Form (CNF). This CNF formula represents the model's behavior. Off-the-shelf model counters are then used to analyze these formulas and provide precise counts of inputs that lead to specific outputs.
Specifically, QuantifyML uses these counts to:
- Quantify Learnability: By comparing model outputs to ground truth predicates, it calculates metrics like True Positives, False Positives, True Negatives, and False Negatives. From these, it derives standard measures like Accuracy, Precision, Recall, and F1-score.
- Quantify Safety: It evaluates input-output safety properties by counting inputs that satisfy or violate a given property (e.g., a classifier producing a certain label).
- Quantify Local Robustness: For models where ground truth is not readily available (like image classifiers), it defines a region around an input (an epsilon-ball) and quantifies the model's accuracy within that region, indicating its robustness to small perturbations.
The paper highlights the use of projected model counting, where input variables are considered primary, and employs tools like projMC and ApproxMC.
Datasets
The paper evaluates QuantifyML on several problem domains:
- Relational Properties of Graphs: Datasets were created using the Alloy tool to represent graphs and label them based on 11 relational properties (e.g., Antisymmetric, Connex, Transitive). Both decision trees and neural networks were trained on this data.
- Image Classification (MNIST): A decision-tree classifier was trained on the MNIST benchmark for handwritten digit recognition.
- Aircraft Collision Avoidance (ACAS Xu): A smaller neural network was trained on a dataset derived from the ACAS Xu system, which issues horizontal turning advisories.
Key Insights and Ideas
- Statistical metrics can be misleading: The paper strongly demonstrates that traditional statistical measures can give a false impression of a model's performance, especially regarding precision and robustness. QuantifyML often reveals significantly lower true performance.
- Quantifying robustness is crucial: For safety-critical applications and in the face of adversarial attacks, understanding how a model behaves in a neighborhood of inputs is more informative than just its performance on a static test set.
- Generalizability beyond MCML: QuantifyML extends the capabilities of prior work (MCML) to handle more complex, multi-class models and neural networks, opening up new avenues for rigorous ML model evaluation.
- Model checking as a powerful analysis tool for ML: The paper showcases the effectiveness of translating ML models into formal representations that can be analyzed by established verification tools.
Key Results
- Decision Trees for Graph Properties: For some graph properties, decision trees achieved 100% statistical accuracy, but QuantifyML revealed lower precision, indicating a significant number of false positives. For others, statistical metrics were misleading, and QuantifyML showed better performance for decision trees over neural networks.
- Neural Networks for Graph Properties: For most graph properties, QuantifyML showed that neural networks had lower true performance (accuracy, F1-score) than statistical metrics suggested, with F1-scores often below 50%.
- MNIST Robustness: For the MNIST classifier, QuantifyML revealed poor robustness for specific digit labels (1, 2, and 9), indicating vulnerability to adversarial attacks, even when statistical accuracy seemed high.
- ACAS Xu Safety: QuantifyML successfully evaluated safety properties for the ACAS Xu neural network, identifying a property (Property 4) that the network never satisfied, a finding not possible with statistical evaluation alone.
Limitations and Future Work
- Scalability of Model Counters: The paper acknowledges that model counters can struggle with the complexity of CNF formulas generated from larger or more complex models, leading to timeouts. This was particularly challenging for neural networks with more than 4 nodes in graph problems.
- Approximate vs. Exact Counts: To address scalability, the authors used approximate model counters (ApproxMC), which provide faster but less precise results.
- Future Work: The authors plan to investigate slicing and/or compositional analysis of the C program representation of models to improve scalability. They also aim to accommodate more learning algorithms beyond decision trees and neural networks.
Summary updated