Computer vision2025

Chess Assistant

CNNs locate a chessboard on screen and classify every piece, then Stockfish suggests the move.

MOBILENETV2 · 384
CORNERS 0/4
DETECTRECTIFYCLASSIFYFENENGINE

A computer-vision pipeline that reads a chess position from pixels. One network regresses the board corners out of a full screenshot; a second classifies each of the 64 squares into thirteen classes. The reconstructed position is serialised to FEN and handed to Stockfish, which returns the best move. Training data is synthetic — boards composited onto generated desktops at random positions, sizes and themes, so the detector generalises past any one client.

ContributionFull pipeline: dataset synthesis, both models, board reconstruction, engine integration and deployment.

99.6%Piece recognition accuracy
1,200Synthetic boards generated
13Piece classes
5Board themes simulated
384×384Detector input
64×64Classifier input

How it works

  • Two trained models are committed to the repository: a per-square piece classifier and a board-corner regressor.
  • Piece classifier is a 3-block CNN (Conv2D 32/64/128 with max-pooling) → Flatten → Dense(128) → Dropout, on 64×64 crops.
  • Board localisation is solved as direct corner regression on a MobileNetV2 backbone at 384×384, refined by a local search.
  • Training data is synthetic: boards composited onto generated desktop wallpapers at random position, scale and theme.
  • Reconstructed positions are serialised to FEN and analysed by Stockfish via python-chess.
  • Thirteen piece classes (six white, six black, empty).
Chess Assistant — Alejandro Newport