Abstract
Modern computers provide excellent opportunities for performing fast computations. They are equipped with powerful microprocessors and large memories. However, programs are not necessarily able to exploit those computer resources effectively. In this paper, we present the way in which we have implemented a nearest neighbor classification. We show how performance can be improved by exploiting the ability of superscalar processors to issue multiple instructions per cycle and by using the memory hierarchy adequately. This is accomplished by the use of floating-point arithmetic which usually outperforms integer arithmetic, and block (tiled) algorithms which exploit the data locality of programs allowing for an efficient use of the data stored in the cache memory. Our results are validated with both an analytical model and empirical results. We show that regular codes could be performed faster than more complex irregular codes using standard data sets.
Similar content being viewed by others
Notes
RISC stands for Reduced Instruction Set Computer
References
Michie D, Spiegelhalter DJ, Taylor CC (1994) (eds) Machine learning, neural and statistical classification. Ellis Horwood, Chichester
Shakhnarovich G, Indyk P, Darrell T (2006) (eds) Nearest neighbor methods in learning and vision. Theory and practice. MIT Press, New York
Kevin B, Jonathan G, Raghu R, Uri S (1999) When is “nearest neighbour” meaningful? In: Catriel Beeri, Peter Buneman (eds) In: Proceedings of 7th international conference data theory, ICDT, number 1540 in lecture notes in computer science, LNCS. Springer, Heidelberg, 10–12 January 1999, pp 217–235
Mahamud S, Hebert M (2003) Minimum risk distance measure for object recognition. In: International conference on computer vision, pp 242–248
Pekalska E, Duin RPW, Gunter S, Bunke H (2004) On not making dissimilarities euclidean. In: Joint IAPR international workshops on statistical and structural pattern recognition, pp 1143–1151.
Vassilis Athitsos, Jonathan Alon, Stan Sclaroff (2005) Efficient nearest neighbor classification using a cascade of approximate similarity measures. In: IEEE computer vision and pattern recognition (CVPR), IEEE Computer Society, pp I: 486–493.
Kilian Q. Weinberger, John Blitzer, Lawrence K. Saul (2005) Distance metric learning for large margin nearest neighbor classification. In: Neural information processing systems, (NIPS)
Navarro JJ, Juan A, Lang T (1994) MOB forms: a class of multilevel block algorithms for dense linear algebra computations. In: ACM International conference supercomputing, pp. 354–363
Fu J, Huang TS (1984) VLSI for pattern recognition and image processing. Springer, Berlin
Bandyopadhyay S, Maulik U (2002) Efficient prototype reordering in nearest neighbor classification. Patt Recognit 35(12):2791–2799
Dasarathy BV (1991) Nearest Neighbor (NN) norms: NN pattern classification techniques, IEEE Computer Society Press, Washington
Grother PJ, Candela GT, Blue JL (1997) Fast implementation of nearest neighbor classifiers. Patt Recognit 30(3):459–465
Van Der Heiden R, Groen FCA (1997) The box–cox metric for nearest neighbor classification improvement. Patt Recognit 30(2):273–279
Kudo M, Masuyamaa N, Toyamaa J, Shimbob M (2003) Simple termination conditions for k-nearest neighbor method. Patt Recognit Lett 24(9–10):1203–1213
Lee EW, Chae SI (1998) Fast design of reduced-complexity nearest-neighbor classifiers using triangular inequality. IEEE Trans Patt Anal Mach Intell 20(5):562–566
Cheng-Lin Liu, Sako H, Fujisawa H (2002) Performance evaluation of pattern classifiers for handwritten character recognition. Int J Doc Anal Recog 4:191–204
Ricci F, Avesani P (1999) Data compression and local metrics for nearest neighbor classification. IEEE Trans Patt Anal Mach Intell 21(4):380–384
Djouadi A, Bouktache E (1997) A fast algorithm for the nearest-neighbor classifier. IEEE Trans Patt Anal Mach Intell 19(3):277–282
Harnamoto Y, Uchimura S, Tornita S (1997) A bootstrap technique for nearest neighbor classifier design. IEEE Trans Patt Anal Mach Intell 19(1):73–79
Pekalska E, Harol A, Lai C, Duin RPW (2005) Pairwise selection of features and prototypes. In: International conference on computer recognition systems, Springer, Heidelberg, pp 271–278
Decaestecker C (1997) Finding prototypes for nearest neighbor classification by means of gradient descent and deterministic annealing. Patt Recognit 30(2):281–288
Chi Z, Wu J, Yan H (1995) Handwritten numeral recognition using self-organizing maps and fuzzy rules. Patt Recognit 28(1):59–66
Kohonen T (1990) The self-organizing map. Proc IEEE 78(9):1464–1480
Baglietto P, Maresca M, Migliardi M (1996) Image processing on high-performance risc systems. In: Proc IEEE, 84(7):917–930
Anderson E, Dongarra J (1992) LAPACK user’s guide. SIAM, Philadelphia
Hewlett Packard (1994) PA-RISC 1.1 Architecture and instruction set reference manual
Digital Equip. Corp. (1994) DECchip 21064 and DECchip 21064A Alpha AXP microprocessors—hardware ref. manual
SUN Microsystems (2003) UltraSPARC IIIi processor user’s manual, June
Grother PJ, Candela GT (1993) Comparison of handprinted digit classifiers. Technical report NISTR 5209, National Institute of Standards and Technology (NIST)
Lam M (1999) Software pipelining: an effective technique for VLIW machines. In: Proceedings of the SIGPLAN’88, pp 318–3281999
John LH, David AP (1996) Computer architecture a quantitative approach, 2nd edn. Morgan Kaufmann, San Francisco
Lam MS, Rothberg EE, Wolf ME (1991) The cache performance and optimizations of blocked algorithms. In: Proceedings of ASPLOS’91, pp 67–74
Newman DJ, Hettich S, Blake CL, Merz CJ (1998) UCI repository of machine learning databases
Chih-Chung C, Chih-Jen L (2001) LIBSVM: a library for support vector machines. Available at http://www.csie.ntu.edu.tw/∼cjlin/libsvm
Acknowledgements
This work was supported by the Comissionat per a Universitats i Recerca of the Generalitat de Catalunya (BE94/Annex 3-642 and BE94-A1/110) and the Ministerio de Educación y Ciencia of Spain (TIN2004-07739-C02-01).
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
About this article
Cite this article
Herrero, J.R., Navarro, J.J. Exploiting computer resources for fast nearest neighbor classification. Pattern Anal Applic 10, 265–275 (2007). https://doi.org/10.1007/s10044-007-0065-y
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s10044-007-0065-y