Usually, the optimization of antennas by means of numerical simulation focuses on a few objective functions (KPI's) such as antenna gain, half power beam width, side lobe level or bandwidth. With multi-objective optimization methods (as implemented in HyperStudy) Pareto-optimal solution sets can be calculated. However, during each simulation run additional responses can be calculated without much additional effort. These responses could be for example a current distribution of a far field pattern of the antenna. For many applications, it can be useful to consider the information from these high-dimensional data sets during an optimization.
Often it is not so much the values of individual vector components that are important, but rather the pattern that results from the vector data. This will be demonstrated with a simple antenna array example (f = 77 GHz), formed by 8 dipole elements in front of a backplate:

The antenna model is parametrized with 3 design variables. As optimization goal the antenna gain in main direction (theta = 0°, phi = 0°) should be maximized. This was done in a standard process using Feko and HyperStudy. First a DoE (Design of Experiments) was defined. On top of this evaluation data an optimization with GRSM was performed. Of the 160 calculated antenna designs, 38 meet the specification condition gain ≥ 17.5 dBi. Some of these optimized designs have very similar patterns, but others have a completely different shape, as you can see in the two pattern-pictures above.
Now you can “look” at all the patterns of all the optimal solutions and sort them into different clusters. For large data sets, this can no longer be done "by eye", but machine learning can quickly solve this task: Cluster Analysis is an unsupervised learning approach, and several algorithms are available as for example K-means clustering or hierarchical clustering.
KnowledgeStudio offers multiple powerful ML methods for Clustering, Classification and Regression. In this project the K-Means algorithm in KnowledgeStudio was used to cluster the pattern data into two sets. Each directivity pattern D(theta) with theta =-90°, … ,+90° is represented as a point in a 181-dimensional metric space. The K-means algorithm finds partitions into K clusters that the total within-cluster variation summed over all clusters is as small as possible.
Afterwards the cluster data have been labeled and a classification model was trained using a deep learning model (2-layer neural network). With this ML-model you can predict from the 3 design variables the cluster membership of each configuration.
KnowledgeStudio is a no-coding-platform, and all steps can be defined easily by editing the nodes and connecting them in the GUI:

You can see from this workflow chart that another classification model was trained using the Random Forest Method, but in this case, it gives slightly worse predictions than the Deep Learning model, what was evaluated in the Analyzer Node.
Now the Classification model for the cluster prediction can be imported in HyperStudy as a *.kdm-file. In the optimization process of HyperStudy the cluster class can be defined as a constraint. With this strategy the optimizer takes automatically into account the cluster membership and finds a solution in the relevant subset of the design space.

The results of this optimization process are visualized in the above diagrams. The left side picture shows gain over the first design variable. The point color indicates the cluster number (blue color for cluster index 1). The right picture show the pattern for the two best solutions regarding cluster 1 and the best in cluster 2. As expected run 77 and run 78 (representing cluster 1) have very similar antenna pattern, while run 91 has only similar peak gain, but very different pattern shape.
Let’s summarize the complete optimization process:
- Setup of parametrized antenna model in CADFEKO
- Run one simulation and evaluate the relevant responses in POSTFEKO
- Setup of design exploration in HyperStudy. Read design variables from CADFEKO and responses from POSTFEKO
- Run a DoE in HyperStudy and Evaluate the responses (Gain and antenna pattern)
- Export data to KnowledgeStudio
- Build cluster and classification models in KnowledgeStudio
- Export the Classification model back to HyperStudy and link the design variables of the Feko model and the ML model
- Define Constraint in HyperStudy and run the Optimization

I hope you find this interesting, and it inspires you to come up with your own use cases where unsupervised learning can be used in electromagnetic optimization problems.