A computer implemented method of encoding a feature vector, the method comprising: retrieving a feature vector, the feature vector representing a target media object, wherein each feature vector entry represents a measurement or value associated with the particular feature or features of the target media object; generating a set of one or more permutations, the permutations comprising vectors of ordinals, wherein the dimensionalities of the permutation vectors are equivalent to the dimensionality of the feature vector; permuting the feature vector with the set of permutations, creating a set of one or more permuted feature vectors; truncating the set of permuted feature vectors according to a selected window size K, where K has a magnitude greater than or equal to 2 and is smaller than the dimensionality of the feature vector and wherein the truncated permuted vector keeps the first K entries of the permuted feature vector and the remaining entries of the permuted feature vector are discarded, and creating a set of truncated permuted feature vectors; identifying the index of the maximum value of each truncated permuted feature vector in the set of truncated permuted feature vectors; producing a set of one or more sparse binary sub-vectors, each sparse binary sub-vector comprising the identified index, wherein the identified index is encoded using one-hot encoding; and wherein when the set of sparse binary sub-vectors is greater than one, concatenating the sparse binary sub-vectors to produce a sparse binary vector, wherein the target media object represented by the feature vector comprises one of: an image, a video clip, and an audio clip, wherein the feature vector of the image or video clip comprises features derived from the image, video or audio content of the media object and describes one or more of: motion; color; texture; gradients; edges; interest points; comers; or other visual characteristics; a scale invariant feature transform, SIFT; speeded up robust features, SURF; a gradient location and orientation histogram, GLOH; a local energy based shape histogram, LESH; a histogram of oriented gradients, HOG; or space scale and affine representations, and/or wherein the audio features include spectrogram features; or Mel-frequency cepstral coefficients. retrieving a feature vector, the feature vector representing a target media object, wherein each feature vector entry represents a measurement or value associated with the particular feature or features of the target media object; generating a set of one or more permutations, the permutations comprising vectors of ordinals, wherein the dimensionalities of the permutation vectors are equivalent to the dimensionality of the feature vector; permuting the feature vector with the set of permutations, creating a set of one or more permuted feature vectors; truncating the set of permuted feature vectors according to a selected window size K, where K has a magnitude greater than or equal to 2 and is smaller than the dimensionality of the feature vector and wherein the truncated permuted vector keeps the first K entries of the permuted feature vector and the remaining entries of the permuted feature vector are discarded, and creating a set of truncated permuted feature vectors; identifying the index of the maximum value of each truncated permuted feature vector in the set of truncated permuted feature vectors; producing a set of one or more sparse binary sub-vectors, each sparse binary sub-vector comprising the identified index, wherein the identified index is encoded using one-hot encoding; and wherein when the set of sparse binary sub-vectors is greater than one, concatenating the sparse binary sub-vectors to produce a sparse binary vector, wherein the target media object represented by the feature vector comprises one of: an image, a video clip, and an audio clip, wherein the feature vector of the image or video clip comprises features derived from the image, video or audio content of the media object and describes one or more of: motion; color; texture; gradients; edges; interest points; comers; or other visual characteristics; a scale invariant feature transform, SIFT; speeded up robust features, SURF; a gradient location and orientation histogram, GLOH; a local energy based shape histogram, LESH; a histogram of oriented gradients, HOG; or space scale and affine representations, and/or wherein the audio features include spectrogram features; or Mel-frequency cepstral coefficients.