aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVasil Zlatanov <v@skozl.com>2019-02-12 20:11:42 +0000
committerVasil Zlatanov <v@skozl.com>2019-02-12 20:11:42 +0000
commit5465197675ff82c54b477cebff3be7beccfec560 (patch)
tree1a0516f8615848e6bab833f31bbde8822800c1d2
parent17528eb77d8f7c888186a85f17fa60ad0ffd6cf8 (diff)
downloade4-vision-5465197675ff82c54b477cebff3be7beccfec560.tar.gz
e4-vision-5465197675ff82c54b477cebff3be7beccfec560.tar.bz2
e4-vision-5465197675ff82c54b477cebff3be7beccfec560.zip
Fixes to intro
-rwxr-xr-xevaluate.py1
-rw-r--r--report/paper.md9
2 files changed, 5 insertions, 5 deletions
diff --git a/evaluate.py b/evaluate.py
index 321e792..371ba36 100755
--- a/evaluate.py
+++ b/evaluate.py
@@ -107,6 +107,7 @@ def main():
train = data['desc_tr']
test = data['desc_te']
train_part = data['desc_sel'].T
+ print(train_part.shape)
logging.debug("Verbose is on")
if args.testmode:
diff --git a/report/paper.md b/report/paper.md
index d5d5d37..bbd7d73 100644
--- a/report/paper.md
+++ b/report/paper.md
@@ -6,8 +6,7 @@ A common technique for codebook generation involves utilising K-means clustering
image descriptors. In this way descriptors may be mapped to *visual* words which lend themselves to
binning and therefore the creation of bag-of-words histograms for the use of classification.
-In this courseworok 100-thousand descriptors have been extracted through SIFT to build the visual vocabulary from the
-Caltech dataset.
+In this courseworok 100-thousand random SIFT descriptors of the Caltech dataset are used to build the K-means visual vocabulary.
## Vocabulary size
@@ -15,9 +14,9 @@ The number of clusters or the number of centroids determines the vocabulary size
## Bag-of-words histogram quantisation of descriptor vectors
-An example histograms for training and testing images is shown on figure \ref{fig:histo_tr}, computed with a vocubulary size of 100. The histograms appear to have similar counts for the same words, demonstrating they had a descriptors which matched the *keywowrds* in similar proportions. We later look at the effect of the vocubalary size (as determined by the number of K-means centroids) on the classificaiton accuracy in figure \ref{fig:km_vocsize}. A small vocabulary size turns out to misrepresent the information contained in the different patches, resulting in poor classification accuracy. When the vocabulary size gets too big (too many k-mean centroids), the result is instead overfitting. Figure \ref{fig:km_vocsize} shows a plateau after 60 cluster centers.
+An example histograms for training and testing images is shown on figure \ref{fig:histo_tr}, computed with a vocubulary size of 100. The histograms of the same class appear to have comparable magnitudes for their respective keywords, demonstrating they had a similar number of descriptors which mapped to each of the clusters. The effect of the vocubalary size (as determined by the number of K-means centroids) on the classificaiton accuracy is shown in figure \ref{fig:km_vocsize}. A small vocabulary size tends to misrepresent the information contained in the different patches, resulting in poor classification accuracy. Conversly a large vocabulary size (many K-mean centroids), may display overfitting. In our tests, we observe a plateau after a cluster count of 60 on figure \ref{fig:km_vocsize}.
-The time complexity of quantisation with a K-means codebooks is $O(DNK)$ , where N is the number of entities to be clustered (descriptors), D is the dimension (of the descriptors) and K is the cluster count @cite[km-complexity]. As the computation time is high, the tests we use a subsample of descriptors to compute the centroids. An alternative method we tried is applying PCA to the descriptors vectors to improve time performance. However in this case the descriptors' size is relatively small, and for such reason we opted to avoid PCA for further training.
+The time complexity of quantisation with a K-means codebooks is $O(DNK)$, where N is the number of entities to be clustered (descriptors), D is the dimension (of the descriptors) and K is the cluster count @cite[km-complexity]. As the computation time is high, the tests we use a subsample of descriptors to compute the centroids (a random selection of 100 thousand descriptors). An alternative method we tried is applying PCA to the descriptors vectors to improve time performance. However in this case the descriptors' size is relatively small, and for such reason we opted to avoid PCA for further training.
K-means is a process that converges to local optima and heavilly depends on the initialization values of the centroids.
Initializing k-means is an expensive process, based on sequential attempts of centroids placement.
@@ -50,7 +49,7 @@ for K-means 100 cluster centers.
\end{center}
\end{figure}
-Random forests will select a random number of features on which to apply a weak learner (such as axis aligned split) and then select the best feature of the selected ones to perform the split on, based on some criteria (our results use the *Gini index*). The fewer features that are compared for each split the quicker the trees are built and the more random they are. Therefore the randomness parameter can be considered the number of features used when making splits. We evaluate accuracy given different randomness when using a K-means vocabulary in figure \ref{fig:kmeanrandom}. The results in the figure use a forest size of 100 as we found that this estimatator count the improvement for $\sqrt{n}$ performance gains tend to plateau.
+Random forests will select a random number of features on which to apply a weak learner (such as axis aligned split) and then chose the best feature of the sampled ones to perform the split on, based on a given criteria (our results use the *Gini index*). The fewer features that are compared for each split the quicker the trees are built and the more random they are. Therefore the randomness parameter can be considered the number of features used when making splits. We evaluate accuracy given different randomness when using a K-means vocabulary in figure \ref{fig:kmeanrandom}. The results in the figure use a forest size of 100 as we found that this estimatator count the improvement for $\sqrt{n}$ performance gains tend to plateau.
\begin{figure}[H]
\begin{center}