0
$\begingroup$

I want to use a clustering algorithm to group various images of clothing together. For example, within shoes, I would like the algorithm to form clusters for sneakers, high heels, boots, etc. So far, I have used the tensorflow inception model ( from the following tutorial: https://www.tensorflow.org/tutorials/image_retraining), replacing the final output layer of the model with a layer that uses the K-means clustering algorithm.

Essentially, the next to last layer of the model produces a length 2048 vector of features for each clothing item. I wanted to determine the most important/distinguishing features from each vector to use when training my model. In order to try to isolate the most significant features, I first extracted the "top 10" features. To do this, I ran the K-means algorithm where the inputted matrices had vectors all of length one so as to isolate one feature at a time (this was done once for each feature). Based on the Silhouette Coefficient of each model, I took the 10 features that produced the highest Silhouette Coefficient to be the top 10.

I then formed pairs by pairing each of the top 10 features with each of the original 2048 features (excluding doubles) to form length 2 vectors. I then ran the model on the matrices of length 2 vectors. Taking the grouping of 10 features that produced the highest Silhouette Coefficient to be my "top 10" pairs. I continued this way to form larger vectors.

My hope was that this approach would allow me to somewhat efficiently determine the combination of features that are most distinguishing and would be best to train my model on. However, as I progressed, there was no improvement in my model's clustering ability (as measured by the Silhouette Coefficent); nor did the plotting of the points indicate any useful groupings.

I am not sure why this didn't work, nor am I aware of any other approaches. Does anyone know of a better way to go about this? Any suggestions would be greatly appreciated.

$\endgroup$

1 Answer 1

1
$\begingroup$

Neither k-means nor Silhouette will work well on high dimensional data. Your 2048 dimensional vectors are supposedly not very sparse, and thus you will see the curse of dimensionality.

This should be apparent in the silhouette values you got. I would be surprised if you get values above 0.5 - what were the best Silhouettes you got?

I do not see why it would be beneficial to use vectors of length 1.

Beware that k-mrans is randomized. Running it twice with different seeds will likely give you a very different result. If this random initialization affects your feature selection, it likely is not working reliably. So if you run everything again with a different seed, do you get a similar result or not?

$\endgroup$
2
  • $\begingroup$ I'm not running the k-means on the length 2048 vectors, I'm running it on matrices with much smaller vectors (around length 4-5) that contain selected features from the 2048 length vector outputted by the original inception model. So the vectors in this case would be sparse. With length 4 vectors I get silhouette values around .7. And yes, running k-means with different seeds returns different results, but none of them seem to be particularly meaningful. $\endgroup$
    – Giancarlo Pacenza
    Commented Jun 8, 2018 at 10:27
  • $\begingroup$ Then probably the way you choose these features doesn't work? $\endgroup$ Commented Jun 8, 2018 at 17:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.