Thanks to organizers for this fun competition!
The key to solve all this puzzles was “Chess Configuration” puzzle, which asked to recognize FEN from images. I tried 2 approaches, but both had trouble with black pawns on dark background, so they gave .001 score, just below most competitors. Luckily, I got a teammate.
Chess Win Prediction
For this one I installed stockfish and called it from python API, as below. It disagreed with provided labels 7% of time, so probably labels were incorrect.
engine = chess.engine.SimpleEngine.popen_uci("stockfish")
limit = chess.engine.Limit(time=.2)
def predict_win(fen, turn):
"""
fen: fen string
turn: 'b' or 'w'
"""
ext_fen = f'{fen} {turn} - - 0 1'
board = chess.Board(ext_fen)
result = engine.analyse(board, limit)
score = result['score'].white() # from white perspective
if score.is_mate():
value = score.mate()
else:
value = score.score()
winner = 'white' if value > 0 else 'black'
return winner