user20786: I'm working on a chess AI for a school project and I am looking into ways to identify the current phase of a board, meaning the opening, middlegame, and  endgame. I have seen an article explaining Tapered Evaluation, however I don't really understand what the point of this is. I want to be able to change my overall board evaluation heuristic depending on what state the game is in. This way, in the middlegame, I can prioritize king protection and development and other strategies.

user18809: As a rough estimate, I've once seen the definition that the endgames begins when each side's pieces has a strength of 13 or less (counting 9 for queen, 5 for rook, 3 for bishop/knight and ignoring pawns) Can't remember the source, though.
The opening is often said to end when all of the pieces are developped, but it's not always so clear. You may want to alow one piece to stay on its starting square and call it the middlegame already

user20776: There is no sharp definition that would say x moves and y moves is where.
The opening is pretty much over when you have exhausted moves that have been played so many times by many players. It could be short if someone makes an unusual move, or, for a very long time, play some extremely old lines especially when GMs want to play safe for a draw.  
Endgames would tend to start when there is really not enough material to mount a mating attack by force.  Just trading queens is not enough if all the other pieces are still in play.  
But none of this should matter to an AI program.  They are just arbitrary identifiers to help indicate the stage of the game. 
A good AI program would evaluate the position independently of what stage you thought the game was in.  Not doing so would lead to a number of places that give weird results.  Anyway, isn't AI supposed to determine those weightings for itself based on the position?
The problem is you can't train AI with enough examples to really make AI work the way it normally does.  

user-1: The definition of "the middlegame" is a somewhat gray area.
There's no commonly-accepted, sharply-defined definition for when the middlegame starts/ends.
I suggest you start with one of these definitions, test it, and refine it if it gives poor results:
Middlegame Definition #1:

Castling has occurred, OR
10 moves have been played

Middlegame Definition #2:

One player's rooks are connected, OR
12 moves have been played

Middlegame Definition #3:

One player has castled AND has moved all minor pieces at least once AND has moved at least 1 pawn, OR
12 moves have been played

The endgame is generally defined as being "when the Kings are ready to join the battle", which usually occurs when there are few pieces left on the board. Start with defining the endgame as when there are 12 pieces left on the board and improve it if that definition ever fails.

user19997: I think you don't need this. You shift from opening to middle game when your opening book for this line runs out.
The middle-end phase is less relevant in AI, and your algorithm will handle those the same. You could define a line, e.g. when your search depth could be increased over some threshold, because the board has only a handful of pieces left, but I don't think it's an important change.

20786: <p>I'm working on a chess AI for a school project and I am looking into ways to identify the current phase of a board, meaning the opening, middlegame, and  endgame. I have seen an article explaining <a href="https://www.chessprogramming.org/Tapered_Eval" rel="noreferrer">Tapered Evaluation</a>, however I don't really understand what the point of this is. I want to be able to change my overall board evaluation heuristic depending on what state the game is in. This way, in the middlegame, I can prioritize king protection and development and other strategies.</p>
 18809: <p>As a rough estimate, I've once seen the definition that the endgames begins when each side's pieces has a strength of 13 or less (counting 9 for queen, 5 for rook, 3 for bishop/knight and ignoring pawns) Can't remember the source, though.</p>

<p>The opening is often said to end when all of the pieces are developped, but it's not always so clear. You may want to alow one piece to stay on its starting square and call it the middlegame already</p>
 20776: <p>There is no sharp definition that would say x moves and y moves is where.</p>

<p>The opening is pretty much over when you have exhausted moves that have been played so many times by many players. It could be short if someone makes an unusual move, or, for a very long time, play some extremely old lines especially when GMs want to play safe for a draw.  </p>

<p>Endgames would tend to start when there is really not enough material to mount a mating attack by force.  Just trading queens is not enough if all the other pieces are still in play.  </p>

<p>But none of this should matter to an AI program.  They are just arbitrary identifiers to help indicate the stage of the game. </p>

<p>A good AI program would evaluate the position independently of what stage you thought the game was in.  Not doing so would lead to a number of places that give weird results.  Anyway, isn't AI supposed to determine those weightings for itself based on the position?</p>

<p>The problem is you can't train AI with enough examples to really make AI work the way it normally does.  </p>
 -1: <p>The definition of "the middlegame" is a somewhat gray area.</p>

<p>There's no commonly-accepted, sharply-defined definition for when the middlegame starts/ends.</p>

<p>I suggest you start with one of these definitions, test it, and refine it if it gives poor results:</p>

<p><strong>Middlegame Definition #1:</strong></p>

<ul>
<li>Castling has occurred, OR</li>
<li>10 moves have been played</li>
</ul>

<p><strong>Middlegame Definition #2:</strong></p>

<ul>
<li>One player's rooks are connected, OR</li>
<li>12 moves have been played</li>
</ul>

<p><strong>Middlegame Definition #3:</strong></p>

<ul>
<li>One player has castled AND has moved all minor pieces at least once AND has moved at least 1 pawn, OR</li>
<li>12 moves have been played</li>
</ul>

<p>The endgame is generally defined as being "when the Kings are ready to join the battle", which usually occurs when there are few pieces left on the board. Start with defining the endgame as when there are 12 pieces left on the board and improve it if that definition ever fails.</p>
 19997: <p>I think you don't need this. You shift from opening to middle game when your opening book for this line runs out.
The middle-end phase is less relevant in AI, and your algorithm will handle those the same. You could define a line, e.g. when your search depth could be increased over some threshold, because the board has only a handful of pieces left, but I don't think it's an important change.</p>
