# CoreTemp: Coreset Sampled Templates for Multimodal Mobile Biometrics
## 4 Methods
### CoreTemp: Coreset-Reduced Templates
#### 4.2.2 Inference  
Now, assuming an authentication scheme, we assume a claimant sample \(\bar{m}=f(\hat{\mathbf{X}})\). The similarity score is calculated based on the nearest neighbor distance within data registered in \(\mathcal{M}_{C}\), that is,  
\[s=-\min_{m\in\mathcal{M}_{C}}||m-\bar{m}||_{2}, \tag{3}\]  
with the computational complexity linearly dependent on the size, the dimension, and the sampling ratio of the template assuming a fixed number of claimant samples. Namely, assuming \(p\) as the sampling ratio, \(N\) the original length of a template, and \(d\) the dimension of the template, the complexity is given as \(\mathcal{O}(pNd)\), where coreset sampling achieves \(N\to pN\).  
To further reduce the computational burden, we propose reducing the dimension of the CoreTemp via random linear projection. By applying the same reduction layer when the greedy sampling selection process takes place, we justify such an application to calculate the similarity score, that is, taking the notations given in Section 3.2,  
\[s=-\min_{m\in\mathcal{M}_{C}}||\psi(m)-\psi(\bar{m})||_{2}, \tag{4}\]  
where we further reduce the computational burden to \(\mathcal{O}(pNd^{*})\), hence a fast match algorithm (\(d\to d^{*}\)). Finally, the similarity score is compared against a predefined threshold for both cases, where the accept or reject decision occurs.  
Correspondingly, for identification, we simply take the \(\arg\max\) of the the similarity scores, namely,  
\[id=\operatorname*{arg\,max}_{i}s^{i} \tag{5}\]  
where \(s^{i}\) denotes the similarity score calculated corresponding to the coreset with identity \(i\), that is, \(s^{i}=-\min_{m\in\mathcal{M}_{C}^{i}}||m-\bar{m}||_{2}\), or for an application of the fast match algorithm, \(s^{i}=-\min_{m\in\mathcal{M}_{C}^{i}}||\psi(m)-\psi(\bar{m})||_{2}\). A detailed algorithm for authentication and identification is further provided in Algorithms 1 and 2.  
```
1:\(\mathcal{D}_{\mathbf{A}},\mathcal{D}_{\mathbf{B}},f(\cdot),s(\cdot),\tau\)
2:for\((\mathcal{P},\mathcal{E})\) in \(\{(\mathcal{D}_{\mathbf{A}},\mathcal{D}_{\mathbf{B}}),(\mathcal{D}_{\mathbf{B}},\mathcal{D}_{\mathbf{A}})\}\)do
3:\(\mathsf{P}\) Pretraining
4: Initialize \(f(\cdot)\)\(\triangleright\) PIEformer+
5: Train \(f(\cdot)\) on \(\mathcal{P}\)
6:\(\mathsf{Authentication}\)
7:for\(y_{g}\) in \(\mathcal{Y}_{\mathcal{E}}\)do
8: Generate \(\mathcal{M}^{y_{g}}\)
9: Subsample \(\mathcal{C}\): \(\mathcal{M}^{y_{g}}\rightarrow\mathcal{M}^{y_{g}}_{\mathcal{C}}\)
10: Generate \(\mathbf{q}_{g},\mathbf{q}_{i}\)\(\triangleright\) query samples of genuine and impostors
11:for\(q\) in \(\mathbf{q}_{g}\cup\mathbf{q}_{i}\)do
12:if\(s(f(q))>\tau\)then
13: Accept
14:else
15: Reject
16:endif
17:endfor
18:endfor
19:Average accumulated statistics
```  
**Algorithm 1** Authentication Implementation  
```
1:\(\mathcal{D}_{\mathbf{A}},\mathcal{D}_{\mathbf{B}},f(\cdot)\)
2:for\((\mathcal{P},\mathcal{E})\) in \(\{(\mathcal{D}_{\mathbf{A}},\mathcal{D}_{\mathbf{B}}),(\mathcal{D}_{\mathbf{B}},\mathcal{D}_{\mathbf{A}})\}\)do
3:\(\mathsf{P}\) Pretraining
4: Initialize \(f(\cdot)\)\(\triangleright\) PIEformer+
5: Train \(f(\cdot)\) on \(\mathcal{P}\)\(\triangleright\)
6:\(\mathsf{P}\) Identification
7:for\(y_{g}\) in \(\mathcal{Y}_{\mathcal{E}}\)do
8: Generate \(\mathcal{M}^{y_{g}}\)
9: Subsample \(\mathcal{C}\): \(\mathcal{M}^{y_{g}}\rightarrow\mathcal{M}^{y_{g}}_{\mathcal{C}}\)
20:endfor
11: Register \(\mathcal{M}^{1}_{\mathcal{C}},\ldots,\mathcal{M}^{|\gamma_{\mathcal{E}}|}_{ \mathcal{C}}\)
12:for\(y_{g}\) in \(\mathcal{Y}_{\mathcal{E}}\)do
13: Generate \(\mathbf{q}_{g},\mathbf{q}_{i}\)\(\triangleright\) query samples of genuine and impostors
14:for\(q\) in \(\mathbf{q}_{g}\cup\mathbf{q}_{i}\)do
15:\(id=\arg\max_{i}s^{i}(f(q))\)
16:endfor
17:endfor
18:endfor
19:Average accumulated statistics
```  
**Algorithm 2** Identification Implementation