Here is the result with a somewhat too ad-hoc clustering:
May be with some tweaking the code below can produce more desired results. But please observe the obtained clusters. Although, they are not exactly as the ones mentioned in the question the found clusters "make lots of sense."
Get the images
imgLinks =
Flatten[StringCases[
Import["https://mathematica.stackexchange.com/q/174223/34008",
"Hyperlinks"], __ ~~ "imgur" ~~ __]]
imgs = Import /@ Take[imgLinks,36]
First try
ColumnForm[FindClusters[imgs, 6, Method -> "Spectral"]]
Clustering code
In order to get better results with further tweaking I would use a vector representation. FeatureExtract
(coupled with transformations like GaussianFilter
etc.) can be used, but I got better results by just taking the image data.
vecsImgs = Flatten /@ Map[ImageData, imgs];
Tally[Dimensions /@ vecsImgs]
(* {{{5625}, 36}} *)
cls =
FindClusters[vecsImgs -> Range[Length[vecsImgs]], 6,
DistanceFunction -> CosineDistance]
(* {{1, 2, 3, 7, 8, 9, 25, 27}, {4, 5, 6, 10, 11, 12}, {13, 14,
15, 19, 20, 21, 26}, {16, 17, 18, 22, 23, 24}, {28, 29, 30, 34, 35,
36}, {31, 32, 33}} *)
ColumnForm[imgs[[#]] & /@ cls]
"Spectral"
method forFindClusters
does a good job IF you specify the number of clusters which, I realize, is a big if...FindClusters[imgs, 6, Method -> "Spectral"]
. $\endgroup$