# Deep Active Learning for Computer Vision Tasks: Methodologies, Applications, and Challenges
## 4 Deep Active Learning Methods
### Active Contrastive Learning
They firstly defined the score function:  
\[score=\theta\big{(}x_{i},x_{j}\big{)}=\exp\left(\frac{f(x_{i})^{\top}f(x_{j})} {\tau\cdot\|f(x_{i})\|\big{\|}f(x_{j})\big{\|}}\right) \tag{11}\]  
Then, they used contrastive learning to select semantic and distinctive features and then selected the most informative unlabeled samples \(v^{\star}\) with minimax selection scheme for querying. \[v^{\star}=\underset{v_{i}\in\mathcal{V}-L}{\operatorname*{argmin}}\max_{v_{j} \in\mathcal{N}(i)}d\big{(}x_{i},x_{j}\big{)}, \tag{12}\]  
where \(d(x_{i},x_{j})\) calculates the Euclidean distance between embeddings of two nodes \(x_{i}\) and \(x_{j}\), \(\mathcal{N}(i)\) represents the neighbor set of node \(i\), \(\mathcal{V}\) and \(L\) denotes the node set and labeled set, respectively. Finally, they generalized contrastive learning to active learning with the following modified loss function:  
\[L_{CAL}\big{(}x_{i},x_{i}^{\prime}\big{)}=-\log\frac{\theta\big{(}x_{i},x_{i} ^{\prime}\big{)}+\lambda\cdot\sum_{x_{p}\in\mathcal{P}(i)}\theta\big{(}x_{i},x_{p}\big{)}}{\theta\big{(}x_{i},x_{i}^{\prime}\big{)}+\lambda\cdot\sum_{x_ {p}\in\mathcal{P}(i)}\theta\big{(}x_{i},x_{p}\big{)}+\sum_{j\
eq i}\left[ \theta\big{(}x_{i},x_{j}^{\prime}\big{)}+\theta\big{(}x_{i},x_{j}^{\prime} \big{)}\right]}, \tag{13}\]  
where \(\mathcal{P}(i)\) denotes the set of positive embedding whose label is the same with node \(v_{i}\). ```
input :A labeled data pool \(L\), an unlabeled data pool \(\mathcal{U}\). output :A well-trained model \(\mathcal{M}\) with the least labeling cost. 1\(\mathcal{M}\) initialization; repeat
2 construct the positive and negative sample pairs;
3 Train the model \(\mathcal{M}\) with the labeled dataset \(L\) by minimizing the contrastive loss objective;
4 Calculate the distance between each sample in the batch;
5 Select the candidate \(\mathcal{K}\) according the distance of embeddings or other certain estimations;
6 Query \(\mathcal{K}\)'s label \(\mathcal{Y}^{\mathcal{K}}\) ;
7 Update the positive embeddings set \(\mathcal{P}(\cdot)\) with samples embeddings having the same label as \(\mathcal{Y}^{\mathcal{K}}\) ;
8 Update \(L=L\cup\{\mathcal{K},\mathcal{Y}^{\mathcal{K}}\}\), update \(\mathcal{U}=\mathcal{U}/\mathcal{K}\). 9 untilEnd conditions;
```  
**Algorithm 4**The workflow of basic contrastive active learning algorithm  
[PERSON] et al. [91] integrated graph neural networks (GNNs)-based active learning with contrastive learning. They denoised the selected candidates by considering the neighborhood propagation scheme in GNNs. [PERSON] et al. [92] proposed the featuresim score, which selected balanced, diverse, and informative samples (samples in-between clusters and from edge of clusters) from each class. [PERSON] et al. [93] applied active learning and contrastive learning to the fine-grained off-road semantic segmentation task. They used different semantic attributes for weak supervision and defined the image patches that share the same label as positive pairs while the rest were negative pairs. Besides this, they proposed a risk evaluation method to evaluate high-risk predictions and selected for additional annotation.