Is it illegal to use pictures of public figures to train a neural network?
If you use any pictures you find online, you can use them as you wish: as long as you don't (re)publish them under your name. Also, if you really want to play safe, never upload them at all. Download them, use them, disregard them. 

People can't proof you used certain pictures to train your network by looking at your network data. 

And the 'big' companies out there, like Google, train their networks by using public photos. 

And follow this chart:


As you are using it for a personal/educational project, it shouldn't be a problem.