Face detection and recognition depend strongly on illumination conditions. In this paper, we present improvements in the illumination compensation method called Self Quotient Image (SQI) applied to face recognition. Using genetic algorithms (GA) we select parameters of the SQI method to improve face recognition. The parameters optimized by the GA were: the fraction of the mean value within the region for the SQI, selection of Arctangent, Sigmoid, Hyperbolic Tangent or Minimum functions, and the values for the weights of each filter are selected within the range 0 and 1. We compare results of our proposed method to those with no illumination compensation and to those previously published for SQI method. We use four internationally available face databases: Yale B, CMU PIE, AR, Color FERET (grayscaled), where the first two contain face images with significant changes in illumination conditions, and the third one contains face images with slight changes in illumination conditions. Our method performs better than SQI in images with non-homogeneous illumination.