Fairguard: Harness Logic-based Fairness Rules in Smart Cities

Yiqi Zhao, Ziyan An, Xuqing Gao, Ayan Mukhopadhyay, Meiyi Ma

Introduction

Smart cities increasingly rely on a "predict-then-optimize" loop to manage urban resources. In this paradigm, machine learning models predict demand—such as where residents will need shared bicycles or public transit—and city officials allocate resources based on those predictions. However, these models are often trained on historical data that reflects past systemic inequalities. If a low-income neighborhood was historically underserved, a predictive model will "learn" this lack of demand as a natural state, reinforcing a feedback loop of inequality.

Fairguard is a novel, two-phase framework designed to break this cycle. By utilizing Signal Temporal Logic (STL), Fairguard detects and mitigates bias in real-time, ensuring that resource allocation remains fair across different demographic groups even as city conditions shift.

The Challenge: Bias as a Moving Target

A significant gap in current fairness research is the treatment of bias as a "static" problem—a single, fixed metric to be minimized during training. In reality, smart city data is highly dynamic. The correlations between service demand and socioeconomic factors (such as income, age, or public assistance status) fluctuate wildly across different hours of the day and across various neighborhoods. Existing fairness tools often struggle to handle these "micro-level" temporal and spatial variations, leading to models that may be fair on average but highly biased during specific peak hours.

The Fairguard Framework

Fairguard addresses these challenges through a dual-layered approach that intervenes at both the data level and the algorithmic level.

1. Static Fairguard (Data Level)

Before a model is even trained, the Static Fairguard component adjusts historical datasets to remove inherent biases. It employs Signal Temporal Logic (STL), a formal language used to specify requirements over time, to define fairness. For example, a policy might state: "the correlation between neighborhood income and bike demand should remain near zero for the next five hours."

To satisfy these logic rules, Fairguard uses a modified Powell’s Hybrid Method—a non-linear root-solver. This method tweaks the historical data just enough to meet the STL fairness requirements while ensuring the overall data distribution remains as close to the original as possible, preserving the data's utility for training.

2. Dynamic Fairguard (Algorithm Level)

During model training and deployment, Fairguard acts as a runtime monitor using a teacher-student network architecture.

  • The Student: This is the primary predictive model (e.g., an LSTM or Graph Neural Network) making demand predictions.
  • The Teacher: The teacher checks the student's predictions against the STL fairness rules. If a prediction violates a rule, the teacher generates a "corrected" fair version of the signal.

The student then uses this corrected signal to refine its learning process. This effectively "distills" fairness into the model, allowing it to adapt to real-time shifts in city dynamics without losing its predictive accuracy.

Experimental Evaluation

The authors evaluated Fairguard using extensive real-world data from Chattanooga, TN, focusing on two primary datasets:

  • Bicycle Transit Data: 677,123 bike trips from 42 stations spanning 2012 to 2021.
  • Socioeconomic Data: Demographic features from 82 census tracts, including mean household income and the percentage of households receiving public assistance.

The framework was tested across various modern deep learning architectures, including Long Short-Term Memory (LSTM) networks and Diffusion Convolutional Recurrent Neural Networks (DCRNN), proving its model-agnostic nature.

Key Results and Insights

Fairguard demonstrated that it is possible to achieve high levels of fairness without significantly compromising model performance:

  • Substantial Bias Reduction: The Static Fairguard improved data fairness metrics, such as Pearson Correlation, by over 80% in several case studies.
  • Algorithmic Equity: In scenarios focused on household income, LSTM-based models achieved a 100% improvement in Bounded Group Loss (BGL), effectively equalizing error rates across different protected demographic groups.
  • Accuracy Preservation: The "fair" models maintained high predictive accuracy. For instance, the DCRNN model kept its Mean Squared Error (MSE) below 0.25 while successfully ensuring fair resource allocation.
  • Persistence of Fairness: A notable finding was the "persistence" effect. Enforcing fairness rules for even a short duration had a lasting positive impact on the model's future predictions, even after the explicit enforcement was removed.

Conclusion and Future Directions

Fairguard represents a shift toward interpretable, logic-based fairness in urban computing. By using STL, policymakers can define fairness in human-readable, time-stamped rules rather than abstract mathematical functions.

While the framework minimizes the fairness-accuracy trade-off, some tension remains; higher data fairness requires more significant modifications to the original city state data. Future work will focus on simplifying the creation of STL rules for non-experts and expanding the root-solver's ability to process complex metrics like Spearman’s rank correlation. Ultimately, Fairguard provides a robust "guardrail" for the smart cities of tomorrow, ensuring that efficiency does not come at the cost of equity.

Summary updated

BibTeX
@inproceedings{zhao2024fairguard,
  author = {Yiqi Zhao and Ziyan An and Xuqing Gao and Ayan Mukhopadhyay and Meiyi Ma},
  title = {{Fairguard: Harness Logic-based Fairness Rules in Smart Cities}},
  booktitle = {8th ACM/IEEE Conference on Internet of Things Design and Implementation},
  year = {2024},
  url = {https://openreview.net/forum?id=7IL6vE05Kj},
}
Figure