# FGM: Noisy Label Learning via Fine-Grained Confidence Modeling
## 3 Proposed Method
### Mixed Semi-Training  
With the sample selection steps introduced above, we already constructed a cleaned labeled set \(\mathcal{X}_{l}\) which consists of \(N_{l}\) samples since the pseudo labels of CS, NS and CH clusters have a high probability of being correct:  
\[\mathcal{X}_{l}=\{(x_{i},l_{i}):i\in(1,\ldots,N_{l})\}=(\mathcal{X}_{ \overline{MS}},\mathcal{M}\mathcal{Y}_{\overline{MS}})\cup(\mathcal{X}_{ \overline{GS}^{\prime}},\mathcal{A}\mathcal{Y}_{\overline{GS}})\cup( \mathcal{X}_{\overline{CH}},\mathcal{A}\mathcal{Y}_{\overline{CH}}).\]  
where \(l_{i}\) is the corresponding cleaned label for sample \(x_{i}\). To maximize the use of training samples, instead of dropping all the samples in NHI and NHIR clusters, we drop their labels to construct an unlabeled set \(\mathcal{X}_{u}\) consists of \(N_{u}\) samples:  
\[\mathcal{X}_{u}=\{u_{i}:i\in(1,\ldots,N_{u})\}=(\mathcal{X}_{\mathcal{N} \mathcal{H}\mathcal{R}})\cup(\mathcal{X}_{\mathcal{N}\mathcal{H}\mathcal{I}})\]  
where \(u_{b}\) refers to an unlabeled sample. We reinitialize the model to prevent over-fitting, and make use of the labeled as well as the unlabeled dataset to train it in a mixed semi-supervised way inspired by [31]. Cross entropy loss for labeled batches \(\mathcal{L}_{x}\) is defined as:  
\[\mathcal{L}_{x}=\frac{1}{B}CE(\mathcal{P}_{model}(x_{i};\theta),l_{i})_{i=1}^{B} \tag{4}\]  
where \(B\) is the batch size of labeled batches. Strong augmentations have been proved to be beneficial to the training of model [31]. [PERSON] et al. take the whole training set as unlabeled data and applies strong augmentations to unlabeled data [31]. To speed up the semi-training process while improving the performance, we propose mixed batches \(BatchNorm=\{m_{b}:b\in(1,\ldots,(\mu+1)B)\}\in\mathcal{X}_{l}\cup\mathcal{X}_{u}\) randomly sampled from both labeled data and unlabeled data. Every \(BatchNorm\) samples \(B\) samples from labeled dataset and \(\mu\)B samples from unlabeled dataset. Therefore, the batch size for mix batches is \((\mu+1)B\).  
For mixed batches, first we record the confidence scores for every sample \(m_{b}\) as \(\mathcal{C}^{m}\).  
\[\mathcal{C}^{m}=\mathcal{P}_{model}(m_{b};\theta)_{b=1}^{(\mu+1)B} \tag{5}\]  
Then, labels with maximum confidence for unlabeled data are employed as their pseudo labels \(Pse_{b}^{m}\) while labels for labeled data are kept:  
\[Pse_{b}^{m}=\begin{cases}argmax(C_{b}^{m})&\text{if }m_{b}\in\mathcal{X}_{u}\\ l_{b}&\text{if }m_{b}\in\mathcal{X}_{l}\end{cases} \tag{6}\]  
By performing various augmentations [31], the cross entropy loss for mixed batches is defined as:  
\[\mathcal{L}_{m}=\frac{1}{(\mu+1)B}\Sigma_{b=1}^{(\mu+1)B}\mathbb{1}_{max(C_{b }^{m})>\tau}CE(\mathcal{P}_{model}(\mathcal{A}(m_{b});\theta),Pse_{b}^{m}) \tag{7}\]where only predicted labels with confidence higher than \(\tau\) are counted in the loss and \(\mathcal{A}\) refers to augmentations. Finally, a coefficient factor \(\lambda_{m}\) is used to balance the loss of mixed batches and forms the overall loss.  
\[loss=\mathcal{L}_{x}+\lambda_{m}\mathcal{L}_{m} \tag{8}\]