# Probability of given position/piece configuration

I'm currently working on an image based FEN generator. I found a paper doing the same and they have used Stockfish to calculate the most probable piece configurations.

Now I wonder if Stockfish has this functionality or if they implemented it on their own. Does anybody know more about this, as it would be extremely helpful for my project?

On pages 7-8, the paper gives information on what they did.

Utilizing a chess engine: We utilized the open-source Stockfish engine, which allows us to calculate the most probable piece configurations. By calculating the prob-abilities of all possible configurations, we could choose the most probable candidate (see Figure 7). Additionally, we strengthened this method by utilizing large-scale chess game statistics in the manner proposed by Acher and Es-nault Acher and Esnault (2016).

• they probably played games with it and noted the results. python-chess can help with that Commented Jun 18, 2020 at 9:30
• The section of the paper you refer to is not well explained, in my opinion. My understanding of it, based on the technique borrowed from the referenced paper by Ding 2016, is that several possible board configurations based on piece probabilities are given to stockfish to score. I would assume that scores which suggest a heavy imbalance between the two sides are rejected as being improbable in an active game. In my view, the approach should have been explained in more detail so as to be reproducible by others. Commented Jun 18, 2020 at 21:42
• Interesting question. Have you tried contacting the authors of the paper? Commented Oct 25, 2020 at 15:02
• No I haven't. But it's a good idea. Commented Oct 28, 2020 at 12:22
• Took a while but i have asked it now, it is like you've said that heavy imbalances are weighted less probable. Also from the answer: It is possible to handle some trivial cases on your own (without stockfish): 1) find similar FEN in chess database (of professional players); 2) check the imbalance / count the pieces; for example, the position is at the opening stage, but we have 3 rooks, which is quite impossible. @MichaelWest Commented Jan 12, 2021 at 11:10