# Towards Automatic Image Enhancement with Genetic Programming and Machine Learning
## 3 The Proposed Approach
### Genetic Programming Engine--ELAINE
Besides the conditional functions and terminals, the function set of ELAINE is also composed of a set of 7 previously reviewed image enhancement filters. The filters focus on five main aspects of IE approaches: contrast adjustment, brightness adjustment, color balance, noise removal, and edge enhancement (also referred to as _sharpening_). The contrast in image processing is the range of intensity values available to an image. The contrast stretching is a point operation method that tries to improve the image contrast by linearly increasing the difference between the maximum intensity value and the minimum intensity value in an image, increasing the contrast level. The work of [PERSON] et al. [27] discusses and reports such a filter for IE. Histogram Equalization (HE) is another method that tries to improve an image's quality by manipulating the contrast. It does this by spreading the most common intensity values by the less common ones, increasing the global contrast of an image. This method is highly used, and there are multiple iterations and discussions about its results [28]. Contrast Limited Adaptive Histogram Equalization (CLAHE) is yet another contrast enhancement method and adaptable for different use cases [29], which consists of an iteration of the Adaptive Histogram Equalization (AHE) technique that is an improved version of the regular histogram equalization. Thus, CLAHE improves upon the AHE by clipping the maximum intensity values of each region and redistributing the clipped values  
Figure 3: Graphical example of an individual. The numbers represent the ephemeral constants, the _ITE_ node represents the _if-then-else_ primitive, and the Saturation node represents the conditional function. uniformly throughout the histogram before applying the equalization. Gamma Correction (CB) tries to accommodate the fact that the HVS perceives brightness in a non-linear way. This is performed by scaling each pixel brightness from [0-255] to [0-1] and applying an expression to map the original values. Non-local Means Denoising (NLMD) [30], as the name implies, tries to reduce the existing noise in an image. It replaces the value of each pixel in each channel with the average of similar pixels. Unsharp Masking (UM) is an IE technique that sharpens the edges of an image [18]. It does that by subtracting a blurred version from the original image to create a mask. This mask is then applied to the original image, enhancing edges and details. Simplest Color Balance (SCB) was proposed by [PERSON] et al. in Reference [31]. The algorithm tries to remove incorrect color cast by scaling each channel histogram to the complete 0-255 range via affine transform. Along with the Evolutionary engine, we have created a website that allows a user to test the evolved filters with ELAINE ([[http://elaine.dei.uc.pt](http://elaine.dei.uc.pt)]([http://elaine.dei.uc.pt](http://elaine.dei.uc.pt))), as shown in Figure 4. The interaction goes as follows: upload an image; select a filter from the preset evolved filters; submit to the system; and see the generated image which may be downloaded. Note that the filters are examples of outputs for the particular sample image. Since the pipelines have conditionals based on image properties, different images with the same filter can have different effects.