How moritzhambach/detecting-cheating-in-chess works
This repository is a chess-game engine-use classifier. Its main workflow takes a PGN game, prepares board-position and attack tensors, and applies a color-specific trained model to estimate whether the opponent used an engine. A separate data workflow converts game archives, filters and balances labeled games, encodes them, and trains several model architectures. The README also documents heatmap exploration. Relationships are limited to calls visible in excerpts or workflow statements in the README; DVC stage internals were not sampled.
Main entry points: moves_to_fen.py Board and attack tensors · make_prediction.py Prediction command · models Trained models · preprocess.py Game filtering
Components 17
Game ingestion
- PGN to JSON
python_code/pgn_to_json.py - Game filtering
python_code/preprocess.py - Evaluation moves
python_code/eval_get_moves.py
Game features
- Move to FEN
python_code/moves_to_fen.py - PGN to FEN
python_code/pgn_to_fen.py - Board and attack tensors
python_code/moves_to_fen.py - Preprocess parameters
configs/preprocess_params.json - Heatmap exploration
data_exploration_and_heatmaps.ipynb
Model training
- CNN-LSTM training
python_code/train_CNN_LSTM.py - Conv3D training
python_code/train_Conv3D.py - Dense-LSTM training
python_code/train_Fully_Connected_LSTM.py - Trained models
models
Game classification
- Evaluation preparation
dvc-stages/eval_moves_to_fen.dvc - Prediction command
python_code/make_prediction.py
Other components
- PGN archives
- Game submitter
- Engine-use probability
Connections 19
- PGN archives → PGN to JSON: supplies games
README.md - PGN to JSON → Game filtering: provides game data
README.md - Game filtering → Board and attack tensors: selects labeled games
- Move to FEN → PGN to FEN: calls converter
python_code/moves_to_fen.py - Move to FEN → Board and attack tensors: encodes positions
python_code/moves_to_fen.py - Game filtering → Preprocess parameters: reads settings
python_code/preprocess.py - Board and attack tensors → Heatmap exploration: supports exploration
- Board and attack tensors → CNN-LSTM training: trains on tensors
python_code/train_CNN_LSTM.py - Board and attack tensors → Conv3D training: trains on tensors
python_code/train_Conv3D.py - Board and attack tensors → Dense-LSTM training: trains on tensors
python_code/train_Fully_Connected_LSTM.py - CNN-LSTM training → Trained models: saves model
python_code/train_CNN_LSTM.py - Conv3D training → Trained models: saves model
python_code/train_Conv3D.py - Dense-LSTM training → Trained models: saves model
python_code/train_Fully_Connected_LSTM.py - Game submitter → Evaluation preparation: submits PGN
README.md - Evaluation preparation → Prediction command: prepares evaluation
README.md - Trained models → Prediction command: loads color model
python_code/make_prediction.py - Prediction command → Preprocess parameters: reads settings
python_code/make_prediction.py - Prediction command → Engine-use probability: reports estimate
python_code/make_prediction.py - Evaluation moves → Evaluation preparation: prepares move data