I trained a variational autoencoder (VAE) on a set of thousands of flags from around the world, making it possible to generate new flags and to measure the "probability" of existing ones. My original goal was to quantify whether distance in flag space is correlated to distance in geographic space, but all of my results were negative, and the dataset I used made it difficult to connect flags to geography.
The picture below shows a more limited result. I trained a simpler feature extractor on national flags, and performed hierarchical clustering to generate a tree of flags:
You can see how the feature extractor found certain common types of flags. For example, there is a branch for the tricolors, and another for the flags with the Union Jack in the corner, and another for flags with crosses, etc.