Open-Source Chess Board Recognition: Image to FEN Projects Compared
For screenshots and other 2D boards, fenshot (MIT) is the most practical open-source image-to-FEN recognizer and runs in a browser; for photos of physical boards, ChessLens (MIT) reports 99.3% of squares and 91.8% of whole boards correct with a model small enough for a phone. LiveChess2FEN handles live video but is AGPL-3.0.
We surveyed these projects when building the photo scanner on BestChessMove.xyz, which uses fenshot and a TypeScript port of ChessLens. Chess board recognition has two halves: finding the board and its 64 squares in the image, then classifying the piece on each square. Screenshots make the first half easy, since the board is flat and square; photos of real boards need perspective correction and must cope with pieces that overlap neighbouring squares. Accuracy is usually reported per square, which flatters: 99% of squares still means a wrong square on roughly every other board, so any real product needs a correction step.
The projects
fenshotMIT · TypeScript/npm · screenshots
A screenshot reader published on npm as @scoriiu/fenshot. It finds the board in JavaScript and classifies each tile with a 1.3 MB ONNX network on onnxruntime-web (WebAssembly), so it runs entirely in the browser. Its evaluation on real screenshots from chess sites reports zero wrong tiles on every board in the set. It is built for flat 2D boards, including straight-on photos of screens, not for physical pieces.
ChessLensMIT · Python + ONNX · physical boards
Reads photos of real boards. Its board finder locates the saddle points where squares meet and fits the grid with RANSAC in OpenCV, then a 0.84-million-parameter CNN (a 3.4 MB ONNX file) classifies each square. The authors report 99.3% of squares and 91.8% of full boards correct on held-out real photos taken from above, lower at steep angles and on other piece sets. The training data partly comes from a dataset without a license, which matters if you need a clean chain; the training scripts are MIT, so you can retrain.
chesscogMIT · Python · research
A well-documented research pipeline for physical boards with large ResNeXt and Inception classifiers (around 100 MB or more), trained on rendered boards. A 2023 study by Masouris and van Gemert found that only about 2% of its real-photo boards came out fully correct, so treat it as a starting point for research rather than a ready-made recognizer.
End-to-end chess recognition (ChessReD)MIT · Python · research
The Masouris and van Gemert project that introduced the ChessReD dataset of real smartphone photos and an end-to-end model that predicts the whole board at once instead of square by square. The paper reports about 15% of real boards fully correct, far ahead of chesscog on the same photos, and the dataset is useful for training or testing your own recognizer.
LiveChess2FENAGPL-3.0 · Python · live video
Follows a physical game from a camera and outputs each new position as FEN, built to run on an NVIDIA Jetson. Its paper reports 92% piece classification accuracy. The AGPL-3.0 license means that if you serve it as part of a web app, you must publish your app’s source, which rules it out for many products.
tensorflow_chessbotMIT · Python · screenshots
One of the earliest image-to-FEN projects, a TensorFlow model that read screenshots posted to Reddit. It only handles 2D boards and confuses queens and kings on some Chess.com themes; fenshot does the same job better today. Still a readable introduction to the square-by-square approach.