Documente Academic
Documente Profesional
Documente Cultură
Abstract
4.2. Models
5. Performance Analysis
k-Nearest Neighbors algorithm (k-NN)
[Cover and Hart, 1967] and Support Vector Ma- 5.1. Effects of data dimensionality
chine (SVM) [Suykens and Vandewalle, 1999] were Data dimensionality can affect the classification ac-
used as learning methods in our study. They are two curacy a lot. Thus, we need to find an optimal dimen-
popular discriminative classifiers with no distribution sion. From Figure.2, at the beginning, the accuracy
requirement. k-NN is simple to implement with increases very fast as the dimension increases. How-
usually good result. And the accuracy of this method ever, when the dimension reaches 104 , the accuracy
can be highly influenced by parameter k (Figure increases very slowly, and even decreases a little when
3). SVM was chosen since it’s very robust and dimension reaches 105 . This is because, when the di-
well developed for classification. [Kim et al., 2012] mension is too high, the volume of the data space con-
It was originally designed for two-class problems. centrates on the surface, therefore available feature di-
Therefore, we utilized “one-versus-the-rest” method mension won’t increase. Thus increasing dimensional-
in our multi-class problem. ity won’t help classification at this point. In this study,
Moreover, χ2 Kernel was utilized for both meth- the optimal dimension is 113375, which corresponds
ods as some study shows that it’s good at image tex- to shrink image to 30% along both X- and Y-axis.
ture recognition. [Zhang et al., 2007] χ2 Kernel is of-
ten used with bag of feature since it is a more natu-
5.2. Effects of “K” in k-NN
ral distance measure between histograms than the eu-
clidean distance. [Yang et al., 2009] The χ2 Kernel From Figure.3, increasing number of neighbors im-
comes from the χ2 distribution: proves the accuracy because it helps reduce noise ef-
fects on k-NN classification. But including too much
k
Xi − µi 2 neighbors would ruin the classification, as neighbors
X
(1) from incorrect class would be involved. From the clas-
σi
i=1
sification accuracy on test data, we choose the number
where Xi ∼ N (µi , σi2 ), i = 1, . . . , k. of nearest neighbors to be 4.
Effects of K on k-NN accuracy
72 100%
Classification accuracy (%)
70 90%
80%
68
70%
Accuracy
66 60%
We choose K=4 50%
64
40%
With
Kernel
62 30%
Without
Kernel
60 20%
1 2 3 4 5 6 7 8 9 10
K (number of nearest neighbors) 10%
0%
Color
Bag
of
SIFT
+
Color
Bag
of
SIFT
+
k-‐
Figure 3. Effects of number of nearest neighbors on k-NN. Histogram
+
SVM
Histogram
+
k-‐ NN
SVM
NN
The data here is the “ColorCorrected”, χ2 kernel is used.
95
Accuracy vs. size of training data Figure 5. Kernel effects on SVM and k-NN classification
accuracy
classification accuracy (%)
90
85
Color Histogram and KNN Confusion matrix (74.23 % accuracy with kernel) Bag of SIFT and KNN Confusion matrix (71.39 % accuracy with kernel)
Donut 0.96
True Class
Donut 0.72
True Class
BreadSand Burger Chicken Donut Pancake Pizza Salad Sandwich BreadSand Burger Chicken Donut Pancake Pizza Salad Sandwich
Predicted Class Predicted Class
Color Histogram and SVM Confusion matrix (84.93 % accuracy with kernel) Bag of SIFT and SVM Confusion matrix (94.00 % accuracy with kernel)
True Class
BreadSand Burger Chicken Donut Pancake Pizza Salad Sandwich BreadSand Burger Chicken Donut Pancake Pizza Salad Sandwich
Predicted Class Predicted Class
Figure 6. Confusion Matrix on “ColorCorrected” dataset with Color Histogram (left) and bag of SIFT (right), using models
of k-NN (top) and SVM (bottom). χ2 kernel was utilized in all cases.
Table 1. Classification accuracy comparison among the Original, “ColorCorrected” and “ColorCorrected+Segment” dataset.
BreadSand 1.00
Burger 1.00
Chicken 1.00
Donut 1.00
True Class
Pancake 0.88
Pizza 1.00
Salad 1.00
Sandwich 0.92
Figure 7. Confusion Matrix on “ColorCorrected” dataset with combined feature of Color Histogram (left) and bag of SIFT
(right), using model of SVM with kernel.
from food images, and utilized k-NN and SVM to classification: The Journal of Machine Learning Research, 9,
do the classification. To achieve a higher accuracy, 1871–1874.
we linearly combined the two kind of features and [Kawano and Yanai, 2013] Kawano, Y., and K. Yanai, 2013,
Real-time mobile food recognition system: Computer Vision
adopted the χ2 kernel. With performance analysis like and Pattern Recognition Workshops (CVPRW), 2013 IEEE
dimensionality and data size, we accomplished a high- Conference on, IEEE, 1–7.
accuracy result with great computational efficiency. [Kim et al., 2012] Kim, J., B.-S. Kim, and S. Savarese, 2012,
Comparing image classification methods: K-nearest-neighbor
8. Future Work and support-vector-machines: Proceedings of the 6th WSEAS
international conference on Computer Engineering and Appli-
We plan to study for better background segmenta- cations, and Proceedings of the 2012 American conference
tion and color correction in image processing. We on Applied Mathematics, World Scientific and Engineering
Academy and Society (WSEAS), 133–138.
are also going to explore more machine learning al-
[Lowe, 1999] Lowe, D. G., 1999, Object recognition from lo-
gorithms and technique details. Moreover, we will cal scale-invariant features: Computer vision, 1999. The pro-
test algorithms with food images with real-life envi- ceedings of the seventh IEEE international conference on, Ieee,
ronment. 1150–1157.
[Suykens and Vandewalle, 1999] Suykens, J. A., and J. Vande-
References walle, 1999, Least squares support vector machine classifiers:
Neural processing letters, 9, 293–300.
[Bossard et al., 2014] Bossard, L., M. Guillaumin, and L. [Vedaldi and Fulkerson, 2012] Vedaldi, A., and B. Fulkerson,
Van Gool, 2014, Food-101–mining discriminative compo- 2012, Vlfeat: An open and portable library of computer vision
nents with random forests, in Computer Vision–ECCV 2014: algorithms (2008).
Springer, 446–461. [Yang et al., 2009] Yang, J., K. Yu, Y. Gong, and T. Huang, 2009,
[Chen et al., 2009] Chen, M., K. Dhingra, W. Wu, L. Yang, and Linear spatial pyramid matching using sparse coding for image
R. Sukthankar, 2009, Pfid: Pittsburgh fast-food image dataset: classification: Computer Vision and Pattern Recognition, 2009.
Image Processing (ICIP), 2009 16th IEEE International Con- CVPR 2009. IEEE Conference on, IEEE, 1794–1801.
ference on, IEEE, 289–292. [Zhang et al., 2007] Zhang, J., M. Marszałek, S. Lazebnik, and
[Cover and Hart, 1967] Cover, T., and P. Hart, 1967, Nearest C. Schmid, 2007, Local features and kernels for classification
neighbor pattern classification: Information Theory, IEEE of texture and object categories: A comprehensive study: In-
Transactions on, 13, 21–27. ternational journal of computer vision, 73, 213–238.
[Fan et al., 2008] Fan, R.-E., K.-W. Chang, C.-J. Hsieh, X.-R.
Wang, and C.-J. Lin, 2008, Liblinear: A library for large linear