[h!]
Optimal Pair Finding Algorithm
Random Image Pairs (\(I_1^1,I_2^1\) ),\(\cdots \) ,(\(I_1^N,I_2^N\) )
Optimal Image Pairs (\(O_1^1\) ,\(O_2^1\) ),\(\cdots \) ,(\(O_1^N\) ,\(O_2^N\) )
[1]
Compute Arcface features on the input face images.
Optimal-Pair \(\leftarrow \)  \(\left[ \right]\) 
\(i \leftarrow 1\)  to \(N\) 
Compute Index of nearest arcface feature \(j\)  to \(i\) 
\(\left(j,i\right)\)  \(\notin \)  Optimal-Pair
Append \(\left(i,j\right)\)  to Optimal-Pair
Compute Index of second-nearest arcface feature \(k\)  to \(i\) 
Append \(\left(i,k\right)\)  to Optimal-Pair
 Optimal-Pair


It is essential to select the look-alike data subjects to achieve the optimal attack potential with the proposed composite face image generation. We choose the optimal pairs to generate the composite face images to this extent. Given \(n\)  synthetic samples, the total number of pairs possible is \(((n){\times }(n-1))/2\) , and thus finding optimal pairs using this approach is quadratic (\(O(n^2)\) ) as we have to compute the pair-wise distance for all pairs. The quadratic time for pair-finding is within the computing limits as our dataset now consists of 1000 unique data subjects. We have put an additional constraint in the pair-finding algorithm not to return swapped pairs, i.e., if (\(i\) ,\(j\) ) is the list, then (\(j\) ,\(i\) ) is not added to the optimal pair list. The approach for optimal pair finding is summarized in an algorithmic format in Algorithm REF  and a few optimal pairs are shown in Figure REF . The distance metric used in our approach is cosine-distance from Arcface [1]} features.
