Seeking Flat Minima with Mean Teacher on Semi- and Weakly-Supervised Domain Generalization for Object Detection

## Abstract

Abstract Object detectors do not work well when domains largely differ between training and testing data.
To overcome this domain gap in object detection without requiring expensive annotations, we consider two problem settings: semi-supervised domain generalizable object detection (SS-DGOD) and weakly-supervised DGOD (WS-DGOD).
In contrast to the conventional domain generalization for object detection that requires labeled data from multiple domains, SS-DGOD and WS-DGOD require labeled data only from one domain and unlabeled or weakly-labeled data from multiple domains for training.
In this paper, we show that object detectors can be effectively trained on the two settings with the same Mean Teacher learning framework, where a student network is trained with pseudo-labels output from a teacher on the unlabeled or weakly-labeled data.
We provide novel interpretations of why the Mean Teacher learning framework works well on the two settings in terms of the relationships between the generalization gap and flat minima in parameter space.
On the basis of the interpretations, we also show that incorporating a simple regularization method into the Mean Teacher learning framework leads to flatter minima.
The experimental results demonstrate that the regularization leads to flatter minima and boosts the performance of the detectors trained with the Mean Teacher learning framework on the two settings.

## 1 Introduction

Object detection has been attracting much attention because it has practically useful applications such as in autonomous driving.
Object detectors have performed tremendously well on commonly used benchmark datasets for object detection, such as MSCOCO (Lin et al., ) and PASCAL VOC (Everingham et al., ).
However, such performance significantly drops when they are deployed on unseen domains, i.e., when the training and testing domains are different.
For example, Inoue et al. (Inoue et al., ) reported a performance drop caused by the difference in image styles, and Li et al. (Li et al., ) showed one caused by the weather and time difference in the images captured with car-mounted cameras.

To solve this problem, many researchers have been exploring unsupervised domain adaptive object detection (UDA-OD) (Deng et al., ; Li et al., ; Chen et al., ).
On UDA-OD, we train object detectors using source domain data with ground-truth labels (bounding boxes and class labels) and unlabeled target domain data to adapt the detectors to the target domain.
However, in the real world, target domain data cannot always be accessed in the training phase.

Domain generalizable object detection (DGOD) is another common problem setting for solving the problem of the performance drop caused by the domain gaps (Lin et al., ; Zhang et al., ).
On DGOD, we train object detectors using labeled data from multiple domains so that the detectors work well on unseen domains.
However, it is labor-intensive to collect these data for object detection because both bounding boxes and class labels for all objects in the images must be annotated.
Although single-DGOD (Wu & Deng, ; Fan et al., ; Vidit et al., ; Wang et al., ; ; Lee et al., ), on which we train object detectors to generalize unseen domains using labeled data from one single domain, has been investigated, the performance gain is still limited.

In this paper, we tackle two tasks as more realistic settings: i) semi-supervised DGOD (SS-DGOD) (Malakouti & Kovashka, ) and ii) weakly-supervised DGOD (WS-DGOD).
The goal of SS-DGOD is to generalize object detectors to unseen domains using labeled data only from one single domain and unlabeled data from multiple domains.
Note that the target domain data are not included in the training data.
On WS-DGOD, we use weakly labeled data from multiple domains instead of the unlabeled data in SS-DGOD.
“Weakly labeled” means that we have only image-level labels that show the existence of each class in each training image and do not have bounding box annotations.
To the best of our knowledge, this is the first attempt to tackle WS-DGOD.
We show that object detectors can be effectively trained on the two settings with the same Mean Teacher learning framework, where a student network is trained with pseudo-labels output from a teacher on the unlabeled or weakly labeled data, and the teacher network is updated as the exponential moving average (EMA) of the student.

Not only do we experimentally demonstrate the good performance of the Mean Teacher learning framework, but also provide novel interpretations of why the Mean Teacher learning framework works well on these two settings in terms of the relationship between generalization ability and flat minima in parameter space.
These interpretations are based on our findings that the two key components of the Mean Teacher learning framework, i) EMA update and ii) learning from pseudo-labels, lead to flat minima during the training.
In the research area of domain generalization, it has been shown both theoretically and empirically that neural networks with flatter minima in parameter space have better generalization ability to unseen domains (Foret et al., ; Chaudhari et al., ; Cha et al., ; Izmailov et al., ; Caldarola et al., ; Wang et al., ; Kaddour et al., ; Zhang et al., ).

On the basis of the interpretations, we also show that incorporating a simple regularization method into the Mean Teacher learning framework leads to flatter minima.
Specifically, because the teacher and the student have similar loss values around the flat minima, we introduce an additional loss term so that the output from the student network becomes similar to that from the teacher network.
The experimental results demonstrate that the detectors trained with the Mean Teacher learning framework perform well for unseen test domains on the two settings.
We show that the simple yet effective regularization leads to flatter minima and boosts the performance of those detectors.

It is noteworthy that our aim is not to propose an entirely new method or surpass the state-of-the-art methods.
Instead, our contributions are summarized as follows:

- •
We show that object detectors can be effectively trained on the SS-DGOD and WS-DGOD settings with the same Mean Teacher learning framework.
- •
We provide interpretations of why the detectors trained with the Mean teacher learning framework achieve robustness to unseen test domains in terms of the flatness of minima in parameter space.
- •
On the basis of the interpretations, we introduce a simple regularization method into the Mean Teacher learning framework to achieve flatter minima.
- •
We are the first to tackle the WS-DGOD setting.

## 2 Problem Settings

We formally describe the two problem settings of SS-DGOD and WS-DGOD.
Their goal is to obtain object detectors that perform well on unseen target domain data $\mathcal{D}_{t}=\{X_{t}\}$, where $X_{t}$ is a set of images from the target domain.

On SS-DGOD, we have labeled data from a source domain $\mathcal{D}_{s_{1}}=\{(X_{s_{1}},B_{s_{1}},C_{s_{1}})\}$ and unlabeled data from multiple source domains $\mathcal{D}_{s_{i}}=\{X_{s_{i}}\}_{i=2}^{N_{D}}$ in the training phase.
Here, $X_{s_{1}}=\{x^{j}_{s_{1}}\}_{j=1}^{N_{s_{1}}}$ is a set of $N_{s_{1}}$ images from domain $s_{1}$.
$B_{s_{1}}=\{b_{s_{1}}^{j}\}_{j=1}^{N_{s_{1}}}$ and $C_{s_{1}}=\{c_{s_{1}}^{j}\}_{j=1}^{N_{s_{1}}}$ are the corresponding bounding boxes and object-class labels, respectively.
${s_{i}}$ is the $i$-th source domain, and $N_{\mathcal{D}}$ is the number of the source domains.
We assume that the data distributions differ between the domains, i.e., $P(X_{s_{1}})\neq P(X_{s_{2}})\neq\cdots P(X_{s_{N_{D}}})\neq P(X_{t})$.

On WS-DGOD, we use labeled data from a source domain $\mathcal{D}_{s_{1}}=\{(X_{s_{1}},B_{s_{1}},C_{s_{1}})\}$ and weakly labeled data from multiple domains $\mathcal{D}_{s_{i}}=\{(X_{s_{i}},C_{s_{i}})\}_{i=2}^{N_{D}}$ for training.

**Table 1: Formal comparisons of SS-DGOD, WS-DGOD, and related problem settings. DGOD stands for domain generalizable object detection, and SS-DGOD and WS-DGOD are semi-supervised DGOD and weakly-supervised DGOD, respectively. UDA-OD is unsupervised domain adaptive object detection.**
| task | train data | test data |
| --- | --- | --- |
| Single-DGOD | $\mathcal{D}_{s_{1}}=\{(X_{s_{1}},B_{s_{1}},C_{s_{1}})\}$ | $\mathcal{D}_{t}=\{X_{t}\}$ |
| SS-DGOD | $\mathcal{D}_{s_{1}}=\{(X_{s_{1}},B_{s_{1}},C_{s_{1}})\}$, | $\mathcal{D}_{t}=\{X_{t}\}$ |
| $\mathcal{D}_{s_{i}}=\{X_{s_{i}}\}_{i=2}^{N_{D}}$ |  |  |
| WS-DGOD | $\mathcal{D}_{s_{1}}=\{(X_{s_{1}},B_{s_{1}},C_{s_{1}})\}$, | $\mathcal{D}_{t}=\{X_{t}\}$ |
| $\mathcal{D}_{s_{i}}=\{(X_{s_{i}},C_{s_{i}})\}_{i=2}^{N_{D}}$ |  |  |
| DGOD | $\mathcal{D}_{s_{i}}=\{(X_{s_{i}},B_{s_{i}},C_{s_{i}})\}_{i=1}^{N_{D}}$ | $\mathcal{D}_{t}=\{X_{t}\}$ |
| UDA-OD | $\mathcal{D}_{s_{1}}=\{(X_{s_{1}},B_{s_{1}},C_{s_{1}})\}$, | $\mathcal{D}_{t}=\{X_{t}\}$ |
| $\mathcal{D}_{t}=\{X_{t}\}$ |  |  |
| WSDA-OD | $\mathcal{D}_{s_{1}}=\{(X_{s_{1}},B_{s_{1}},C_{s_{1}})\}$, | $\mathcal{D}_{t}=\{X_{t}\}$ |
| $\mathcal{D}_{t}=\{(X_{t},C_{t})\}$ |  |  |

Table 1 compares SS-DGOD and WS-DGOD with related problem settings (Single-DGOD, DGOD, and UDA-OD).
As discussed in Sec. 1, DGOD requires labeled data from multiple domains $\mathcal{D}_{s_{i}}=\{(X_{s_{i}},B_{s_{i}},C_{s_{i}})\}_{i=1}^{N_{D}}$, but those data are sometimes hard to prepare due to the high annotation cost.
In contrast, SS-DGOD (or WS-DGOD) requires labeled data from one domain $\mathcal{D}_{s_{1}}=\{(X_{s_{1}},B_{s_{1}},C_{s_{1}})\}$ and unlabeled data $\mathcal{D}_{s_{i}}=\{X_{s_{i}}\}_{i=2}^{N_{D}}$ (or weakly labeled data $\mathcal{D}_{s_{i}}=\{(X_{s_{i}},C_{s_{i}})\}_{i=2}^{N_{D}}$), which are easier to obtain.
Therefore, SS-DGOD and WS-DGOD are more practical settings than DGOD.
By using those data, we aim to better generalize object detectors to the unseen target domain data $\mathcal{D}_{t}=\{X_{t}\}$ than on Single-DGOD.

Another related setting is weakly-supervised domain adaptive object detection (WSDA-OD), a.k.a., cross-domain weakly-supervised object detection (Inoue et al., ; Hou et al., ; Xu et al., ; Tang et al., ), which requires weakly-labeled target data $\mathcal{D}_{t}=\{(X_{t},C_{t})\}$ for training.
Unlike on UDA-OD and WSDA-OD, we can train the detectors even when the unlabeled or weakly-labeled target domain data ($\mathcal{D}_{t}=\{X_{t}\}$ or $\mathcal{D}_{t}=\{(X_{t},C_{t})\}$) are not accessible.

## 3 Related Work

### 3.1 Domain Generalization for Image Classification

Many methods have been proposed for domain generalization on image classification tasks as summarized in recent survey papers (Zhou et al., ; Wang et al., ).
Among a variety of domain generalization methods, finding flat minima is one of the most common approaches (Foret et al., ; Chaudhari et al., ; Cha et al., ; Izmailov et al., ; Caldarola et al., ; Wang et al., ; Kaddour et al., ; Zhang et al., ).
Those studies empirically and theoretically showed that finding flat minima in parameter space results in a better generalization ability.
Izmailov et al. () and Cha et al. () demonstrated that empirical risk minimization (ERM) with stochastic gradient descent (SGD) converges to the vicinity of a flat minimum, and averaging the parameter weights over a certain number of training steps/epochs results in reaching the flat minimum.
Inspired by these findings, we reveal that the Mean Teacher learning framework leads to flat minima, and thus can obtain good generalization ability.

### 3.2 Domain Generalization for Object Detection

Domain generalization for object detection has not been widely explored, compared with image classification.
Lin et al. () proposed a method for disentangling domain-specific and domain-invariant features by adversarial learning on both image-level and instance-level features for DGOD.
Liu et al. () investigated DGOD in underwater object detection and proposed DG-YOLO.
For Single-DGOD, Wang et al. () proposed a self-training method that uses the temporal consistency of objects in videos.
Wu & Deng () proposed a method for disentangling domain-invariant features by contrastive learning and self-distillation.
Fan et al. () proposed perturbing the channel statistics of feature maps, which can be interpreted as data augmentation of image styles to a variety of domains.
Wang et al. () proposed a disentangle method on frequency space for object detection from unmanned aerial vehicles.
Vidit et al. () proposed an augmentation method using a pre-trained vision-language model (CLIP) with textual prompts.

Unlike the above methods, as discussed in Sects. 1 and 2, we tackle SS-DGOD (Semi-Supervised Domain Generalization for Object Detection) and a new problem setting called WS-DGOD (Weakly-Supervised Domain Generalization for Object Detection).
The most closely related to our work is Malakouti & Kovashka ()’s work.
They tackled SS-DGOD and proposed a language-guided alignment method.
However, the limitation of their method is that it requires a backbone network that was pre-trained on vision-and-language tasks.
Our experiments show that the object detectors trained with the Mean Teacher learning framework and our regularization outperform their method when the same backbone is used.

### 3.3 Semi-supervised Domain Generalization

There are a few methods that use both labeled and unlabeled data for domain generalization (SSDG) on image classification (Zhang et al., ; Zhou et al., ).
Zhang et al. () proposed an unsupervised pre-training method called DARLING, which performs contrastive learning on unlabeled images to obtain domain-irrelevant feature representation.
Zhou et al. () extended a semi-supervised learning method called FixMatch (Sohn et al., ) to SSDG.

In contrast to those studies, we tackle SSDG for object detection.
We also tackle the “weakly-labeled” setting (i.e., WS-DGOD), which has not been explored even for image classification.

### 3.4 Mean Teacher Learning Framework

Mean Teacher learning framework was originally proposed for semi-supervised image classification (Tarvainen & Valpola, ).
Several studies have investigated the use of the Mean Teacher learning framework for a variety of tasks such as domain generalization on image classification (Yang et al., ), (in-domain) weakly-supervised object detection (Wang et al., ), (in-domain) semi-supervised object detection (Mi et al., ),
UDA-OD (Deng et al., ; Li et al., ; He et al., ; Deng et al., ; Kennerley et al., ), and UDA for semantic segmentaion (Araslanov & Roth, ; Wang et al., ; Hoyer et al., ; Zhang et al., ).
Lee et al. () provided a theoretical analysis of the Mean Teacher learning framework on masked image modeling pretext tasks for semi-supervised image classification.
We show that the Mean Teacher learning framework also works well on different settings (SS-DGOD and WS-DGOD), provide their interpretations, and introduce a simple regularization method to lead to flatter minima.

Figure: Figure 1: Training framework.
Refer to caption: x1.png

## 4 Training Method

### 4.1 Overview and Key Idea

On both SS-DGOD and WS-DGOD, our goal is to obtain object detectors that work well on the unseen target domain data $\mathcal{D}_{t}=\{X_{t}\}$.
Gulrajani & Lopez-Paz () reported that if carefully implemented, empirical risk minimization (i.e., the image classifier simply trained with supervised learning on multiple domains) outperformed state-of-the-art domain generalization methods on several benchmark datasets for image classification.
Following this important finding, we expect similar behavior on object detection and aim to train an object detector on multiple domains $\mathcal{D}_{s_{i}}(i=1,\cdots,N_{D})$.
However, we have no ground-truth labels (or have only weak labels) for $\mathcal{D}_{s_{i}}(i=2,\cdots,N_{D})$ although ground-truth labels are available for $\mathcal{D}_{s_{1}}$.
Therefore, the question is how to train a detector on those domains.
Our solution is to use the Mean Teacher learning framework for object detection (Li et al., ; Chen et al., ) shown in Fig. 1, where we have two networks (teacher and student) with the same structure and train the student network using the pseudo-labels generated by the teacher network.
Note that this Mean Teacher learning framework can be applied to any object detector, but we hereafter describe the loss functions of FasterRCNN (Ren et al., ) as an example for ease of explanation.

### 4.2 Pre-training

If we start the Mean Teacher learning from randomly initialized parameters, the teacher network cannot output reliable pseudo labels.
Therefore, we first perform supervised learning with the labeled data of one source domain $\mathcal{D}_{s_{1}}=\{(X_{s_{1}},B_{s_{1}},C_{s_{1}})\}$.

$$ $\begin{multlined}\mathcal{L}^{\mathrm{sup}}_{s_{1}}(\theta)=\mathcal{L}^{ \mathrm{cls}}_{\mathrm{RPN}}(\theta,X_{s_{1}},B_{s_{1}},C_{s_{1}})+\mathcal{L} ^{\mathrm{reg}}_{\mathrm{RPN}}(\theta,X_{s_{1}},B_{s_{1}},C_{s_{1}})\\ +\mathcal{L}^{\mathrm{cls}}_{\mathrm{RoI}}(\theta,X_{s_{1}},B_{s_{1}},C_{s_{1} })+\mathcal{L}^{\mathrm{reg}}_{\mathrm{RoI}}(\theta,X_{s_{1}},B_{s_{1}},C_{s_{ 1}}),\end{multlined}\mathcal{L}^{\mathrm{sup}}_{s_{1}}(\theta)=\mathcal{L}^{ \mathrm{cls}}_{\mathrm{RPN}}(\theta,X_{s_{1}},B_{s_{1}},C_{s_{1}})+\mathcal{L} ^{\mathrm{reg}}_{\mathrm{RPN}}(\theta,X_{s_{1}},B_{s_{1}},C_{s_{1}})\\ +\mathcal{L}^{\mathrm{cls}}_{\mathrm{RoI}}(\theta,X_{s_{1}},B_{s_{1}},C_{s_{1} })+\mathcal{L}^{\mathrm{reg}}_{\mathrm{RoI}}(\theta,X_{s_{1}},B_{s_{1}},C_{s_{ 1}}),$ (1) $$

where $\mathcal{L}^{\mathrm{cls}}_{\mathrm{RPN}}$ and $\mathcal{L}^{\mathrm{reg}}_{\mathrm{RPN}}$ are the classification and regression losses for region proposal networks (RPN), respectively.
$\mathcal{L}^{\mathrm{cls}}_{\mathrm{RoI}}$ and $\mathcal{L}^{\mathrm{reg}}_{\mathrm{RoI}}$ are those for RoIhead.
We initialize both the teacher and student networks with the parameters $\theta^{*}=\operatorname*{arg\,min}_{\theta}\mathcal{L}^{\mathrm{sup}}_{s_{1}}
(\theta)$ obtained from this pre-training.

### 4.3 Mean Teacher Learning

#### 4.3.1 Generate Pseudo-labels

Because we have no ground-truth labels (or have only weak labels) for the other source domains $\mathcal{D}_{s_{i}}(i=2,\cdots,N_{D})$, we generate pseudo labels using the teacher network.
Specifically, we perform weak data augmentation to the unlabeled (or weakly-labeled) image $x_{s_{i}}^{j}$ and input it into the teacher network.
We denote the output from the teacher as $\{(\hat{b}_{s_{i}}^{jr},\hat{p}_{s_{i}}^{jr})\}_{r=1}^{N_{R}}$, where $\hat{b}_{s_{i}}^{jr}$ and $\hat{p}_{s_{i}}^{jr}$ are the predicted bounding box and class probabilities for the $r$-th region of interests (RoI) in the $j$-th image, respectively, and $N_{R}$ is the number of output RoIs.

In the case of SS-DGOD, we simply perform post-processing $f_{post}$ to $(\hat{b}_{s_{i}}^{jr},\hat{p}_{s_{i}}^{jr})$ and obtain the pseudo label $(\bar{b}_{s_{i}}^{jr},\bar{c}_{s_{i}}^{jr})=f_{\mathrm{post}}(\hat{b}_{s_{i}}^
{jr},\hat{p}_{s_{i}}^{jr})$.
Post-processing $f_{post}$ indicates a simple thresholding function if we use “hard” pseudo labels like (Li et al., ) and indicates a sharpening function if we use “soft” pseudo labels like (Chen et al., ).

In the case of WS-DGOD, we perform the refinement process of applying the weak labels to the predicted class probabilities $\hat{p}_{s_{i}}^{jr}$ immediately before post-processing $f_{post}$ to obtain more accurate pseudo labels as follows:

$$ $(\bar{b}_{s_{i}}^{jr},\bar{c}_{s_{i}}^{jr})=f_{\mathrm{post}}(\hat{b}_{s_{i}}^ {jr},\hat{p}_{s_{i}}^{jr}),\ \ \ \ \hat{p}_{s_{i}}^{jr}(k)=\begin{cases}\hat{p }_{s_{i}}^{jr}(k)&\text{if}\ k\in c_{s_{i}}^{j}\\ 0&\text{otherwise}\end{cases}$ (2) $$

where $\hat{p}_{s_{i}}^{jr}(k)$ is the predicted class probability for the $k$-th class.
Using the weak label $c_{s_{i}}^{j}$, Eq. (2) makes the predicted probability zero at each RoI if the $k$-th class does not exist in the $j$-th image.

#### 4.3.2 Update Student

Now we have the pseudo labels $\bar{B}_{s_{i}}=\{\bar{b}_{s_{i}}^{j}\}_{j=1}^{N_{s_{i}}}$ and $\bar{C}_{s_{i}}=\{\bar{c}_{s_{i}}^{j}\}_{j=1}^{N_{s_{i}}}$ and train the student network with them.

We perform strong data augmentations to the image $x_{s_{i}}^{j}$ and input it into the student network.
In domain $s_{1}$, because the ground-truth labels are available, we update the student by backpropagating loss $\mathcal{L}^{\mathrm{sup}}_{s_{1}}$ in Eq. (1).
In the other domains $s_{i}(i=2,\cdots,N_{D})$, we calculate loss $\mathcal{L}^{\mathrm{unsup}}_{s_{i}}$ using the pseudo labels and backpropagate it to update the student.
In summary, we update the parameters of student $\theta^{\mathrm{student}}$ with loss $\mathcal{L}^{\mathrm{student}}$ as follows:

$$ $\displaystyle\theta^{\mathrm{student}}\leftarrow\theta^{\mathrm{student}}- \nabla_{\theta}\mathcal{L}^{\mathrm{student}}(\theta),\ \ \ \ \mathcal{L}^{ \mathrm{student}}(\theta)=\mathcal{L}^{\mathrm{sup}}_{s_{1}}(\theta)+\sum_{i=2 }^{N_{D}}\mathcal{L}^{\mathrm{unsup}}_{s_{i}}(\theta)$ (3) $\displaystyle\begin{multlined}\mathcal{L}^{\mathrm{unsup}}_{s_{i}}(\theta)= \mathcal{L}^{\mathrm{cls}}_{\mathrm{RPN}}(\theta,X_{s_{i}},\bar{B}_{s_{i}}, \bar{C}_{s_{i}})+\mathcal{L}^{\mathrm{reg}}_{\mathrm{RPN}}(\theta,X_{s_{i}}, \bar{B}_{s_{i}},\bar{C}_{s_{i}})\\ +\mathcal{L}^{\mathrm{cls}}_{\mathrm{RoI}}(\theta,X_{s_{i}},\bar{B}_{s_{i}}, \bar{C}_{s_{i}})+\mathcal{L}^{\mathrm{reg}}_{\mathrm{RoI}}(\theta,X_{s_{i}}, \bar{B}_{s_{i}},\bar{C}_{s_{i}}).\end{multlined}\mathcal{L}^{\mathrm{unsup}}_{ s_{i}}(\theta)=\mathcal{L}^{\mathrm{cls}}_{\mathrm{RPN}}(\theta,X_{s_{i}},\bar {B}_{s_{i}},\bar{C}_{s_{i}})+\mathcal{L}^{\mathrm{reg}}_{\mathrm{RPN}}(\theta, X_{s_{i}},\bar{B}_{s_{i}},\bar{C}_{s_{i}})\\ +\mathcal{L}^{\mathrm{cls}}_{\mathrm{RoI}}(\theta,X_{s_{i}},\bar{B}_{s_{i}}, \bar{C}_{s_{i}})+\mathcal{L}^{\mathrm{reg}}_{\mathrm{RoI}}(\theta,X_{s_{i}}, \bar{B}_{s_{i}},\bar{C}_{s_{i}}).$ (6) $$

#### 4.3.3 Update Teacher

Similar to previous studies (Chen et al., ; Li et al., ), we do not update the parameters of the teacher $\theta^{\mathrm{teacher}}$ by backpropagation to obtain stable pseudo labels. Instead, we update them by the exponential moving average (EMA) of the parameters of the student network ${\theta^{\mathrm{teacher}}\leftarrow\alpha\theta^{\mathrm{teacher}}+(1-\alpha)
\theta^{\mathrm{student}}}$.
Here, $\alpha$ is a hyperparameter to control the update speed.

## 5 Why Does Mean Teacher Become Robust to Unseen Domains?

Figure: Figure 2: Empirical and robust risks.
Refer to caption: x2.png

We provide novel interpretations of why the Mean Teacher learning framework works well on SS-DGOD and WS-DGOD settings in terms of the relationship between generalization ability and flat minima in parameter space.
We show that the two key components of the Mean Teacher learning framework, i) EMA update and ii) learning from pseudo labels, lead to flat minima during the training.

### 5.1 Definition

We define an empirical risk as $\mathcal{E}_{\mathrm{ER}}(\theta)\vcentcolon=\sum_{i=1}^{N_{D}}\mathcal{L}^{
\mathrm{sup}}_{s_{i}}(\theta)$ when we assume that ground-truth labels are available on all the training domains.
A risk at the target domain is defined as $\mathcal{E}_{t}(\theta)\vcentcolon=\mathcal{L}^{sup}_{t}(\theta)$.
The goal is to minimize the test risk $\mathcal{E}_{t}(\theta)$ by only solving the empirical risk minimization (ERM), i.e., $\min_{\theta}\mathcal{E}_{\mathrm{ER}}(\theta)$.
Hereafter, we use the terms risk and loss interchangeably.

### 5.2 Preliminary Knowledge

Previous studies for domain generalization demonstrated both theoretically and empirically that neural networks with flatter minima in parameter space exhibit superior generalization ability to unseen domains (Foret et al., ; Chaudhari et al., ; Cha et al., ; Izmailov et al., ; Caldarola et al., ; Wang et al., ; Kaddour et al., ; Zhang et al., ).
Cha et al. () theoretically revealed the relationship between the flat minima and generalization gap (i.e., performance drop by domain shift).
We briefly describe the theorem for the subsequent explanation.
We consider the worst-case loss within neighbor regions in parameter space, which is defined as a robust risk $\mathcal{E}_{RR}^{\gamma}(\theta)\vcentcolon=\max_{{\|\Delta}\|\leq\gamma}
\mathcal{E}_{ER}(\theta+\Delta)$.
Here, $\gamma$ is the radius of the neighbor region.
As shown in Fig. 2, when $\gamma$ is sufficiently large, sharp minima of the empirical risk are not minima of the robust risk.
In contrast, the minima of the robust risk (i.e., $\operatorname*{arg\,min}_{\theta}\mathcal{E}_{RR}^{\gamma}(\theta)$) are also minima in the flat regions of the empirical risk.
The following theorem shows the relationship between the optimal solution of robust risk minimization (RRM):

###### Theorem (from (Cha et al., 2021 ) ) .

Consider a set of $N$ covers $\{\Theta_{k}\}_{k=1}^{N}$ such that the parameter space $\Theta\subset\cup_{k}^{N}\Theta_{k}$ where $\mathrm{diam}(\Theta)\vcentcolon=\mathrm{sup}_{\theta,\theta^{\prime}\in\Theta
}\|\theta-\theta^{\prime}\|_{2}$, $N\vcentcolon=\lceil(\mathrm{diam}(\Theta)/\gamma)^{d}\rceil$ and $d$ is dimension of $\Theta$. Let $\theta^{\gamma}$ denote the optimal solution of the RRM, i.e., $\theta^{\gamma}\vcentcolon=\operatorname*{arg\,min}_{\theta}\mathcal{E}_{RR}^{
\gamma}(\theta)$, and let $v_{k}$ and $v$ be VC dimensions of each $\Theta_{k}$ and $\Theta$, respectively. Then, the gap between the optimal test loss, $\min_{\theta^{\prime}}\mathcal{E}_{t}(\theta^{\prime})$, and the test loss of $\theta^{\gamma}$, $\mathcal{E}_{t}(\theta^{\gamma})$, has the following bound with probability of at least $1-\delta$.

$$ $\begin{multlined}\mathcal{E}_{t}(\theta^{\gamma})-\min_{\theta^{\prime}} \mathcal{E}_{t}(\theta^{\prime})\leq\mathcal{E}_{RR}^{\gamma}(\theta^{\gamma}) -\min_{\theta^{\prime\prime}}\mathcal{E}_{ER}(\theta^{\prime\prime})+\frac{1}{ N_{D}}\sum_{i=1}^{N_{D}}\mathrm{Div}(s_{i},t)\\ +\max_{k\in[1,N]}\sqrt{\frac{v_{k}\ln(m/v_{k})+\ln(2N/\delta)}{m}}+\sqrt{\frac {v\ln(m/v)+\ln(2/\delta)}{m}},\end{multlined}\mathcal{E}_{t}(\theta^{\gamma})- \min_{\theta^{\prime}}\mathcal{E}_{t}(\theta^{\prime})\leq\mathcal{E}_{RR}^{ \gamma}(\theta^{\gamma})-\min_{\theta^{\prime\prime}}\mathcal{E}_{ER}(\theta^{ \prime\prime})+\frac{1}{N_{D}}\sum_{i=1}^{N_{D}}\mathrm{Div}(s_{i},t)\\ +\max_{k\in[1,N]}\sqrt{\frac{v_{k}\ln(m/v_{k})+\ln(2N/\delta)}{m}}+\sqrt{\frac {v\ln(m/v)+\ln(2/\delta)}{m}},$ (7) $$

where m is the number of training samples and $\mathrm{Div}(s_{i},t)\vcentcolon=2\mathrm{sup}_{A}|\mathbb{P}_{s_{i}}(A)-
\mathbb{P}_{t}(A)|$ is a divergence between two distributions.

For its proof, see (Cha et al., ).
From the theorem, we can interpret that the gap between the RRM and ERM (i.e., $\mathcal{E}_{RR}^{\gamma}(\theta^{\gamma})-\min_{\theta^{\prime\prime}}
\mathcal{E}_{ER}(\theta^{\prime\prime})$) upper bounds the generalization gap in the test domain (i.e., $\mathcal{E}_{t}(\theta^{\gamma})-\min_{\theta^{\prime}}\mathcal{E}_{t}(\theta^
{\prime})$).
Intuitively, as shown in Fig 2, the gap between the RRM and ERM narrows at flat regions of ERM.
Therefore, we can interpret that lowering the gap leads to flat minima of ERM and results in better generalization performance on the target domain.

###### Theorem (from (Cha et al., 2021 ) ) .

### 5.3 EMA Update

We explain why the EMA update in the Mean Teacher learning framework leads to flat minima.
Stephan et al. () showed that optimizing with constant SGD (i.e., SGD with a fixed learning rate) converges to a Gaussian distribution centered on the optimum.
On the basis of this finding, Izmailov et al. () and Cha et al. () showed that the ERM with SGD converges to the marginal of a flat minimum, and averaging the weights of the parameters over some training steps/epochs leads to the flat minima.
To avoid overfitting, Izmailov et al. () and Cha et al. () proposed sophisticated algorithms called SWA and SWAD for averaging the weights, and Arpit et al. () introduced a carefully designed averaging strategy called SMA.
In contrast to them, we found that a simple EMA also leads to flat minima, even without using those averaging algorithms.
This finding has not been provided in previous works, although the theoretical explanations for the benefit of averaging weights have already been provided.
The experiments presented in Sec. 7 show that the teacher network with only the EMA update of the student (i.e., without pseudo labeling) as shown in Eqs. (8-9) can reach flatter minima and perform better than the student.

$$ $\displaystyle\theta^{\mathrm{student}}$ $\displaystyle\leftarrow\theta^{\mathrm{student}}-\nabla_{\theta}\mathcal{L}^{ \mathrm{student}}(\theta),\ \ \ \ \mathcal{L}^{\mathrm{student}}(\theta)= \mathcal{L}^{\mathrm{sup}}_{s_{1}}(\theta)$ (8) $\displaystyle\theta^{\mathrm{teacher}}$ $\displaystyle\leftarrow\alpha\theta^{\mathrm{teacher}}+(1-\alpha)\theta^{ \mathrm{student}},$ (9) $$

### 5.4 Learning from Pseudo Labels

Figure: Figure 3: Intuitive interpretation of difference between loss values of trajectory of student and their mean (teacher).
Refer to caption: x3.png

We explain why learning from pseudo-labels in the Mean Teacher learning framework leads to flat minima.
Assuming that the pseudo-labels from the teacher are accurate enough (i.e., similar enough to ground truth), $\mathcal{L}_{s_{i}}^{unsup}$ in Eq. (3) can be approximated by $\mathcal{L}_{s_{i}}^{sup}$, and we can regard the student network as the ERM in Sec. 5.1.
On the other hand, as explained in Sec. 5.3 and shown in the experiments, because the teacher network updated with EMA has a better ability to reach flat minima than the student, the teacher can obtain less robust risk than the student, and we can regard the teacher as the robust risk minimizer.
Therefore, from Eq. (7), the smaller the difference between the losses of the teacher and student, the smaller the generalization gap in the target domain is.
Fig. 3 shows its intuitive interpretations.
At the flat region, the trajectory of the student over the training steps and their mean (teacher) have similar loss values.
In contrast, there is a large difference between the loss values of the trajectory of the student and their mean at the sharp valley.

Next, we show that learning from pseudo-labels in the Mean Teacher learning framework makes the losses of the student and teacher similar.
Because the student is trained with the output from the teacher as pseudo-ground truth, the training promotes the outputs from the student similar to those from the teacher.
When we use monotonically increasing/decreasing functions with respect to the outputs as loss functions $\mathcal{E}$ (e.g., cross-entropy loss $\mathcal{E}(p)=p_{gt}\log(p)$), the more similar the outputs are, the more similar the loss values are, as shown below:

###### Proposition .

Assume $p_{1}<p_{2}<p_{3}\in\mathbb{R}$, and $\mathcal{E}(p):\mathbb{R}\rightarrow\mathbb{R}$ is a monotonically increasing/decreasing function of $p$.
Then, $|\mathcal{E}(p_{3})-\mathcal{E}(p_{2})|<|\mathcal{E}(p_{3})-\mathcal{E}(p_{1})|$ holds.

Let us consider $p_{3}$ as the teacher’s output, and $p_{2}$ and $p_{1}$ as the outputs of the student.
Since $p_{2}$ is closer to $p_{3}$ than $p_{1}$, the loss of $p_{2}$ becomes more similar to the loss of $p_{3}$ than that of $p_{1}$.
Therefore, we can interpret that learning from pseudo-labels align the outputs from the student to be similar to those from the teacher, thereby aligning the loss values, consequently leading to flat minima.

###### Proposition .

## 6 Regularization for Flatter Minima

### 6.1 Method

As discussed in Sec. 5, when the output from the student and teacher are similar, the networks tend to reach flat minima.
To this end, we introduce a simple regularization method to make the two networks’ outputs more similar by training the student using raw outputs from the teacher.

Fig. 4 shows an overview of the method.
The concept is to apply regularization so that the outputs from the two networks are similar for the same input image.
Specifically, we perform weak data augmentations to the unlabeled (or weakly labeled) image $x_{s_{i}}^{j}$ and input the image into the teacher network.
We then use the output from the teacher $\{(\hat{b}_{s_{i}}^{jr},\hat{p}_{s_{i}}^{jr})\}_{r=1}^{N_{R}}$ directly as pseudo-ground truth without post-processing $f_{post}$.
To update the student, we input the same weakly augmented image $x_{s_{i}}^{j}$ into the student and calculate the regularization loss $\mathcal{L}^{\mathrm{regul.}}$ as follows:

$$ $\displaystyle\mathcal{L}^{\mathrm{student}}(\theta)=\mathcal{L}^{\mathrm{sup}} _{s_{1}}(\theta)+\sum_{i=2}^{N_{D}}[\mathcal{L}^{\mathrm{unsup}}_{s_{i}}( \theta)+\beta\mathcal{L}^{\mathrm{regul.}}_{s_{i}}(\theta)]$ (10) $\displaystyle\begin{multlined}\mathcal{L}^{\mathrm{regul.}}_{s_{i}}(\theta)= \mathcal{L}^{\mathrm{cls}}_{\mathrm{RPN}}(\theta,X_{s_{i}},\hat{B}_{s_{i}}, \hat{C}_{s_{i}})+\mathcal{L}^{\mathrm{reg}}_{\mathrm{RPN}}(\theta,X_{s_{i}}, \hat{B}_{s_{i}},\hat{C}_{s_{i}})\\ +\mathcal{L}^{\mathrm{cls}}_{\mathrm{RoI}}(\theta,X_{s_{i}},\hat{B}_{s_{i}}, \hat{C}_{s_{i}})+\mathcal{L}^{\mathrm{reg}}_{\mathrm{RoI}}(\theta,X_{s_{i}}, \hat{B}_{s_{i}},\hat{C}_{s_{i}}),\end{multlined}\mathcal{L}^{\mathrm{regul.}}_ {s_{i}}(\theta)=\mathcal{L}^{\mathrm{cls}}_{\mathrm{RPN}}(\theta,X_{s_{i}}, \hat{B}_{s_{i}},\hat{C}_{s_{i}})+\mathcal{L}^{\mathrm{reg}}_{\mathrm{RPN}}( \theta,X_{s_{i}},\hat{B}_{s_{i}},\hat{C}_{s_{i}})\\ +\mathcal{L}^{\mathrm{cls}}_{\mathrm{RoI}}(\theta,X_{s_{i}},\hat{B}_{s_{i}}, \hat{C}_{s_{i}})+\mathcal{L}^{\mathrm{reg}}_{\mathrm{RoI}}(\theta,X_{s_{i}}, \hat{B}_{s_{i}},\hat{C}_{s_{i}}),$ (13) $$

where $\hat{B}_{s_{i}}=\{\hat{b}_{s_{i}}^{j}\}_{j=1}^{N_{s_{i}}}$ and $\hat{C}_{s_{i}}=\{\hat{c}_{s_{i}}^{j}\}_{j=1}^{N_{s_{i}}}$ are the raw pseudo-labels from the teacher, and $\beta$ is a hyperparameter to tune the strength of the regularization.

Figure: Figure 4: Overview of regualization method.
Refer to caption: x4.png

The differences between the regularization and the traditional Mean Teacher loss in Sec. 4.3 are 1) the use of weak augmentation instead of strong augmentation, and 2) the omission of post-processing (i.e., the sharpening function of (Chen et al., ) in our experiments).
These approaches ensure that 1) the same input is given to both the student and teacher, and 2) the raw output from the teacher is used as pseudo-labels, which encourages closer alignment between the student and teacher.

### 6.2 Connection to Prior Arts

We can regard the regularization method as a type of knowledge distillation as the student is trained to mimic the raw output from the teacher.
Although the technical details are different, it has been empirically shown that knowledge distillation methods are effective on related tasks such as Single-DGOD (Wu & Deng, ), domain adaptive semantic segmentation (Zhang et al., ), UDA-OD (Cao et al., ; Deng et al., ), and semi-supervised domain adaptive object detection (where a small part of labeled target data $\mathcal{D}_{t}=\{(X_{t},C_{t})\}$ is accessible during the training (Zhou et al., )).
We believe that our interpretation revealed one of the reasons knowledge-distillation methods lead to better generalization ability.

## 7 Experiments

### 7.1 Dataset Details

We used the artistic style image dataset (Inoue et al., ), which has four domains: natural image, clipart, comic, and watercolor.
The natural image domain has 16,551 images from PASCAL VOC07&12, and the other domains have 1,000, 2,000, and 2,000 images, respectively.
There are six object classes (bike, bird, car, cat, dog, and person), and we removed the images that do not contain these classes.

We conducted the experiments on three patterns of domains.
In the first pattern, we set the natural image domain as the labeled domain $s_{1}$ and set clipart and comic as the unlabeled domains $s_{2},s_{3}$.
We set watercolor as the target domain $t$.
Concretely, we used the labeled trainval set of PASCAL VOC 2007&2012, the unlabeled train set of clipart, and the unlabeled train set of comic for training.
We then used the test sets of clipart and comic for validation.
For evaluation (testing), we used the test set of watercolor.
In the second and third patterns, we set $(s_{1},s_{2},s_{3},t)=(\mathrm{natural,watercolor,comic,clipart})$ and $(s_{1},s_{2},s_{3},t)=(\mathrm{natural,watercolor,clipart,comic})$, respectively.
The results on another dataset are shown in the supplementary material B.

### 7.2 Implementation Details

We used soft pseudo labeling proposed in (Chen et al., ) for the Mean Teacher learning.
We used Gaussian FasterRCNN (Chen et al., ) as the object detector, in which the regression output is modified to use the soft labels.
We used cross-entropy loss for both classification and regression losses, similar to (Chen et al., ).
We applied the same hyperparameters as in a previous study (Chen et al., ) except for the number of iterations.
All training (including baseline models) was done with four A100 GPUs.
The parameters of the backbone network were initialized with the ResNet101 pre-trained on ImageNet.
The hyperparameters $\alpha$ in Eq. (9) and $\beta$ in Eq. (10) were set to 0.9996 and 0.5 throughout the experiments, respectively.
During the inference (testing) phase, we used the teacher network.
Other details are given in the supplementary material.

### 7.3 Baseline Methods

As the baseline, we trained the detector Gaussian FasterRCNN on Single-DGOD setting (i.e., supervised learning on $s_{1}$ in Eq. (1)).
To show the effectiveness of the EMA update, we trained Gaussian FasterRCNN + EMA with Eqs. (8-9).
Gaussian FasterRCNN + EMA + PL is a detector trained with the Mean Teacher learning framework in Sec. 4.
Gaussian FasterRCNN + EMA + PL + Regul. is a detector with the Mean Teacher learning framework and the regualization in Eqs. (10-13).

To confirm the upper-bound performance, we also trained Gaussian FasterRCNN on DGOD and Oracle settings.
On DGOD, the detector was trained with supervised learning using the ground-truth labels on the domains $s_{1},s_{2}$, and $s_{3}$.
On Oracle, the detector was trained with supervised learning on $s_{1},s_{2},s_{3}$, and the target domain $t$.

Because there is only one existing method on SS-DGOD (i.e., CDDMSL (Malakouti & Kovashka, )), we also compared the above detectors with state-of-the-art methods on related task settings such as Single-DGOD and UDA-OD.
It is noteworthy that existing DGOD methods such as (Lin et al., ; Liu et al., ) cannot be applied to SS-DGOD and WS-DGOD because they require labeled data from multiple source domains for training.
It is important to reiterate that our goal is not to propose a new method that outperforms state-of-the-art methods.
Instead, our goal is to offer novel interpretations of the Mean Teacher and demonstrate that introducing simple regularization can lead to flatter minima, resulting in better robustness to unseen domains.

### 7.4 Comparisons with Other Methods

**Table 2: Comparisons of mAP50 on the artistic style image dataset (Inoue et al., ) when the target domain is watercolor. Values with * are from previous study (Li et al., ).**
| setting | method | backbone | mAP50 |  |  |
| --- | --- | --- | --- | --- | --- |
| watercolor | clipart | comic |  |  |  |
| Single-DGOD | CLIP-based augmentation (Vidit et al., ) | Res101 | 46.6 | 27.2 | 31.4 |
| Single-DGOD | Gaussian FasterRCNN | Res101 | 50.5 | 34.5 | 26.6 |
| Single-DGOD | Gaussian FasterRCNN + EMA | Res101 | 55.5 | 38.0 | 29.0 |
| SS-DGOD | CDDMSL (Malakouti & Kovashka, ) | Res50 (RegionCLIP) | 46.1 | 39.1 | 38.3 |
| SS-DGOD | CDDMSL (Malakouti & Kovashka, ) | Res101 | 41.3 | 26.0 | 28.8 |
| SS-DGOD | Gaussian FasterRCNN + EMA + PL | Res101 | 56.6 | 39.8 | 30.1 |
| SS-DGOD | Gaussian FasterRCNN + EMA + PL + Regul. | Res101 | 58.2 | 43.3 | 32.2 |
| WS-DGOD | Gaussian FasterRCNN + EMA + PL | Res101 | 59.7 | 44.2 | 39.9 |
| WS-DGOD | Gaussian FasterRCNN + EMA + PL + Regul. | Res101 | 62.9 | 46.2 | 40.2 |
| DGOD | Gaussian FasterRCNN | Res101 | 62.6 | 47.1 | 45.2 |
| Oracle | Gaussian FasterRCNN | Res101 | 62.2 | 48.2 | 48.6 |
| UDA-OD | Gaussian FasterRCNN + EMA + PL (Chen et al., ) | Res101 | 54.9 | 43.4 | 27.0 |
| UDA-OD | Gaussian FasterRCNN + EMA + PL + Regul. | Res101 | 58.8 | 45.4 | 32.7 |
| UDA-OD | SCL* (Shen et al., ) | Res101 | 55.2 | - | - |
| UDA-OD | SWDA* (Saito et al., ) | Res101 | 53.3 | - | - |
| UDA-OD | UMT* (Deng et al., ) | Res101 | 58.1 | - | - |
| UDA-OD | AT* (Li et al., ) | Res101 | 59.9 | - | - |

Table 2 shows the results on the artistic image style dataset.
We evaluated with the mean average precision (mAP50) when the IoU threshold was 0.5.
EMA increased the mAP of Gaussian FasterRCNN from (50.5, 34.5, 26.6) to (55.5, 38.0, 29.0), and this was further boosted to (56.6, 39.8. 30.1) with pseudo labeling (PL).
We observed additional improvement to (58.2, 43.3, 32.2) with the regularization.
The regularization improved the performance not only on SS-DGOD but also on WS-DGOD.
The detectors trained on WS-DGOD performed better than those on SS-DGOD because WS-DGOD can generate more accurate pseudo labels by the refinement in Eq. (2).
Those results are comparable to those of the detectors trained on DGOD and Oracle.

For fair comparisons, we trained CDDMSL with Res101 backbone pre-trained on ImageNet.
However, its performance significantly degraded, as reported in a previous study (Malakouti & Kovashka, ), because it requires language-guided training, and initializing the model with RegionCLIP is crucial to achieve good performance.

The detectors trained on SS-DGOD and WS-DGOD also performed comparably to or better than those on UDA-OD, although we did not use the target domain data during the training.
Furthermore, the regularization can be directly applied to UDA-OD as well as SS-DGOD and WS-DGOD, and we also observed significant performance improvement by the regularization on UDA-OD.

### 7.5 Analysis of Flatness

Figure: Figure 5: Left and right plots compare average training and test flatness, respectively.
Refer to caption: x5.png

To evaluate the flatness of the detectors in parameter space, following previous studies (Izmailov et al., ) and (Cha et al., ), we computed the change in loss values when we perturb the parameters.
Specifically, we sampled a random direction vector $d$ on a unit sphere, perturbed the parameters ($\theta^{\prime}=\theta+d\gamma$) with a radius $\gamma$, and computed the average change over ten samples, i.e., $\mathcal{F}^{\gamma}(\theta)=\mathbb{E}_{\theta^{\prime}}|\mathcal{E}(\theta^{
\prime})-\mathcal{E}(\theta)|$.
The lower the change is, the flatter the parameters.

Fig. 5 shows the $\mathcal{F}^{\gamma}(\theta)$ of the training loss $\mathcal{E}(\theta)=\sum_{i}\mathcal{L}_{s_{i}}^{sup}(\theta)$ and the test loss $\mathcal{E}(\theta)=\mathcal{L}_{t}^{sup}(\theta)$.
The training domains were $(s_{1},s_{2},s_{3})$=(natural, watercolor, comic), and the test domain was clipart.
We can see that EMA, PL, and the regularization lowered the changes in the losses on both the training domains and test domain.
In other words, each contributed to falling into flatter minima.

## 8 Conclusion and Limitation

We tackled two problem settings called semi-supervised domain generalizable object detection (SS-DGOD) and weakly-supervised DGOD (WS-DGOD) to train object detectors that can generalize to unseen domains.
We showed that the object detectors can be effectively trained on the two settings with the same Mean Teacher learning framework.
We also provided the interpretations of why the detectors trained with the Mean Teacher framework become robust to the unseen domains in terms of the flatness in the parameter space.
Based on the interpretations, we introduced a regularization method to lead to flatter minima, which makes the loss value of the student similar to that of the teacher.
The experiments showed that the detectors trained with the Mean Teacher learning framework and the regularization performed significantly better than the baseline methods.
Because Mean Teacher has been used across various tasks, our novel interpretation of why Mean Teacher becomes robust to unknown domains is likely to have a broad impact across a wide range of tasks.

The limitation is that the assumption in Sec. 5.4 does not always hold.
Specifically, it is not always guaranteed that the pseudo labels from the teacher are accurate enough to approximate $\mathcal{L}_{s_{i}}^{unsup}$ with $\mathcal{L}_{s_{i}}^{sup}$.
Nevertheless, we empirically showed that the Mean Teacher and the regularization lead to flatter minima in practice.
There are two primary reasons for this observation.
First, when considering each domain independently, the assumption always holds in the labeled domain $s_{1}$, as labeled data is available, ensuring that $\mathcal{L}_{s_{1}}^{unsup}=\mathcal{L}_{s_{1}}^{sup}$. Second, the assumption is only necessary to explain how the Mean Teacher achieves flat minima in the empirical risk (i.e., the sum of the supervised losses $\mathcal{E}_{\mathrm{ER}}(\theta)=\sum_{i=1}^{N_{D}}\mathcal{L}^{\mathrm{sup}}
_{s_{i}}(\theta)$).
Even if this assumption does not hold, we can similarly explain that the Mean Teacher reaches flat minima in the sum of supervised and unsupervised losses in Eq. (3).
We believe that achieving flat minima in Eq. (3) still positively affects robustness against unseen domains.
Further analysis of failure cases is left for future work.

## Appendix / Supplemental Material

## Appendix A More Analysis

### A.1 How Sensitive to Hyperparameter β 𝛽 \beta italic_β ?

Table 3 shows the performance when the hyperparameter $\beta$ in Eq. (10) (i.e. strength of the regularization) was changed from 0 to 1.
By adding the regularization, the performance was constantly improved from the detector without regularization (i.e., $\beta=0$).

**Table 3: mAP50 with various $\beta$ on the artistic style image dataset (Inoue et al., ).**
| setting | method | $\beta$ | mAP50 |
| --- | --- | --- | --- |
| clipart |  |  |  |
| SS-DGOD | Gaussian FasterRCNN + EMA + PL | 0.0 | 39.8 |
| SS-DGOD | Gaussian FasterRCNN + EMA + PL + Regul. | 0.25 | 40.7 |
| SS-DGOD | Gaussian FasterRCNN + EMA + PL + Regul. | 0.5 | 43.3 |
| SS-DGOD | Gaussian FasterRCNN + EMA + PL + Regul. | 0.75 | 42.1 |
| SS-DGOD | Gaussian FasterRCNN + EMA + PL + Regul. | 1.0 | 42.5 |

### A.2 Importance of Encouraging Consistency

#### A.2.1 Comparison of Regularization with and without Post-processing

In the regularization described in Sec. 6.1, we use the raw outputs from the teacher without post-processing to train the student so that the outputs from the two networks are similar.
To validate the claim, we compare the performance with and without post-processing (i.e., sharpening function (Chen et al., )) in the regularization in Eq. (13).
Table 4 shows that the performance drops when we perform the post-processing.
We observe that using raw outputs is important to obtain better performance.

**Table 4: mAP50 with and without post-processing on the artistic style image dataset (Inoue et al., ).**
| setting | method | post process | mAP50 |
| --- | --- | --- | --- |
| clipart |  |  |  |
| SS-DGOD | Gaussian FasterRCNN + EMA + PL + Regul. |  | 43.3 |
| SS-DGOD | Gaussian FasterRCNN + EMA + PL + Regul. | ✓ | 39.4 |

#### A.2.2 Importance of Consistent Augmentation between Teacher and Student

In the regularization described in Sec. 6.1, we input weakly-augmented images to the student (i.e., same input as the teacher) in order to encourage the consistency between the outputs from the teacher and student.
In this section, as shown in Fig. 6, we compare the weak and strong augmentation for the student in the regularization whereas weakly-augmented images were always input to the teacher.
Table 5 shows that the weak augmentation obtains better performance than the strong augmentation, which implies the consistency between the outputs from the teacher and student using the same inputs leads to better performance.

Figure: Figure 6: Comparisons between weak and strong augmentation for the student in the regularization.
Refer to caption: x7.png

**Table 5: Comparison of mAP50 between strong and weak augmentation in the regularization on the artistic style image dataset (Inoue et al., ).**
| setting | method | augmentation | mAP50 |
| --- | --- | --- | --- |
| clipart |  |  |  |
| SS-DGOD | Gaussian FasterRCNN + EMA + PL + Regul. | weak | 43.3 |
| SS-DGOD | Gaussian FasterRCNN + EMA + PL + Regul. | strong | 42.5 |

### A.3 Why is Only Weak Augmentation Used in the Regularization?

One may think why only weak augmentation is used in the regualization in Fig. 4, and what is the performance of randomly using strong and weak augmentation?
To answer this question, we evaluated the performance when randomly using strong and weak augmentation as shown in the right side of Fig. 7.
In this setting, the strong and weak augmentation was randomly chosen with a probability of 0.5 at each iteration.
When the strong augmentation was chosen, the same strongly augmented image was input into both the student and teacher networks.
Then, the raw output from the teacher without post-processing was used to calculate the regularization loss for the students in Eqs. (10) and (13) to encourage consistency between the outputs from the student and teacher.
As shown in Table 6, only weak augmentation obtained better performance.
We think it is because inputting strongly augmented images into the teacher can make noisy pseudo-labels.

Figure: Figure 7: Comparisons between weak and random (weak/strong) augmentation in the regularization.
Refer to caption: x8.png

**Table 6: Comparison of mAP50 between weak and weak/strong (random) augmentation in the regularization on the artistic style image dataset.**
| setting | method | augmentation | mAP50 |
| --- | --- | --- | --- |
| clipart |  |  |  |
| SS-DGOD | Gaussian FasterRCNN + EMA + PL | N/A | 39.8 |
| SS-DGOD | Gaussian FasterRCNN + EMA + PL + Regul. | weak | 43.3 |
| SS-DGOD | Gaussian FasterRCNN + EMA + PL + Regul. | weak/strong (random) | 41.1 |

### A.4 Class-wise Average Precision

Table 7, 8, and 9 show average precision (AP50) at each class when the target domain is watercolor, clipart, and comic, respectively.
We can see that the regularization improved the performance on many classes.

**Table 7: Comparisons of AP50 at each class on watercolor of the artistic style image dataset (Inoue et al., ). The values of * are from (Li et al., ).**
| setting | method | bicycle | bird | cat | car | dog | person | mAP |
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Single-DGOD | CLIP-based augmentation (Vidit et al., ) | 74.8 | 37.3 | 36.8 | 40.7 | 29.2 | 59.9 | 46.4 |
| Single-DGOD | Gaussian FasterRCNN | 90.4 | 47.9 | 30.3 | 46.7 | 28.7 | 59.2 | 50.5 |
| Single-DGOD | Gaussian FasterRCNN + EMA | 86.2 | 54.3 | 35.3 | 53.5 | 34.5 | 69.0 | 55.5 |
| SS-DGOD | CDDMSL (Malakouti & Kovashka, ) (RegionCLIP) | 66.3 | 50.6 | 34.5 | 49.2 | 20.1 | 56.0 | 46.1 |
| SS-DGOD | CDDMSL (Malakouti & Kovashka, ) (Res101) | 75.5 | 36.1 | 23.9 | 40.7 | 19.7 | 52.0 | 41.3 |
| SS-DGOD | Gaussian FasterRCNN + EMA + PL | 87.4 | 54.6 | 40.0 | 51.9 | 32.4 | 73.1 | 56.6 |
| SS-DGOD | Gaussian FasterRCNN + EMA + PL + Regul. | 87.2 | 52.3 | 44.7 | 53.2 | 36.8 | 75.3 | 58.2 |
| WS-DGOD | Gaussian FasterRCNN + EMA + PL | 90.3 | 55.8 | 49.3 | 49.9 | 37.5 | 75.4 | 59.7 |
| WS-DGOD | Gaussian FasterRCNN + EMA + PL + Regul. | 95.8 | 59.9 | 51.5 | 53.3 | 40.2 | 76.7 | 62.9 |
| DGOD | Gaussian FasterRCNN | 84.8 | 57.8 | 51.0 | 50.8 | 51.8 | 79.3 | 62.6 |
| Oracle | Gaussian FasterRCNN | 90.9 | 59.9 | 44.2 | 53.1 | 46.7 | 78.3 | 62.2 |
| UDA-OD | Gaussian FasterRCNN + EMA + PL (Chen et al., ) | 77.7 | 46.5 | 40.4 | 50.1 | 39.7 | 75.0 | 54.9 |
| UDA-OD | Gaussian FasterRCNN + EMA + PL + Regul. | 82.8 | 51.4 | 43.2 | 59.3 | 39.0 | 77.0 | 58.8 |
| UDA-OD | SCL* (Shen et al., ) | 82.2 | 55.1 | 51.8 | 39.6 | 38.4 | 64.0 | 55.2 |
| UDA-OD | SWDA* (Saito et al., ) | 82.3 | 55.9 | 46.5 | 32.7 | 35.5 | 66.7 | 53.3 |
| UDA-OD | UMT* (Deng et al., ) | 88.2 | 55.3 | 51.7 | 39.8 | 43.6 | 69.9 | 58.1 |
| UDA-OD | AT* (Li et al., ) | 93.6 | 56.1 | 58.9 | 37.3 | 39.6 | 73.8 | 59.9 |

**Table 8: Comparisons of AP50 at each class on clipart of the artistic style image dataset (Inoue et al., ).**
| setting | method | bicycle | bird | cat | car | dog | person | mAP |
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Single-DGOD | CLIP-based augmentation (Vidit et al., ) | 36.5 | 22.5 | 20.1 | 25.0 | 8.8 | 50.4 | 27.2 |
| Single-DGOD | Gaussian FasterRCNN | 69.5 | 25.1 | 5.7 | 39.4 | 17.3 | 49.9 | 34.5 |
| Single-DGOD | Gaussian FasterRCNN + EMA | 87.6 | 29.3 | 5.5 | 30.1 | 18.3 | 57.2 | 38.0 |
| SS-DGOD | CDDMSL (Malakouti & Kovashka, ) (RegionCLIP) | 51.0 | 33.3 | 26.5 | 45.2 | 14.6 | 63.8 | 39.1 |
| SS-DGOD | CDDMSL (Malakouti & Kovashka, ) (Res101) | 41.6 | 19.2 | 5.5 | 26.7 | 12.3 | 50.9 | 26.0 |
| SS-DGOD | Gaussian FasterRCNN + EMA + PL | 75.8 | 31.2 | 9.4 | 33.1 | 20.4 | 69.1 | 39.8 |
| SS-DGOD | Gaussian FasterRCNN + EMA + PL + Regul. | 79.3 | 32.5 | 11.6 | 40.9 | 26.3 | 69.0 | 43.3 |
| WS-DGOD | Gaussian FasterRCNN + EMA + PL | 80.3 | 33.3 | 11.1 | 44.5 | 23.2 | 72.6 | 44.2 |
| WS-DGOD | Gaussian FasterRCNN + EMA + PL + Regul. | 84.8 | 33.2 | 23.8 | 43.0 | 22.1 | 70.1 | 46.2 |
| DGOD | Gaussian FasterRCNN | 76.0 | 34.8 | 18.8 | 38.3 | 36.9 | 77.6 | 47.1 |
| Oracle | Gaussian FasterRCNN | 70.4 | 38.8 | 26.1 | 52.9 | 27.5 | 73.4 | 48.2 |
| UDA-OD | Gaussian FasterRCNN + EMA + PL (Chen et al., ) | 79.9 | 33.5 | 6.5 | 53.1 | 23.7 | 65.2 | 43.6 |
| UDA-OD | Gaussian FasterRCNN + EMA + PL + Regul. | 72.4 | 35.4 | 16.0 | 57.2 | 19.7 | 71.5 | 45.4 |

**Table 9: Comparisons of AP50 at each class on comic of the artistic style image dataset (Inoue et al., ).**
| setting | method | bicycle | bird | cat | car | dog | person | mAP |
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Single-DGOD | CLIP-based augmentation (Vidit et al., ) | 29.0 | 18.6 | 27.6 | 32.7 | 28.4 | 52.2 | 31.4 |
| Single-DGOD | Gaussian FasterRCNN | 45.0 | 10.8 | 9.5 | 33.8 | 17.5 | 43.0 | 26.6 |
| Single-DGOD | Gaussian FasterRCNN + EMA | 50.0 | 15.0 | 11.2 | 26.8 | 22.4 | 48.3 | 29.0 |
| SS-DGOD | CDDMSL (Malakouti & Kovashka, ) (RegionCLIP) | 41.8 | 27.8 | 23.5 | 44.2 | 34.8 | 57.8 | 38.3 |
| SS-DGOD | CDDMSL (Malakouti & Kovashka, ) (Res101) | 44.3 | 12.2 | 13.7 | 30.5 | 19.7 | 52.1 | 28.8 |
| SS-DGOD | Gaussian FasterRCNN + EMA + PL | 41.5 | 14.5 | 11.4 | 24.5 | 27.3 | 61.1 | 30.1 |
| SS-DGOD | Gaussian FasterRCNN + EMA + PL + Regul. | 42.3 | 15.6 | 15.9 | 31.5 | 30.2 | 57.8 | 32.2 |
| WS-DGOD | Gaussian FasterRCNN + EMA + PL | 53.7 | 23.1 | 19.9 | 44.3 | 33.7 | 64.5 | 39.9 |
| WS-DGOD | Gaussian FasterRCNN + EMA + PL + Regul. | 54.2 | 23.2 | 23.8 | 44.1 | 31.5 | 64.2 | 40.2 |
| DGOD | Gaussian FasterRCNN | 54.6 | 29.5 | 33.5 | 38.9 | 43.2 | 71.4 | 45.2 |
| Oracle | Gaussian FasterRCNN | 55.7 | 29.0 | 44.5 | 46.3 | 45.1 | 71.3 | 48.6 |
| UDA-OD | Gaussian FasterRCNN + EMA + PL (Chen et al., ) | 42.2 | 13.6 | 10.8 | 16.6 | 19.3 | 59.5 | 27.0 |
| UDA-OD | Gaussian FasterRCNN + EMA + PL + Regul. | 46.3 | 14.4 | 20.3 | 28.8 | 23.5 | 62.6 | 32.7 |

### A.5 Qualitative Results

Figure: (a) Gaussian FasterRCNN trained on Single-DGOD setting (i.e., trained with labeled data on PASCAL VOC07&12).
Refer to caption: x9.png

Figure: (a) Gaussian FasterRCNN trained on Single-DGOD setting (i.e., trained with labeled data on PASCAL VOC07&12).
Refer to caption: x11.png

Figure: (a) Gaussian FasterRCNN trained on Single-DGOD setting (i.e., trained with labeled data on PASCAL VOC07&12).
Refer to caption: x13.png

Figs. 8, 9, and 10 show the qualitative comparison on watercolor, clipart, and comic, respectively.
We observe that false negative detection of the baseline model was drastically improved.

### A.6 When the Number of Unlabeled Domain is One

In Sec. 7, we conducted the experiments under the setting of one labeled domain and multiple unlabeled domains (e.g., $(s_{1},s_{2},s_{3},t)$= (natural, clipart, comic, watercolor)).
In this section, we conducted the experiments with one labeled domain and one unlabeled domain, which are the same settings as the CDDSL paper (Malakouti & Kovashka, ): (s1, s2, t) = (natural, comic, watercolor) and (natural, comic, clipart).
Table 10 shows the superior performance to CDDMSL even on these settings.

**Table 10: Comparisons of mAP50 on the artistic style image dataset when $(s_{1},s_{2},t)$= (natural, comic, watercolor) and (natural, comic, clipart). Values with * are from previous study (Malakouti & Kovashka, ).**
| setting | method | backbone | mAP50 |  |
| --- | --- | --- | --- | --- |
| watercolor | clipart |  |  |  |
| SS-DGOD | CDDMSL* (Malakouti & Kovashka, ) | Res50 (RegionCLIP) | 49.4 | 39.8 |
| SS-DGOD | Gaussian FasterRCNN + EMA + PL | Res101 | 55.2 | 38.4 |
| SS-DGOD | Gaussian FasterRCNN + EMA + PL + Regul. | Res101 | 56.5 | 40.1 |

## Appendix B Results on Car-mounted Camera Dataset (Wu & Deng, 2022 )

### B.1 Dataset Details

The car-mounted camera dataset is a recently developed dataset in (Wu & Deng, ) for Single-DGOD or DGOD, where the images were selected from the standard datasets such as Cityscapes (Cordts et al., ), FoggyCityscapes (Sakaridis et al., ), BDD-100k (Yu et al., ), and AdverseWeather (Hassaballah et al., ).
The domains were clearly redefined based on the weather and time differences: daytime-sunny, night-sunny, daytime-foggy, dusk-rainy, and night-rainy.
The number of images for each domain is 27,708, 18,310, 2,642, 3,501, and 2,494, respectively. We used daytime-sunny as the labeled domain $s_{1}$ and used night-sunny and daytime-foggy as the unlabeled (or weakly-labeled) domains $s_{2},s_{3}$.
We used each of the remaining domains (dusk-rainy and night-rainy) as the target domain.
Because the train/val/test split is not publicly available for daytime-sunny, dusk-rainy, and night-rainy, we used all images of daytime-sunny, the trainval set of night-sunny, and the trainval set of daytime-foggy for training.
We then used the test set of night-sunny and the test set of daytime-foggy for validation.
We used all images of dusk-rainy and night-rainy for evaluation (testing).
There are seven object classes: bus, bike, car, motor, person, rider, and truck.

There are two reasons for using this dataset for evaluation. One is that the images in this dataset were selected from the standard datasets, and the other is that the domains were clearly redefined based on the weather and time differences as described above.
In the setting of the previous work (Malakouti & Kovashka, ), i.e., $(s_{1},s_{2},t)$ = (Cityscapes, FoggyCityscapes, BDD100k), the differences between domains are ambiguous. This is because Cityscape primarily assumes clear/medium daytime weather, Foggycityscape assumes foggy weather, while BDD100K includes various times of day and weather conditions.
Therefore, instead, we used the car-mounted camera dataset.

### B.2 Comparisons with Other Methods

**Table 11: Comparisons of mAP50 on the car-mounted camera dataset (Wu & Deng, ). The values of * and ** were from (Wu & Deng, ) and (Vidit et al., ), respectively.**
| setting | method | backbone | mAP50 |  |
| --- | --- | --- | --- | --- |
| dusk-rainy | night-rainy |  |  |  |
| Single-DGOD | FasterRCNN* | Res101 | 26.6 | 14.5 |
| Single-DGOD | CDSD* (Wu & Deng, ) | Res101 | 28.2 | 16.6 |
| Single-DGOD | CLIP-based augmentation**(Vidit et al., ) | Res101 | 32.3 | 18.7 |
| Single-DGOD | Gaussian FasterRCNN | Res101 | 25.3 | 13.3 |
| Single-DGOD | Gaussian FasterRCNN + EMA | Res101 | 36.0 | 19.0 |
| SS-DGOD | Gaussian FasterRCNN + EMA + PL | Res101 | 30.3 | 21.3 |
| SS-DGOD | Gaussian FasterRCNN + EMA + PL + Regul. | Res101 | 31.2 | 21.9 |
| WS-DGOD | Gaussian FasterRCNN + EMA + PL | Res101 | 30.5 | 22.5 |
| WS-DGOD | Gaussian FasterRCNN + EMA + PL + Regul. | Res101 | 32.5 | 23.1 |
| DGOD | Gaussian FasterRCNN | Res101 | 28.4 | 21.2 |

Table 11 shows the results on the car-mounted camera dataset.
Each of EMA, PL, and the regularization improved the performance on both target domains except that PL degraded the performance on dusk-rainy.
We will investigate the cause of the performance drop in our future work.

The mAP50 of the detector with the regularization is boosted to (32.5, 23.1) on WS-DGOD.
This result exceeds (32.3, 18.7), which is the result of CLIP-based augmentation (Vidit et al., ) proposed for Single-DGOD.
Also, this result is better than those of the models trained with supervised learning on the three domains (DGOD).

### B.3 Analysis of Flatness

Fig. 11 shows the average change of the training loss at each domain when perturbing the parameters ($\mathcal{F}^{\gamma}(\theta)=\mathbb{E}_{\theta^{\prime}}|\mathcal{E}(\theta^{
\prime})-\mathcal{E}(\theta)|$ described in Sec. 7.5), and Fig. 12 shows those of the test loss.
Each of EMA, PL, and the regularization lowered the changes in the losses at every domain when the radius is 125 or smaller although EMA lowered the changes the most when the radius is extremely large ($>125$).
In other words, each contributed to falling into flatter minima with a sufficiently large radius.

Figure: (a) Daytime-clear
Refer to caption: x15.png

Figure: (a) Dusk-rainy
Refer to caption: x18.png

### B.4 Class-wise Average Precision

Tables 12 and 13 show class-wise average precision on dusk-rainy and night-rainy domains, respectively.
We can see that each of EMA, PL, and regularization contributes to improving the performance on many classes except the performance drop by PL on dusk-rainy.

**Table 12: Comparisons of AP50 at each class on dusk-rainy of the car-mounted camera dataset (Wu & Deng, ). The values of * and ** are from (Wu & Deng, ) and (Vidit et al., ), respectively.**
| setting | method | bus | bike | car | motor | person | rider | truck | mAP |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Single-DGOD | FasterRCNN* | 36.8 | 15.8 | 50.1 | 12.8 | 18.9 | 12.4 | 39.5 | 26.6 |
| Single-DGOD | CDSD* (Wu & Deng, ) | 37.1 | 19.6 | 50.9 | 13.4 | 19.7 | 16.3 | 40.7 | 28.2 |
| Single-DGOD | CLIP-based augmentation** (Vidit et al., ) | 37.8 | 22.8 | 60.7 | 16.8 | 26.8 | 18.7 | 42.4 | 32.3 |
| Single-DGOD | Gaussian FasterRCNN | 33.9 | 14.9 | 53.6 | 4.2 | 17.4 | 13.6 | 39.2 | 25.3 |
| Single-DGOD | Gaussian FasterRCNN + EMA | 46.3 | 24.9 | 65.9 | 11.9 | 29.1 | 23.7 | 50.0 | 36.0 |
| SS-DGOD | Gaussian FasterRCNN + EMA + PL | 40.0 | 17.3 | 61.0 | 8.0 | 23.6 | 17.1 | 45.1 | 30.3 |
| SS-DGOD | Gaussian FasterRCNN + EMA + PL + Regul. | 40.8 | 20.1 | 61.8 | 7.8 | 23.6 | 18.3 | 46.2 | 31.2 |
| WS-DGOD | Gaussian FasterRCNN + EMA + PL | 39.0 | 19.4 | 60.4 | 9.4 | 23.8 | 17.3 | 44.0 | 30.5 |
| WS-DGOD | Gaussian FasterRCNN + EMA + PL + Regul. | 41.7 | 22.3 | 62.1 | 11.2 | 25.3 | 18.9 | 45.9 | 32.5 |
| DGOD | Gaussian FasterRCNN | 36.2 | 18.2 | 61.3 | 7.3 | 18.4 | 15.9 | 41.9 | 28.4 |

**Table 13: Comparisons of AP50 at each class on night-rainy of the car-mounted camera dataset (Wu & Deng, ). The values of * and ** are from (Wu & Deng, ) and (Vidit et al., ), respectively.**
| setting | method | bus | bike | car | motor | person | rider | truck | mAP |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Single-DGOD | FasterRCNN* | 22.6 | 11.5 | 27.7 | 0.4 | 10.0 | 10.5 | 19.0 | 14.5 |
| Single-DGOD | CDSD* (Wu & Deng, ) | 24.4 | 11.6 | 29.5 | 9.8 | 10.5 | 11.4 | 19.2 | 16.6 |
| Single-DGOD | CLIP-based augmentation** (Vidit et al., ) | 28.6 | 12.1 | 36.1 | 9.2 | 12.3 | 9.6 | 22.9 | 18.7 |
| Single-DGOD | Gaussian FasterRCNN | 20.4 | 7.7 | 31.0 | 0.5 | 6.8 | 5.6 | 21.3 | 13.3 |
| Single-DGOD | Gaussian FasterRCNN + EMA | 33.9 | 11.1 | 38.5 | 0.8 | 10.5 | 8.8 | 29.2 | 19.0 |
| SS-DGOD | Gaussian FasterRCNN + EMA + PL | 35.7 | 9.8 | 46.7 | 1.4 | 12.6 | 10.8 | 32.0 | 21.3 |
| SS-DGOD | Gaussian FasterRCNN + EMA + PL + Regul. | 37.0 | 10.3 | 46.3 | 2.8 | 12.9 | 12.0 | 31.8 | 21.9 |
| WS-DGOD | Gaussian FasterRCNN + EMA + PL | 38.6 | 11.3 | 47.9 | 2.9 | 13.4 | 11.2 | 32.1 | 22.5 |
| WS-DGOD | Gaussian FasterRCNN + EMA + PL + Regul. | 38.3 | 13.4 | 46.2 | 2.7 | 15.1 | 14.0 | 32.0 | 23.1 |
| DGOD | Gaussian FasterRCNN | 38.9 | 7.6 | 46.7 | 1.8 | 9.8 | 11.3 | 32.1 | 21.2 |

### B.5 Qualitative Results

Figure: (a) Gaussian FasterRCNN trained on Single-DGOD setting (i.e., labeled data on daytime-sunny).
Refer to caption: x20.png

Figure: (a) Gaussian FasterRCNN trained on Single-DGOD setting (i.e., labeled data on daytime-sunny).
Refer to caption: x22.png

Figs. 13 and 14 show the qualitative comparison on dusk-rainy and night-rainy, respectively.
Similar to the artistic image dataset, the baseline model had false negative detections, which were improved by EMA, PL, and regularization.

## Appendix C Training Details

On the artistic style image dataset, the detectors were trained with 10,000 and 20,000 iterations for the pretraining and the student-teacher learning of SS-DGOD (or WS-DGOD), respectively.
During the training, we saved the models and evaluated the performance on the validation at every 2,000 iterations, and the best model was used for the evaluation.
The whole training took about one day.
For fair comparisons, the compared models on Single-DGOD and DGOD were trained with 30,000 iterations, and the best models at the validation of every 2,000 iterations were used for evaluation.

On the car-mounted camera dataset, we performed the same procedure for training, validation, and evaluation, but the numbers of iterations for the pretraining and the student-teacher learning were set to 20,000 and 40,000 respectively, and the validation was conducted at every 4,000 iterations.
The whole training took about two days.
For fair comparisons, the compared models on Single-DGOD and DGOD were trained with 60,000 iterations, and the best models at the validation of every 4,000 iterations were used for evaluation.

## Appendix D More discussions

### D.1 The Other Semi-supervised Domain Generalization Setting

There are two types of settings on semi-supervised domain generalization. The first setting assumes that only a part of the samples in each domain are labeled (Zhou et al., ).
The other one assumes that only a part of the source domains are labeled (Lin et al., ).
In this paper, we tackled the second setting for simplicity.
To confirm the effectiveness of the Mean Teacher framework and the regularization on the other setting is one of our future works.

### D.2 Broader Impacts

In this work, we tackled the task of semi-supervised and weakly-supervised domain generalization for object detection (SS-DGOD and WS-DGOD), which are more practical settings than previous works.
Also, we showed the good performance of the Mean Teacher learning framework, its interpretations, and a simple regularization method to boost the performance. Therefore, we believe that this paper has a potential positive social impact to enable practitioners or researchers to train robust object detectors to unseen domains in a simpler way than previous approaches.
In addition, because Mean Teacher has been used across various tasks, our novel interpretation of why Mean Teacher becomes robust to unknown domains is likely to have a broad impact across a wide range of tasks.
We are unable to identify any pertinent information concerning potential negative impacts.

## Peer Reviews

confidence: 4
contribution: 3
initial_rating: 6
presentation: 3
questions: I think the quality of this paper is good, and I am glad to see the response of the weaknesses above.
soundness: 3
strengths: 1. This paper is well-written and easy to understand.
2. Theoretical interpretation is given to make the readers better understanding the mean-teacher frameworks and the proposed approach.
3. The proposed approach with the regularization term outperforms the SOTA and the baseline method. Ablation studies are sufficient.
summary: This paper focuses on how to generalize the object detectors from the source domain to the target domain while the label of target domain is unavailable. Two settings: semi-supervised and weakly-supervised domain generalizable object detection (SS-DGOD and WS-DGOD) are defined. Based on these settings, the authors propose a mean-teacher-based framework, and make theoretically interpretation on how the mean-teacher-based framework works. A regularization term is added to the framework based on the interpretation, which improves the performance of both SS-DGOD and WS-DGOD.
weaknesses: 1. The baseline method under the SS-DGOD significantly outperforms the SOTA method CDDMSL (in Table 2). For “watercolor” and “clipart”, the margins are larger than 10% mAP50. It seems that ”EMA” and “PL” play a vital role in the proposed framework, which however are common tricks under semi-supervised settings. Is it possible to compare the proposed method with “CDDMSL+EMA+PL”, or even “CDDMSL+EMA+PL+Regul.”? If so, the comparison could be more convincing, while the generalization ability to vary detection frameworks of the proposed approach is also validated.
2. In Figure4, both of the input and output of the framework are modified to make sure that the teacher and student produce the similar predictions. Does this modification increase the risk of network collapse, making it more difficult or slower to train the model?

---

confidence: 4
contribution: 1
initial_rating: 5
presentation: 3
questions: 1. What is the difference between recent mean-teacher based semi-supervised methods and the proposed method?
soundness: 1
strengths: 1. The paper introduces two new settings for domain generalizable object detection: semi-supervised DGOD (SS-DGOD) and weakly-supervised DGOD (WS-DGOD), which have not been actively explored before. These settings are novel approaches to domain generalization, which is not commonly applied in object detection research.

2.The paper also provides theoretical reasoning for why the Mean Teacher learning framework works well in SS-DGOD and WS-DGOD settings, particularly in terms of finding flat minima.

3. Experiments are conducted to validate the effectiveness of the proposed method, showing improved robustness across various domains.
summary: The paper focuses on domain generalization for object detection where the domain differences between the training and testing domains is huge. The authors introduce two new setups: semi-supervised domain generalizable object detection (SS-DGOD) and weakly-supervised DGOD (WS-DGOD), where labeled data from one domain and either unlabeled or weakly-labeled data from multiple domains are used for training. The authors suggest a Mean Teacher learning framework with a student-teacher model that uses pseudo-labels to find flat minima in the parameter space, which helps improve the model's ability to generalize. The proposed method shows better object detection performance on unseen domains through a simple regularization technique that creates flatter minima.
weaknesses: The major concern of this paper is its incremental novelty.
The concept of domain-generalizable object detection is interesting, but the proposed method lacks significant novelty. The major idea—regularizing the two networks to produce more similar outputs, also known as consistency regularization—is a widely used framework in the mean-teacher student approach (e.g., FixMatch). Although the authors slightly modify the pipeline by using weakly augmented inputs for both networks, the reviewer cannot find any substantial technical innovation in the proposed method.

---

confidence: 4
contribution: 3
initial_rating: 6
presentation: 3
questions: See the weaknesses.
soundness: 3
strengths: -	This paper is well motivated.
-	Theoretical analysis is provided.
-	The proposed method is simple yet effective.
-	The supplementary material is sufficient and abundant.
summary: This paper delves into Semi-Supervised Domain Generalizable Object Detection and Weakly-Supervised Domain Generalizable Object Detection. This paper addresses these two tasks using Mean Teacher framework, and provide interpretations from the perspective of flat minima. Based on this interpretation, this paper provides two tricks to achieve flatter minima, include providing weak data augmentation for the student model during Mean Teaching, and generating pseudo labels for object detector without post-processing. Experiments validate the effectiveness of the proposed method.
weaknesses: -	Related work about Semi-Supervised Domain Generalization (SSDG). The listed previous work of SSDG in Section 3.3 assumed that there are labeled and unlabeled data in each training domain. And this paper assumes that there only one labeled training domain while the other training domains are all unlabeled (or weakly labeled). The SSDG setting of this paper is more similar to [1]. 

[1] Semi-Supervised Domain Generalization with Evolving Intermediate Domain. PR 2023.

- The interpretations of model generalization from the perspective of flat minima had appeared in many previous works, such as [2,3], to name a few.

[2] SWAD: Domain Generalization by Seeking Flat Minima. NeurIPS 201.

[3] Exploring Flat Minima for Domain Generalization with Large Learning Rates. 2023.

- Although the interpretations of Mean Teacher from flat minima is inspirable, the proposed method and the corresponding two tricks are kind of lacking technique novelty. As mentioned above, there had been many previous works providing tricks to improve generalization by seeking flat minima. Had you ever tried other existing tricks to improve flat minima, such as Sharpness-Aware Minimization (SAM) regularization?
- Although Table 2 validates the effectiveness of the proposed method, had you ever tried any other Semi-Supervised or Weakly-Supervised learning methods in the proposed two settings, SSDGOD and WSDGOD, so as to set up more baselines and highlight the superiority of the proposed method?

---

confidence: 4
contribution: 2
initial_rating: 5
presentation: 3
questions: Please see Weakness.
soundness: 3
strengths: 1.  This paper is well written and organized. 

2. The two settings SS-DGOD and WS-DGOD are reasonable.

3. The performances are quite good.
summary: Object detectors struggle with domain gaps between training and testing data, but this issue can be mitigated using semi-supervised (SS-DGOD) and weakly-supervised domain generalizable object detection (WS-DGOD) approaches. These methods require labeled data from only one domain and utilize unlabeled or weakly-labeled data from multiple domains, reducing annotation costs. The authors demonstrate that the Mean Teacher learning framework, where a student network is trained using pseudo labels generated by a teacher network, effectively addresses both SS-DGOD and WS-DGOD settings. Additionally, the authors show that adding a simple regularization method to the Mean Teacher framework can lead to flatter minima in the parameter space, further improving detector performance across different domains.
weaknesses: 1. Limited novelty: All adopted techniques including Mean Teacher, Flat minimal interpretation are existing technique.

2. The performances seems strange. The performances of the proposed methods better  than DGOD, Oracle and SOTA UDA-OD in Table 7. Can the authors provide more explanation. The authors could provide statistical significance tests for the performance differences and discuss potential reasons why their method outperforms DGOD and Oracle, which theoretically should have advantages.

Meta-review: Summary of the paper: This paper considers domain generalization in object detection, where the goal is to generalize object detectors from a source domain to a target domain without using target domain labels. Two new settings are introduced: Semi-Supervised Domain Generalizable Object Detection (SS-DGOD) and Weakly-Supervised Domain Generalizable Object Detection (WS-DGOD), which utilize labeled data from one domain and either unlabeled or weakly-labeled data from multiple domains. The key idea is to leverage a Mean Teacher framework, where a student network is optimized using pseudo-labels generated by a teacher network, and incorporate a theoretical interpretation highlighting the role of flat minima in enhancing generalization. To further improve performance, a regularization term promotes flatter minima. Experimental results demonstrate the effectiveness of the proposed approach, achieving robust domain generalization while reducing annotation costs.

Strengths: The reviewers highlight the major strengths of the paper as 1) theoretical reasoning that strengthens the methodology; 2) strong experimental results demonstrating that the proposed approach consistently outperforms state-of-the-art methods and baselines across various domains; 3) a well-written and well-motivated presentation.

Weaknesses and missing in the submission: There is a general consensus on the weaknesses and limitations of the paper among the reviewers, in particular limited technical novelty, unclear motivation, and insufficient experimental justification of the proposed method. While the settings of SS-DGOD and WS-DGOD are novel, the methodology primarily relies on existing techniques, such as the Mean Teacher framework and consistency regularization, which are widely used in semi-supervised learning (e.g., FixMatch). The added contributions, including weak augmentation and regularization for flat minima, are perceived as minor modifications that lack substantial technical innovation. Furthermore, the interpretation of model generalization through flat minima aligns with prior works such as SWAD and SAM, raising questions about the originality of the insights provided. Concerns were also raised regarding experimental validation, including the need for comparisons with stronger baselines and other semi-supervised or weakly-supervised learning methods in the proposed SS-DGOD and WS-DGOD settings, and more in-depth analysis of the results like potential risk of network collapse.

The discussion phase featured comprehensive exchanges between the authors and reviewers, with a particular focus on clarifying the contributions and providing additional evaluations. However, the reviewers remained unconvinced, and the concerns they raised were ultimately not resolved.

Decision: Reject