Depending on how accurate it should be, you can simply define a reasonable color space that covers skin tones, and then have some% threshold value at which if the number of pixels of the flesh pixel exceeds that threshold%, then it can be exposed picture.
source share