I am using the following algorithm to detect skin color, but its not working real well in different lighting conditions. Can anybody offer any advice how to improve it or su
See my answer to robust hand detection here where I recommended a method using color histogram built using just the hue and saturation channels of an image originally from Gary Bradski (OpenCV's creator)'s paper on face tracking. It includes an overview of the method as well as links to sample code on how to detect skin region.
The method is simple yet fairly robust to noise and lighting variations as well as being able to detect different skin tones. No machine learning needed :).