Probabilistic Verification of Neural Networks Against Group Fairness

Bing Sun, Jun Sun, Ting Dai, Lijun Zhang

Introduction

As neural networks (NNs) are increasingly deployed in high-stakes domains such as medical diagnosis, credit scoring, and criminal justice, the question of algorithmic fairness has become paramount. While NNs can inherit and amplify societal biases present in training data, traditional methods for ensuring fairness—such as fairness testing or fairness-aware training—often lack formal guarantees. Testing can identify specific biased instances but cannot prove fairness across the entire input space. Conversely, training-based approaches may improve fairness but do not provide a mathematical certificate of compliance.

This paper presents a novel framework for the formal verification of "group fairness" in neural networks. By abstracting complex models into probabilistic structures, the authors provide a scalable method to verify fairness properties, diagnose bias, and repair models with minimal impact on accuracy.

Problem Formulation: Group Fairness

The authors focus on Independence-based Fairness, specifically Group Fairness. A model is considered fair if its prediction $Y$ is statistically independent of a protected attribute $F$ (e.g., gender or race). Formally, for a binary classification task, group fairness requires that the probability of a positive outcome is equal across different groups. In practice, a relaxed version is often used, where the difference in probabilities must be below a threshold $\xi$:

$$|P(Y=1 | F=f_i) - P(Y=1 | F=f_j)| \leq \xi$$

Verifying this property across the entire input distribution is computationally challenging for large, non-linear neural networks due to the "black box" nature of their internal representations.

Methodology: The SOCRATES Framework

The proposed workflow is implemented in a tool called SOCRATES, which follows a four-stage process to bridge the gap between black-box models and formal verification.

1. Learning a Markov Chain Abstraction

Directly analyzing a high-dimensional NN is often intractable. Instead, the authors sample the model's behavior to construct a Discrete-Time Markov Chain (DTMC). This DTMC serves as a simplified, interpretable map of how inputs transition through hidden layers to reach a final decision. To ensure the abstraction is reliable, they employ a sampling algorithm that guarantees the DTMC is Probably Approximately Correct (PAC). This means the abstraction is a statistically sound representation of the underlying NN within defined error bounds.

The verification and repair algorithms used in the SOCRATES framework.

2. Probabilistic Model Checking

Once the DTMC is constructed, formal verification techniques are applied. The system checks if the DTMC satisfies the fairness property $\phi$ against the threshold $\xi$. If the probability difference between protected groups is within limits, the model is formally "Verified."

3. Sensitivity Analysis

If a model fails the fairness check, the DTMC structure allows for fine-grained diagnosis. The authors perform sensitivity analysis to identify which internal neurons or input features contribute most significantly to the observed bias. This identifies the "guilty" components of the network that require adjustment.

4. Surgical Model Repair

Unlike traditional methods that require full retraining, SOCRATES performs surgical repairs. Using Particle Swarm Optimization (PSO), the weights of the identified sensitive neurons are slightly adjusted. The objective is to minimize the fairness gap while maintaining the model's original predictive accuracy.

Examples of DTMCs learned from a Feed-Forward Neural Network (a) and a Recurrent Neural Network (b).

Experimental Evaluation

The framework was evaluated on four benchmark datasets: Census Income, German Credit, Bank Marketing, and Jigsaw Comment. The latter was specifically chosen to test the framework's ability to handle Recurrent Neural Networks (RNNs/LSTMs), which are notoriously difficult for standard verification tools due to their cyclic nature.

Key Results

  • Efficiency and Scalability: Verification for standard feed-forward networks was completed in under 7 seconds. The complex Jigsaw RNN model, which often causes timeouts in other tools, was verified in less than 30 minutes.
  • Comparative Performance: SOCRATES significantly outperformed existing tools. FairSquare timed out on all benchmarks, while VeriFair was approximately 62 times slower on average.
  • Effective Repair: In the Census Income case study, the fairness gap was reduced from 3.13% to 0.7% with only a 2% drop in overall accuracy (from 88% to 86%).

Discussion and Conclusion

The conversion of "black box" neural networks into interpretable Markov Chains provides a dual benefit: formal verification and human-readable insights. By identifying and repairing specific sensitive neurons, the authors demonstrate that fairness can be achieved without discarding the entire learned logic of a model.

While the current approach is highly effective for tabular and text data, future work is needed to scale these techniques to high-dimensional image data and Convolutional Neural Networks (CNNs). Nonetheless, this research represents a significant step toward building a "moral compass" for AI through rigorous probabilistic verification.

Citation: Sun, B., Sun, J., Dai, T., & Zhang, L. (2021). Probabilistic Verification of Neural Networks Against Group Fairness. CAV 2021.

Summary updated

BibTeX
@inproceedings{sun2021probabilistic,
  author = {Bing Sun and Jun Sun and Ting Dai and Lijun Zhang},
  title = {{Probabilistic Verification of Neural Networks Against Group Fairness}},
  booktitle = {FM},
  year = {2021},
  doi = {10.1007/978-3-030-90870-6\_5},
}
Figure