## 3 Proposed Method
### Objective Functions  
In the cross-domain object detection, we had \(N_{s}\) source domains of labeled samples, defined as \(\mathcal{D}_{S}=\{x_{i}^{s},y_{i}^{s}\}_{i=1}^{N_{s}}\), and \(N_{t}\) target domains of unlabeled samples, defined as \(\mathcal{D}_{T}=\{x_{i}^{t}\}_{i=1}^{N_{t}}\). \(x_{i}^{s}\) and \(x_{i}^{t}\) denoted the input samples in the source and target domains, respectively. \(y_{i}^{s}=(c_{i}^{s},b_{i}^{s})\) denoted the labels of the corresponding input samples in the source domain; \(c_{i}^{s}\) was the category label, and \(b_{i}^{s}\) was the bounding box label.  
Firstly, we trained the student model on the labeled source domain, as shown in Equation (5).  
\[\mathcal{L}_{sup}(\mathcal{D}_{S})=\mathcal{L}_{sup}^{cls}(x_{i}^{s},y_{gt})+ \mathcal{L}_{sup}^{loc}(x_{i}^{s},y_{gt})+\mathcal{L}_{sup}^{reg} \tag{5}\]  
where the source domain sample was denoted as \(x_{i}^{s}\), and its corresponding ground truth labels were denoted as \(y_{gt}\). \(\mathcal{L}_{sup}(\mathcal{D}_{S})\) denoted the object detection loss under supervision, including the classification loss, bounding box regression loss, and the regular term. \(\mathcal{L}_{sup}^{cls}(x_{i}^{s},y_{gt})\) stands for the object detection classification loss for each \(x_{i}^{s}\) source domain sample with the corresponding ground truth label \(y_{gt}\). \(\mathcal{L}_{sup}^{loc}(x_{i}^{s},y_{gt})\) stands for the object detection bounding box regression loss for each \(x_{i}^{s}\) source domain sample with corresponding ground truth label \(y_{gt}\). \(\mathcal{L}_{sup}^{reg}\) stands for the regular term, to prevent overfitting.  
As a critical element of the Teacher-Student framework, pseudo labels were generated in our method. We trained the Student model using the pseudo-labeling method in the target domain. We alternated between training the Student model on a supervised source domain and a pseudo-supervised target domain, and the Teacher model was updated by the weights of the Student model, as shown in Equation (6):  
Figure 5: The transformer encoder layer.  
\[\mathcal{L}_{unsup}(\mathcal{D}_{T})=\mathcal{L}_{unsup}^{cls}(x_{i}^{t},\hat{y}_{ gt})+\mathcal{L}_{unsup}^{loc}(x_{i}^{t},\hat{y}_{gt})+\mathcal{L}_{unsup}^{reg} \tag{6}\]  
where the unlabeled target domain sample was denoted as \(x_{i}^{t}\), and its corresponding generated pseudo label was denoted as \(\hat{y}_{gt}\). \(\mathcal{L}_{unsup}(\mathcal{D}_{T})\) is the pseudo-supervised object detection for the target domain. \(\mathcal{L}_{unsup}^{cls}(x_{i}^{t},\hat{y}_{gt})\) stands for the object detection classification loss for each \(x_{i}^{s}\) target domain sample with corresponding pseudo label \(\hat{y}_{gt}\). \(\mathcal{L}_{unsup}^{loc}(x_{i}^{t},\hat{y}_{gt})\) stands for the object detection bounding box regression loss for each \(x_{i}^{t}\) target domain sample with corresponding pseudo label \(\hat{y}_{gt}\). \(\mathcal{L}_{unsup}^{reg}\) stands for the regular term, to prevent overfitting.  
To achieve the domain-invariant feature alignment of the source and target domains, we propose a cross-attention strategy transformer to train the cross branch and target branch by the distillation loss \(\mathcal{L}_{dis}\), as shown in Equation (7):  
\[\mathcal{L}_{dis}(I^{c},I^{t})=\sum_{k}\mathcal{L}_{CE}(I^{c}_{k})\log\mathcal{ L}_{CE}(I^{t}_{k}), \tag{7}\]  
where \(I^{c}_{k}\) and \(I^{t}_{k}\) denote the features of category \(k\) in the cross branch and the target branch, respectively. \(\mathcal{L}_{CE}\) stands for the cross-entropy loss.  
To summarize, the final training objective is defined as shown in Equation (8).  
\[\mathcal{L}=\mathcal{L}_{sup}+\lambda_{unsup}\mathcal{L}_{unsup}+\lambda_{dis }\mathcal{L}_{dis}, \tag{8}\]  
where \(\lambda_{unsup}\) and \(\lambda_{dis}\) are the tradeoff parameters.