*3.1. Spectral Clustering Algorithm*

Spectral clustering algorithms [45] have proven to be suitable to process highly-dimensional data. In this work, a spectral normalized clustering algorithm is used as was introduced by Ng et al. [46]. This algorithm has been already used for mapping along with local features extracted from the scenes [29,47].

In our work, the algorithm departs from the set of global appearance descriptors *D* = { #»*d*1, #»*d*2, ...# »*dN*} obtained from the images collected in the environment, and the parameter *nc* is the desired number of clusters. Initially, the similitude between descriptors is calculated. This parameter #»*di* <sup>−</sup> #»*dj* <sup>|</sup> 2

is calculated for each pair of descriptors; hence, a matrix of similitudes *S* is obtained as *Sij* = *e* − | 2*σ*2 where *σ* is a parameter that controls the rapidity of the reduction of the similitude when the distance between #»*di* and #»*dj* increases. The steps to carry out the clustering are the following:

1. Calculation of the normalized Laplacian matrix:

$$L = I - D^{-1/2} S D^{1/2} \tag{2}$$

where Dis a diagonal matrix *Di* = ∑*<sup>N</sup> <sup>j</sup>*=<sup>1</sup> *Sij*.


If the number of instances *N* or the dimension *l* is high, the computation of the *nc* eigenvectors (third step) will be computationally expensive. To solve this issue, Luxburg [45] proposed cancelling some components of the similitude matrix. This way, in the matrix *S*, only the components *Sij* so that *j* is among the *t* nearest neighbours of *i* are retained. After this, the *nc* first eigenvectors of the Laplacian matrix *L* are calculated by using the Lanczos/Arnoldi factorization [48].

Finally, for each cluster, a representative is obtained as the average visual descriptor of the set of descriptors that compose that cluster.

Spectral clustering may result in being more efficient than traditional methods such as k-means or hierarchical clustering in large environments due to the fact that spectral clustering considers the mutual similitude between the instances.
