Successive training of a generative adversarial network for the design of an optical cloak

We present an optimization algorithm based on a deep convolution generative adversarial network (DCGAN) to design a 2-Dimensional optical cloak. The optical cloak consists in a shell of uniform and isotropical dielectric material, and the cloaking is achieved via the geometry of the shell. We use a feedback loop from the solutions of the DCGAN to successively retrain it and improve its ability to predict and find optimal geometries.


Introduction
The theoretical idea of an optical cloak was first suggested in 2006 by JF Pendry in a paper of transformation optics [1] and was later demonstrated experimentally [2]. It introduced the concept that a electromagnetic wavefront could be bent inside a circular shell of carefully chosen dielectric and magnetic materials and remain unchanged upon its exit, thus concealing an object inside of it. The proposed materials of the shell consisted of non-uniform anisotropic dielectric and magnetic materials. Recently, similar cloaking behaviour was found to exist in shell designs of more simple all-dielectric isotropical and uniform material [3,4,5]. The working principle for those shells resides in their geometry which can lead to the bending of the wavefront around the object to hide. The optimal geometries in those reported cases were found using topology optimization methods.
In this paper we use a deep learning genarative algorithm to accomplish the optimization of the geometry of an all-dielectric isotropic shell for cloaking. Generative networks have recently been demonstrated as useful tools for finding global solutions to inverse engineering problems [6] and have found applications in nanophotonics for the design of metasurfaces [7,8,9,10,11], nanostructures [12], metagratings [13] and power splitters [14]. We suggest to use a generative adversarial network [15] in a feedback loop in order to enable the network to improve itself and find an optimal configuration for cloaking. The procedure is done in several steps: First, several shells geometries are randomly created and are simulated to obtain their scattering coefficient (see Figure 1(a)). We then train a forward network (FN) to predict the scattered field amplitude from each geometry. A deep convolutional generative adversarial network (DCGAN) coupled to the FN is then used to generate new solutions which are aimed at minimizing the scattered fields. We then implement the loop to reuse the generated solutions to improve both the CN and the DCGAN for sufficient iterations until a satisfactory solution is found or the generative algorithm doesn't improve anymore.

FEM simulations
In order to obtain the scattering fields amplitude from a given cloak geometry, finite-element simulations using COMSOL's RF module are used. The simulation domain is presented in Figure 1 and has an exterior circular boundary with a radius of 12 μm. Another circular boundary of perfect electrical conductor (PEC) is located at R 1 =1 μm and constitutes the object to conceal. Multiple polygons of dielectric constant ε 2 = 2 are included in the region R 1 < r < R 2 arXiv:2005.08832v1 [eess.IV] 12 May 2020 to form the cloaking shell. A background illumination electromagnetic field defined by E = E 0 e ik0xŷ is used and the scattered fields are solved with scattering boundary conditions at Ψ. We then integrate the relative Poynting vector at the exterior boundary of the simulation to obtain the scattering metric to minimize : We use an object of radius R 1 =1 μm and a shell of R 2 =3 μm for the simulations, and the wavelength is set at λ= R 2 /2.5 = 1.2 μm. A total of 13000 simulations were performed with randomly generated shell geometries to form the initial dataset. The geometries were generated using the union of randomly generated curves inside the defined shell radius. We use a shell which is symmetrical in -x and -y according to the symmetry of the problem and also to assure continuity of the shell around the object.

Neural networks
The first part of the model consists in a forward predictive model of the scattering coefficient Φ as a function of the shell geometry. The input image consists in 64 × 64 binary images where the region of dielectric constant 2 is represented by 1 and 1 by 0. Since the shells are symmetrical in -x and -y, the images are taken for only one quadrant of the shell. A convolution network is then used, which consists in 4 convolution layers and 2 dense layers that takes a (64 × 64) image data and creates a single digit output. The network is trained with an Adam optimizer [16] with a learning rate of 1 · 10 −4 and the mean squared error is used as the loss function. Precise details of the network are provided in the supplementary information section. The generative adversarial network consists of two different networks, a generator and a discriminator, which work in opposition to create new shell geometries similar to those of the dataset. The generator is a transposed convolution network, which takes a random noise vector of dimension 200 as input and creates a new "fake" image of a cloaking shell as output. It consists of four layers of transposed convolution layers (Conv2DTranspose), which upsamples a matrix by applying strided convolution operations. The discriminator is a convolution network and takes a set of "fake" images (from the generator) and real images (from the initial dataset) and gives it a probability that the image is real. It consists of 3 layers of convolution layers and a dense layer. Both network are represented in Figure 3(a) and their details can be found in the supplementary information section. The adversarial play between the two networks is accomplished via their loss function, which is computed using the binary cross-entropy function : where I is the dataset of images, N is the number of images in the dataset, y i is the label of the image (1 or 0), and p(y i ) is the probability output. Loss of the discriminator is calculated using a sample of real and fake images with labels 1 and 0 respectively, while the loss of the generator is calculated using the sample of fake images only and using 1 as their label. This way, the discriminator is trained to differentiate the real and fake images, while the generator is trained to fool the discriminator by feeding it more and more realistic images which look like those of the dataset.
To this branched network we add an additional path, which will calculate the scattering metric of the new fake images using the forward model. This way, we can add this value to the loss function of the generator so the new images not only aim to resemble the ones of the dataset but also to optimize cloaking. Schematic of the full DCGAN network is represented in Figure 3(b). The total loss function of the generator is thus given by : where L t is the total loss, L g is the generator loss, L f is the forward model loss and α g , α f are weighting coefficients. Care must be taken in order to choose weighting coefficients that balances cloaking optimization and generator efficiency.
One important detail of the previous network is the implementation of a rounding function on the fake images obtained from the DCGAN in order to have binary image input for the forward model. Since a rounding function's derivative is equal to zero, its direct use will lead to a vanishing gradient and the forward model wouldn't contribute to the training of the generator. We thus use a round function with a forced approximated derivative given by: This function represents the derivative of a sigmoid function centered at 0.5, which is a close approximate of the rounding function.

Feedback Loop Training
DCGAN networks are effective at quickly generating and evaluating potential configurations for the cloacking shell. The addition of the forward network guides this generative process towards the optimization goal, in this case to minimize scattering. This method is limited though since the forward model isn't perfect at predicting the output to minimize, especially for configurations that differ considerably from those of the dataset. Some solutions might thus not be as optimal as the forward model predicts, and the model might also pass on a good configuration by wrongly predicting its output.
For this reason, an iterative process of retraining the forward network is suggested for improving the solution search. The method is depicted in Figure 4. The best solutions from the DCGAN according to the predicted scattering coefficient Ψ p are taken and simulated using FEM in order to obtain the actual scattering coefficient Ψ r . Those solutions are then added to the dataset and the forward model is retrained. The new forward model is added in the DCGAN and a new solutions search is initiated, using the new and improved dataset. This way, the forward model is improved by correcting any wrong prediction attributed to specific configurations which were deemed optimal. Furthermore, the dataset is improved by including good configurations, which will in turn lead the generator towards suggesting more favorable geometries.

Training of the DCGAN
Training of the DCGAN usually requires a fine tuning of the parameters for each of the neural networks, whether it is the generator, the discriminator or the forward model. Both generator and discriminator are involved in a zero-sum game one with the other, since positive outcome for one means negative outcome for the other. They usually reach a Nash equilibrium and oscillate out of phase [17]. The generator and discriminator need not to overpower one another, or else the generated configuration might be random and noisy, and as they differ considerably from those of the dataset the performance of the forward model will decrease significantly.
Adding an additional loss for the generator with the forward model creates a perturbation of this equilibrium, since the generator not only updates its weights to fool the discriminator but also to minimize scattering of the configuration. This leads, as can be seen in Figure 5(a), to a generator reaching an equilibrium slightly above that of the discriminator, meaning that the generator might not perform fully at suggesting configuration resembling those of the dataset. Choosing the weighting parameters α f , α g and α d of Equation (3) carefully as to keep the difference between generator and discriminator loss as small as possible is thus crucial for obtaining adequate solutions. The coefficient α g and α d were set to 1 and the parameter α f = 5/ < Ψ > for each generation of the method in order to adapt for lower loss with improved shell configuration. Since the dataset doesn't contain similar type of images, the outputs of the generator remains dynamic and keeps evolving during the training even once the equilibrium between discriminator and generator has been reached.

Feedback loop
In order to achieve optimization of the cloaking shell, 11 iterations of the training of the DCGAN were accomplished. In Figure 6, 4 random examples of the generator output are presented for each iteration of this feedback loop of the DCGAN. The proposed configurations are very diverse for the first few iterations, but converge towards one optimal configuration starting at iteration 5. This convergence is caused by two effects: on one hand, the forward model forces the generator to suggest optimal configurations, and on the other hand, the dataset is slowly getting more and more populated by those optimal configurations. In order to avoid getting the algorithm trapped in a local minimum, the α f parameter of Equation (3) needs to be chosen carefully low enough as to not collapse all the solutions of the generator towards the same configuration.
The strong point of the DCGAN is its ability to generate adequate configuration and to quickly predict the output of a certain configuration. The forward model takes about 0.1 ms for one prediction working on a Kaggle 17 GPU RAM kernel, while one COMSOL simulation takes 5-10s, making it roughly 50 000 -100 000 times faster. We thus take advantage of this feature by testing 128000 configurations at each of the 60 epoch of the DCGAN.
After each training of the DCGAN the 1000 best configurations are taken according to their predicted value of Ψ p and are simulated in the FEM method in order to have their actual value Ψ r . The loop is continued until no more improvements in the Ψ r is observed. The minimal value of Ψ r and the average value for each of the 11 iterations are plotted in Figure 7(a). We can observe a continual improvement of the minimal value and the average value of Ψ until it reaches 5.11 × 10 −11 W/m. This leads to a cloaking ratio of 0.0089 when comparing to the value 5.77 × 10 −9 W/m without the cloak. This performance is comparable to solutions found using topology optimization [3,4,5] for similar dimensions of the shell and object compared to the wavelength. In Figure 7(b) the total transverse magnetic field H z is plotted with the optimal cloak configuration found, which shows almost no distorsion of the wavefront compared to Figure 1(b). A strong concentration of the fields near the top and bottom regions of the object is observed, which is typical of the bending of the electromagnetic wavefront for cloaking shells.

Conclusion
In this paper we have demonstrated the use of deep learning for the optimization of an optical cloak. The suggested algorithm consists in a DCGAN architecture which is trained multiple times in a feedback loop in order to improve the solution search. The total scattered field coefficient, calculated with the Poynting vector at the outside boundary of the simulation domain of a FEM simulation, reached a ratio of 0.0089 of the field scattered without a cloak, which is comparable to results obtained using topology optimization.