exposure or skin color in image

  c++, computer-vision, image-processing, light, python

How to detect/differentiate underexposure vs dark-skin in a face image?

The face image on the left side is white (Caucasian) having underexposure and the face image on the right is dark-skin having no underexposure. The background in the image is variable. How to detect that the image on left side is underexposed and the image on right side is good?

enter image description hereenter image description here

Source: Windows Questions C++