How Decisions Are Made in Brains: Unpack "Black Box" of CNN With Ms. Pac-Man Video Game

Beilun Wang, Rui Ma, Jingyu Kuang, Yan Zhang

Introduction

Convolutional Neural Networks (CNNs) have long been inspired by the biological visual cortex, yet they are frequently criticized as "black boxes" due to the difficulty in interpreting their internal decision-making logic. While these networks excel at complex tasks, understanding why they prioritize certain features over others remains a challenge in both artificial intelligence and neuroscience. This research bridges that gap by using the dynamic, naturalistic environment of the Ms. Pac-Man video game to compare artificial neural processing with biological decision-making in monkeys.

Experimental Framework and Methodology

The researchers developed an end-to-end CNN designed to predict the gameplay moves of monkeys. The network was trained on a substantial behavioral dataset consisting of 1,297 rounds of gameplay, totaling approximately 1.2 million individual frames. Each frame was labeled with the corresponding joystick movement made by a pre-trained monkey (up, down, left, right, or stay).

CNN Architecture

The model employs a standard hierarchical structure:

  1. Feature Extraction Phase: Four convolutional blocks utilizing max-pooling to identify visual patterns.
  2. Estimation Phase: Three fully connected layers with 50% dropout to map features to specific actions.

Visualizing "Attention" with Grad-CAM

To interpret the network's logic, the team utilized Gradient-weighted Class Activation Mapping (Grad-CAM). This technique generates heatmaps that highlight the specific pixels in a game frame that most heavily influenced the CNN's classification. Unlike traditional saliency maps, Grad-CAM provides semantically meaningful insights into the network's strategic focus.

The Ms. Pac-Man game environment, including the maze layout, possible actions, and reward-bearing entities like beans, energizers, and fruits.

Key Insights: Reward-Driven Logic

The study revealed that the CNN’s internal attention is primarily dictated by high-reward entities and immediate threats, mirroring biological survival strategies. The researchers identified four distinct behavioral modes through Grad-CAM analysis:

  • Hunting Mode: The network focuses intensely on "scared" ghosts (blue), which offer high point values.
  • Grazing Mode: Attention shifts toward distant fruits or dense clusters of dots (beans) when ghosts are not a threat.
  • Escaping Mode: The CNN’s focus narrows to the immediate vicinity of Ms. Pac-Man, prioritizing survival and risk-aversion over distant rewards.
  • Hierarchy of Abstraction: Analysis across layers showed a transition from particularization to generalization. Early layers (conv1) detect raw pixel edges, while deeper layers (conv5) integrate these into complex game states and strategic trade-offs.

Results and Performance

The CNN demonstrated high predictive accuracy, reaching 82% when including all five possible moves and 87% when the "stay" (hesitation) move was excluded. The difficulty in predicting "stay" suggests that while directional movement is often triggered by immediate visual cues, hesitation may stem from internal planning or temporal dependencies that a frame-by-frame CNN cannot fully capture.

Limitations and Future Directions

The current model is time-independent, meaning it analyzes each frame in isolation without memory of previous states. Because real-world decision-making is inherently temporal, future work aims to integrate Recurrent Neural Networks (RNNs) or Long Short-Term Memory (LSTM) units. This would allow the AI to better model the long-term planning and sequential dependencies observed in biological brains during complex tasks.

Summary updated

Abstract

The convolutional neural network (CNN) is widely used in various computer vision problems such as image recognition and image classification because of its powerful ability to process image data. However, it is an end-to-end model that remains a “block box” for users. The internal logic of CNN is not explicitly known. Interpreting CNN can help us better understand neural networks and the various ways they benefit us as users. In this paper, we explain the contributions of the convolutional layer of CNN with a neuroscience experiment paradigm: the Ms. Pac-Man video game. Ms. Pac-Man is a popular game that provides a complex yet natural decision-making task rather than a laboratory artifact. An analysis of the game can thus intuitively reveal the complicated decision-making process in animal brains. We sought to (1) elucidate the role of the CNN convolutional layer and (2) analyze the low-level strategies in animal brains based on high-level decisions. We use recorded videos of monkeys playing the Ms. Pac-Man game to empirically demonstrate that our network is able to predict the moving direction of the Pac-Man at every time step. We further find that the decision-making process at work during gameplay is high-reward-driven. A heatmap of the weighted feature map at each convolutional layer shows that CNN makes predictions based on the most important input pattern, which in this case is the high reward entities in the game.
BibTeX
@article{wang2020how,
  author = {Beilun Wang and Rui Ma and Jingyu Kuang and Yan Zhang},
  title = {{How Decisions Are Made in Brains: Unpack "Black Box" of CNN With Ms. Pac-Man Video Game}},
  journal = {IEEE Access},
  year = {2020},
  doi = {10.1109/access.2020.3013645},
}
Figure