You may enjoy this blogpost I made that goes into how the BMI prediction algorithm was developed. It's the only one in the project that I trained myself.
https://www.sherpapieces.eu/overview/predicting-your-bmi-fro...
Like you said, muscles matter quite a bit. It's attractive to use photos af athletes to train the algorithm, because there are a lot of websites that show their photos along with their weight and height (which you need to calculate a BMI). But since muscles weigh so much more than fat, athletes have high BMI with slim bodies, which warps the algorithm.
I didn't use athletes for this reason (it's trained on a diet of 50% Chinese celebrities and 50% American arrest records). But I found projects that do use these photos.