# Conditional Generative Adversarial Networks for Inverse Design of Multi-
functional Microwave Metasurfaces

###### Abstract

Electromagnetic (EM) metasurfaces can present a versatile platform for
realization of multiple diverse EM functionalities with incident wave
frequency, polarization, propagation direction, or power intensity through
appropriate choice of unit cells structures. However, the inverse design of
multi-functional metasurfaces relies on massive full-wave EM numerical
simulations to obtain an optimized solution. This article proposes a step-by-
step procedure based on conditional Generative Adversarial Networks (cGANs)
integrated with Gramian Angular Fields (GAFs) to reduce the computational time
required for the EM simulations in the inverse design of multi-functional
microwave metasurfaces. The proposed procedure initially implements GAFs to
encode the desired multi-objective scattering parameters to images and then
passes them through the cGAN model to map them to three-layer metasurfaces.
The present study uses a robust dataset with a wide range of values and
designs, including 54,000 metasurface structures and corresponding scattering
parameters to train and validate the cGAN model. This article also presents a
case study example using a multi-functional metasurface with three independent
functionalities and full-space coverage to justify the performance of the
proposed procedure in the inverse design of multi-functional microwave
metasurfaces. The results demonstrate that the performance of the proposed
model is promising, and the proposed procedure can be used to efficiently and
accurately design multi-functional metasurfaces.

###### keywords:

Multi-functional metasurface inverse design, Conditional Generative
Adversarial Networks, Convolutional Neural Networks

Mehdi Kiani andJalal Kiani*

M. Kiani
School of Electrical Engineering, Iran University of Science and Technology,
Tehran, Iran

J. Kiani, Ph.D.
FedEx, Memphis, TN 38125, USA
Email Address<EMAIL_ADDRESS>
Figure 1:  (a) The perspective view of the three-layer unit cells contains
64$\times$64 configurations of metal and void square blocks. (b) Top layer,
(c) middle layer, and (d) bottom layer.

##  1 Introduction

Electromagnetic (EM) metasurfaces are two-dimensional counterparts of EM
metamaterials that received substantial attention for their great flexibility
in EM waves control [1, 2]. They represent a thin-layer periodic or quasi-
periodic array of metallic and/or dielectric elements, called unit cells,
tailored to control the EM waves in unconventional ways. The realization of
these structures has brought on a multitude of applications in achieving
mantle cloaks [3, 4], polarizers [5, 6], wave-front manipulators [7, 8],
holograms [9, 10], analogue computers [11, 12], absorbers [13, 14], flat
lenses [15, 16], etc.

A critical issue concerning metasurfaces is designing appropriate unit cells
to reach the required scattering coefficients [17], equivalent refractive
indexes [18], or surface impedances [19] for performing the applications. The
traditional design of unit cells requires a deep understanding of the EM
fields distribution in the unit cells metallic patterns to make an initial
design. Additionally, the design process necessitates establishing tremendous
numerical EM simulations and solving the expensive wave’s equations
iteratively to reach the optimized EM responses. On the other hand, the design
of metasurfaces with multiple functionalities needs more complex unit cells.
Therefore, the design process of multi-functional unit cells is accompanied by
highly time-consuming and costly optimization of a broad range of unit cell’s
geometric parameters.

Over the past decade, due to the remarkable developments in data science and
big data computing, the applications of machine learning methods across many
fields, including computer vision [20, 21], natural language processing [22],
speech recognition [23], quantum computing [24] reinforcement learning [25],
and in different fields of engineering [26, 27, 28, 29] are continuously
growing. Recently, several research studies were published in the field of
optical metamaterials and metasurfaces to implement machine learning tools to
automatically design and optimize chiral metamaterials [30], resonant
metasurfaces [31], multi-parametric metasurfaces [32], metasurface imagers
[33], all-dielectric metasurfaces [34], intelligent coding metasurfaces [35],
multi-functional metasurfaces [36], etc. In these studies, the machine
learning algorithms helped reduce the computational time required for the
numerical simulations of classical metamaterials and metasurfaces. Inspired by
the recent rapid advancements of machine learning tools in optics, several
research studies elaborately explored machine learning-based inverse design of
microwave metasurfaces to overcome the sophistic challenges of metasurfaces
design [37, 38, 39, 40, 41, 42, 43].

Qiu et al. [37] introduced a deep learning-based approach for microwave
metasurfaces inverse design. Their proposed model automatically generates a
one-layer unit cell given a desired reflection amplitude response as the
input. In addition, owing to the recent advancements of the reprogrammable
digital coding metasurfaces in the engineering of EM waves [44, 45, 46, 47], a
deep learning technique for image processing was proposed for inverse design
of anisotropic digital coding metasurfaces [38]. This deep convolutional
neural network could automate designs from the desired reflection phase to the
objective unit cell structure. However, these metasurfaces inverse design
models can only realize the target design in proportion to the amplitude or
phase of reflection. Therefore, they cannot generate unit cells for different
plausible applications requiring simultaneous control over both amplitude and
phase.

Generative models were used as a solution to this shortcoming in the
metasurfaces inverse design [39, 40, 41]. Hodge et al. [39] trained a deep
convolutional generative adversarial network on a dataset of known unit cells
to generate new unit cells tailored to the design objectives. Similarly, a
generative machine learning model based on a variational autoencoder for
designing multi-layer metasurfaces in transverse-electric (TE) and transverse-
magnetic (TM) polarizations was developed [40]. However, these designs were
trained using variations in geometric parameters of a limited number of known
unit cells such as Jerusalem cross, rectangular and elliptical patches, and
ring resonators that restrict the access to various EM functionalities by the
designed metasurfaces. Moreover, these models only design metasurfaces in one-
half EM space, leaving half of the space entirely unused, or with a single EM
function that is unattractive for future smart radio environments and adaptive
wireless networks.

The ever-increasing demand for system integration and device miniaturization,
specifically in wireless communications, led to growing interest in multi-
functional metasurfaces. One way to address this need is to employ
semiconductor lumped elements into the structures to reach reconfigurability
[48, 49, 50]. Reconfigurable metasurfaces can show various EM functionalities
depending on the controlling signals. However, they usually need DC bias
networks which dramatically increases the complexity of the systems. On the
other hand, designing multi-functional passive metasurfaces that cover the
whole space is time-consuming and computationally expensive. Using machine
learning-based approaches for the inverse design of multi-functional passive
metasurfaces can significantly reduce the computation and optimization time of
the design process. In this regard, an approach based on conditional
Generative Adversarial Networks (cGANs) is developed for the inverse design of
dependent and independent multi-functional passive microwave metasurfaces for
full-space coverage. The proposed methodology encodes the scattering
parameters to images using Gramian Angular Fields (GAFs), allowing the cGAN
model as a computer vision tool to be used for designing multi-functional
metasurfaces with full-space coverage. The training and validation datasets
are unit cells structures in the form of 64$\times$64$\times$3 matrices of
metallic and void square blocks with various metallic square block presence
probabilities (MSBPPs) and metal and void square block arrangements (MVSBAs)
and their corresponding scattering parameters with a broad range of values.
For validation of the model, a passive microwave metasurface is presented with
three independent functionalities for EM wave manipulation in the full space
at a fixed frequency.

Figure 2:  The MSBPP distribution in the three layers of the studied unit
cells in the different cases.

##  2 Study Dataset

The study dataset is a collection of several components: metasurfaces
characteristics, EM features, and the metasurfaces responses exposed to EM
waves. The dataset is built using results from analyses of about 54,000
configurations of microwave metasurfaces excited by EM waves across an 8-12
GHz frequency range. Each metasurface unit cell in the study dataset comprises
a 64$\times$64$\times$3 configuration of metal and void square blocks. The
diversified MSBPPs and MVSBAs in these unit cells of the dataset result in a
reliable and robust training dataset. In this study, CST Microwave Studio EM
simulator [51] is used to calculate the scattering parameters of the
metasurfaces as the EM responses.

The following parts provide additional information about the overall
specifications of the proposed metasurfaces, incident EM waves, and the data
collection process.

###  2.1 Metasurface Model

This study employs three-layer metasurfaces to manipulate EM waves in the
full-space. As shown in Figure 1, the three-layer metasurfaces unit cells are
accomplished by means of three configurations of 64$\times$64 square blocks
(or a 64$\times$64$\times$3 configuration) with side length $l=0.125$ $mm$,
situated on FR-4 dielectric substrates with thickness $t=1.5$ $mm$, period
$p=10$ $mm$, dielectric constant $\epsilon_{r}=4.3$ $F/m$, and loss tangent
$tan\delta=0.025$. In order to create a slot-based coat, a thin metallic
square ring with a width $w_{m}=2$ $mm$ is patched in the middle layer so that
all around the middle layer is covered by the metal. The 64$\times$64$\times$3
configurations are composed of two types of metallic blocks and void blocks,
which are distributed randomly on the unit cells.

###  2.2 Electromagnetic Excitation

In general, for the design of metasurfaces with single functionality, one
parameter, the reflection coefficient or transmission coefficient of the
metasurface in just one polarization, is usually required to be considered.
However, to design metasurfaces with several functionalities, examining the
reflection and transmission coefficients in TE and TM polarizations is
necessary. In this study, TE- and TM-polarized EM plane-waves illuminate the
three-layer unit cells in the $-z$ and $+z$ directions. The reflection and
transmission coefficients of the structures in these polarizations and
directions are computed by CST Microwave Studio. Periodic boundary conditions
(PBCs) are activated in $x$ and $y$ directions and Floquet ports are defined
along the $-z$ and $+z$ directions in order to construct a transversely-
infinite array from the unit cells shown in Figure 1. The reflection and
transmission coefficients of metasurfaces ($S_{11}$, $S_{21}$, and $S_{22}$)
are examined to achieve metasurfaces with desired EM functions using the
machine learning model.

###  2.3 Data Collection

It is well acknowledged that the performance of the deep learning models
significantly depends on the quality and quantity of the training samples.
When the amount of training samples is small, the deep learning models are
likely to overfit the training data resulting in low performance for unseen
data. 54,000 data samples that sufficiently represent the metasurface inverse
design problem are collected to prevent the overfitting of the proposed deep
learning model. The dataset contains 27 different cases, each containing 2000
64$\times$64$\times$3 configurations of square blocks and their scattering
parameters. Each configuration of square blocks differs from the other
configurations in at least one of these two aspects: first, the MSBPPs in each
layer of the three-layer unit cells, and, second, the MVSBAs in the different
layers of the unit cells. As shown in Figure 2, MSBPPs for the top and bottom
layers change from 20% to 90%, whereas for the middle layer, they change from
20% to 70%. For example, in case 1, MSBPPs in the top and bottom layers are
20%, while it is 70% in the middle layer. Such a robust training dataset with
various MSBPPs and MVSBAs significantly improves the proposed deep neural
network performance. To observe and compare the performance of different cases
in generating EM responses, the phase and amplitude distributions of the
reflection and transmission coefficients are calculated and shown in Figure 3.
This figure shows that different cases with different designs produce diverse
amplitude and phase distributions. For example, the reflection amplitude and
phase for case 25 mainly change between 0 and -1 dB and between -50∘ to -100∘,
respectively. For case 5, these values are between 0 and -1.5 dB and -40∘ to
-180∘, respectively. In fact, the difference in the amplitude (and phase)
distributions of different cases is due to the difference in the amount of
MSBPPs.

Figure 3:  (a) and (b) The amplitude and phase distributions of the reflection
coefficient for the multiple cases. (c) and (d) The amplitude and phase
distributions of the transmission coefficient for the multiple cases.

##  3 Methodology

Generative Adversarial Networks (GANs) are deep learning-based generative
models in which two sub-models, namely the generator and the discriminator,
contend against each other to learn a mapping from random noise vector $z$ to
output image $y$, $G:z$ $\rightarrow$ $y$ [52]. The generator sub-model
generates new conceivable images from the problem domain, while the
discriminator model seeks to classify the generated images as either real or
fake.

An outstanding extension to the GANs is their utilization to generate
associate output conditionally [53]. In conditional GANs (cGANs), the input is
conditional on some auxiliary information such as an input image. This
provides one of the most compelling applications of the GANs, namely image-to-
image translation [54]. Isola et al. [54] introduced the concept of Pix2Pix as
a type of cGAN for comprehensive image-to-image translation tasks. In the
Pix2Pix model, the generation of an output image is conditional on an input
image; in fact, the cGAN model performs a mapping from input image $x$ and
random noise vector $z$ to output image $y$, $G:\\{x,z\\}$ $\rightarrow$ $y$.
In such models, the generator takes an image (source image) as the input and
tries to generate a sample output (generated image or target image) that
cannot be identified from the real images. Then, the discriminator, a deep
convolutional neural network that performs conditional-image classification,
takes both the generated image and the target image as the input and predicts
whether the target image is a real or a fake conversation of the source image.
Therefore, the cGAN objective with the generator G and the discriminator D can
be interpreted as a min-max game, as follows:

$\displaystyle\underset{G}{min}\>\underset{D}{max}\>V(D,G)\>=\>E_{y\sim
p_{data}(y)}[log(D(y|x))]\;+\>E_{z\sim p_{z}(z)}[log(1-D(G(z|x))]$ (1)

in which, $p_{z}(z)$ is prior input noise distribution, D(y$|$x) is the
probability that y given x is a real data. It is supposed that $z$ is a random
noise vector; accordingly, $D(G(z|x))$ is the probability that the generated
images comprise noise and input images attained from the real dataset [54,
55]. At the beginning of training, the discriminator can effortlessly
apprehend the random fake output from the real target image. As a result, the
$D(G(z|x))$ value is low, resulting in a large $log(1-D(G(z|x)))$. Thus, the
generator model is updated to minimize the loss predicted by the discriminator
for generated images marked as real images. As such, the generator is
encouraged to generate more synthetic images similar to the target or original
images.

In this study, the collected scattering parameters are converted into images,
which will be discussed in detail in the next section. On the other hand, the
unit cells structures are in the forms of matrices with the shape of
64$\times$64 or images with the shape of 64$\times$64$\times$3 from the
metallic and void square blocks. Hence, a cGAN model (Pix2Pix model) is
introduced for the inverse design of multi-functional metasurfaces. The
scattering parameters images are used as the input (source images) of the cGAN
model and unit cells images (target images) as the model’s output. The cGAN
model generator tries to generate the corresponding unit cells images of the
desired EM responses or the scattering parameters, and the cGAN model
discriminator attempts to distinguish the valid unit cells from the invalid
unit cells. Finally, the generator model designs unit cells whose EM behaviour
leads to expected EM responses after learning.

Figure 4:  The workflow of the cGAN-based methodology for the inverse design
of multi-functional microwave metasurfaces.

###  3.1 The Workflow of Applied Method

The workflow of the recommended methodology for inverse design of multi-
functional metasurfaces is demonstrated in Figure 4. Achieving an accurate and
reliable inverse design model based on this methodology comprises the
following steps.

Step 1. Data generation: generate data in terms of square blocks distribution
in unit cells with various MVSBAs and MSBPPs. As discussed in Section II, it
is significant to consider a wide range of unit cells with different metallic
and void square blocks distributions.

Step 2. EM simulation: extract the EM response of the produced unit cells.
When choosing a set of unit cells, a key principle called diversity should be
considered. Diversity means that the selected data samples must be distributed
across the entire input space instead of focusing on a small local region
[56]. In other words, the scattering parameters of the generated unit cells
for TE and TM polarizations in $+z$ and $-z$ directions must cover a wide
variety of values over the specified frequency range. Conversely, if the
generated unit cells specify some limited EM responses, the machine learning
method most likely learns less using the input/output samples within the local
region.

Step 3. Scattering parameters imaging: encoding scattering parameters as GAFs
images [57]. Inspired by the great achievements of GANs in computer vision,
there is a tendency to encode the scattering parameters as images so that
machines can learn structures and EM responses visually. This article uses
GAFs to encode the scattering parameters as images.

Gramian Angular Fields are images that depict a time series in a polar
coordinate system, in which the location of each point $P$ on the plane is
indicated by its distance $r$ from the origin and the angle $\phi$ relative to
the positive x-axis. The scattering parameters calculated from step 2 can be
considered as time series in the form of n observations
$S=\\{s_{1},s_{2},...,s_{n}\\}$ in the frequency domain. On the other hand,
the observations can be represented on the basis of Polar coordinates as
follows:

$\displaystyle r_{i}=\sqrt{Imaginary(s_{i})^{2}+Real(s_{i})^{2}},\>\>\>0\leq
r\leq 1$ (2)
$\displaystyle\phi_{i}=\tan^{-1}(\dfrac{Imaginary(s_{i})}{Real(s_{i})}),\>\>\>-180^{\circ}\leq\phi<180^{\circ}$

Following the transformation of the scattering parameters into the Polar
coordinate system, the GAFs calculate the inner product of the scattering
parameters in the Polar system via the characterization of angular summation
to detect the correlation across different frequency intervals. The GAFs of
the scattering parameters are shown below.

$\displaystyle GAF=\langle
S,\>\>S^{{}^{\prime}}\rangle=S^{{}^{\prime}}.\>\>S-\sqrt{I-S^{2}}^{{}^{\prime}}.\>\>\sqrt{I-S^{2}}$
(3)

in which I is the unit row vector [1, 1,…, 1].

Step 4. Image stacking: stack scattering parameters images generated by GAFs,
which are represented by three 2D 64 $\times$ 64 arrays, to produce three-
layer images with the size of 64 $\times$ 64 $\times$ 3 pixels. The three-
layer metasurfaces depending on the polarization and direction of the incident
wave, show three independent applications at a fixed frequency. Hence, it is
necessary to incorporate three scattering components to design the
metasurfaces. To consider all three scattering components in the cGAN model,
the three generated images of the scattering parameters are stacked and the
resulted three-layer image is used as the input of the model.

Step 5. Training the cGAN model: train both the generator model and the
discriminator model as the main parts of the cGAN model simultaneously using
the training data. In this step, the stacked versions (i.e., the
64$\times$64$\times$3 images) of the generated GAFs images, source images, are
applied as the input of the generator model. The final expected outputs of the
generator model are the three-layer metasurface unit cells, which are
represented as three configurations of 64$\times$64 square blocks or 3D
matrices. These generated outputs of the generator model and the original unit
cells images, target images, are provided as the input of the cGAN
discriminator model to distinguish the invalid outputs from the valid ones.
The generator model is updated based on the calculated loss by the
discriminator measuring the differences between the generated outputs and the
expected or target outputs. The training continues until the cGAN objective in
equation 1 is satisfied, or the discriminator could not identify the real unit
cells images from the fake unit cells images. Of the 54,000 data points used
for simulation in this study, 51,000 of them are implemented for the model’s
training and the rest (3,000 data points) are used for the validation of the
model.

Step 6. Prediction: predict the corresponding metasurface unit cells in
regards to the desired EM responses. When the cGAN model is trained using the
scattering parameters and unit cells images, the discriminator cannot
recognize the difference between the original unit cells structures and the
generated unit cells given the input EM features. This means that the
generator part can produce valid unit cells whose EM behaviours are the same
as the input source EM features. Hence, the trained cGAN generator model can
predict the proper unit cells configurations for the desired EM responses.

Figure 5:  The schematic diagram of the generator and discriminator layers in
the proposed cGAN model.

###  3.2 The Architecture of the Conditional Generative Adversarial Network

This part describes the technical aspects of the proposed cGAN model for the
inverse design of multi-functional microwave metasurfaces. As shown in Figure
5, the cGAN model is comprised of two elements: the generator and the
discriminator. The generator model uses the scattering parameters converted to
stack images in the form of 64$\times$64$\times$3 as the input and generates
the unit cells structures in terms of 64$\times$64$\times$3 images in which
each channel represents one unit cell layer. In other words, the cGAN model
passes the scattering parameter images through the generator network, which is
an encoder-decoder model based on a U-Net architecture, to generate the unit
cells structures. The symmetric U-Net architecture initially encodes the input
images down to a bottleneck layer and then decodes the bottleneck
representation to the size of the target images. General convolutional layers
generate the encoder path and transposed 2D convolutional layers develop the
decoder path [58]. Residual connections connect the convolutional layers with
their corresponding transposed convolutional layers to prevent accuracy
saturation in the deep convolutional neural network [59].

According to Figure 5, the discriminator model is a deep convolutional neural
network that performs conditional image classification. This study uses a
PatchGAN paradigm as the discriminator that takes two types of input images,
including the target images representing the original unit cells structures
and the generated images. Then, it concatenates the images together, passes
them through various hidden layers that decrease by a factor of 2, and
predicts a patch output of predictions [54, 55]. The output predictions of the
proposed PatchGAN are 4$\times$4 patches/portions of the unit cells images.
The average of these output predictions gives an overall plausibility or
classification score, which is used as feedback to the generator model to
improve the quality of the generated unit cells images.

The implementation in this study uses the Keras deep learning framework for
building the cGAN model, which takes the scattering parameters and generates
metasurface structures with the size 64$\times$64$\times$3 pixels. Both the
discriminator and generator models apply dropout regularization to mitigate
overfitting and enhance the generalization of the deep convolutional neural
network [60]. An experimentation demonstrated that setting the epochs number
and the batch size, respectively, to 150 and 1 leads to the best results as
also recommended in [54]. In addition, the cGAN model uses Adam optimizer with
an initial learning rate of 3$\times 10^{-4}$, which has a high convergence
speed and is quicker than gradient descent [61, 62]. Since there are 51,000
data points in the training dataset and the batch size is 1, each epoch
involves 51,000 training steps. The generator is saved and evaluated every
epoch or every 51,000 training steps, and the cGAN model will run for a total
of 7,650,000 training steps (150 epochs $\times$ 51,000 training steps).

Figure 6:  The target and generated unit cell structures for a random example
in the validation dataset at different epochs (a) layer 1, (b) layer 2, and
(c) layer 3.

Figure 7:  The target and generated unit cell structures for a random example
in the validation dataset at different epochs (a) layer 1, (b) layer 2, and
(c) layer 3.

##  4 Results and Discussion

###  4.1 cGAN Model Performance Evaluation

In contrast to other deep learning models, evaluating the performance of the
cGAN model and the quality of the generated images is a challenging open issue
[63]. Deep learning models usually use a loss function in the training
process, while the generator in the cGAN models uses the loss calculated by
the discriminator model. In these models, both the generator and discriminator
are trained simultaneously by an adversarial process to reach a compromise.
Therefore, the performance of cGAN model cannot be easily measured to decide
when the training process should be stopped since it is not possible to use
quantitative metrics to evaluate the performance of the cGAN models or assess
the progress of the training. [63]. In addition, metrics such as per-pixel
mean-squared error cannot capture the very structure like structured losses
because these metrics do not assess joint statistics of the generated images
(or unit cells here).

To solve the mentioned issue, this study uses a ”real versus fake” comparison
technique through manual inspection of generated metasurfaces over different
epochs to measure the quality of the generated unit cells and the efficiency
of the cGAN model. Reviewing the generated images over different epochs helps
to choose the best optimal model as the final model at the end of training.
The ”real versus fake” comparison technique involves using the cGAN model to
generate a batch of synthetic unit cells structures given the input scattering
parameters, then evaluating the quality and diversity of the generated unit
cells structures compared to the original or target unit cells. For this
purpose, this study compares different layers of the generated or fake unit
cells versus the original unit cells over different epochs. To ensure that the
cGAN model performs well on the unseen dataset, this study uses the validation
dataset to measure the cGAN model’s performance.

Figures 6 and 7 show the generated unit cells structures over different epochs
when the GAFs method is utilized for imaging the scattering parameters for two
randomly selected three-layer unit cells in the validation dataset. As shown,
the unit cells generated over different epochs are compared to the expected
target unit cells. These plots can be assessed at the end of the training
process and used to choose the best generator model based on the quality of
generated unit cells. The figures show that the generated three-layer unit
cells structures get more similar to the original unit cells as the number of
training epochs increases. There are significant differences between the
generated unit cells and the original ones after the initial epochs (e.g.,
after 5 or 25 epochs). In other words, the generator model is initially unable
to mislead the PatchGAN model used as the discriminator for the cGAN model.
However, by increasing the number of epochs to 50, the U-Net model generates
unit cells that are similar to the target unit cells. Generating high-quality
unit cells by the generator model deceives the discriminator to make mistake
in distinguishing the fake generated unit cells from the real ones (i.e., by
returning lower loss values for updating the generator model). Therefore, the
generated unit cells begin to look realistic and get more similar to the
original unit cells. For the rest of the training process, the generated unit
cells’ quality appears to improve or at least remain good. More importantly,
after epoch 95, it can be seen that the cGAN discriminator is almost fooled by
the generator and the discriminator model can not distinguish the original
unit cells from the fake unit cells generated by the generator model. The
figures show the same pattern for all three layers of the unit cells and also
the rest of the unit cells in the training and validation datasets. It should
be mentioned that training the cGAN model for more epochs does not necessarily
lead to a better quality model, high-quality images (or more plausible designs
for unit cells in this study). However, the cGAN model is trained up to 150
epochs in the present study to find the optimal number of epochs. Because the
generated unit cells at epoch 95 demonstrate satisfying consistency to the
original unit cells, this study chooses the trained model up to this epoch as
the final model and uses it to design metasurfaces unit cells. In addition, at
this epoch, the cGAN model performs well on both training and validation
dataset and there is no concern about overfitting. Hence, this study uses this
model for inverse design of EM microwave metasurfaces based on the procedure
explained in step 6 of Figure 4 given the desired scattering parameters. A
case study example is presented in the next section based on this model.

Figure 8:  The schematic illustration of the multi-functional metasurface
designed using the cGAN model. Figure 9:  The generated unit cells for
realizing the multi-functional metasurface of Figure 8 with their coding
states in TE and TM polarizations and $-z$ and $+z$ directions.

Figure 10:  The scattering parameters of the generated unit cells. (a), (c)
The reflection coefficients amplitude in both $-z$ and $+z$ direction,
respectively. (b) The transmission coefficient amplitude. (d), (e) The
reflection coefficients phase in both $-z$ and $+z$ direction, respectively.
(f) The transmission coefficient phase.

###  4.2 Metasurface Inverse Design Using cGAN Model

This part of the study presents a three-functional digital coding microwave
metasurface, designed using the proposed cGAN model for validating its
efficiency and performance in the inverse design of multi-functional
metasurfaces. Figure 8 exhibits the designed multi-functional metasurface that
manipulates the incident EM waves in three independent ways in both
transmitted and reflected modes at the same frequency band depending on the
incoming wave polarization and direction. It is worth noting that it is
possible to generate metasurfaces with multiple functions in different
frequencies because the cGAN model generates unit cells in proportion to the
three separate components of the scattering parameters in the whole frequency
range of 8 GHz to 12 GHz. When the designed metasurface is normally
illuminated by TM-polarized EM waves propagating along the $-z$ or $+z$
direction, it efficiently transmits the EM waves and displays tailored phases
covering the whole $360^{\circ}$ range. While the metasurface reflects TE-
polarized EM waves normally radiating from the $-z$ or $+z$ direction at the X
frequency band (around 10 GHz). On the other hand, the reflection
characteristics of the proposed metasurface depend on the incident wave
direction so that the metasurface reveals independent functions in different
propagation directions ($-z$ and $+z$ directions).

The proposed metasurface is incorporated different coding patterns from four
types of unit cells that realize three functionalities (Func. 1 to Func. 3) at
10 GHz frequency. In the first and second functionalities (Func. 1 and Func.
2), the metasurface under the periodic coding sequence of 010101…/010101…,
reflects and transmits the normally incident TE- and TM-polarized EM waves
propagating along $-z$ direction to two symmetrically oriented directions,
respectively. Whereas in the third functionality (Func. 3), the metasurface
operates as a 2-bit coding surface when subjected to $+z$ direction TE-
polarized EM waves and under periodic coding sequence 0001101100011011…, the
normally incident waves are reflected at oblique angles.

For the inverse design of such a multi-functional metasurface, the scattering
parameters required to obtain the coding states at 10 GHz are initially
converted to GAFs images using step 3 of Figure 4. After stacking (step 4 of
Figure 4), the generated images are passed into the trained generator (step 6
of Figure 4). Then, the generator designs the corresponding unit cells
structures shown in Figure 9. Each unit cell describes three coding states
against TE-polarized EM waves propagating along the $-z$ direction, TE-
polarized EM waves propagating along the $+z$ direction, and TM-polarized EM
waves. For example, Figure 9a acts as “0” binary code for TE- and TM-polarized
EM waves from $-z$ direction and realizes a “00” binary code against TE-
polarized EM waves from $+z$ direction. Other required coding states for the
desired applications are performed by the other three unit cells of Figure
9b-d.

For further verification, the generated unit cells are simulated using the CST
Microwave Studio to calculate the reflection coefficients $S_{11}$ and
$S_{22}$, as well as the transmission coefficient $S_{21}$. At the frequency
of the interest, 10 GHz, the scattering parameters amplitude, shown in Figure
10a-c, indicate that the reflections and transmission of the four designed
unit cells subjected to EM waves are greater than 0.8. Moreover, Figure 10d,e
presents when TE- and TM-polarized EM waves from $-z$ direction are incident
to generated unit cells, there is a $180^{\circ}$ phase difference between the
reflection, as well as the transmission of two unit cells, 1 and 3, and other
two unit cells, 2 and 4, respectively. Whereas according to Figure 10f, the
rate of phase change among the unit cells exposed to TE-polarized waves from
$+z$ direction is $90^{\circ}$. Consequently, deploying the generated unit
cells using the cGAN model in the specific configurations can produce a three-
functional microwave passive metasurface for wave manipulation in the whole
space (see Figure 8). The suggested cGAN model for the inverse design of
multi-functional microwave metasurfaces performs well in numerical
simulations. In fact, in a range of application scenarios, the cGAN-based
technique provides an efficient method for multi-functional metasurface
inverse design.

##  5 Conclusion

A step-by-step framework is presented based on the cGANs for inverse design of
multi-functional microwave metasurfaces to mitigate the computational costs of
the conventional inverse design methods. The proposed methodology leverages a
technique brought by the recent computer vision developments, known as GAFs,
to initially encode the multi-objective scattering parameters of the three-
layer unit cells as images to use them as the input for the cGAN model. In
addition, the matrix representation of the unit cells structures is considered
the target for the cGAN model. The cGAN model is comprised of two distinct
convolutional neural networks competing against each other, including a
conditional generator model for designing the unit cells given the desired
scattering parameters and a discriminator model to determine whether the
generated unit cells are plausible designs for the given scattering
parameters. A robust study dataset including 54,000 three-layer unit cells
with various configurations (i.e., various MSBPPs and MVSBAs) and their EM
responses are implemented to train and validate the cGAN model.

The fully-trained cGAN model demonstrates its efficiency and capability in
designing multi-functional metasurfaces via the design of a metasurface with
three independent functions at a fixed frequency. The results of numerical EM
case study simulations confirm that the proposed cGAN model can be adopted as
an efficient tool for designing three-functional metasurfaces. Generally, the
results suggest that the cGAN model is an efficient method to reduce the
computational costs associated with the inverse design of multi-functional
microwave metasurfaces. Although the results of this study are based on a
specific dataset for metasurfaces with a particular shape, they are promising,
and the same framework can be re-applied for designing multi-functional
microwave metasurfaces with different shapes (e.g., circles, rectangles, “H”s,
and quasi-free forms). Additionally, owing to the simple structure, the
proposed methodology can be extended to develop multi-functional metadevices
for many diversified application demands at microwave, terahertz, and optical
regimes.

## References

  * [1] H.-T. Chen, A. J. Taylor, N. Yu,  _Reports on progress in physics_ 2016, _79_ , 7 076401\.
  * [2] A. Li, S. Singh, D. Sievenpiper,  _Nanophotonics_ 2018, _7_ , 6 989.
  * [3] P.-Y. Chen, A. Alu,  _physical review B_ 2011, _84_ , 20 205110.
  * [4] D. L. Sounas, R. Fleury, A. Alù,  _Physical Review Applied_ 2015, _4_ , 1 014005.
  * [5] Y. Zhao, A. Alù,  _Physical Review B_ 2011, _84_ , 20 205428.
  * [6] M. Kiani, A. Momeni, M. Tayarani, C. Ding,  _Optics express_ 2020, _28_ , 23 35128.
  * [7] F. Monticone, N. M. Estakhri, A. Alu,  _Physical review letters_ 2013, _110_ , 20 203903.
  * [8] N. Yu, P. Genevet, M. A. Kats, F. Aieta, J.-P. Tetienne, F. Capasso, Z. Gaburro,  _science_ 2011, _334_ , 6054 333.
  * [9] G. Zheng, H. Mühlenbernd, M. Kenney, G. Li, T. Zentgraf, S. Zhang,  _Nature nanotechnology_ 2015, _10_ , 4 308.
  * [10] L. Li, T. J. Cui, W. Ji, S. Liu, J. Ding, X. Wan, Y. B. Li, M. Jiang, C.-W. Qiu, S. Zhang,  _Nature communications_ 2017, _8_ , 1 197.
  * [11] A. Pors, M. G. Nielsen, S. I. Bozhevolnyi,  _Nano letters_ 2015, _15_ , 1 791.
  * [12] A. Babaee, A. Momeni, A. Abdolali, R. Fleury,  _Physical Review Applied_ 2021, _15_ , 4 044015.
  * [13] X. Liu, K. Fan, I. V. Shadrivov, W. J. Padilla,  _Optics express_ 2017, _25_ , 1 191.
  * [14] M. Kiani, M. Tayarani, A. Momeni, H. Rajabalipanah, A. Abdolali,  _Optics Express_ 2020, _28_ , 4 5410.
  * [15] F. Aieta, P. Genevet, M. A. Kats, N. Yu, R. Blanchard, Z. Gaburro, F. Capasso,  _Nano letters_ 2012, _12_ , 9 4932.
  * [16] M. Khorasaninejad, F. Capasso,  _Science_ 2017, _358_ , 6367.
  * [17] E. Saenz, I. Ederra, R. Gonzalo, S. Pivnenko, O. Breinbjerg, P. de Maagt,  _IEEE Transactions on Antennas and Propagation_ 2009, _57_ , 2 383.
  * [18] O. Quevedo-Teruel, M. Ebrahimpouri, M. N. M. Kehn,  _IEEE Antennas and Wireless Propagation Letters_ 2015, _15_ 484\.
  * [19] D. Sievenpiper, L. Zhang, R. F. Broas, N. G. Alexopolous, E. Yablonovitch,  _IEEE Transactions on Microwave Theory and techniques_ 1999, _47_ , 11 2059.
  * [20] A. Krizhevsky, I. Sutskever, G. E. Hinton,  _Advances in neural information processing systems_ 2012, _25_ 1097\.
  * [21] A. Voulodimos, N. Doulamis, A. Doulamis, E. Protopapadakis,  _Computational intelligence and neuroscience_ 2018, _2018_.
  * [22] P. M. Nadkarni, L. Ohno-Machado, W. W. Chapman,  _Journal of the American Medical Informatics Association_ 2011, _18_ , 5 544.
  * [23] L. Deng, G. Hinton, B. Kingsbury,  In _2013 IEEE international conference on acoustics, speech and signal processing_. IEEE, 2013 8599–8603.
  * [24] J. Biamonte, P. Wittek, N. Pancotti, P. Rebentrost, N. Wiebe, S. Lloyd,  _Nature_ 2017, _549_ , 7671 195.
  * [25] A. Krizhevsky, I. Sutskever, G. E. Hinton, F. Pereira, C. Burges, L. Bottou, K. Weinberger 2012.
  * [26] J. Kiani, C. Camp, S. Pezeshk,  _Computers and Structures_ 2019, _218_ 108\.
  * [27] S. D. Campbell, R. P. Jenkins, P. J. O’Connor, D. Werner,  _IEEE Antennas and Propagation Magazine_ 2020, _63_ , 3 16.
  * [28] P. Raccuglia, K. C. Elbert, P. D. Adler, C. Falk, M. B. Wenny, A. Mollo, M. Zeller, S. A. Friedler, J. Schrier, A. J. Norquist,  _Nature_ 2016, _533_ , 7601 73.
  * [29] J. Kiani, C. Camp, S. Pezeshk, N. Khoshnevis,  _Computers and Structures_ 2020, _241_ 106355\.
  * [30] W. Ma, F. Cheng, Y. Liu,  _ACS Nano_ 2018, _12_ , 6 6326.
  * [31] M. Zhou, D. Liu, S. W. Belling, H. Cheng, M. A. Kats, S. Fan, M. L. Povinelli, Z. Yu,  _ACS Photonics_ 2021, _8_ , 8 2265.
  * [32] C. Yeung, R. Tsai, B. Pham, B. King, Y. Kawagoe, D. Ho, J. Liang, M. W. Knight, A. P. Raman,  _Advanced Optical Materials_ 2021, _9_ , 20 2100548\.
  * [33] L. Li, H. Ruan, C. Liu, Y. Li, Y. Shuang, A. Alù, C. W. Qiu, T. J. Cui,  _Nature Communications_ 2019, _10_ , 1.
  * [34] C. C. Nadell, B. Huang, J. M. Malof, W. J. Padilla,  _Optics express_ 2019, _27_ , 20 27523.
  * [35] C. Liu, W. M. Yu, Q. Ma, L. Li, T. J. Cui,  _Photonics Research_ 2021, _9_ , 4 B159.
  * [36] S. An, B. Zheng, H. Tang, M. Y. Shalaginov, L. Zhou, H. Li, M. Kang, K. A. Richardson, T. Gu, J. Hu, et al.,  _Advanced Optical Materials_ 2021, _9_ , 5 2001433.
  * [37] T. Qiu, X. Shi, J. Wang, Y. Li, S. Qu, Q. Cheng, T. Cui, S. Sui,  _Advanced Science_ 2019, _6_ , 12.
  * [38] Q. Zhang, C. Liu, X. Wan, L. Zhang, S. Liu, Y. Yang, T. J. Cui,  _Advanced Theory and Simulations_ 2019, _2_ , 2 1.
  * [39] J. A. Hodge, K. V. Mishra, A. I. Zaghloul,  In _2019 IEEE International Symposium on Phased Array System & Technology (PAST)_. IEEE, 2019 1–6.
  * [40] P. Naseri, S. V. Hum,  _IEEE Transactions on Antennas and Propagation_ 2021.
  * [41] S. Mohammadjafari, O. Ozyegen, M. Cevik, E. Kavurmacioglu, J. Ethier, A. Basar,  _Neural Computing and Applications_ 2021, 1–15.
  * [42] X. Shi, T. Qiu, J. Wang, X. Zhao, S. Qu,  _Journal of Physics D: Applied Physics_ 2020, _53_ , 27 275105.
  * [43] R. Zhu, T. Qiu, J. Wang, S. Sui, C. Hao, T. Liu, Y. Li, M. Feng, A. Zhang, C.-W. Qiu, et al.,  _Nature communications_ 2021, _12_ , 1 1.
  * [44] T. J. Cui, M. Q. Qi, X. Wan, J. Zhao, Q. Cheng,  _Light: Science & Applications_ 2014, _3_ , 10 e218.
  * [45] A. Momeni, K. Rouhi, H. Rajabalipanah, A. Abdolali,  _Scientific reports_ 2018, _8_ , 1 1.
  * [46] S. Liu, T. J. Cui,  _Advanced Optical Materials_ 2017, _5_ , 22 1700624\.
  * [47] K. Rouhi, S. E. Hosseininejad, S. Abadal, M. Khalily, R. Tafazolli,  _Journal of Lightwave Technology_ 2021, _39_ , 21 6893\.
  * [48] W. Tang, M. Z. Chen, X. Chen, J. Y. Dai, Y. Han, M. Di Renzo, Y. Zeng, S. Jin, Q. Cheng, T. J. Cui,  _IEEE Transactions on Wireless Communications_ 2020, _20_ , 1 421.
  * [49] A. Li, Z. Luo, H. Wakatsuchi, S. Kim, D. F. Sievenpiper,  _IEEE Access_ 2017, _5_ 27439\.
  * [50] A. Momeni, K. Rouhi, R. Fleury,  _Carbon_ 2022, _186_ 599\.
  * [51] CST,  Cst microwave studio advanced topics,  Technical report, CST-Computer Simulation Technology, 2002.
  * [52] I. Goodfellow, J. Pouget-Abadie, M. Mirza, B. Xu, D. Warde-Farley, S. Ozair, A. Courville, Y. Bengio,  _Advances in neural information processing systems_ 2014, _27_.
  * [53] M. Mirza, S. Osindero,  _arXiv preprint arXiv:1411.1784_ 2014.
  * [54] P. Isola, J.-Y. Zhu, T. Zhou, A. A. Efros,  In _Proceedings of the IEEE conference on computer vision and pattern recognition_. 2017 1125–1134.
  * [55] J.-Y. Zhu, T. Park, P. Isola, A. A. Efros,  In _Proceedings of the IEEE international conference on computer vision_. 2017 2223–2232.
  * [56] D. Wu,  _IEEE transactions on neural networks and learning systems_ 2018, _30_ , 5 1348.
  * [57] Z. Wang, T. Oates,  In _Twenty-Fourth International Joint Conference on Artificial Intelligence_. 2015 .
  * [58] O. Ronneberger, P. Fischer, T. Brox,  In _International Conference on Medical image computing and computer-assisted intervention_. Springer, 2015 234–241.
  * [59] C. Szegedy, S. Ioffe, V. Vanhoucke, A. A. Alemi,  In _Thirty-first AAAI conference on artificial intelligence_. 2017 .
  * [60] N. Srivastava, G. Hinton, A. Krizhevsky, I. Sutskever, R. Salakhutdinov,  _The journal of machine learning research_ 2014, _15_ , 1 1929.
  * [61] Y. Bengio,  In _Neural networks: Tricks of the trade_ , 437–478. Springer, 2012.
  * [62] D. P. Kingma, J. Ba,  _arXiv preprint arXiv:1412.6980_ 2014.
  * [63] T. Salimans, I. Goodfellow, W. Zaremba, V. Cheung, A. Radford, X. Chen,  _Advances in neural information processing systems_ 2016, _29_ 2234\.