I have some data, say a finite set $\mathcal{S}$ of grayscale images of given dimension $m\times n$, seen as vectors in $\mathbb{R}^{m \times n}$, with each coordinate expressing the intensity of one pixel. I have a machine learning model that selects a connected sub-manifold $\mathcal{M} \subset \mathbb{R}^{m \times n}$ that contains all elements of $\mathcal{S}$. I can thus measure the geodesic distance on $\mathcal{M}$ between my images, which is a more meaningful distance than the Euclidean distance, assuming that $\mathcal{M}$ has been chosen in a suitable way. However, I would also like to enforce invariance of my data under a finite group $G$ of isometries of $\mathbb{R}^{m \times n}$. For instance, one image and its mirror image should be considered the same. My dataset $\mathcal{S}$ is preserved under these transformations, but $\mathcal{M}$ is not.
If it were, I could take the quotient $\mathcal{M}/G$ and it would at least be a connected metric space (or even a Riemannian manifold, if $G$ acts freely); I could thus measure distances between classes (elements of $\mathcal{M}/G$) as $$ d_{\mathcal{M}/G}(A,B) := \mathrm{min}_{a \in A, b \in B} \ d_\mathcal{M}(a,b),$$ as explained here (note that $G$ acts by isometries also on $\mathcal{M}$, as long as $\mathcal{M}$ is preserved by $G$).
But, as I mentioned, the problem is that $\mathcal{M}$ is not preserved by $G$. Is there any smart way to enlarge $\mathcal{M}$ to a "minimal" (or at least not too high-dimensional) manifold $\mathcal{N}$ that is preserved by $G$? I cannot just take the union of the translates of $\mathcal{M}$ under $G$, as these might intersect quite badly; but maybe there is some kind of "enveloppe" of these translates that I could take?
Or, more generally: is there any meaningful way to measure distances between the points of $\mathcal{S}$ while taking into account the structure of $\mathcal{M}$ and while also enforcing $G$-invariance?