# Multi-Augmentation-Based Contrastive Learning for Semi-Supervised Learning
## 2 Method
### The Proposed MAC-SSL  
MAC-SSL generates one batch of augmented labeled data, denoted as \(\mathcal{X}^{\prime}\), and three batches of augmented unlabeled data, where \(\mathcal{U}^{\prime}_{m}\), \(\mathcal{U}^{\prime}_{m}\), and \(\mathcal{U}^{\prime}_{s}\). \(\mathcal{X}^{\prime}\) represent the labeled data batch after weak augmentation and \(\mathcal{U}^{\prime}_{w}\), \(\mathcal{U}^{\prime}_{m}\), and \(\mathcal{U}^{\prime}_{s}\) represent the unlabeled data batches after weak, moderate, and strong augmentations, respectively. The average prediction distribution \(p^{u}_{p}\) is computed using the model outputs \(p^{u\prime}_{wb}\) and \(p^{u\prime}_{mb}\) from \(\mathcal{U}^{\prime}_{m}\) and \(\mathcal{U}^{\prime}_{m}\), respectively (see Equation (1)), which are then used to generate the pseudo-labels \(q^{u\prime}_{b}\) for the unlabeled data batch (see Equation (2)). Subsequently, \(\mathcal{X}^{\prime}\) and \(\mathcal{U}^{\prime}_{w}\), \(\mathcal{U}^{\prime}_{m}\), and \(\mathcal{U}^{\prime}_{s}\) are mixed to generate the mixed weakly augmented labeled data batch \(\mathcal{X}^{\prime\prime}\) and the mixed weakly augmented unlabeled data batches \(\mathcal{U}^{\prime\prime}_{w}\), the mixed moderately augmented unlabeled data batch \(\mathcal{U}^{\prime\prime}_{m}\), and the mixed strongly augmented unlabeled data batch \(\mathcal{U}^{\prime\prime}_{s}\), respectively. Likewise, the ground-true label \(q_{b}\) and pseudo-label \(q^{u}_{b}\) are also mixed to obtain the corresponding pseudo-labels \(q^{\prime}_{b}\) and \(q^{u\prime}_{b}\) for \(\mathcal{X}^{\prime\prime}\) and \(\mathcal{U}^{\prime\prime}_{w}\), \(\mathcal{U}^{\prime\prime}_{m}\), and \(\mathcal{U}^{\prime}_{s}\), respectively (see Section 2.3). The complete MAC-SSL framework is illustrated in Figure 3, and a flowchart of the MAC-SSL process is presented in Figure 4.  
The loss function of MAC-SSL consists of the following four components: supervised classification loss \(\mathcal{L}_{x}\), mixed supervised classification loss \(\mathcal{L}_{xm}\), unsupervised classification loss \(\mathcal{L}_{u}\), and contrastive loss \(\mathcal{L}_{c}\). \(\mathcal{L}_{x}\) is the supervised classification loss on \(\mathcal{X}\), which is defined as the cross-entropy between the ground-true label and the model prediction, as follows:  
\[\mathcal{L}_{x}=\frac{1}{B}\sum_{b=1}^{B}H(q^{\prime}_{b},p(q|x_{b})), \tag{12}\]  
where \(p(q|x_{b})\) is the model's prediction for \(x_{b}\in\mathcal{X}\) and \(H\) denotes the cross-entropy between \(q_{b}\) and \(p(q|x_{b})\). Regarding \(\mathcal{L}_{xm}\), it is the supervised classification loss on \(\mathcal{X}^{\prime\prime}\). It is defined as the cross-entropy between the pseudo-label and the model prediction, as follows:  
\[\mathcal{L}_{xm}=\frac{1}{B}\sum_{b=1}^{B}H(q^{\prime}_{b},p(q|x^{\prime\prime }_{b})), \tag{13}\]  
where \(q^{\prime}_{b}\) is the pseudo-label, \(p(q|x^{\prime\prime}_{b})\) is the model's prediction for \(x^{\prime\prime}_{b}\in\mathcal{X}^{\prime\prime}\), and \(H\) denotes the cross-entropy between \(q^{\prime}_{b}\) and \(p(q|x^{\prime}_{b})\). The unsupervised classification loss, \(\mathcal{L}_{u}\), is defined on \(\mathcal{U}^{\prime\prime}_{w}\), \(\mathcal{U}^{\prime\prime}_{m}\), and \(\mathcal{U}^{\prime\prime}_{s}\).