\section{Introduction}

The $b\rightarrow s$ flavour changing neutral current transition is suppressed in the standard model.
Dominant contributions to rare $B$ decays such as $B\rightarrow K^{(*)}l^+l^-$ come from loop diagrams:
box and penguin diagrams. These rare $B$ decays are good windows for looking for new physics: New particles
beyond the standard model could appear in the loops and change the decay widths of those rare decays.

The starting point of theoretical calculations of weak decays of hadrons is the effective weak Hamiltonian.
In the standard model, there are ten operators in the effective Hamiltonian for radiative and semileptonic decays.
The dominant short distance contributions are from effective local operators $Q_7$, $Q_9$ and $Q_{10}$, which come
 from the penguin and box diagrams.

In quantum chromodynamics (QCD), quarks are confined in color singlets. The $b\rightarrow s$ transition happens
inside hadrons. Therefore the matrix elements of the above three local operators have to be computed using
non-perturbative methods, for example, lattice QCD. Those matrix elements can be parametrized by
form factors according to their Lorentz structures.
In total, there are ten form factors for the quark currents in $Q_7$, $Q_9$,
and $Q_{10}$, and our aim is to calculate these on the lattice with
dynamical simulations.

More details of our calculation strategy and our definitions of the form factors can be found in Ref.~\cite{Liu:2009dj}.
Here we update our progress in the extraction of the form factors. In the next section, we present our
lattice setup and then we show some preliminary results in the last section.

\section{Lattice setup}

We use configurations from the MIMD\footnote{Multiple Instruction stream, Multiple Data stream.}
Lattice Computation (MILC) Collaboration,
which are $2+1$ flavour dynamical simulations
using $\mathcal{O}(a^2)$ and tadpole improved staggered fermions (AsqTad)~\cite{Bazavov:2009bb}.
\begin{table}[hb]
\begin{center}
\begin{tabular}{cccccc}
\hline
\hline
       & $a$(fm) & $am_{sea}$ & Volume         & $N_{conf}\times N_{src}$ & $am_{val}$ \\
\hline
coarse & $\sim$0.12         & $0.007/0.05$  & $20^3\times64$ & $2109\times8$       & $0.007/0.04$ \\
       &              & $0.02/0.05$ & $20^3\times64$ & $2052\times8$ & $0.02/0.04$ \\
\hline
fine   & $\sim$0.09         & $0.0062/0.031$ & $28^3\times96$ & $1910\times8$ & $0.0062/0.031$ \\
\hline
\hline
\end{tabular}
\caption{Parameters of lattices being used in this study. $N_{src}$ is the number of point sources used on each
configuration.}
\label{tab:lat_parameters}
\end{center}
\end{table}
We currently have data from two
lattice spacings. At the coarse lattice spacing we have two different
light quark masses. The lightest
quark mass gives a pion mass of about 300 MeV. The parameters of our calculation are collected in
Table~\ref{tab:lat_parameters}.
On each configuration, eight point sources are used to increase statistics. In~\cite{Liu:2009dj},
we found $Z_2\times Z_2$
random wall sources were inefficient for vector mesons and heavy-light mesons in reducing statistical errors of
correlators (random wall source methods allow one to approximately obtain all to all correlators and thus possibly to
reduce statistical errors). Therefore we now use several point sources.

The light valance quarks are also AsqTad fermions as the sea quarks. For the heavy $b$ quark, we
use the (moving-)non-relativistic QCD (NRQCD) action~\cite{Horgan:2009ti}, which is expanded up to and including
$\mathcal{O}(\Lambda^2_{QCD}/m_b^2)$. We can work directly at the physical $b$ quark
mass, thus no extrapolation up to $m_b$ is required.
In the lattice heavy-light currents, the heavy quark expansion includes order $1/m_b$.

We compute 2-point functions for the heavy-light $B$ meson and the light-light final state mesons as well
as 3-point functions with the current operators inserted. Then we fit these correlation functions with the
Bayesian fitting method~\cite{Lepage:2001ym}. From the fitted ground state energies and amplitudes,
one can extract the
matrix elements of the current operators and then the form factors. The detailed formulas
can be found in Refs.~\cite{Liu:2009dj,Meinel:2008th}.

Matching factors of the lattice current operators to the $\overline{\rm MS}$ scheme were computed perturbative in
Ref.~\cite{Muller:2010kb} to one loop. We set $\alpha_s=0.3$ below
to get the values of these matching factors.

Previous lattice calculations of the above form factors are all quenched calculations. And an extrapolation up
to the physical $b$ quark mass is needed for the heavy quark.
See, e.g.,~\cite{Becirevic:2006nm} and the references therein.

\section{Preliminary results}
\begin{figure}[p]
\centering
\includegraphics[height=2in,width=0.48\linewidth]{Aee_B2K_q2max}
\includegraphics[height=2in,width=0.48\linewidth]{MB}
\caption{Comparison of separate Bayesian fitting and simultaneous Bayesian fitting to heavy-light 2-point (hl2pt)
and heavy-light 3-point (hl3pt) functions
for the ground state amplitude in a 3-point function (left graph) and the $B$ meson energy $aE_B^{lat}$
(right graph) in lattice units.
The horizontal axis is the number of (ground and excited) states in the fitting functions.
}
\label{fig:Aee_MB}
\end{figure}
We tried both separate fitting and simultaneous fitting of the 2- and 3-point functions.
The simultaneous fitting, where common
energy parameters are used, gives better results with smaller
statistical errors.
Examples are shown in Fig.~\ref{fig:Aee_MB} for the ground state amplitude in
a 3-point function for $B\rightarrow K$ and the $B$ meson
energy (in lattice units) obtained from different fits. Note a mass shifting term needs to be added for the
$B$ meson energy due to the use of (moving-)NRQCD.
In Fig.~\ref{fig:Aee_MB} the horizontal axis
is the number of (ground and excited) states in the Bayesian fitting functions.
Equal number of opposite parity states are also in the fitting functions due to the use of
staggered fermions. The fitting results stabilize when more than 6
normal states and 6 opposite parity states are used.

\begin{figure}
\begin{minipage}[t]{.48\linewidth}
\centerline{\includegraphics[width=\linewidth,height=2in]{B2K_fplus_f0_fT_q2}}
\caption{Preliminary results for the form factors $f_0$, $f_+$ and $f_T$
for $B\rightarrow K$ decays, obtained from simultaneous
Bayesian fits. The left-most points have $\vec v=(0,0,0)$,
$\vec p_B=0$ and $\vec p'_K=2\pi/L\cdot(-2,0,0)$.}
\label{fig:B_to_K_f0_fplus_fT}
\end{minipage}
\hfill
\begin{minipage}[t]{.48\linewidth}
\centerline{\includegraphics[width=\linewidth,height=2in]{B2Kstar_T2_T1_q2}}
\caption{Preliminary results for the form factor $T_1$ and $T_2$ for $B\rightarrow K^*$ decays,
obtained from simultaneous Bayesian fits. The left-most points have $\vec v=(0,0,0)$,
$\vec p_B=0$ and $\vec p'_{K^*}=2\pi/L\cdot(-2,0,0)$.}
\label{fig:B_to_Kstar}
\end{minipage}
\end{figure}
Preliminary results of some form factors for $B\rightarrow K$ and $B\rightarrow K^*$ are given
in Fig.~\ref{fig:B_to_K_f0_fplus_fT} and Fig.~\ref{fig:B_to_Kstar} respectively. They are from the coarse
lattice with light valance quark masses $0.007/0.04$. The $1/m_b$ corrections to the currents are not included
yet, but will be soon. A first fitting to the 3-point functions shows that these corrections are small.
For the other quark mass and for the fine lattice spacing,
data analysis is going on.
We will have more data points at lower $q^2$ after we analyze the correlators with non-zero velocity $\vec v$ for the
$B$ meson in the moving NRQCD action.

For the radiative decay $B\rightarrow \gamma K^*$, we want the form factor $T(0)=T_1(0)=T_2(0)$ to get
the branching fraction. To extrapolate our results to the $q^2=0$ limit, we need some ansatz. In Fig.~\ref{fig:T_zero} we
do an extrapolation using the B-K ansatz~\cite{Becirevic:1999kt}
\begin{equation}
T_1(q^2)=\frac{T(0)}{(1-\tilde q^2)(1-\alpha\tilde q^2)},\quad
T_2(q^2)=\frac{T(0)}{1-\tilde q^2/\beta},\quad \tilde q^2=q^2/M^2_{B^*_s},
\label{eq:BK_ansatz}
\end{equation}
with $M_{B^*_s}=5.4158$ GeV fixed.
\begin{figure}[htb]
\centering
\includegraphics[height=2in,width=0.48\linewidth]{T1_T2_4_dat_BK_ansatz_fix_M_Bs_star}
\caption{Extrapolation of $T_1$ and $T_2$ to $q^2=0$ using the B-K ansatz in Eq.(\ref{eq:BK_ansatz}).}
\label{fig:T_zero}
\end{figure}
This is only preliminary and we get $T(0)=0.168(29)$. The statistical errors will be reduced when
more data points at low $q^2$ are included.

Eventually we need to extrapolate to the physical pion
mass and the continuum limit to really compare with experiments.
In a recent paper by H.~Na et al.\cite{Na:2010uf} on $D\rightarrow K$ form factors,
the extrapolation in $q^2$, light quark mass and lattice spacing
were done all together using a ``simultaneous modified $z$-expansion".
We may try this method in the future.


\section{INTRODUCTION}
\begin{figure}
\centering
\includegraphics[scale=0.5]{Figure1.jpg}
\caption{An image of a truncated magnetoelastic membrane in a precessing magnetic field. The degree of truncation $S=h/2R$, where $h$ is the sagitta length of the removed circular segment, and $R$ is the membrane radius, determines membrane symmetry. The magnetic field $\vec{\bm{H}}$ precesses at the angle $\theta$ around the $z$-axis with a phase given by $\phi=\omega t$, where $\omega$ is the precession frequency and $t$ is time. The field induces an amplitude, $A$, along the membrane perimeter, measured from the $x$-$y$ plane. Coloration indicates z-position (+z in red and -z in blue).}
\label{fig:fig1}
\end{figure}

\begin{figure*}
\centering
\includegraphics[scale=0.62]{Figure2.jpg}
\caption{A circular magnetoelastic membrane in a precessing magnetic field adopts dynamic motion. (a) Transverse waves propagate around the membrane above a critical frequency ($\omega > \omega_c$). (b) A schematic plot showing the phase diagram of a membrane. Above the dotted black curve, the ``wobbling" membrane remains perpendicular to the precession axis and possess the rotational waves from (a). The wave amplitude maximizes just before the transition. Below this curve, the membrane buckles and rotates asynchronously with the field, hence ``dancers". (c) The bending stiffness controls the shape of the rotational waves. The black arrows indicate the direction of wave propagation. Coloration indicates z-position (+z in red and -z in blue).}
\label{fig:fig2}
\end{figure*}

Magnetically controlled microrobots have applications in drug delivery  \cite{klosta2020kinematics,Dreyfus2005micro, jang2015undulatory, bryan2019magneto}, sensing  \cite{moerland2019rotating,goubault2003flexible}, micromixing  \cite{biswal2004mixing}, detoxification  \cite{zhu2015microfish, wu2015nanomotor} and microsurgery  \cite{wu2020multifunctional, Vyskocil2020cancer}. Such versatile use of magnetic microrobots is possible because magnetic fields can penetrate organic matter, do not interfere with biological or chemical functions, do not require fuel, and, most importantly, can be externally controlled. These properties allow for non-invasive and precise spatiotemporal execution of desired function. In particular, superparamagnetic particles are ideal candidates for robotic functions when combined with elastic components \cite{dempster2017contractile,Dreyfus2005micro} due to their lack of residual magnetization, lowering their propensity to agglomerate, and are less toxic than ferromagnetic particles \cite{markides2012biocomp}. Magnetoelastic membranes possess a diverse repertoire of possible dynamic motion under time-dependent magnetic fields  \cite{brisbois2019actuation,Hu2018small}, making them particularly suited for designing multifunctional microrobots.

Navigating a viscous environment requires a magnetoelastic microrobot to use competing magnetic and elastic interactions to induce non-reciprocal motion  \cite{purcell1977life}. That is, the sequence of configurations that the robot adopts must break time-reversal symmetry to swim at low Reynolds numbers (Re $\ll 1$). For example, magnetoelastic filaments achieve non-reciprocal motion with a non-homogeneous distribution of magnetic components or with shape asymmetry  \cite{Dreyfus2005micro, jang2015undulatory, bryan2019magneto, yang2020reconfig, cebers2005flexible}. These asymmetries induce bending waves that propagate along the chain.

In nature, microscopic organisms such as euglenids  \cite{Arroyo2012reverse} swim using self-propagating waves directed along their cellular membrane. G. I. Taylor was the first to model such organisms using a transverse wave traveling along a infinite 2D sheet  \cite{taylor1951analysis}. Taylor found that the wave induced motion in the sheet opposite to the propagating wave direction. Subsequent works expanded upon Taylor's findings  \cite{lauga2009hydro}, and developed a rotational counterpart  \cite{Corsi2019neutrally} that produces a hydrodynamic torque on circular membranes with prescribed waves traveling around their perimeter.

In this article, we study rotational waves in homogeneous superparamagnetic membranes under precessing magnetic fields. We investigate the dynamic modes of the membrane separated by a critical precession frequency, $\omega_c$, below which the membrane motion is asynchronous with the field, and above which rotational waves propagate in-phase with the field precession. Breaking the membrane's center of inversion symmetry, by removing part of the circle (Fig 1), allows for locomotion in the fast frequency phase ($\omega > \omega_c$). Shape asymmetry is needed to disrupt the inversion symmetry of the magnetic forces experienced by a circular membrane.
We show that the torque and velocity of the membrane counterintuitively resembles the linear Taylor sheet rather than its rotational analogue.
Furthermore, by controlling a magnetoviscous parameter and the membrane shape asymmetry, we demonstrate swimming directed by a programmed magnetic field and diagram its non-reciprocal path through conformation space.

The paper is organized as follows. In Sec. II, we establish the phase diagram of a circular magnetoelatic membrane in a precessing magnetic field and determine the transition frequency $\omega_c$. In Sec. III, we introduce hydrodynamic interactions and observe circular locomotion in asymmetric membranes. We demonstrate a programmed magnetic field, in Sec. IV, that directs a membrane swimmer along a predetermined path. Finally, we make concluding remarks on the necessary conditions for superparamagnetic swimmers in Sec. V.

\section{PHASE SPACE FOR UNTRUNCATED MEMBRANE}

\begin{figure}
\centering
\includegraphics[scale=0.65]{Figure3.jpg}
\caption{The synchronous-asynchronous (wobbler-dancer) transition frequency $\omega_c$ for a magnetoelastic membrane. (a) Molecular dynamics calculation of $\omega_c$ as a function of the field precession angle $\theta$. The solid and dashed lines indicate a dipole magnitude of $\mu=$ 2 and $\mu=$ 1, respectively. The inset shows the dimensionless transition frequency $\omega_c/\Omega$, where $\Omega$ is the membrane's characteristic rotation frequency. The green dashed line represents the theoretical transition at $\omega_c/\Omega=2/\pi$, which, near $\theta=$ 90$^\circ$, is independent of bending stiffness ($\kappa=$ 1, orange. $\kappa=$ 100, blue/red). The black squares show the transition calculated from lattice-Boltzmann simulations. (b) Supercritical and subcritical behavior of the total energy U (magnetic + bending). The precession frequency is close to the critical frequency, $0.029 < \omega_c < 0.030$ ($\theta=$ 80$^\circ$). Fourier transform of the rotational wave amplitude (bottom).}
\label{fig:fig3}
\end{figure}

We construct the phase diagram for the dynamic modes of the membrane using molecular dynamics (MD) without hydrodynamics to efficiently search for non-reciprocal actuation relevant to locomotion. Actuation of magnetoelastic membranes in time-dependent magnetic fields necessitates a model that captures elastic bending in response to magnetic forces, which are imparted by the dipolar interactions of embedded magnetic colloids. The membrane is composed of a hexagonal close-packed monolayer of hard spherical colloids, each of diameter $\sigma$ and possessing a point dipole moment $\bm{\mu}$ at its center. The bonds between the colloids are approximately inextensible, but able to bend with rigidity, $\kappa$. We model an implicit, uniform magnetic field by constraining the orientation of the colloids' dipole moments in the direction of the field, $\bm{H}=\bm{\mu}/\chi$, where $\chi$ is the magnetic susceptibility of the material and $\bm{\mu}$ is the dipole moment with magnitude $\mu$. The instantaneous dipole orientation is given by $\bm{\hat{\mu}} = \sin{\theta}\sin{\omega t}~\bm{\hat{i}} + \sin{\theta}\cos{\omega t}~\bm{\hat{j}} + \cos{\theta}~\bm{\hat{k}}$, where $\theta$ is the field precession angle, $\omega$ is the precession frequency, and $t$ is time. All quantities herein are expressed in dimensionless units (see Appendix A).

A diverse set of possible dynamic motion develop depending on the radius $R$ of the thin membrane and the magnetic field parameters ($\mu$, $\theta$, $\omega$). While varying these parameters, we solve the equations of motion for an overdamped system with a friction force imparted on each colloid given by $-\xi v(t)$, where $v(t)$ is the colloid velocity, and $\xi$ is the damping coefficient. Within this approximation, two dynamic mode regimes develop. At fast frequencies ($\omega > \omega_c$), the membrane motion synchronizes with the field to produce transverse waves that propagate around the membrane (Fig. 2a). At slow frequencies ($\omega < \omega_c$), we observe a collection of modes that are asynchronous with the field. We find a critical frequency, $\omega_c$, where there is an abrupt change in the membrane's dynamic motion (Fig 2b).

As the field precesses, the forces along the membrane perimeter generate internal buckling and create a torque that rotates the membrane around its diameter. If the magnetic field precession is fast ($\omega > \omega_c$), the continuous change in the direction of the axis of rotation leads to the development of a constant-amplitude wave traveling along the membrane perimeter, see Video 1 in Ref. \cite{video1}. On average, the membrane remains perpendicular to the precession axis and simply ``wobbles", synchronous to the field, and with no significant rotation around the precession axis. This state closely resembles acoustically levitated granular rafts \cite{lim2021acoustically}.

The direction of the propagating wave matches the handedness of precession because the dipole-dipole forces, which cause buckling, point in the direction of the magnetic field. However, the field polarity does not affect the magnitude or travel direction of the wave since the superparamagnetic dipoles are always oriented in the same direction as the field. Hence, the force due to the dipole-dipole interactions, ${\bm{F}}_{dipole}$, remains unchanged (${\bm{F}}_{dipole} \propto (\bm{\mu} \cdot \bm{r})\bm{\mu} = (-\bm{\mu} \cdot \bm{r})(-\bm{\mu})$, where $\bm{r}$ is the displacement vector between dipoles  \cite{yung1998analytical}).

In addition to the rotational waves, the wobbling mode also manifests radially propagating (inward) bending waves (Fig. 2c) that terminate at the membrane center. The wave shape weakly depends on the membrane stiffness $\kappa$; the wave form is better defined as $\kappa$ decreases. However, totally compliant membranes ($\kappa\rightarrow 0$) do not transmit bending waves and therefore this phenomenon exists only for intermediate $\kappa$.
\begin{figure*}
\centering
\includegraphics[scale=0.65]{Figure4.jpg}
\caption{Fluid flow around a magnetoelastic membranes in the ``wobbler" regime. The top images show the total force vector for each colloid (blue arrows) alongside the dipole orientation (cyan arrows) for a precessing field ($\mu=$1, $\theta=$ 70$^\circ$, $\omega=$ 0.1). The bottom images show streamlines around the membrane, where the color indicates flow speed (red $>$ blue). (a) A snapshot of a circular membrane. (b) Two snapshots of a truncated circular membrane separated by a shift in the field precession $\Delta\phi=\omega t=6\pi/5$.}
\label{fig:fig4}
\end{figure*}

If the precession is slow ($\omega < \omega_c$), the membrane has enough time to rotate completely parallel to the precession axis and will adopt new configurations due to elastic buckling. How the membrane buckles depends on the magnetoelastic parameter  \cite{vazquez2018flexible}, $\Gamma = M L^2 / \kappa$, which characterizes the ratio between the membrane's magnetic and bending energies, where $M$ is the magnetic modulus, and $L^2$ is the membrane area. If the magnitude of $\Gamma$ is very small ($\Gamma \ll 1$) or very large ($\Gamma \gg 1$), we observe hard disk behavior because bending distortions become impossible due to mechanical stiffness or due to unfavorable magnetic interactions, respectively. While not investigated here, strong magnetic coupling \cite{park2020dna,messina2015quant} between colloids will adversely affect membrane synthesis.

At intermediate $\Gamma$, membrane edges buckle several times per precession period and produce magnetically stabilized conformations that, while periodic, run out-of-sync with the field, see Video 2 in Ref. \cite{video2}. Much of this back-and-forth ``dancing" motion is essentially reciprocal and is therefore generally a poor candidate for studying swimming at small Re. Therefore, here we seek to formally define $\omega_c$ and focus on the wobbling regime ($\omega > \omega_c$).

To accurately determine the transition frequency $\omega_c$ that separates the wobblers from the dancers, we investigate how the magnetic field parameters (precession angle $\theta$, dipole magnitude $\mu$), and membrane radius $R$ (Fig. 3a) contribute to the characteristic response time $\tau$ of the rotating membrane. When the membrane rotation time $\tau$ increases, it necessarily requires a slower field to keep the membrane in the wobbling mode, decreasing $\omega_c$. A larger $\tau$, can be achieved by weakening the magnetic torque ($\theta$ closer to $\pi/2$ or smaller $\mu$) or increasing the drag on the membrane (larger $R$). Similarly, a smaller $\tau$ implies a fast membrane response from a strong field or a small membrane. We observe that $\omega_c$ diverges as $\theta$ approaches the magic angle, partly due to instability of the wobbling phase at angles below the magic angle  \cite{cimurs2013dynamics}.

The transition to the wobbling state is characterized by the abrupt shift in the membrane's potential energy from a time-dependent function to a constant value (Fig. 3b, top). When the potential energy does not change, this implies that the shape of the membrane conformation becomes invariant in the rotating field reference frame. This change in the dynamic buckling results in a single Fourier mode for the displacement of the colloids parallel to the precession axis (Fig. 3b, bottom). This resembles the transition between the synchronous and asynchronous motion for oblate magnetic particles  \cite{cimurs2013dynamics}.

\begin{figure*}
\centering
\includegraphics[scale=0.65]{Figure5.jpg}
\caption{Actuation drives circular locomotion of truncated magnetoelastic membranes through a viscous fluid. (a) The average rotational (``wobble") wave amplitude $A_{avg}$, scaled by the membrane radius $R$, depends inversely on the magnetoviscous parameter $\tau \omega$. Data points from lattice Boltzmann simulations are compared to our analytical model (solid blue line). The coloration of the simulation data notes the degree of truncation $S$. The inset shows the variation in $A/\sigma$ over time based on membrane geometry ($S=$ 0.05, black; $S=$ 0.5, gray), where $\sigma$ is the colloid diameter. (b) The path taken by a membrane in a precessing field. The arrow indicates the travel direction with velocity $V$. The inset shows the radius $\rho$ of this path as a function of $S$. (c) The membrane velocity is proportional to $A_{avg}^2 \propto (\tau \omega)^{-2}$ and scales with $S^{3/2}$ due to changes in the length of the membrane perimeter. The data points shape are coded by the membrane radius ($R=$ 7, triangle; $R=$ 9, square; $R=$ 12, circle). The line shows our analytical prediction (slope = 1.0). The inset shows the continuous inversion symmetry measure for a flat truncated membrane.}
\label{fig:fig5}
\end{figure*}

When the precession angle approaches $\pi/2$, the membrane motion becomes independent of the stiffness of the membrane; the membrane remains flat at all times and for all values of $\omega$. As the field precesses, the forces perpendicular to the membrane plane vanish near $\theta = \pi/2$ preventing significant radial bending and, consequently, changing $\kappa$ does not shift $\omega_c$ (Fig. 3a, inset). By solving an Euler-Lagrange equation with Rayleigh dissipation (Appendix B), we derive an equation of motion for a membrane in a field precessing at a large angle. It reveals a characteristic frequency of membrane motion, $\Omega = 6 \zeta(3)\mu_0\mu^2\sin{2\theta} / \pi^2 \eta R^2 \sigma^4$, where $\mu_0$ is the magnetic permeability of free space, $R$ is the radius of the membrane, $\eta$ is the viscosity, and $\zeta(x)$ is the Riemann zeta function. The frequency $\Omega$ comes from the magnetic ($\propto \mu_0\mu^2\sin{2\theta} R^2/\sigma^5$) and drag ($\propto \eta R^4/\sigma$) potential functions. The $\omega_c$ curves in Fig. 3a can be scaled by $\Omega$ to obtain a dimensionless transition frequency $\omega_c / \Omega = 2/\pi$ (Fig 3a, inset). This provides a single number with which to predict the dynamic motion of a membrane and defines the membrane response time $\tau = \Omega^{-1}$.

\section{HYDRODYNAMIC EFFECTS ON ``WOBBLING" MEMBRANES}

It is useful to investigate the broad range of dynamic motions accessible to a magnetoelastic membrane using a simple overdamped system to highlight relevant transitions in motion. Afterwards, we confirmed the dimensionless transition $\omega_c / \Omega$ using the more computationally expensive hydrodynamic simulations (Fig. 3a, black squares) and change the characteristic frequency $\Omega = 27 \zeta(3)\mu_0 \mu^2\sin{2\theta}/64\eta R\sigma^5$ to include hydrodynamic interactions (see Appendix B). Using the same magnetic potential as the previous section, this change in $\Omega$ is due to the torque on the membrane a viscous fluid ($\propto \eta R^3$). We will use this definition for $\Omega$ hereafter.

To observe the effect of the wobbler's non-reciprocal motion on the surrounding fluid, we add hydrodynamic interactions to our simulations by coupling the MD model to the lattice Boltzmann method (LBM)  \cite{Mackay2013hydrodynamic}. This technique, which comes from a discretization of the Boltzmann transport equation, reproduces the incompressible Navier-Stokes equation in the macroscopic limit. LBM calculates the evolution of a discrete-velocity distribution function, $f_i$, at each fluid node that fills the simulation box on a square lattice mesh with a spacing of $\Delta x$. The surface of the colloids act as a boundary and is defined by surface nodes that interact with the fluid using the model developed by Peskin  \cite{peskin2002immersed}. Care must be taken when implementing LBM with MD because compliant springs can cause translation of the membrane due to in-plane stretching. This mechanism has been observed in systems of a few colloids  \cite{Grosjean2018surface}. Therefore, the stiffness of the springs must be large enough to eliminate this effect for an inextensible membrane model requiring the use of a smaller simulation timestep. Simultaneously, small Re in LBM is achieved by decreasing the Mach number, set by the speed of sound $c_s=\frac{1}{\sqrt3}\frac{\Delta x}{\Delta t}$  \cite{kruger}. Therefore, we rely on a small timestep that is compatible with both schemes. See Appendix C for a complete description of the model.

The fluid flow around the membrane is determined by its symmetry and actuation. The precessing magnetic field induces a torque along the membrane perimeter that circulates fluid around an axis of rotation through the membrane diameter (Fig. 4a). This axis of rotation moves continuously with the field, producing circulating flows above and below the membrane. The rising peaks push the fluid up (+z) and it flows towards the falling peak (-z) on the other side of the membrane. This flow simultaneously resembles analytical predictions for rotating hard disks \cite{tanzosh1996general} and the flow vorticity from Taylor's swimming sheet \cite{lauga2009hydro}.

\begin{figure*}
\includegraphics[scale=0.5]{Figure6.jpg}
\caption{A two-step magnetic field directs a swimming membrane along a path. (a) First, a membrane wobbler moves under a precessing magnetic field. After it rotates a half-turn (\#1), the precession switches to a fast frequency at $\theta=\pi/2$ while the axis rotates to flip the membrane (\#2). (b) We define the angles that the normal vector $\bm{n}$ and the truncation vector $\bm{S}$ make with the $x$-axis as $\zeta_n$ and $\zeta_S$, respectively. (c) The path in conformation space over the two-step field. (c) Repeated cycles from (a) move the membrane against the Brownian motion of a thermalized fluid. The upper panel shows the motion of the membrane in the $x$-$y$ plane. The black arrow indicates the direction of motion. The lower panel shows the displacement in the $z$-direction.}
\label{fig:fig6}
\end{figure*}

The centrosymmetry of a magnetoelastic membrane generates a flow that prevents its center of mass from translating. To induce locomotion, we truncate the membrane by removing a circular segment with a sagitta of length $h$. We normalize $h$ by the diameter of the circle to define the degree of truncation of the circular membranes as $S = h/2R$.  In contrast to the circular membrane case, the shape of the fluid flow in the truncated membrane changes during a single precession period leading to asymmetric flow field depending on the relative orientation between the field and the truncation cut (Fig. 4b).

The amplitude of propagating waves is particularly relevant for predicting the translational \cite{taylor1951analysis} or rotational \cite{Corsi2019neutrally} velocity of a membrane. Here, the wobble amplitude can be calculated by balancing the magnetic \cite{yung1998analytical} and drag \cite{tanzosh1996general} torque in a viscous fluid (see Appendix D). Under small amplitudes for the rotational wave, we obtain the simple relation
\begin{equation}
    \frac{A}{R}=\frac{C}{\tau\omega}
    \label{eq:amplitude}
\end{equation}
where $A$ is the amplitude, and $C=32/9\pi^2$ (Fig. 5a). It is reasonable to assume, in the limit of small deformations, the bending contribution to the torque along the edge is negligible, unless $\kappa \rightarrow \infty$. Furthermore, the amplitude is independent of the membrane size since $\tau \propto R$. However, the membrane is not free to increase in radius arbitrarily. The small Re condition implies that $\nu \gg R^2/\tau$, where $\nu$ is the kinematic viscosity. Obeying this constraint on $\tau$, we can define a magnetoviscous parameter $\tau \omega$ and use it to predict locomotion of the membrane.

Asymmetry in the fluid flow due to a degree of truncation $S>0$ leads to locomotion of the membrane. The membrane travels with a net velocity in the direction of the truncation cut. This net motion is due to the decrease in the amplitude of the waves traveling along the truncated edge. Since the truncated edge is closer to the center of mass and $\kappa$ is homogeneous, the membrane will bend to a lesser extent along the truncation. This manifests as a net motion every $2\pi/\omega$, where reversing the handedness of the field reverses the locomotive direction.

However, the membrane follows a curved path. While the membrane torque due to the underlying colloidal lattice is negligible, the membrane can rotate significantly by choosing $\omega$ close to $\omega_c$. This rotation emerges exclusively due to the magnetic interactions perpendicular to the wobbling membrane. If the projection of the forces, visualized in Fig. 4, on the $x$-$y$ plane are non-zero, the membrane will rotate. Over many precession periods, the membrane moves in a circular path around a central point (Fig. 5b). The radius $\rho$ of the path depends on $S$ and $A_{avg}$. Untruncated, $S=0$, and fully truncated, $S = 1$, do not translate and result in $\rho=0$. Hence, a maximum for $\rho$ exists at intermediate S values (Fig. 5b inset). Since the membrane is composed of colloids, irregularities in the $\rho \left(S,A_{avg}\right)$ curve appear because the symmetry of the membrane changes in discrete steps.

The magnetic field controls how quickly the membrane travels along the circular path and affects its angular velocity. Together with the truncation $S$, the velocity $V$ at which the membrane translates along the path can be determined using a singularity method. With a nearest-neighbors assumption for the magnetic interactions and treating them as point-disturbances, the advective flow through the center of mass leads to the velocity
\begin{equation}
    \frac{V}{R\omega} = \frac{C^2}{12 \zeta(3)} \frac{S^{3/2}}{{(\tau\omega)}^2}
    \label{eq:velocity}
\end{equation}
where the $S^{3/2}$ dependence comes from the number of uncompensated point forces formed by truncation. The velocity is normalized by the phase speed $R\omega$. The inverse squared relation on $\tau \omega$ for the velocity is a result of the dependence on the product of the magnetic force and wave amplitude, which, in turn, relies on the magnetic force. Here, we recover the velocity dependence on the square of the wave amplitude \cite{taylor1951analysis}, but with a lower velocity ($V \leq V_{Taylor}/6$). Appendix E contains the full derivation. We see a deviation from the relationship obtained in Eq. \ref{eq:velocity} at large values of $S^{3/2}/(\tau \omega)^2$ owing to either a high degree of truncation (a linear polymer) or a small viscomagnetic parameter (``dancer") (Fig. 5c). The direction of $V$ is dictated by the handedness of the precessing field and is an example of magnetically induce symmetry breaking. We find that the continuous symmetry measurement \cite{zabrodsky1992continuous} can predict relative changes in the velocity of locomotion. When the inversion asymmetry increases, $V$ increases (Fig. 5c, inset) because the conformational path taken by the membrane widens, leading to greater net work done on the fluid \cite{grosjean2016realization}.

\section{MEMBRANE SWIMMING}

Here, we give an example of how a programmed magnetic field can produce a non-reciprocal conformational path that results linear swimming. In Fig. 6a, we show that a precessing field can rotate the membrane 180$^\circ$ from its initial configuration. Then, the precession frequency is increased and $\theta$ is set to $\pi/2$. This keeps the membrane flat in the precession plane while the precession axis is rotated to flip the membrane. This field is on for a period of $\pi/\omega_s$ to flip the membrane orientation, where $\omega_s > \omega$. Once the membrane resembles the starting configuration, the 2-step field is repeated. After half the orbit from Fig. 5b is obtained, the membrane's center of mass has shifted $\sim 2 \rho$. The ``flip" from the second field places the membrane back into its original configuration. This recovery stroke moves the membrane back towards its original position, but not entirely, leading to a net translation. The chirality and duration of the magnetic field precession controls the displacement in the membrane plane and the flip direction controls the direction for the out-of-plane displacement. The fastest achievable velocity using this method is $V_{max}=(2/\pi)V$, but will be slowed by the time taken during the recovery step.

This cycle forms a closed loop in configuration space based on the two independent degrees of freedom that are defined by the angles the normal vector $\bm{n}$ and the truncation vector $\bm{S}$ make with the x-axis as $\zeta_n$ and $\zeta_S$, respectively (Fig. 6b). It is reasonable to note that this configuration loop is in addition to the already present non-reciprocal motion of the wobbling mode, but is needed since the latter only follows circular paths. Thermalizing the LB fluid to 1 $k_BT$, by the method of Adhikari et al. \cite{Adhikari2005fluctuating} for $S^{3/2}/(\tau \omega)^2 \approx$ 10$^{-2}$, shows a swimming membrane as $\zeta_n$ and $\zeta_S$ changes (Fig. 6c). In this instance, the path during the rotation step, to change $\zeta_S$, is dominated by Brownian motion. The largest displacement occur during the flipping step, to change $\zeta_n$. Additionally, each flip shifts the membrane along the $z$-axis, where the traveling direction is determined by the handedness of the flip. By controlling the precession axis orientation, a membrane may be directed along an arbitrary path.

The useful swimming regime is bound by the P\'{e}clet number and the dimensionless transition frequency. In other words, the system parameters, in particular, the field frequency $\omega$, must be large enough to maintain the wobbling mode, but not too large as to attenuate the wobble amplitude below an efficient swimming velocity. In practice, this implies operating at a driving frequency just above $\omega_c$. The range for the frequency can be written as $2\Omega/\pi<\omega<C^2\eta R^3S^{3/2}/\sqrt2 ~\zeta(3)\tau^2k_BT$. Here, we calculate the P\'{e}clet number using swimming velocity from Appendix E, the membrane radius as the characteristic length, and set the diffusion coefficient using the radius of gyration of a disk \cite{capuani2006disks}. For example, a membrane of $R=$ 1 $\upmu$m composed of 25 nm magnetite nanoparticles at $25^{\circ}$C in water subject to 50 mT field \cite{susan2019from} precessing at 80$^\circ$ gives a effective frequency range of 1--10 kHz.

\section{SWIMMING IN HOMOGENEOUS MEMBRANES}

Homogeneous superparamagnetic membranes require both non-reciprocal motion and shape asymmetry to swim in viscous fluids. While the Scallop Theorem \cite{purcell1977life} makes the necessity for non-reciprocal motion known, implementing such motion without modifying the elastic or magnetic homogeneity implies using a ``non-reciprocal" magnetic field, where the field vector returns to its starting position without retracing its path. Using a field that does not self-retrace imparts a change in membrane conformation that breaks time-reversal symmetry. However, this type of external magnetic field will still generate centrosymmetric forces within a symmetric membrane. Therefore, shape asymmetry is also needed to displace the membrane center of mass during one precession period, where more asymmetry leads to a larger per-period displacement.

\acknowledgements{We would like to acknowledge Mykola Tasinkevych and Eleftherios Kyrkinis for helpful discussions. We thank the Sherman Fairchild Foundation for computational support. This project was funded by the Department of Energy's Center for Bio-Inspired Energy Science (DE-SC0000989).}


\section{Introduction}

In real world scenarios, generic object detection always faces severe challenges from variations in viewpoint, background, object appearance, illumination, occlusion conditions, scene change, etc.
These unavoidable factors make object detection in domain-shift circumstance a challenging and new rising research topic in the recent years. Also, domain change is a widely-recognized, intractable problem that urgently needs to break through in reality of detection tasks, like video surveillance, autonomous driving, etc.

\noindent{\textbf{Revisiting Domain-Shift Object Detection.}}
Common approaches for tackling domain-shift object detection are mainly in two directions: (i) training supervised model and then fine-tuning on the target domain; or (ii) unsupervised cross-domain representation learning. The former requires additional instance-level annotations on target data, which is fairly laborious, expensive and time-consuming. So most approaches focus on the latter one but still have some challenges. The first challenge is that the representations of source and target domain data should be embedded into a common space for matching the object, such as the hidden feature space~\cite{Saito_2019_CVPR,chen2018domain}, input space~\cite{tzeng2018splat,cai2019exploring} or both of them~\cite{kim2019diversify}. The second is that a feature alignment/matching operation or mechanism for source/target domains should be further defined, such as subspace alignment~\cite{raj2015subspace}, $\mathcal{H}$-divergence and adversarial learning~\cite{chen2018domain}, MRL~\cite{kim2019diversify}, Strong-Weak alignment~\cite{Saito_2019_CVPR}, universal alignment~\cite{wang2019towards}, etc. In general, our SCL targets at these two challenges, and it is also a learning-based alignment method across domains with an end-to-end framework.

\begin{figure*}[t]
	\centering
	\subfloat[\scriptsize Non-adapted]{\includegraphics[width=0.25\textwidth, keepaspectratio]{figs/pascal_to_clipart_non-adapted_2400_1000}\label{fig:subfig1}}
	\subfloat[\scriptsize CVPR'18~\cite{chen2018domain}]{\includegraphics[width=0.25\textwidth, keepaspectratio]{figs/cvpr18}\label{fig:subfig2}}
	\subfloat[\scriptsize CVPR'19~\cite{Saito_2019_CVPR}]{\includegraphics[width=0.25\textwidth, keepaspectratio]{figs/cvpr19}\label{fig:subfig3}}
	\subfloat[\scriptsize SCL (Ours)]{\includegraphics[width=0.25\textwidth, keepaspectratio]{figs/ours2400}\label{fig:subfig4}}

	\subfloat[\scriptsize Non-adapted]{\includegraphics[width=0.25\textwidth, keepaspectratio]{figs/city_to_foggy_non-adapted_500_500_new}\label{fig:subfig5}}
	\subfloat[\scriptsize CVPR'18~\cite{chen2018domain}]{\includegraphics[width=0.25\textwidth, keepaspectratio]{figs/city_to_foggy_CVPR18_500_500}\label{fig:subfig6}}
	\subfloat[\scriptsize CVPR'19~\cite{Saito_2019_CVPR}]{\includegraphics[width=0.25\textwidth, keepaspectratio]{figs/city_to_foggy_CVPR19_500_500}\label{fig:subfig7}}
	\subfloat[\scriptsize SCL (Ours)]{\includegraphics[width=0.25\textwidth, keepaspectratio]{figs/city_to_foggy_ours_500_500}\label{fig:subfig8}}

	\vspace{-0.1in}
	\caption{Visualization of features from PASCAL to Clipart (first row) and from Cityscapes to FoggyCityscapes (second row) by t-SNE~\cite{maaten2008visualizing}.
		Red indicates the source examples and blue is the target one. If source and target features locate in the same position, it is shown as light blue.
		All models are re-trained with a unified setting to ensure fair comparisons. It can be observed that our feature embedding results are consistently much better than previous approaches on either dissimilar domains (PASCAL and Clipart) or similar domains (Cityscapes and FoggyCityscapes). Best viewed in color and zoom in.}
	\label{visualization}
	\vspace{-0.05in}
\end{figure*}

\noindent{\textbf{Our Key Ideas.}} The goal of this paper is to introduce a simple design that is specific to convolutional neural network optimization and improves its training on tasks that adapt on discrepant domains. Unsupervised domain adaptation for recognition has been widely studied by a large body of previous literature~\cite{ganin2016domain,long2016unsupervised,tzeng2017adversarial,panareda2017open,hoffman2018cycada,murez2018image,zhao2019learning,wu2019domain}, our method more or less draws merits from them, like aligning source and target distributions with adversarial learning (domain-invariant alignment). However, object detection is a technically different problem from classification, since we would like to focus more on the object of interests (regions).

Some recent work~\cite{zhu2019adapting} has proposed to conduct alignment only on local regions so that to improve the efficiency of model learning. While this operation may cause a deficiency of critical information from context. Inspired by strong-weak/multi-feature alignment~\cite{Saito_2019_CVPR,zhang2018collaborative,he2019multi} which proposed to align corresponding local-region on shallow layers with a small respective field (RF) and align image-level features on deep layers with large RF, we extend this idea by studying diverse complementary objectives and their potential assembly for domain adaptive circumstance. We observe that domain adaptive object detection is supported dramatically by the deep supervision, however, the diverse supervisions should be applied in a controlled manner, including the cut-in locations, loss types, orders, updating strategy, etc., which is one of the contributions of this paper.
Furthermore, our experiments show that even with the existing objectives, after elaborating the different combinations and training strategy, our method can obtain competitive results.
By plugging-in a new sub-network that learns the context features independently with gradient detach updating strategy in a hierarchical manner, we obtain the best results on several domain adaptive object detection benchmarks.

\noindent{\textbf{The Relation to Complement Objective Training~\cite{chen2018complement} and Deep Supervision~\cite{lee2015deeply}.}} {COL}~\cite{chen2018complement} proposed to involve additional loss function that complements the primary objective
which is moderately similar to our goal in spirit. The cross entropy in COL is used as the primary objective $\mathbf{H_p}$:
\begin{equation}
\begin{aligned} \mathbf{H_p}(\mathbf{y}, \hat{\mathbf{y}}) &=-\frac{1}{N} \sum_{i=1}^{N} \mathbf{y}_{i}^{T} \cdot \log \left(\hat{\mathbf{y}}_{i}\right)  \end{aligned}
\end{equation}
where ${\mathbf{y}_i} \in {\{ 0,1\} ^D}$ is the label of the $i$-th sample in one-hot representation and ${\hat {\mathbf{y}}_i} \in {[0,1]^D}$ is the predicted probabilities.

Th complement entropy $\mathbf{H_c}$ is defined in COT~\cite{chen2018complement} as the average of sample-wise entropies over complement classes in a mini-batch:
\begin{equation}
\begin{aligned} \mathbf{H_c}\left(\hat{\mathbf{y}}_{\overline{c}}\right) &=\frac{1}{N} \sum_{i=1}^{N} \mathcal{H}\left(\hat{\mathbf{y}}_{{i} \overline{c}}\right) \end{aligned}
\end{equation}
where $\mathcal H$ is the entropy function. $\hat{\mathbf{y}}_{\overline{c}}$ is the predicted probabilities of complement classes $\overline{c}$. The training process is that: for each iteration of training, 1) update parameters by $\mathbf{H_p}$ first; then 2) update parameters by $\mathbf{H_c}$. Different from COL, we don't use the alternate strategy but update the parameters simultaneously using gradient detach strategy with primary and complement objectives. Since we aim to let the network enable to adapt on both source and target domain data and meanwhile still being able to distinguish objects from them. Thus our complement objective design is quite different from COT. We will describe with details in Section~\ref{method}.

In essence, our method is more likely to be the deeply supervised formulation~\cite{lee2015deeply} that backpropagation of error now proceeds not only from the final layer but also simultaneously from our intermediate complementary outputs. While DSN is basically proposed to alleviate ``vanishing'' gradient problem, here we focus on how to adopt these auxiliary losses to promote to mix two different domains through domain classifiers for detection. Interestingly, we observe that diverse objectives can lead to better generalization for network adaptation. Motivated by this, we propose {\bf S}tacked {\bf C}omplementary {\bf L}osses (SCL), a simple yet effective approach for domain-shift object detection. Our SCL is fairly easy and straightforward to implement, but can achieve remarkable performance. We conjecture that previous approaches that focus on conducting domain alignment on high-level layers only~\cite{chen2018domain} cannot fully adapt shallow layer parameters to both source and target domains (even local alignment is applied~\cite{Saito_2019_CVPR}) which restricts the ability of model learning. Also, gradient detach is a critical part of learning with our complementary losses. We further visualize the features obtained by non-adapted model, DA~\cite{chen2018domain}, Strong-Weak~\cite{Saito_2019_CVPR} and ours, features are from the last layer of backbone before feeding into the Region Proposal Network (RPN). As shown in Figure~\ref{visualization}, it is obvious that the target features obtained by our model are more compactly matched with the source domain than any other models.

\noindent{\textbf{Contributions.}} Our contributions are three-fold.
\begin{itemize}[leftmargin=5.5mm]
	\vspace{-0.05in}
	\addtolength{\itemsep}{-0.05in}
	\item We study {\bf the interaction of multi-loss (deep supervision with complement objective) and gradient detach (training strategy for maximizing context information)} in an end-to-end learnable framework for the challenging domain adaptive object detection task.
	\item  We provide a step-by-step ablation study to empirically verify the effectiveness of each component and design in our framework. Thus, this work gives intuitive and practical guidance for building a high performance framework with multi-objective learning on domain adaptive object detection.

	\item To the best of our knowledge, this is a pioneer work to investigate the influence of diverse loss functions and gradient detach for domain adaptive object detection. Our method achieves the highest accuracy on several domain adaptive or cross-domain object detection benchmarks\footnote{Our code and models are available at: \url{https://github.com/harsh-99/SCL}.}.
\end{itemize}

\begin{figure*}[t]
	\centering
	\hspace{1.1cm}
	\includegraphics[width=0.89\textwidth]{figs/framework_fix.pdf}
	\vspace{-0.1in}
	\caption{Overview of our SCL framework. More details please refer to Section~\ref{method}.}
	\label{framework}
\end{figure*}

\section{Methodology} \label{method}

Following the common formulation of domain adaptive object detection, we define a {\em source domain} $\mathcal{S}$ where annotated bound-box is available, and a {\em target domain $\mathcal{T}$} where only  the image can be used in training process without any labels. Our purpose is to train a robust detector that can adapt well to both source and target domain data, i.e., we aim to learn a  {\em domain-invariant} feature representation that works well for detection across two different domains.
\subsection{Multi-Complement Objective Learning}
As shown in Figure~\ref{framework}, we focus on the complement objective  learning and let $\mathcal{S}=\{(\mathbf{x}_i^{(s)}, \mathbf{y}_i^{(s)})\}$ where $\mathbf{x}_i^{(s)} \in \mathcal{R}^n$ denotes an image, $\mathbf{y}^{(s)}_i$ is the corresponding bounding box and category labels for sample $\mathbf{x}^{(s)}_i$, and $i$ is an index. Each label $\mathbf{y}^{(s)}=(y_\mathbf{c}^{(s)},y_\mathbf{b}^{(s)})$ denotes a class label $y_\mathbf{c}^{(s)}$ where $\mathbf{c}$ is the category, and a 4-dimension bounding-box coordinate $y_\mathbf{b}^{(s)} \in \mathcal{R}^4$. For the target domain we only use image data for training, so $\mathcal{T}=\{\mathbf{x}_i^{(t)}\}$. We define a recursive function for layers $\mathbf{k}=1,2,\dots,\mathbf{K}$ where we cut in complementary losses:
\begin{equation}
\begin{array}{l}{\hat \Theta_{\mathbf{k}}=\mathcal{F}\left(\mathbf{Z}_{\mathbf{k}}\right), \text { and } \mathbf{Z}_{0} \equiv \mathbf{x}} \end{array}
\end{equation}
where $\hat \Theta_{\mathbf{k}}$ is the feature map produced at layer $\mathbf{k}$, $\mathcal{F}$ is the function to generate features at layer $\mathbf{k}$ and $\mathbf{Z}_{\mathbf{k}}$ is input at layer $\mathbf{k}$. We formulate the complement loss of domain classifier $\mathbf{k}$ as follows:
\begin{equation}\label{k}
\begin{gathered} \mathcal{L}_{\mathbf{k}}\left(\hat{\Theta}^{(s)}_{\mathbf{k}}, \hat{\Theta}^{(t)}_{\mathbf{k}} ; \mathbf{D}_{\mathbf{k}}\right)={\cal L}_\mathbf{k}^{(s)}({{\hat \Theta }^{(s)}_{\mathbf{k}}};{\mathbf{D}_{\bf{k}}}) + {\cal L}_\mathbf{k}^{(t)}({{\hat \Theta }^{(t)}_{\mathbf{k}}};{\mathbf{D}_{\bf{k}}}) \\ = \mathbb{E}\left[\log \left(\mathbf{D}_{\mathbf{k}}\left(\hat{\Theta}^{(s)}_{\mathbf{k}}\right)\right)\right]  + \mathbb{E}\left[\log \left(1-\mathbf{D}_{\mathbf{k}}\left(\hat{\Theta}^{(t)}_{\mathbf{k}}\right)\right)\right] \end{gathered}
\end{equation}
where $\mathbf{D}_\mathbf{k}$ is the $\mathbf{k}$-th domain classifier or discriminator. $\hat{\Theta}^{(s)}_{\mathbf{k}}$ and $\hat{\Theta}^{(t)}_{\mathbf{k}}$ denote feature maps from source and target domains respectively. Following~\cite{chen2018domain,Saito_2019_CVPR}, we also adopt gradient reverse layer (GRL)~\cite{ganin2015unsupervised} to enable adversarial training where a GRL layer is placed between the domain classifier and the detection backbone network. During backpropagation, GRL will reverse the gradient that passes through from domain classifier to detection network.

For our instance-context alignment loss ${\mathcal{L}_{{\mathbf{ILoss}}}}$, we take the instance-level representation and context vector as inputs. The instance-level vectors are from RoI layer that each vector focuses on the representation of local object only. The context vector is from our proposed sub-network that combine hierarchical global features. We concatenate instance features with same context vector. Since context information is fairly different from objects, joint training detection and context networks will mix the critical information from each part, here we proposed a better solution that uses detach strategy to update the gradients.  We will introduce it with details in the next section. Aligning instance and context representation simultaneously can help to alleviate the  variances of object appearance, part deformation, object size, etc. in instance vector and illumination, scene, etc. in context vector. We define $d_i$ as the domain label of $i$-th training image where $d_i=1$ for the source and $d_i=0$ for the target, so the instance-context alignment loss can be further formulated as:
\begin{equation}
\begin{aligned} {\mathcal{L}_{{\mathbf{ILoss}}}} =  - \frac{1}{{{N_s}}}\sum\limits_{i = 1}^{{N_s}} {\sum\limits_{i,j} {(1 - d_i)} \log {{\mathbf{P}}_{(i,j)}}}  \\ \quad- \frac{1}{{{N_t}}}\sum\limits_{i = 1}^{{N_t}} {\sum\limits_{i,j} {d_i\log \left( {1 - {{\mathbf{P}}_{(i,j)}}} \right)} } \end{aligned}
\end{equation}
where $N_s$ and $N_t$ denote the numbers of source and target examples. $\mathbf{P}_{(i,j)}$ is the output probabilities of the instance-context domain classifier for the $j$-th region proposal in the $i$-th image. So our total {\bf SCL} objective $\mathcal{L}_{\mathbf{SCL}}$ can be written as:
\begin{equation}
{\mathcal{L}_{\mathbf{SCL}}} = \sum\limits_{\mathbf{k} = 1}^\mathbf{K} {{\mathcal{L}_{\mathbf{k}}}}  + {\mathcal{L}_{\mathbf{ILoss}}}
\end{equation}

\subsection{Gradients Detach Updating}

In this section, we introduce a simple yet effective detach strategy which prevents the flow of gradients from context sub-network through the detection backbone path. We find this can help to obtain more discriminative context and we show empirical evidence (see Figure~\ref{heatmaps}) that this path carries information with diversity and hence gradients from this path getting suppressed is superior for such task.

As aforementioned, we define a sub-network to generate the context information from early layers of detection backbone. Intuitively, instance and context will focus on perceptually different parts of an image, so the representations from either of them should also be discrepant. However, if we train with the conventional process, the companion sub-network will be updated jointly with the detection backbone, which may lead to an indistinguishable behavior from these two parts. To this end, in this paper we propose to suppress gradients during backpropagation and force the representation of context sub-network to be dissimilar to the detection network, as shown in Algorithm~\ref{alg:detach}.
To our best knowledge, this may be the first work to show the effectiveness of gradient detach that can help to learn better context representation for domain adaptive object detection.
The details of our context sub-network architecture are illustrated in Appendix~\ref{sec:sfp}.

\begin{algorithm2e}[h]
	\caption{Backward Pass of Our Detach Algorithm}
	\label{alg:detach}
	{\bf INPUT:} $\mathbf{G}_{\bf c}$ is gradient of context network, $\mathbf{G}_{\bf d}$ is the gradient of detection network, $\mathcal{L}_{det}$ is the detection objective, $\mathcal{L}_\mathbf{SCL}$ is the complementary objective;

	\For{$t \gets 1$ \textbf{to} $n_{train\_steps}$} {
		{1. Update context net by detection and instance-context objectives:~$\mathcal{L}_{det}$(w/o $\mathcal{L}_{rpn}$)+$\mathcal{L}_\mathbf{ILoss}$}

		{2. $\mathbf{G}_{\bf d} \gets$ stop-gradient($\mathbf{G}_{\bf c}$;$\mathcal{L}_{det}$)}

		{3. Update detection net by detection and complementary objectives:~$\mathcal{L}_{det}$+$\mathcal{L}_\mathbf{SCL}$}
	}
\end{algorithm2e}

\subsection{Framework Overall}

Our detection part is based on the Faster RCNN~\cite{ren2015faster}, including the Region Proposal Network (RPN) and other modules. This is a conventional practice in many adaptive detection works. The objective of the detection loss is summarized as:
\begin{equation}
{\mathcal{L}_{det}} = {\mathcal{L}_{rpn}} + {\mathcal{L}_{cls}} + {\mathcal{L}_{reg}}
\end{equation}
where ${\mathcal{L}_{cls}}$ is the classification loss and ${\mathcal{L}_{reg}}$  is the bounding-box regression loss.
To train the whole model using SGD, the overall objective function in the model is:
\begin{equation} \label{lambda}
\min _{\mathcal{F}, \mathbf{R}} \max _{\mathbf{D}} \mathcal{L}_{det}(\mathcal{F}(\mathbf{Z}), \mathbf{R})-\lambda \mathcal{L}_\mathbf{SCL}(\mathcal{F}(\mathbf{Z}), \mathbf{D})
\end{equation}
where $\lambda$ is the trade-off coefficient between detection loss and our complementary loss. $\mathbf{R}$ denotes the RPN and other modules in Faster RCNN.

\section{Empirical Results}

\noindent{\textbf{Datasets.}}
We evaluate our approach in three different domain shift scenarios: (1) Similar Domains; (2) Discrepant Domains; and (3) From Synthetic to Real Images.
All experiments are conducted on seven domain shift datasets: Cityscapes~\cite{cordts2016cityscapes} to FoggyCityscapes~\cite{sakaridis2018semantic}, Cityscapes to KITTI~\cite{Geiger2012CVPR}, KITTI to Cityscapes, INIT Dataset~\cite{shen2019towards}, PASCAL~\cite{everingham2010pascal} to Clipart~\cite{inoue2018cross}, PASCAL to Watercolor~\cite{inoue2018cross}, GTA (Sim 10K)~\cite{johnson2016driving} to Cityscapes.

\noindent{\textbf{Implementation Details.}} In all experiments, we resize the shorter side of the image to 600 following~\cite{ren2015faster,Saito_2019_CVPR} with ROI-align~\cite{he2017mask}. We train the model with SGD optimizer and the initial learning rate is set to $10^{-3}$, then divided by 10 after every 50,000 iterations.
Unless otherwise stated, we set $\lambda$ as 1.0 and $\gamma$ as 5.0, and we use $\mathbf{K}=3$ in our experiments (the analysis of hyper-parameter $\mathbf{K}$ is shown in Table~\ref{tab:ablation_k}). We report mean average precision (mAP) with an IoU threshold of 0.5 for evaluation. Following~\cite{chen2018domain,Saito_2019_CVPR}, we feed one labeled source image and one unlabeled target one in each mini-batch during training. SCL is implemented on PyTorch platform, we will release our code and models.

\renewcommand{\arraystretch}{1.03}
\setlength{\tabcolsep}{.2em}
\begin{table*}[t]

	\caption{Ablation study (\%) on Cityscapes to FoggyCityscapes (we use 150m visibility, the densest one) adaptation. Please refer to Section~\ref{ablation} for more details.}
	\label{ablation_foggy}
	\vspace{-1.8ex}
	\centering
	\resizebox{0.95\textwidth}{!}{%
		\begin{tabular}{l|c|ccc|c|c|cccccccc|c}

			\toprule[1.5pt]
			\multirow{2}{*}{} & \multirow{2}{*}{} & \multicolumn{1}{r}{\multirow{2}{*}{}} & \multicolumn{1}{r}{\multirow{2}{*}{}} & \multicolumn{1}{r|}{\multirow{2}{*}{}} & \multirow{2}{*}{} & \multirow{2}{*}{}& \multicolumn{9}{c}{AP on a target domain}                                    \\
			Method     &       Context     & \multicolumn{1}{r}{$L_1$}                    & \multicolumn{1}{r}{$L_2$}                    & \multicolumn{1}{r|}{$L_3$}  &    ILoss     &  Detach    & person & rider & car   & truck & bus   & train & mcycle & bicycle & \bf mAP  \\ \hline
			Faster RCNN (Non-adapted)&&&&&&&24.1&33.1&34.3&4.1&22.3&3.0&15.3&26.5&20.3\\
			DA (CVPR'18)&$\checkmark$&&&&&&25.0&31.0&40.5&22.1&35.3&20.2&20.0&27.1& 27.6 \\
			MAF~\cite{he2019multi} (ICCV'19)&&&&&& &28.2& 39.5&43.9&23.8& 39.9& 33.3& 29.2& 33.9&34.0\\
			Strong-Weak (CVPR'19)&$\checkmark$&&&&& &29.9&42.3&43.5&24.5&36.2&32.6&30.0& 35.3&  34.3\\
			Diversify\&match~\cite{kim2019diversify} (CVPR'19)&&&&&& &30.8& 40.5& 44.3& 27.2& 38.4& 34.5& 28.4& 32.2&34.6\\ \hline
			Strong-Weak (Our impl. w/ VGG16)&$\checkmark$&&&&& &30.0&40.0&43.4&23.2&40.1&34.6&27.8& 33.4&34.1\\
			Strong-Weak (Our impl. w/ Res101)&$\checkmark$&&&&&&29.1&41.2&43.8&26.0&43.2&27.0&26.2& 30.6&33.4\\ \hline
			&\ding{55}&$LS$&$FL$&\ding{55}& \ding{55}&\ding{55}&29.6&42.2&43.4&23.1&36.4&31.5&25.1&30.5&32.7 \\
			&\ding{55}&$LS$&$CE$&$FL$& \ding{55}&\ding{55}&29.0&41.4&43.9&24.6&46.5&28.5&27.0&32.8&34.2\\
			&\ding{55}&$LS$&$CE$&$FL$&$FL$&\ding{55}&28.6&44.0&44.2&25.2&42.9&31.1&27.4&33.0&34.5\\ \hline
			&$\checkmark$&$LS$&$FL$&\ding{55}& \ding{55}&\ding{55}&28.5&42.6&43.8&23.2&41.6&24.9&28.3&30.3&32.9 \\
			&$\checkmark$&$LS$&$FL$&$FL$& \ding{55}&\ding{55}&28.6&41.8&43.8&27.9&43.3&24.0&28.7&31.3&33.7\\
			&$\checkmark$&$LS$&$LS$&$FL$& \ding{55}&\ding{55}&28.8&\bf 45.5&44.3&28.6&44.6&29.1&27.8&31.4&35.0 \\
			&$\checkmark$&$LS$&$CE$&$FL$& \ding{55}&\ding{55}&29.6&42.6&42.6&28.4&46.3&31.0&28.4&33.0&35.3\\
			&$\checkmark$&$LS$&$CE$&$FL$& \ding{55}&$\checkmark$&30.0&42.7&44.2&30.0&\bf 50.2&34.1&27.1&32.2&36.3\\ \cline{2-16}

			&$\checkmark$&$LS$&$FL$&$FL$& $FL$& \ding{55}&26.3&42.8&44.2&26.7&41.6&36.4& 29.2&30.9&34.8\\
			&$\checkmark$&$LS$&$LS$&$FL$& $FL$&$\checkmark$&29.5&43.2&44.2&27.0&42.1&33.3&29.4&30.6&34.9\\
			&$\checkmark$&$LS$&$FL$&$FL$& $FL$&$\checkmark$&29.7&43.6&43.7&26.6&43.8&33.1& 30.7&31.5&35.3
			\\ \cline{2-16}
			&$\checkmark$&$LS$&$CE$&$FL$& $CE$&\ding{55}&28.3&41.9&43.1&25.4&45.1&35.5&26.7&31.6&34.7\\
			&$\checkmark$&$LS$&$CE$&$FL$& $FL$&\ding{55}&29.8&43.9&44.0&29.4&46.3&30.0&31.8&31.8&35.8
			\\
			&$\checkmark$&$LS$&$CE$&$FL$& $CE$&$\checkmark$ &29.0&42.5&43.9&28.9&45.7&42.4&26.4&30.5&36.2
			\\
			&$\checkmark$& $LS$& $CE$& $FL$&$FL$     &  $\checkmark$  &  30.7 & 44.1 & 44.3 & 30.0 & 47.9 &\bf 42.9 & 29.6 & 33.7 & \bf 37.9   \\ \hline
			Our full model w/ VGG16&$\checkmark$&$LS$&$CE$&$FL$& $FL$&$\checkmark$ &\bf 31.6&44.0&\bf 44.8&\bf 30.4&41.8&40.7&\bf 33.6&\bf 36.2&\bf 37.9\\ \hline
			Upper Bound~\cite{Saito_2019_CVPR}                      &         --                & --                                       & --                                      & --                                       &         --     &  --   & 33.2 & 45.9 & 49.7 & 35.6 & 50.0 & 37.4 & 34.7 & 36.2&  40.3  \\ \bottomrule[1.5pt]
	\end{tabular}}
	\\
	{ \em LS: Least-squares Loss; CE: Cross-entropy Loss; FL: Focal Loss; ILoss: Instance-Context Alignment Loss.}
	\vspace{-.1in}
\end{table*}

\subsection{How to Choose Complementary Losses in Our Framework}
There are few pioneer works for exploring the combination of different losses for domain adaptive object detection, hence we conduct extensive ablation study for this part to explore the intuition and best collocation of our SCL method. We mainly adopt three losses which have been introduced in many literature. Since they are not our contribution so here we just give some brief formulations below.

\noindent{\textbf{Cross-entropy (CE) Loss.}} CE loss measures the performance of a classification model whose output is a probability value. It increases as the predicted probability diverges from the actual label:
\begin{equation}
\mathcal{L}_\mathbf{CE}(p_\mathbf{c})=- \sum\limits_{\mathbf{c} = 1}^\mathbf{C} {{y_\mathbf{c}}} \log \,{p_\mathbf{c}}
\end{equation}
where $p_\mathbf{c} \in [0,1]$ is the predicted probability observation of $\mathbf{c}$ class. $y_\mathbf{c}$ is the $\mathbf{c}$ class label.

\noindent{\textbf{Weighted Least-squares (LS) Loss.}} Following~\cite{Saito_2019_CVPR}, we adopt LS loss to stabilize the training of the domain classifier for aligning low-level features. The loss is designed to align each receptive field of features with the other domain.
The least-squares loss is formulated as:
\begin{equation}
\begin{aligned}
{\mathcal{L}_\mathbf{LS}} = \alpha{\mathcal{L}^{(s)}_{loc}} + \beta{\mathcal{L}^{(t)}_{loc}}
= \frac{\alpha}{{HW}} {\sum\limits_{w = 1}^W {\sum\limits_{h = 1}^H \mathbf D } } \left( {{{\hat \Theta }^{(s)}}} \right)_{wh}^2 \hfill
\\ + \frac{\beta}{{HW}} {\sum\limits_{w = 1}^W {\sum\limits_{h = 1}^H {{{\left( {1 - \mathbf{D}{{\left( {{{\hat \Theta }^{(t)}}} \right)}_{wh}}} \right)}^2}} } }  \hfill \\
\end{aligned}
\end{equation}
where $\mathbf D\left( {{{\hat \Theta }^{(s)}}} \right)_{wh}$ denotes the output of the domain classifier in each location $(w,h)$. $\alpha$ and $\beta$ are balance coefficients and we set them to 1 following~\cite{Saito_2019_CVPR}.

\noindent{\textbf{Focal Loss (FL).}}
Focal loss $\mathcal{L}_\mathbf{FL}$~\cite{lin2017focal} is adopted to ignore easy-to-classify examples and focus on those hard-to-classify ones during training:
\begin{equation}\label{gamma}
\mathcal{L}_\mathbf{FL}\left(p_{\mathrm{t}}\right)=-f\left(p_{\mathrm{t}}\right) \log \left(p_{\mathrm{t}}\right), f\left(p_{\mathrm{t}}\right)=\left(1-p_{\mathrm{t}}\right)^{\gamma}
\end{equation}
where $p_{\mathrm{t}}=p \text { if } d_i=1, \text{otherwise}, p_{\mathrm{t}}={1-p}$.

\subsection{Ablation Studies from Cityscapes to FoggyCityscapes} \label{ablation}
We first investigate each component and design of our SCL framework from Cityscapes to FoggyCityscapes. Both source and target datasets have  2,975 images in the training set and 500 images in the validation set. We design several controlled experiments for this ablation study. A consistent setting is imposed on all the experiments, unless when some components or structures are examined. In this study, we train models with the ImageNet~\cite{deng2009imagenet} pre-trained ResNet-101 as a backbone, we also provide the results with pre-trained VGG16 model.

The results are summarized in Table~\ref{ablation_foggy}. We present several combinations of four complementary objectives with their loss names and performance. We observe that ``$LS$|$CE$|$FL$|$FL$'' obtains the best accuracy with {\em Context} and {\em Detach}. It indicates that $LS$ can only be placed on the low-level features (rich spatial information and poor semantic information) and $FL$ should be in the high-level locations (weak spatial information and strong semantic information). For the middle location, $CE$ will be a good choice. If you use $LS$ for the middle/high-level features or use $FL$ on the low-level features, it will confuse the network to learn hierarchical semantic outputs, so that {\em ILoss+detach} will lose effectiveness under that circumstance. This verifies that domain adaptive object detection relies heavily on the deep supervision, however, the diverse supervisions should be adopted in a controlled and correct manner. Furthermore, our proposed method performs much better than baseline Strong-Weak~\cite{Saito_2019_CVPR} (37.9\% {\em vs.}34.3\%) and other state-of-the-arts.

\vspace{-0.1cm}
\subsection{Similar Domains}
\vspace{-0.05cm}

\noindent{\textbf{Between Cityspaces and KITTI.}}
In this part, we focus on studying adaptation between two real and similar domains, as we take KITTI and Cityscapes as our training and testing data. Following~\cite{chen2018domain}, we use KITTI training set which contains 7,481 images. We conduct experiments on both adaptation directions K $\to$ C and C $\to$ K and evaluate our method using AP of {\em car} as in DA.

As shown in Table~\ref{tab:KC}, our proposed method performed much better than the baseline and other state-of-the-art methods. Since Strong-Weak~\cite{Saito_2019_CVPR} didn't provide the results on this dataset, we re-implement it and obtain 37.9\% AP on K$\to$C and 71.0\% AP on C$\to$K. Our method is 4\% higher than the former and 1.7\% higher than latter. If comparing to the non-adapted results (source only), our method outperforms it with a huge margin (about 10\% and 20\% higher, respectively).

\begin{table}[t]
	\caption{Adaptation results between KITTI and Cityscapes. We report AP of {\em Car} on both directions: K$\to$C and C$\to$K. We re-implemented DA~\cite{chen2018domain} and Weak-Strong~\cite{Saito_2019_CVPR} based on the same Faster RCNN framework~\cite{ren2015faster}.}
	\vspace{-.1in}
	\label{tab:KC}
	\centering
	\resizebox{0.25\textwidth}{!}{%
		\begin{tabular}{l|c|c}
			\toprule[1.5pt]
			Method   & K$\to$C & C$\to$K \\ \hline
			Faster RCNN &30.2&53.5\\ \hline
			DA~\cite{chen2018domain}  &38.5&64.1\\
			DA (Our impl.)~\cite{chen2018domain}  &35.6&70.8\\
			WS (Our impl.)~\cite{Saito_2019_CVPR}  &37.9&71.0\\ \hline
			Ours     &\bf 41.9&\bf 72.7\\
			\bottomrule[1.5pt]
		\end{tabular}
	}
	\vspace{-.05in}
\end{table}

\begin{table}[t]
	\centering
	\caption{Adaptation results on INIT dataset.}
	\vspace{-.2cm}
	\label{tab:INIT}
	\resizebox{0.33\textwidth}{!}{%
		\begin{tabular}{l|l|c|c|c|c}
			\toprule[1.5pt]

			&                            & Car                   &  Sign      & Person                & mAP                   \\ \hline
			\multirow{3}{*}{s2n} & Faster&63.33 &63.96 &32.00 &53.10 \\
			& Strong-Weak&67.43&64.33&\bf 32.53&54.76\\
			& Ours& \bf 67.92&\bf 65.89&32.52&\bf 55.44\\ \cline{2-6}
			& Oracle&80.12&84.68&44.57&69.79\\ \hline
			\multirow{3}{*}{s2r} & Faster&70.20 &72.71 &36.22 &59.71 \\
			& Strong-Weak&\bf 71.56&78.07&39.27&62.97\\
			& ours& 71.41&\bf 78.93&\bf 39.79&\bf 63.37\\ \cline{2-6}
			& Oracle & 71.83 & 79.42 & 45.21 & 65.49 \\ \hline
			\multirow{3}{*}{s2c}  & Faster&-- &-- &-- &-- \\
			&Strong-Weak&\bf 71.32&72.71&43.18&62.40\\
			& Ours  & 71.28 &\bf 72.91 &\bf 43.79 & \bf 62.66 \\ \cline{2-6}
			&Oracle & 76.60 & 76.72 & 47.28 & 66.87\\
			\bottomrule[1.5pt]
		\end{tabular}
	}
\end{table}

\begin{table*}[t]
	\caption{Results on adaptation from PASCAL VOC to Clipart Dataset. Average precision (\%) is evaluated on target images.}
	\vspace{-2.8mm}
	\label{tbl:ap_clipart}
	\centering
	\scalebox{0.84}{
		\tabcolsep=1.5pt
		\centering
		\begin{tabular}{l|cccccccccccccccccccc|c}
			\toprule[1.5pt]

			Method &  aero & bcycle & bird & boat & bottle & bus  & car  & cat  & chair & cow  & table & dog  & hrs & bike & prsn & plnt & sheep & sofa & train & tv & \bf mAP  \\\hline
			Faster (Non-adapted)& {35.6}      & 52.5    & 24.3 & 23.0 & 20.0   & 43.9 & 32.8 & 10.7 & 30.6  & 11.7 & 13.8        & 6.0  & \bf{36.8}  & 45.9      & 48.7   & 41.9        &{16.5}  & 7.3  & 22.9  & 32.0      & 27.8 \\
			BDC-Faster &20.2      & 46.4    & 20.4 & 19.3 & 18.7   & 41.3 & 26.5 & 6.4  & 33.2  & 11.7 &{ 26.0}        & 1.7  & 36.6  & 41.5      & 37.7  & 44.5        & 10.6  & 20.4 & 33.3  & 15.5      & 25.6 \\
			DA&15.0&34.6&12.4&11.9&19.8&21.1&23.2&3.1&22.1&26.3&10.6&10.0&19.6&39.4&34.6&29.3&1.0&17.1&19.7&24.8&19.8
			\\\hline
			WST-BSR~\cite{Kim_Self_2019}&28.0&\bf 64.5& 23.9& 19.0& 21.9&\bf 64.3&\bf 43.5& 16.4&\bf 42.2& 25.9&\bf 30.5& 7.9& 25.5& 67.6& 54.5& 36.4& 10.3& \bf 31.2& \bf 57.4& 43.5& 35.7\\
			Strong-Weak~\cite{Saito_2019_CVPR}&26.2&48.5&32.6&\bf{33.7}&38.5&{54.3}& 37.1&{18.6}&34.8&{58.3}&17.0&12.5&33.8&65.5&\bf 61.6&\bf{52.0}&9.3&{24.9}& 54.1&\bf{49.1}&{38.1}\\ \hline
			Ours w/$\mathcal{L}_{ILoss}=FL$ &33.4&49.2&36.0&27.1&38.4&55.7&38.7&15.9&39.0&59.2&18.8&23.7&36.9&70.0&60.6&49.7&25.8&34.8&47.2&51.2&40.6 \\
			Ours w/$\mathcal{L}_{ILoss}=CE$ &\bf 44.7&50.0&33.6&27.4&\bf 42.2&55.6&38.3&\bf 19.2&37.9&\bf 69.0&30.1&\bf 26.3&34.4&67.3&61.0&47.9&21.4&26.3&50.1&47.3&\bf 41.5 \\

			\bottomrule[1.5pt]
	\end{tabular}}
	\vspace{-0.15cm}
\end{table*}

\noindent{\textbf{INIT Dataset.}}
INIT Dataset~\cite{shen2019towards} contains 132,201 images for training and 23,328 images for testing. There are four domains: sunny, night, rainy and cloudy, and three instance categories, including: car, person, speed limited sign. This dataset is first proposed for the instance-level image-to-image translation task, here we use it for the domain adaptive object detection purpose.

Our results are shown in Table~\ref{tab:INIT}. Following~\cite{shen2019towards}, we conduct experiments on three domain pairs: sunny$\to$night (s2n), sunny$\to$rainy (s2r) and sunny$\to$cloudy (s2c). Since the training images in rainy domain are much fewer than sunny, for s2r experiment we randomly sample the training data in sunny set with the same number of rainy set and then train the detector. It can be observed that our method is consistently better than the baseline method. We don't provide the results of s2c (faster) because we found that cloudy images are too similar to sunny in this dataset (nearly the same), thus the non-adapted result is very close to the adapted methods.

\subsection{Discrepant Domains}
In this section, we focus on the dissimilar domains, i.e., adaptation from real images to cartoon/artistic. Following~\cite{Saito_2019_CVPR}, we use PASCAL VOC dataset (2007+2012 training and validation combination for training) as the source data and the Clipart or Watercolor~\cite{inoue2018cross} as the target data.
The backbone network is ImageNet pre-trained ResNet-101.

\noindent{\textbf{PASCAL to Clipart.}} Clipart dataset contains 1,000 images in total, with the same 20 categories as in PASCAL VOC. As shown in Table~\ref{tbl:ap_clipart}, our proposed SCL outperforms all baselines. In addition, we observe that replacing $FL$ with $CE$ loss on instance-context classifier can further improve the performance from 40.6\% to 41.5\%. More ablation results are shown in our Appendix~\ref{app_clipart} (Table~\ref{tbl:appendix_clipart}).

\noindent{\textbf{PASCAL to WaterColor.}}
Watercolor dataset contains 6 categories in common with PASCAL VOC and has totally 2,000 images (1,000 images are used for training and 1,000 test images for evaluation). Results are summarized in Table~\ref{tbl:ap_water}, SCL consistently outperforms other state-of-the-arts.

\subsection{From Synthetic to Real Images}

\noindent{\textbf{Sim10K to Cityscapes.}} Sim 10k dataset~\cite{johnson2016driving} contains 10,000 images for training which are generated by the gaming engine Grand Theft Auto (GTA). Following~\cite{chen2018domain,Saito_2019_CVPR}, we use Cityscapes as target domain and evaluate our models on {\em Car} class. Our result is shown in Table~\ref{tab:Sim10k}, which consistently outperforms the baselines.

\begin{table}[t]
	\centering\small
	\setlength{\tabcolsep}{2pt}
	\caption{Adaptation results from PASCAL to WaterColor.}
	\vspace{-2mm}
	\label{tbl:ap_water}
	\scalebox{0.9}{
		\tabcolsep=1.5pt
		\begin{tabular}{l|cccccc|c}
			\toprule[1.5pt]
			& \multicolumn{7}{c}{AP on a target domain}\\%\cmidrule(r){6-19}
			Method & bike & bird & car  & cat  & dog  & prsn &\bf mAP  \\\hline
			Source Only  &68.8 & 46.8 & 37.2 & 32.7 & 21.3 & 60.7   & 44.6 \\ \hline
			BDC-Faster&68.6 & 48.3 & 47.2 & 26.5 & 21.7 & 60.5   & 45.5\\
			DA~\cite{chen2018domain} &75.2 & 40.6 & {48.0} & 31.5 & 20.6 & 60.0   & 46.0\\%\hline
			WST-BSR~\cite{Kim_Self_2019} & 75.6 &45.8 & 49.3 & 34.1 & 30.3 & 64.1 & 49.9\\
			Strong-Weak~\cite{Saito_2019_CVPR}& \bf{82.3}	& \bf{55.9}&46.5&32.7&{35.5}&\bf{66.7}&{53.3}\\ \hline
			Ours& 82.2&55.1&\bf{51.8}&\bf{39.6}&\bf{38.4}&64.0&\bf{55.2}\\
			\bottomrule[1.5pt]
	\end{tabular}}
\end{table}

\begin{table}[t]
	\caption{Adaptation results on {\em Car} from Sim10k to Cityscapes Dataset (\%). {\em Source Only} indicates the non-adapted results ($\lambda = 0.1$ and $\gamma = 2.0$ are used).}
	\label{tab:Sim10k}
	\vspace{-0.15cm}
	\centering
	\scalebox{0.8}{
		\begin{tabular}{c|c}
			\toprule[1.5pt]
			Method   & AP on Car \\ \hline
			Faster &    34.6       \\
			DA~\cite{chen2018domain}       & 38.9     \\
			Strong-Weak~\cite{Saito_2019_CVPR}&  40.1         \\
			MAF~\cite{he2019multi} &  41.1         \\ \hline
			Ours     & \bf 42.6     \\ \bottomrule[1.5pt]
		\end{tabular}
	}
\end{table}

\section{Analysis}

\noindent{\textbf{Hyper-parameter $\mathbf{K}$.}} Table~\ref{tab:ablation_k} shows the results for sensitivity of hyper-parameter $\mathbf{K}$ in Figure~\ref{framework}. This parameter controls the number of SCL losses and context branches. It can be observed that the proposed method performs best when $\mathbf{K}=3$ on all three datasets.

\begin{table}[h
	\vspace{-0.2cm}
	\caption{Analysis of hype-parameter $\mathbf{K}$.}
	\label{tab:ablation_k}
	\vspace{-0.25cm}
	\centering
	\resizebox{0.36\textwidth}{!}{%
		\begin{tabular}{l|c|c|c}
			\toprule[1.5pt]
			Method                             & $\mathbf{K}$=2 & $\mathbf{K}$=3 & $\mathbf{K}$=4 \\ \hline
			from Cityscapes to Foggycityscapes & 32.7  & \bf 37.9   &  34.5   \\ \hline
			from PASCAL VOC to Clipart         &  39.0   & \bf 41.5 &  39.3   \\ \hline
			from PASCAL VOC to Watercolor      &  54.7 & \bf 55.2   & 53.4  \\
			\bottomrule[1.5pt]
		\end{tabular}
	}
	\vspace{-0.2cm}
\end{table}

\begin{figure

	\centering
	\includegraphics[width=0.98\columnwidth]{figs/senti__.pdf}

	\vspace{-0.15cm}
	\caption{Parameter sensitivity for the value of $\lambda$ (left) and $\gamma$ (right) in adaptation from Cityscapes to FoggyCityscapes and from Sim10k to Cityscapes.}
	\label{fig:senti}
	\vspace{-.1cm}
\end{figure}

\begin{figure*}[h]
	\centering
	\subfloat[\scriptsize from Cityscapes and FoggyCityscapes]{\includegraphics[width=0.33\textwidth, keepaspectratio]{figs/clipart}\label{fig:1}}
	\subfloat[\scriptsize from PASCAL VOC to Clipart]{\includegraphics[width=0.33\textwidth, keepaspectratio]{figs/foggy}\label{fig:2}}
	\subfloat[\scriptsize from PASCAL VOC to Watercolor]{\includegraphics[width=0.33\textwidth, keepaspectratio]{figs/watercolor}\label{fig:3}}
	\vspace{-0.1in}
	\caption{AP (\%) with different IoU thresholds. We show comparisons on three datasets and all results are calculated with different IoU thresholds and illustrated in different colors.}
	\label{IOU}
	\vspace{-0.1in}
\end{figure*}

\begin{figure*}[t]
	\centering
	\includegraphics[width=0.99\textwidth]{figs/heatmaps.pdf}
	\vspace{-0.1in}
	\caption{Visualization of {\em Attention Maps} on source and target domains. We use feature maps after {\bf Conv B3} in Figure~\ref{framework} for visualizing. Top: Input images; Middle: Heatmaps from models {\em w/o} gradient detach; Bottom: Heatmaps from models {\em w/} gradient detach. The colors (red$\to$blue) indicate values from high to low. It can be observed that {\em w/} detach training, our models can learn more discriminative representation between object areas and background (context).}
	\label{heatmaps}
	\vspace{-0.1in}
\end{figure*}

\noindent{\textbf{Parameter Sensitivity on $\lambda$ and $\gamma$.}} Figure~\ref{fig:senti} shows the results for parameter sensitivity of $\lambda$ and $\gamma$ in Eq.~\ref{lambda} and Eq.~\ref{gamma}. $\lambda$ is the trade-off parameter between SCL and detection objectives and $\gamma$ controls the strength of hard samples in {\em Focal Loss}. We conduct experiments on two adaptations: Cityscapes $\to$ FoggyCityscapes (blue) and Sim10K $\to$ Cityscapes (red). On Cityscapes $\to$ FoggyCityscapes, we achieve the best performance when $\lambda=1.0$ and $\gamma=5.0$ and the best accuracy is 37.9\%. On Sim10K $\to$ Cityscapes, the best result is obtained when $\lambda=0.1$, $\gamma=2.0$.

\noindent{\textbf{Analysis of IoU Threshold.}} The IoU threshold is an important indicator to reflect the quality of detection, and a higher threshold means better coverage with ground-truth. In our previous experiments, we use 0.5 as a threshold suggested by many literature~\cite{ren2015faster,chen2018domain}. In order to explore the influence of IoU threshold with performance, we plot the performance {\em vs.} IoU on three datasets. As shown in Figure~\ref{IOU}, our method is consistently better than the baselines on different thresholds by a large margin (in most cases).

\noindent{\textbf{Why Gradient Detach Can Help Our Model?}} To further explore why gradient detach can help to improve performance vastly and what our model really learned, we visualize the heatmaps on both source and target images from our  models {\em w/o} and {\em w/} detach training. As shown in Figure~\ref{heatmaps}, the visualization is plotted with feature maps after {\em Conv B3} in Figure~\ref{framework}. We can observe that the object areas and context from {\em detach}-trained models have stronger contrast than {\em w/o} detach model (red and blue areas). This indicates that {\em detach-based} model can learn more discriminative features from the target object and context. To be more precise, {\em w/o detach} model is attentive more on the background (green color), in contrast, {\em with detach} model is  mainly activated on the object areas with less attention on the background (blue color, i.e., less attention). More visualizations are shown in Appendix~\ref{app_heatmaps} (Figure~\ref{heatmaps_more}).

\begin{figure*}[t]
	\centering
	\subfloat[FoggyCityscapes]{\includegraphics[width=0.96\textwidth, keepaspectratio]{figs/foggy_det_redu.pdf}\label{det_fig:1}}\\
	\vspace{-0.12in}
	\subfloat[Clipart]{\includegraphics[width=0.96\textwidth, keepaspectratio]{figs/clipart_det_redu.pdf}\label{det_fig:2}}\\
	\vspace{-0.12in}
	\subfloat[Watercolor]{\includegraphics[width=0.96\textwidth, keepaspectratio]{figs/watercolor_det_redu.pdf}\label{det_fig:3}}
	\vspace{-0.12in}
	\caption{Detection examples with DA~\cite{chen2018domain}, Strong-Weak~\cite{Saito_2019_CVPR} and  our proposed SCL on three datasets. For each group, the first row is the result of DA, the second row is from Strong-Weak and the last row is ours. We show detections with the scores higher than a threshold (0.3 for FoggyCityscapes and 0.5 for other two).}
	\label{detection}
\end{figure*}

\noindent{\textbf{Detection Visualization.}} Figure~\ref{detection} shows several qualitative comparisons of detection examples on three test sets with DA~\cite{chen2018domain}, Strong-Weak~\cite{Saito_2019_CVPR} and our SCL models. Our method detects more small and blurry objects in dense scene (FoggyCityscapes) and suppresses more false positives (Clipart and Watercolor) than the other two baselines.

\section{Conclusion}
We have addressed unsupervised domain adaptive object detection through stacked complementary losses. One of our key contributions is gradient detach training, enabled by suppressing gradients flowing back to the detection backbone. In addition, we proposed to use multiple complementary losses for better optimization. We conduct extensive experiments and ablation studies to verify the effectiveness of each component that we proposed. Our experimental results outperform the state-of-the-art approaches by a large margin on a variety of benchmarks. Our future work will focus on exploring the domain-shift detection from scratch, i.e., without the pre-trained models like DSOD~\cite{shen2017dsod}, to avoid involving bias from the pre-trained dataset.

{
\small
\bibliographystyle{ieee_fullname}