The retrieval can be slow because it’s a brute-force method. Matching can be made faster using approximate nearest neighbor. The curse of dimensionality also kicks in, as shown in the following figure:

With every increasing dimension, complexity increases as the complexity from two dimensions to three dimensions. The computation of the distance also becomes slower. To make the distance search faster, we will discuss an approximate method in the next section.