A neural network that learned to read chessboards so you don't have to
Turns screenshots of online chess games into FEN strings using a CNN, because manually transcribing boards is even more tedious than it sounds.

What it does
Takes an image of a chessboard—screenshots from lichess.org, chess.com, and similar—finds the grid with computer vision, slices it into 64 tiles, and feeds each through a TensorFlow CNN to identify the piece (or empty square). Outputs a standard FEN string you can drop straight into an analysis engine. There’s also a live browser demo using TensorFlow.js.
The interesting bit
The author cheerfully admits using a CNN is “kinda overkill” for classifying 13 discrete tile types, but went ahead anyway. The training data is entirely synthetic: random FENs rendered through lichess.org’s URL interface, screenshotted programmatically, then augmented with noise. The old Reddit bot (/u/ChessFenBot) that auto-replied to /r/chess posts is now deprecated, though the branch still exists.
Key highlights
- 73% success rate on 71 real-world chess subreddit posts (CNN variant)
- Synthetic training pipeline: 80–150 screenshots → 5,000–9,600 tiles with randomized coloration, highlighting, and occlusion
- Four Jupyter notebooks walk through the full pipeline: CV grid detection, dataset generation, basic NN, and CNN
- CLI supports both local files and URLs via
--filepathand--url - Live TensorFlow.js demo runs in browser without install
Caveats
- README notes that boards “too different from what we trained for don’t work”—styles outside lichess/chess.com territory struggle
- Reddit bot is deprecated; active code lives on a separate branch
- Basic regression classifier (non-CNN) exists but CNN is the one with published test results
Verdict
Worth a look if you’re building CV pipelines for structured grid data or want a concrete, low-stakes TensorFlow tutorial. Skip if you need production-grade board recognition; this is a 2015-era learning project with acknowledged brittleness.