Projects

Reinforcement learning · Interactive systems

A transparent DQN for territory capture

A Flood-It agent moves from a categorical board representation to a deployed opponent that exposes the Q-value behind every available color.

Reinforcement LearningDQNReactFastAPI
Flood-It board with colored territories and live AI controls
A transparent DQN for territory capture — primary system view.
46game win streak
The trained policy against random opponents.
6discrete actions
One Q-value for each board color.
3system layers
Environment, inference service, and web client.

01 · Finding

Represent color as structure

Each board becomes an H × W × C one-hot tensor. Color identity stays categorical while the network can still learn which regions touch, expand, and threaten the opposing corner.

The six-color action space stays small, but useful play requires spatial planning rather than a reflexive preference for the largest immediate capture.

Flood-It training and deployment architecture
A shared environment contract connects training, inference, and the browser.

02 · Finding

Train the policy, then inspect it

The DQN learns from replayed transitions and produces a score for every color. Instead of hiding that vector behind a single move, the product surfaces it beside the board.

That decision trace turns the deployment into an inspection tool: visitors can see when the chosen move is decisive, marginal, or constrained by an invalid color.

Flood-It interface showing Q-values for each available color
Live Q-values make the policy legible without pretending to explain the network itself.

03 · Finding

Correct perspective at the boundary

The trained model expected one corner, while a human opponent could occupy the mirrored side. The service corrects that mismatch by flipping the tensor before inference and mapping the decision back afterwards.

FastAPI and WebSockets keep the model state synchronized with a React client, preserving one source of game truth while moves and decision scores update in real time.

Deployed Flood-It web application during a game
The deployed system keeps gameplay and model evidence on the same surface.