# Deep Active Learning for Computer Vision Tasks: Methodologies, Applications, and Challenges
## 4 Deep Active Learning Methods
### Active Contrastive Learning  
Semi-supervised learning still needs some labeled data to carry out training, but self-supervised learning extracts representation by mining data instead of annotation. Contrastive learning is one of the most successful paradigms for self-supervised learning. The key idea of contrastive learning is to learn its relationship by comparing the similarity of different samples in the dataset. Thus, how to define the positive pairs (similar samples) and negative pairs (dissimilar samples) is the main issue in contrastive learning. The workflow of basic contrastive active learning is reported in the Algorithm 4. For arbitrary data \(x\), the goal of contrastive learning is to learn an encoder \(f(\cdot)\) such that:  
\[\text{score}\big{(}f(x),f\big{(}x^{+}\big{)}\big{)}>>\text{score}\big{(}f(x),f\big{(}x^{-}\big{)}\big{)}, \tag{7}\]  
where \(f(x)\) denotes the global features. \(f(x^{+})\) denotes the local features from positive samples. \(f(x^{-})\) denotes the local features from negative samples. The score\((\overrightarrow{X_{1}},\overrightarrow{X_{2}})\) is the function to measure the similarity of vectors \(\overrightarrow{X_{1}}\) and \(\overrightarrow{X_{2}}\). Euclidean distance and cosine similarity are two classical score functions, which are formulated as follows. \[Euclidean\left(\overrightarrow{X_{1}},\overrightarrow{X_{2}}\right)=\left\|F \left(\overrightarrow{X_{1}}\right)-F\left(\overrightarrow{X_{2}}\right) \right\|_{2} \tag{8}\]  
\[Cosine\left(\overrightarrow{X_{1}},\overrightarrow{X_{2}}\right)=\frac{ \overrightarrow{X_{1}}^{\intercal}\overrightarrow{X_{2}}}{|\overrightarrow {X_{1}}||\overrightarrow{X_{2}}|} \tag{9}\]  
After that, it optimizes an objective that pulls the positive pairs together while pushing the negative pairs away in the representation space. The loss function InfoNCE [80] is usually used in the related research of contrastive learning, which is formulated as follows:  
\[L_{NCE}=-\mathbf{E}_{X}\left[\log\frac{score\big{(}f(x_{i}),f\big{(}x_{i}^{+} \big{)}\big{)}}{score\big{(}f(x_{i}),f\big{(}x_{i}^{+}\big{)}\big{)}+\sum_{j \
eq i}score\big{(}f(x_{i}),f\Big{(}x_{j}^{-}\big{)}\big{)}}\right], \tag{10}\]  
where the corresponding sample \(x\) has one positive and N-1 negative pairs. By minimizing the InfoNCE loss, contrastive learning is to make the features of \(f(x)\) more similar to the features of positive samples \(f(x^{+})\), and less similar to the features of N-1 negative samples \(f(x^{-}_{j})(j\in 1,\dots,N-1)\). Finally, it can maximize a lower bound on the mutual information between \(f(x)\) and \(f(x^{+})\)[81]. [PERSON] et al. [82] analyzed the theoretical shortcomings of contrastive learning, where they argued that the learned representations of contrastive learning were high relative to the size of negative samples. For example, MoCo [83; 84; 85] and SimCLR [86; 87] obtained success due to the various data argumentation with large memory bank and extremely large batch size, respectively. However, [PERSON] et al. [88] validated that a larger size of negative samples does not always learn better representations, leading to better performance. They found that the larger batch size would likely generate more redundant samples, thus affecting the efficiency of contrastive learning. In order to address the above problems, active learning was introduced into contrastive learning by assisting the selection of negative samples [89]. When they carried out the cross-modal contrastive representation learning, uncertainty and diversity were used to sample the negative samples, thus reducing the redundancy actively. Furthermore, previous active learning works assume that the labeled and unlabeled data pools follow the same class distribution. When applying these works to mismatched class distribution tasks, it suffered from performance degradation sharply. [PERSON] et al. [90] focused on this problem.