## 3 Methodology
### Global Descriptor Aggregation  
In our work, we adapt the Sinkhorn algorithm from the SALAD method to generate global image descriptors, reformulating feature-to-cluster assignment as an optimal transport problem. Unlike NetVLAD, which relies on k-means cluster centers, SALAD employs a learnable, data-driven assignment strategy. Instead of introducing prior biases, it utilizes a randomly initialized two-layer fully connected network to compute the feature-to-cluster assignment score matrix \(S\in\mathbb{R}^{N\times m}\), where m is the number of cluster centroids, dynamically generating per-row assignment scores. For each local feature \(t_{i}\in\mathbb{R}^{D}\), where \(i\in\{1,2,\ldots,N\}\) indexes the \(i\)-th local feature, the corresponding score vector \(s_{i}\in\mathbb{R}^{m}\) is computed as  
\[s_{i}=W_{s_{2}}(\sigma(W_{s_{1}}(t_{i})+b_{s_{1}}))+b_{s_{2}} \tag{3}\]  
where \(W_{s_{1}}\) and \(W_{s_{2}}\), and \(b_{s_{1}}\) and \(b_{s_{2}}\) are learnable weights and biases, and \(\sigma\) is a non-linear activation function. This formulation allows dynamic learning of cluster structures, making assignments more adaptive.  
To ensure robustness, SALAD introduces a \"dustbin\" cluster, allowing non-informative features to be discarded rather than forced into predefined clusters. This is achieved by extending the assignment matrix:  
\[\overline{S}=[S,\overline{s}_{i,m+1}]\in\mathbb{R}^{N\times m+1}_{>0} \tag{4}\]  
where \(\overline{s}_{i,m+1}=\gamma\cdot 1_{N}\) is a constant column vector, \(\gamma\in\mathbb{R}\) is a learnable scalar, and \(\mathbf{1}_{N}\in\mathbb{R}^{N}\) is an all-one vector.  
By considering feature-to-cluster and cluster-to-feature assignments, the method formulates clustering as an optimal transport problem. The Sinkhorn algorithm solves this constrained optimization, ensuring effective feature distribution:  
\[\overline{P}1_{m+1}=\mu\quad\text{and}\quad\overline{P}^{\top}1_{n}=\kappa \tag{5}\]  
where \(\mu=1_{N}\) and \(\kappa\) defines the mass distribution constraints. The matrix \(\overline{p}\) is the complete assignment matrix containing the dustbin column. Once optimized, the dustbin column is removed, yielding the refined assignment matrix \(P\), where \(P_{i,j}\) represents the assignment weight of feature \(i\) to cluster \(j\).  
With the optimal assignments, local features are aggregated to form the global descriptor. Traditional methods use residual aggregation (e.g., VLAD and NetVLAD) or statistical aggregation (e.g., GeM). Instead, SALAD dynamically assigns features to clusters and pools them based on learned weights.  
Each local feature \(t_{i}\) is then projected onto a lower-dimensional space via a two-layer MLP to obtain \(f_{i}\in\mathbb{R}^{l}\), thus improving efficiency while retaining task-relevant information. The final global descriptor \(V\in\mathbb{R}^{m\times l}\) is constructed via a weighted sum of features as  
\[V_{j,k}=\sum_{i=1}^{n}P_{i,k}\cdot f_{i,k} \tag{6}\]  
where \(f_{i,k}\) is the \(k\)-th dimension of the reduced feature \(f_{i}\).  
This eliminates reliance on residual encoding while enabling adaptive feature selection. By integrating optimal transport principles with learned clustering, SALAD enhances descriptor flexibility and robustness, thus improving adaptability in complex environments.