Main steps required by a genetic algorithm.

## 1. Introduction

Minimizing the aberrations is the basic concern of all the optical system designers. For this purpose, a large amount of work has been carried out and plenty of literature can be found on the subject. Until the last twenty years, the large majority of the optical design was related to “static” optical systems, where several opto-mechanical parameters, such as refractive index, shape, curvatures, etc. are slowly time dependent. In these systems, simple mechanisms can be adopted to change the relative position of one or more optical elements (for example, the secondary mirror of many astronomical telescopes), or slightly modify their shape and curvature (as in some synchrotron beamlines, where some optical surfaces are mechanically bent) to compensate defocusing. In the last years, a new type of optical systems, that we may call “dynamical”, have heavily occupied the interest of optical designers, opening the possibility of working also in situations where the system environment varies rather quickly with time, either in a controlled or not-controlled way. For this class of optical systems adaptive optics (AO) with a closed loop control system has to be implemented. The correction of dynamical systems was predicted by Babcock in the 1953 [1] and, then, the first prototypes were realized in the early 70s with the purpose of satellite surveillance and launching high power laser beams trough the atmosphere [2]. The most known scientific applications of closed loop correction by means of AO is the acquisition of astronomical images in ground-based telescopes [3] and *in-vivo* imaging of cone photoreceptor mosaic by AO enhanced Fundus Cameras [4]. In astronomy, to remove the so called “seeing effect”, the star light twinkling due to local dynamic variations of the atmospheric density in the air column above the telescope, it is necessary to have the real time knowledge of the wavefront of the observed object. This can be realized, for instance, by means of a Shack-Hartmann wavefront sensing device coupled to a dedicated fast algorithm which returns the mathematical description of the wavefront aberration, typically through a Zernike series decomposition [5]. Then, this information is suitably coded and passed to an AO, as a fast deformable mirror located along the optical path, that adapts its shape to compensate the time dependent aberrations. Similarly in vision science [6, 7] or retinal imaging [8-15], static and dynamic aberrations created by variation in shape of eye refractive elements and eye movements are measured by wavefront sensor, usually Schack-Hartmann and corrected by wavefront corrector, in most cases a deformable mirror. Other applications which make use of AO systems are for example: free space optical communication systems [16, 17], microscopy [18-20] or beam shaping in laser applications [21]. It is, however, rather obvious that not all AO applications have similar needs, and in particular that in some cases systems simpler than the astronomical ones can be realized. For example, in some cases there is no need to have the real time information about the aberrated wavefront: either because the aberration variation is slow [22] or because there is a specific phase which remains for a limited amount of time, as for example when correcting low order ocular aberrations “eyeglass prescription”for patient in ophthalmic diagnostics, or in optical devices in which the environmental conditions are not initially defined but the system remains stable in time [23-25]. In all these cases it can be convenient to have a simpler AO system, able to correct only the slow variations of the wavefront aberrations.

In the above mentioned cases the wavefront correction can be operated with a strong reduction in the hardware complexity, in particular by using a sensorless approach. Several techniques have been developed which use these simpler AO systems. They are generally based on the optimization of some merit function that depends on the optical system under consideration.

The algorithms for the sensorless correction can be divided into two main classes: the stochastic and the image-based ones. In the first class, the system is optimized starting from a random set and, then, applying an iterative selection of the best solutions. These algorithms have the advantage of not requiring any preliminary information about the system but they take a lot of time for converging. Many algorithms using this approach have been written and exploited successfully in different fields. Among them the most popular are: genetic algorithms [18, 26, 24], simulated annealing [13], simplex or ant colonies [27]. These approaches have the drawback of requiring a rather long computation time, or many iterations before converging, taking up to several minutes before reaching the desired system optimization.

Other sensorless techniques can be realized by analyzing some specific known feature, either intrinsic to the system or artificially introduced. An example of the latter case can be found in [28-29]. With respect to classical AO systems, the sensorless approach offers the advantage of not needing the wavefront sensor: this reduces the cost of the instrument and avoids all the problems related to maintaining the performance of such a device once installed and aligned. However, the absence of the wavefront sensor implies also some limitations, for instance, a much longer time before reaching an optimal image quality, or a final image not perfectly optimized. Clearly, the required final result and the available resources are the key elements driving the choice towards one system or another. In section 2, we will explain in detail the genetic algorithm and the ant colonies optimization process, while providing a few examples of their application in optical experimental setups.

The image-based algorithms will be explained in section 3, together with a few examples of recently reported successful applications in optical experiments. New devices useful to generate the bias aberrations will also be presented.

## 2. Stochastic algorithms for sensorless correction

### 2.1. Genetic algorithm

A genetic algorithm [30] searches the solution of a problem by simulating the evolution process. Starting from a population of possible solutions, it saves some of the strongest elements, that are the only ones selected to survive, and, thus, are able to reproduce themselves giving rise to the next generations. In general, the inferior individuals can survive and reproduce with a smaller probability.

This strategy allows solving a large class of problems without any initial hypothesis or preliminary knowledge. Its effectiveness was demonstrated in many experimental setups, as will be discussed in the following paragraphs.

The main steps of a genetic algorithm are depicted in Table 1 and in Fig. 1.

The initial population is chosen randomly in the whole set of possible solutions. The selection function can be either probabilistic or deterministic. In the probabilistic case, the strongest elements have more chances of being selected and of reproducing to the next generation. This decreases the possibility of falling in a “local” maximum solution.

The reproduction function creates new individuals from the old population. There are two kinds of functions: crossover and mutations.

*CrossOver* functions: they mix the genes of the two parents by slightly modifying them and by obtaining two sons.

Example: EuristicXOver:

From the parents V_{a}^{(k-1)} and V_{b}^{(k-1)}, the children V_{a}^{(k)} and V_{b}^{(k)} are generated by the following rule:

*Mutations* functions: the genes of the parent are randomly modified.

Example: Uniform Mutation:

The mutation take an element V_{cj}^{(k-1)} and mutate it in a new one by the rule:

where w(k) is weight function which decreases with the iteration k.

#### 2.1.1. Application example: Laser focalization

The intensity of a laser in its focal spot is largely dependent on the quality of the focal point, and this effect is even stronger in nonlinear optics. Often, in laser systems it is not simple to reach an optimal alignment, so that AO devices can be very useful in these cases.

For example, in ref. [24] it was demonstrated how an AO sensorless optimization based on a genetic algorithm can largely enhance the XUV high-order harmonics (HH) generated by the interaction of an ultrafast laser and a gas jet.

The AO system was composed by an electrostatic deformable mirror (Okotech) placed before the interaction chamber as illustrated in Fig. 2. The feedback for the genetic algorithm was the photon flux at the shortest wavelengths acquired placing a photomultiplier tube at the XUV spectrometer output.

The laser pulse was generated by a Ti:S CPA laser system with a hollow-fiber to realize the compression of the pulse duration. The typical values used in the experiment are 6 fs of duration, 200 μJ of pulse energy, at 1 kHz repetition rate (all the experimental details are described in Villoresi et al. 2004). The focusing of the laser pulses on the gas jet, after the modifications introduced by the Deformable Mirror (DM), is obtained by means of a 250 mm focal length spherical mirror. The spectrometer that analyzes the HHs beam is based on a flat varied-line-spacing grazing-incidence grating with two toroidal mirrors.

The real-time acquisition of the spectral intensity is realized by the combination of a solar-blind open microchannel-plate (MCP) with MgF_{2} photocathode and a phosphor screen placed on the spectrometer focal plane, which converts the HHs XUV spectrum in the visible, and by a photomultiplier which acquires a HHs spectral interval selected with a slit. In this way, the single-shot intensity of a single harmonic, or group of harmonics, is used as feedback by the algorithm. A separate optical channel acquires in parallel the image of all at the MCP, from which the HHs spectrum is obtained.

The genetic algorithm used a population of 80 individuals, with a deterministic selection rule that saved the 13 best ones. Both mutations and crossover were used. The results showed an increase of the XUV photons by a factor of 5 when the algorithm was applied. Moreover, the cutoff region moved to shorter wavelengths as reported in Fig 3. The optimization process took about 20 iterations to converge.

### 2.2. Ant colonies

Ant colonies, in natural world, search the food by walking randomly. After having found it, they return to their colony leaving down a pheromone trail. If other ants cross the same trail they will not walk randomly but they will likely follow it and will reinforce the pheromone trail. The more ants will find food at the end of the trail, the more pheromone will mark it. However, since the pheromone evaporates reducing its strength, the described process will make the shortest path which will be the one with the highest density of pheromone, so providing a selection among all the possible paths, as illustrated in Fig. 4.

The main essence of the Ant Colonies optimization algorithm [27] is to simulate the ant behavior for the optimization of a given problem. The algorithm steps necessary for running the optimization are listed in Table 2.

As an example we show in Fig. 5 the simulation of the application of the ant colony strategy to a deformable mirror with 32 actuators and 8 bits control. In this example the actuators and their control values are the domain in which the ants can move. In the simulation the shortest path is a parabolic function, which is represented by the red line. Fig. 5 (top) shows the initial random pheromone distribution, while Fig. 5 (bottom) shows the pheromone distribution at the end of the optimization process.

#### 2.2.1. Application example: Quantum optics

The quality of an optical wavefront plays an important role in Spontaneous Down Conversion (SPDC) process. As demonstrated by [31] the use of a deformable mirror can enhance the generation of photon pairs acting on the wavefront before the generation takes place in the nonlinear crystal. In that system the optimization was carried out by the use of an electrostatic DM (PAN, Adaptica srl) and the application of the ant colonies algorithm.

In the experiment, the pump beam is reflected by the DM to a BBO type-I nonlinear crystal. Then, the degenerate SPDC photons at 808 nm are selected and measured by a high efficiency SPADs (Single Photon Avalanche Diode). Since the wavefront has a strong effect on the downconverted light, it can strongly affect the coupling in the fibers of the SPAD detectors. The feedback for the algorithm imposed the condition of photon coincidences. It was demonstrated in the experiment that the coincidences rate was increased by about 20% when the optimization algorithm was applied. The algorithm used about 80 ants and the convergence took place in about 800 iterations.

## 3. Image based algorithms

Although the stochastic optimization algorithms have been demonstrated to represent important tools for optical experiments, new techniques, which demonstrated to be more effective, have recently been introduced. The use of a modal approach, based on the application of bias aberrations and of a suitable metrics, sorted out some of the limitations of the search algorithms, such as the long convergence time and the need of a training for the determination of the algorithm parameters. This new approach demonstrated to be effective both in visual optics and in laser optimization, as described later in this section. The arbitrary generation of aberrations can be achieved through the use of deformable mirrors, either thanks to a preliminary calibration of them or through the design of a suitable new class of wavefront correctors [32].

### 3.1. Devices for sensorless modal correction

Electrostatic membrane deformable mirrors rely on the electrostatic pressure between an actuator pad array and a thin metalized membrane [33]. Thus, the more the actuators the better the wavefront resolution that the mirror can control. The use of these deformable mirrors is, then, subjected to the acquisition of the deformation generated by each electrode. On the other hand, this kind of DMs can also be used with the optimization algorithms. The drawback, in this case, is that the higher the number of actuators the longer will take to the algorithm to converge.

Recently, a new type of deformable mirrors suitable for the direct generation of aberrated wavefronts was designed. The modal membrane deformable mirror, MDM, relies on the use of a graphite layer electrode arrangement (see Fig. 6) for the generation of a continuous distribution of the electric field which allows the generation of the low order aberrations (defocus, astigmatism, coma) and of the spherical aberration.

The MDM has already been demonstrated to be effective in several fields, as laser focalization [32], image sharpening and Optical Coherence Tomography ( OCT), as it will be discussed later.

Another device for the generation of aberrations is the PhotoControlled Deformable Mirror (PCDM), which is schematically represented in Fig. 7. This deformable mirror [35, 36] is composed of an electrostatic membrane while the actuator pad array is replaced by a photoconductive material. Thus, the membrane shape depends on the light pattern projected on the photoconductor. Arbitrary actuator pads can be conveniently achieved by illuminating the photoconductive side of the mirror with a commercially available Digital Light Processing (DLP) hand-held projector.

The calculation of the electrode pattern that generates a determined aberration is composed of the following steps:

division of the projector area into small subsets (i.e. 40 × 40);

calculation of the membrane shape for each of the 40 × 40 pixels, solving the Poisson equation by the iterative methods;

determination of the pattern by pseudoinversion of the matrix determined at point b.

A few examples of the realized electrode patterns are shown in Fig. 8, together with the corresponding measurements of the aberrated wavefronts.

We proved that the image quality can be considerably improved by using these adaptive devices in an image sharpening setup. For example, the MDM allowed achieving a significant image sharpening with just about 35 measurements, as illustrated in Fig. 9.

### 3.2. Optimization of low spatial frequencies

The sharpness of an optical imaging system depends strongly on the wavefront quality. Recently [28] demonstrated that the low spatial frequency in an image can be used as a metric to perform the optimization. The process takes place by the acquisition of a series of images with the application of a predetermined aberration. The images, then, contain the information about the corrections which have to be applied to cancel the aberrations. This technique is very powerful, especially if coupled to the Lukosz modes aberration expansion. The Lukosz modes are similar to the Zernike polynomials: the difference is that the Zernike polynomials are normalized such that a coefficient of value 1 generates a wavefront with a variance of 1 rad^{2}, while the Lukosz functions are normalized such that a value 1 coefficient corresponds to a rms spot radius of λ/(2πNA), where λ is the wavelength and NA is the numerical aperture of the focusing lens.

The peculiarity of this expansion is that the effect of the Lukosz polynomials coefficients {*ai*}, on the image sharpness *I(ai)* is quadratic:

This implies that the optimization of each mode can be performed independently and requires just the acquisition of three images. Then, the best point for each aberration can be found by interpolating the result with a quadratic function.

### 3.3. Point Spread Function (PSF) optimization

Another example of application of wavefront sensorless AO [29] consists in projecting a known point-like source through the optical system under test and then analyzing its image by means of a suitable software [36]. With the information obtained by the analysis of the point source image, the shape of a deformable mirror inserted along the optical path is modified. This process is iteratively repeated through a defined hierarchy, to gradually remove the optical aberrations.

With this technique, the point source image to be analyzed is not directly available and has to be somehow created. As an example, in the case of a fundus camera dedicated to the observation of the human retina, an illuminated pinhole can be projected on the retina itself through a dedicated optical path; this is a standard technique for this type of applications and is not going to introduce a significant complexity in the system. The light that is back-diffused by the retinal fundus acts as a point source, and its wavefront can be analyzed to estimate the aberrations present along the optical path from the retina to the detector.

#### 3.3.1. Application of the PSF optimization in a visual optics setup

The closed loop method of correcting the aberrations of an optical system has been verified to be very stable, at least with respect to possible misalignments of the deformable mirror or aging of the mirror membrane that has been used. This stability is inherent in the adopted approach to the problem, which is less ambitious than correcting the wavefront aberration.

The described technique has been verified by means of the rather simple optical setup shown in Fig. 10. The radiation emitted by a LED diode source (SOU) is condensed by a microscope objective lens (L_{cond}) on a pinhole (PH). The radiation emerging from the pinhole is collected by a zoom collimating lens (L_{coll}). The collimated beam passes through a diaphragm (DIA) and a beam splitter (BS) and impinges normally onto a deformable mirror (M_{def}). After reflections from M_{def} and BS, the beam is compressed by an a-focal Newtonian system (L_{comp}^{1} and L_{comp}^{2}) and can, then, follow two different paths: either a) a focusing two-lens system L_{foc} that makes the image of the pinhole on a CMOS digital camera (DET), or b) a flip mirror (M_{flip}) which deviates the beam on a wavefront analyzer (WFA). The latter has been used to measure the wavefront aberrations before and after the correction performed by the DM. With this system, both by varying the focal length of L_{coll} and tilting L_{comp}^{1}, it was possible to introduce controlled amounts of aberrations on the nominal pinhole image. Then, by the suitable image analysis and consequent estimate of the aberrations, the parameters needed to drive the deformable mirror to improve the image quality have been derived.

Even if the apparatus performance was constrained by the limited unidirectional sag of the deformable mirror, the obtained results proof the principle of the adopted methodology. This is clearly demonstrated in Fig. 11, which shows the wavefront error measured with the WFA before and after the deformable mirror correction for three different cases. From these graphs, and more quantitatively from the detailed analysis described in [29], it can be seen that a RMS wavefront error as low as *λ*/10 (@527.5 nm) can be obtained, which is a significant result for a sensorless AO system. The correction was not particularly effective only in those cases in which the unidirectionality of the mirror deformation did not allow aberration compensation, as in case of astigmatism. However, with a different choice of AO system, the system is very effective in identifying and correcting aberrations.

It has to be mentioned that these tests verified that the image analysis algorithm takes less than 100 cycles to reach the optimal condition; since one cycles takes approximately 1/20 - 1/25 s on a standard computer, the whole optimization takes just 4-5 s. Comparing this time with the typical times necessary to optimize other sensorless AO systems, it is evident the significant advantage of this technique, once implemented. The only limitation of this technique is that starting PSF image should give enough signal. In fact, if the point source image is too spread out, the signal to noise ratio can be very poor, substantially inhibiting the system to make a correct image analysis.

### 3.4. Optical Coherence Tomography (OCT)

Optical coherence tomography, OCT, is an imaging modality allowing acquisition of micrometer-resolution three-dimensional images from the inside of optical scattering media (e.g. biological tissue). OCT is analogous to ultrasound imaging, except that it makes use of light instead of sound. It relies on detecting interferometric signal created by the light back scattered from the sample and from a reference arm in a Michelson or Mach-Zehnder interferometer. OCT has many applications in biology and medicine and can be treated as a sort of optical biopsy without requirement of tissue processing for microscopic examination.

One of the interesting features of OCT is that, unlike in most optical imaging techniques, the axial and lateral resolutions are decoupled, thus allowing for an improved axial resolution, which is independent of transverse resolution. The axial resolution Δz is determined by the roundtrip coherence length of the light source and can be calculated from the central wavelength (λ_{0}) and the bandwidth (∆λ) of the light source as [37]:

The lateral resolution (∆x) in OCT is defined similarly to the confocal scanning laser ophthalmoscopy (cSLO), since OCT is based on a confocal imaging scheme. In many imaging systems, however, the confocal aperture exceeds the size of the Airy disc, which degrades the resolution to the value known from microscopy, i.e. [38]:

Therefore, as for standard microscopy, AO enhanced devices might be necessary to achieve diffraction limited transverse resolution. As a result, only a combination of OCT with AO has the potential to achieve high and isotropic volumetric resolution. The use of broadband light sources that are necessary for OCT and the complexity of both the AO and the OCT technique, make the combination very challenging [39]. In general, any AO-OCT instrument can be divided into two subsystems: an adaptive optics subsystem, with wavefront sensing and wavefront correction, and an interferometric OCT subsystem. In every implementation of AO-OCT all the elements of the AO subsystem are located in the sample arm of the OCT interferometer. Indeed, there is no need to have AO correction in the reference arm because aberrations introduced within this part of the system will not influence the transverse resolution of the image. In most of the AO-OCT systems, a Shack–Hartmann wavefront sensor is used to measure aberrations and, then, to control adaptive optics correction.

Bonora and Zawadzki recently demonstrated that sensorless correction can be implemented in optical coherence tomography by using a specially developed resistive deformable mirror. This novel modal deformable mirror, MDM, was successfully employed in the UC Davis AO-OCT system to image static samples, test targets and tissue phantoms. Fig. 12 shows a schematic representation of the sensorless AO-OCT system used in the experiments.

To test the performance of our sensorless AO-OCT system, we evaluated the image quality of a sample, consisting of a USAF resolution test chart with an adhesive tape glued to its front side, after insertion of a trial lens with 0.5 Diopter astigmatism in front of the imaging objective. We were able to achieve improved resolution by using the following merit function S [41] on the OCT en-face projection images

where I(x,y) is the intensity in the OCT en-face image plane. This approach is simillar to PSF optimization. In fiber based OCT systems single mode fiber introduces OCT beam to the sample and also act as detector for back scattered light. Therefore we have a point source that is imaged by the optical system and the confocal pinhole that allows direct mesurment of light intensity trougput by the system. As expected, the algorithm performed the optimization by adjusting only defocus and astigmatism (see Fig. 13).

Fig. 14 shows some examples of the en-face projection views extracted from OCT volumes: there are the initial view acquired from the sample, and three improved views after correction of additional aberrations, namely, defocus and two astigmatisms. Clearly, at each correction step the images of the test target get sharper. Additionally, the features of the adhesive tape attached to the back of the Air Force test target become more visible as well.

These recent results demonstrate that wavefront sensorless control is a viable option for imaging biological structures for which AO cannot establish a reliable wavefront that could be corrected by a wavefront corrector. Future refinements of this technique, beyond the simple implementation presented in this chapter, should allow its extension to in-vivo applications. An example of sensorless adaptive optics scanning laser ophthalmoscopy (AO-SLO) for imaging in-vivo human retina has been recently presented [42].

### 3.5. Laser process optimization

Similarly to the optimization process presented in section 2.1.1 [24], we report here about the optimization of a laser process by the use of a sensorless AO [43]. In the former case, the generation of harmonics from an ultrafast laser was improved by the use of a genetic algorithm. In the latter case, an algorithm derived from the image-based procedure was employed in conjunction with the use of a MDM deformable mirror similar to the one described in section 3.1. The advantages in terms of experimental complexity and convergence time are discussed in the given reference.

In the sensorless case, the laser source was a tunable high energy mid-IR (1.2µm-1.6µm) optical parametric amplifier with 10 Hz repetition rate [44]. The harmonics of the laser were generated by the interaction of the laser pulses with a krypton gas jet. In this system, the infrared pulses and the slow repetition rate made inconvenient, respectively, the use of a wavefront sensor and of an optimization algorithm needing hundreds of iterations.

The experimental setup used for this application is illustrated in Fig. 15. To demonstrate the easiness of integrating the sensorless AO device within the experiment, the optical path before the DM is shown with a dotted line. The additional elements are simply a plane mirror and a resistive MDM, which have been introduced without any complex operations. The system optimization consisted in the increase of the harmonic signal detected by the photomultiplier at the output of the monochromator. The obtained result is illustrated in Fig. 16, where it is possible to see that the photon flux on the photomultiplier is doubled with respect to the one obtained after the correction of the defocus.

## 4. Conclusions

In adaptive optics the choice of the optimal correction strategy depends on the required application, desired image quality, and affordable complexity/cost of the final system. In this context, sensorless adaptive optics provides several solutions, most of them implementable at a simplified and relatively low-cost level, that can be exploited for a wide range of applications.

We have presented here both a review of the most diffused systems used in sensorless adaptive optics and some recently developed algorithms and devices. Essentially, two different approaches are employed: those based on random search and the subsequent application of evolutionary strategies, and those based on the application of some bias aberration. In general, the second class of algorithms present a faster convergence.

We have shown several application examples in different fields, such as the optimization of ultrafast nonlinear optical systems for the generation of high order harmonics, the image sharpening in microscopy applications and the enhancement of optical coherent tomography.

Sensorless adaptive optics appears, therefore, as having a great potential for finding new applications in current and future technologies. The continuous improvement of the optimization algorithms and development of novel deformable mirror devices, make the integration of AO into various optical systems increasingly easier. Particularly, the conjunction of sensorless AO with OCT might open the way to a new generation of diagnostic imaging.