Abstract
Deep reinforcement learning (DRL) has shown significant potential for optimizing traffic signal control. However, the "black box" nature of these models often limits their adoption in real-world infrastructure. This work presents a Deep Q-Learning (DQN) approach integrated with the SHAP (SHapley Additive exPlanations) framework to provide policy explainability. Our approach clarifies the impact of specific traffic features on agent actions, fostering a better understanding of agent behavior under varying conditions. Empirically, our model improved travel time, waiting time, and speed by 21.49%, 27.97%, and 20.87%, respectively, compared to traditional fixed-time controllers.
Introduction
Traffic congestion is a critical global issue, imposing substantial economic and environmental costs. While Adaptive Traffic Signal Control (ATSC) systems powered by DRL offer a promising solution to dynamic traffic demands, their lack of transparency remains a barrier for city planners and engineers. In high-stakes environments like urban traffic management, understanding why an AI agent makes a specific decision—such as extending a green light duration—is as important as the performance itself. This research addresses the explainability gap by applying eXplainable AI (XAI) techniques to DRL-based traffic control.
Methodology and Experimental Setup
The core of our approach is a Deep Q-Learning (DQN) agent designed to manage a four-way intersection.
The RL Environment
We utilize the CityFlow simulator, an open-source platform for large-scale traffic scenarios. To ensure realism, the model was trained on real-world traffic data from Hangzhou, China, captured via surveillance cameras.
The agent operates on a fixed-phasing schedule but dynamically determines the duration of each green light (ranging from 0 to 56 seconds). The state space is defined by three primary features:
- F0: Queue length of the current phase.
- F1: Queue length of the next phase.
- F2: Queue length of all other phases.
A six-layer fully connected neural network estimates the Q-values for 57 possible duration actions.
Explainability with SHAP
To "look under the hood," we integrated the SHAP framework. SHAP is a model-agnostic method that assigns a contribution value to each input feature for every decision. This allows us to visualize how much each queue (F0, F1, or F2) influenced the agent's choice of a specific duration at any given moment.
Key Results and Discussion
The DQN agent was evaluated against three fixed-time baselines (FT15, FT30, and FT45 seconds). Our model demonstrated superior performance across all metrics as training progressed.
Policy Logic and Insights
SHAP analysis provided critical insights into the agent's learned policy:
- Logical Decision Making: Visualizations confirmed that the agent prioritizes the current queue (F0). When F0 is high and the next queue (F1) is low, the agent consistently selects longer green-light durations.
- Holistic Optimization: The agent does not ignore secondary queues; it weighs F1 and F2 to ensure that optimizing one direction does not cause excessive delays elsewhere.
- Identifying Outliers: The framework successfully identified occasional counter-intuitive decisions, likely caused by the stochastic nature of experience replay or gaps in the training state-action coverage.
Conclusion and Future Work
By combining DRL with SHAP, we have demonstrated that traffic signal controllers can be both high-performing and interpretable. While this study focused on a single intersection with a discrete action space, future research will explore:
- Network Effects: Extending the model to multi-intersection networks where signals must coordinate.
- Continuous Action Spaces: Implementing Actor-Critic models for more granular control.
- Enhanced Visualization: Developing more intuitive ways to present SHAP explanations to non-expert stakeholders, such as city officials.
This work marks a significant step toward deploying trustworthy, AI-driven infrastructure in modern cities.
Summary updated