In computer vision, a bag-of-words model represents an image by counts or occurrences of local visual features rather than by word tokens. These visual features are grouped into a vocabulary of visual words, producing a histogram-like representation that can support image classification and retrieval.
In computer vision, the bag-of-words model (BoW model) can be applied to image classification, by treating image features as words. In document classification, a bag of words is a sparse vector of occurrence counts of words; that is, a sparse histogram over the vocabulary. In computer vision, a bag of visual words is a vector of occurrence counts of a vocabulary of local image features.