# Atomic Focusing by Quantum Fields: Entanglement Properties

I. G. da Paz111Corresponding author. Departamento de Física, Universidade
Federal do Piauí, Campus Ministro Petrônio Portela, CEP 64049-550, Teresina,
PI, Brazil.  H.M. Frazão  Universidade Federal do Piauí, Campus Profa.
Cinobelina Elvas, CEP 64900-000, Bom Jesus, PI, Brazil and Departamento de
Física, Instituto de Ciências Exatas, Universidade Federal de Minas Gerais,
Caixa Postal 702, Belo Horizonte, MG 30123-970, Brazil  M. C. Nemes
Departamento de Física, Instituto de Ciências Exatas, Universidade Federal de
Minas Gerais, Caixa Postal 702, Belo Horizonte, MG 30123-970, Brazil  J. G.
Peixoto de Faria  Departamento de Física e Matemática, Centro Federal de
Educação Tecnológica de Minas Gerais, Av. Amazonas 7675, Belo Horizonte, MG
30510-000, Brazil

###### Abstract

The coherent manipulation of the atomic matter waves is of great interest both
in science and technology. In order to study how an atom optic device alters
the coherence of an atomic beam, we consider the quantum lens proposed by
Averbukh et al [1] to show the discrete nature of the electromagnetic field.
We extend the analysis of this quantum lens to the study of another
essentially quantum property present in the focusing process, i.e., the atom-
field entanglement, and show how the initial atomic coherence and purity are
affected by the entanglement. The dynamics of this process is obtained in
closed form. We calculate the beam quality factor and the trace of the square
of the reduced density matrix as a function of the average photon number in
order to analyze the coherence and purity of the atomic beam during the
focusing process.

###### pacs:

03.75.-b, 03.65.Vf, 03.75.Be

Keywords: Quantum lens, Atom-field entanglement, Classical limit

##  I Introduction

Since the seminal proposal for laser cooling of atoms in dilute gases and atom
trapping Hansch , the manipulation of all atomic motional degrees of freedom
based on the atom interaction with external light fields have reached enormous
success. Given the recent advances in the manipulation of atoms we now observe
a fast evolution of the field both in terms of scientific knowledge and
technological applications, like in precision sensors, precise metrology and
clocks, lithography, single atom manipulation, trace gas analysis and
ultracold chemistry Schleich2010 . In addition, the area of quantum
information processing has benefited from such advances due to the
establishment of precise quantum protocols. From the theoretical viewpoint the
modeling of strongly correlated materials and nonequilibrium quantum dynamics
are stimulating areas of research.

The dynamics of atomic beams share an intimately close analogy with classical
laser light in the paraxial approximation. The Gouy phase discovered and
measured in 1890 in the latter context is found in any beam subject to
confinement which adds a well defined phase shift and has implications and
applications in many optical systems gouy . The existence of a particle wave
analogy to this phenomenon has been first pointed out in Refs. Paz1  followed
by an experimental proposal in Cavity Quantum Electrodynamics (CQED) Paz2 .
Very recently this proposal has stimulated the search for the matter wave Gouy
phase in different systems: Bose-Einstein condensates cond , electron vortex
beams elec2 , and astigmatic electron matter waves using in-line holography
elec1 . The Gouy phase carries intrinsic properties of the initial state and
dictates the time scale of the process.

In the present work we explore the quantum version of experimental set up
proposed in Ref. Paz2  in order to show how it may be of use to explore other
quantum features as atom-field entanglement, analysis of atomic quantum lenses
proposal in Schleich1994  to study the discrete nature of the field. The
actual measurement of this phenomenon represents a major experimental
challenge, since a quantum tomography would be required. We show here however,
that the measurement of the covariance matrix of the center of mass atomic
wavefunction indicates the presence of entanglement. Purity loss, although far
from being an easily measurable quantity is shown to reveal the entanglement
dynamics which occurs in the focusing process. We setup a model (within
experimental reach) of a focusing and deflection of a nonresonant atomic beam
propagating through a spatially inhomogeneous quantized electromagnetic field.
The interaction of a nonresonant atom with an electromagnetic field in the so
called dispersive approximation is proportional both to the field intensity
and the susceptibility of the atom. Therefore atoms under the influence of
such fields may suffer mechanical effects such as deviations in their center
of mass motion and deflection. In the present case we will use this property
to focus atomic beams. We address the question as to the manifestation of
quantum effects in the focusing process. In Ref. Schleich1994  the discrete
character of the photons was shown to be observable in such experiments. Our
aim within a similar scheme is to enlighten another quantum aspect,
entanglement. Interaction is the key ingredient to produce entanglement which
is an important characteristic of quantum information protocols. We study its
behavior in the atomic focusing process.

In section II we present the model which is essentially the same as the one
used in Refs. Schleich1994 ; Schleich2001  with the difference that we
calculate the probability amplitude instead of the intensities. Our procedure
enable us to determine the density matrix of the system. In section III, we
present our results, in the covariance matrix and the atom-field entanglement
properties as a function of the average photon number $\bar{n}$ showing that
one aspect of the classical limit of the field is the suppression of
entanglement as $\bar{n}$ increases. This is also apparent in the covariance
matrix. The independence of the field’s granular nature on the number of
photons, shown in Refs. Schleich1994 ; Schleich2001 , occurs because in that
model the authors relax the dispersive limit condition. In the present model,
we preserve the dispersive limit and the classical limit of the field is a
consequence of the disentanglement between atom and field, apparent in the
conservation of the initial purity and coherence of the atomic beam.

##  II The Model

In this section we present a model that permit us focusing an atomic beam and
find an expression for the Gouy phase of matter waves that is a connection of
this phase with the inverse square of the beam width. We consider an atomic
beam propagating through a spatially inhomogeneous quantized electromagnetic
field. The atomic beam will suffer deflection and focusing. Different Fock
states deflect the atoms in different angles and focus them at different
points. We suppose that the atomic beam is initially in a coherent Gaussian
state and obtain the equations of motion for the parameters that characterize
the structure of the wavepacket. We see that the equations of motion is not
consistent if the atomic beam was represented at time by the one Gaussian
state without the Gouy phase term.

The model is presented in Fig. 1 in which we use the following (Schleich1994,
; Schleich2001, ): consider two-level atoms moving along the $Oz$ direction
and that they enter in a region where a stationary electromagnetic field is
maintained. The region is the interval $z=-L$ until $z=0$. The atomic linear
momentum in this direction is such that the de Broglie wavelength associated
is much smaller than the wavelength of the electromagnetic field. We assume
that the atomic center of mass moves classically along direction $Oz$ and the
atomic transition of interest is detuned from the mode of the electromagnetic
field (dispersive interaction). The Hamiltonian for this model is given by

$\hat{H}_{AF}=\frac{\hat{p}_{x}^{2}}{2m}+g(\hat{x})\hat{a}^{{\dagger}}\hat{a},$
(1)

where $m$ is the atom mass, $\hat{p}_{x}$ and $\hat{x}$ are the linear
momentum and position along the direction $Ox$, $\hat{a}^{{\dagger}}$ and
$\hat{a}$ are the creation and destruction operators of a photon of the
electromagnetic mode, respectively. The coupling between atom and field is
given by the function $g(x)=\alpha\mathcal{E}^{2}(x)$ where $\alpha$ is the
atomic linear susceptibility, $\alpha=\frac{\wp^{2}}{\hbar\Delta}$, where
$\wp^{2}$ is the square of the dipole moment and $\Delta$ is the detuning from
nearest atomic resonance. $\mathcal{E}(x)$ corresponds to the electric field
amplitude in vacuum. The effective interaction time is
$t_{L}=\frac{L}{v_{z}}$, where $v_{z}$ is the longitudinal velocity of the
atoms. For simplicity the field distribution in $z$-direction of length $L$ is
assumed to have a rectangular profile as expressed by the Heaviside step
functions $\theta(z)$. The initial width of the atomic beam is $b_{0}$ and
$b_{0}^{\prime}$ represents its width at the focus.

Figure 1: Quantum lens. A beam of nonresonant atoms propagating initially
along the $z$-axis interacts with the light field in the region $-L\leq z\leq
0$. Different Fock states deflect the atoms in different directions and focus
them at different points. The initial width of the atomic beam is $b_{0}$ and
$b_{0}^{\prime}$ represents its width at the focus.

The dynamics of the closed system is governed by the Schrödinger equation

$i\hbar\frac{d}{dt}|\Psi(t)\rangle=\hat{H}_{AF}|\Psi(t)\rangle.$ (2)

At $t=0$ the state of the system is given by a direct product of the state
corresponding to the transverse component of the atom and a field state,
$|\Psi_{CM}\rangle\otimes|\Psi_{F}\rangle$. The field state can be expanded in
the eigenstates of the number operator $\hat{a}^{{\dagger}}\hat{a}$

$|\Psi_{F}\rangle=\sum_{n}w_{n}|n\rangle,\;\;\;\sum_{n}|\omega_{n}|^{2}=1.$
(3)

When atom and field interact the atomic and field states get entangled. We can
then write

$|\Psi(t)\rangle=\sum_{n}w_{n}\int_{-\infty}^{+\infty}dx\>\psi_{n}(x,t)|x\rangle\otimes|n\rangle\>,$
(4)

where

$i\hbar\frac{\partial}{\partial
t}\psi_{n}(x,t)=\left\\{-\frac{\hbar^{2}}{2m}\nabla^{2}+g(x)n\right\\}\psi_{n}(x,t)\>,$
(5)

or, if one defines

$|\Psi_{n}(t)\rangle=\int_{-\infty}^{+\infty}dx\;\psi_{n}(x,t)|x\rangle\>,$
(6)

the equation (5) takes the form

$i\hbar\frac{d}{dt}|\Psi_{n}(t)\rangle=\left[\frac{\hat{p}_{x}^{2}}{2m}+g(\hat{x})n\right]|\Psi_{n}(t)\rangle.$
(7)

Next, we will use the harmonic approximation for $g(x)$ where we consider that
the electric field has a node in the atomic beam axis. In addition, we
considered that the width of the transverse atomic beam $b_{0}$ is much
smaller than the wavelength $\lambda$ of the field. In this case, as a good
approximation, the field creates one square well potential for the atom in the
transverse coordinate Schleich1994 ; Schleich2001 . Therefore we take only the
main terms of the Taylor expansion of the function $g(x)$,

$g\left(x\right)\approx
g_{0}-\frac{g_{1}^{2}}{2g_{2}}+\frac{1}{2}g_{2}\left(x-x_{f}\right)^{2}\>,$
(8)

where $g_{0}\equiv g(x=0)$, $g_{1}\equiv dg/dx|_{x=0}$, $g_{2}\equiv
d^{2}g/dx^{2}|_{x=0}$, $x_{f}\equiv-g_{1}/g_{2}$ and
$\Omega_{n}^{2}=ng_{2}/m$. The combination of linear and the quadratic
contributions of the potential in a binomial reduces the problem to the motion
in the harmonic potential
$U_{n}(x)=U_{n}(x_{f})+\frac{1}{2}m\Omega_{n}^{2}(x-x_{f})^{2}$ of the
displaced harmonic oscillator with minimum
$U_{n}(x_{f})\equiv(g_{0}-g_{1}^{2}/2g_{2})n$ at $x_{f}$ and frequency
$\Omega_{n}$.

Omitting the constant term $U_{n}(x_{f})$, since it only results in an
irrelevant phase factor, we get for the Schrödinger equation,

$\displaystyle i\hbar\frac{d}{dt}|\Psi_{n}(t)\rangle$ $\displaystyle=$
$\displaystyle\left[\frac{\hat{p}_{x}^{2}}{2m}+\frac{1}{2}m\Omega_{n}^{2}(\hat{x}-x_{f})^{2}\right]|\Psi_{n}(t)\rangle$
(9) $\displaystyle\equiv$ $\displaystyle\hat{H}_{n}|\Psi_{n}(t)\rangle\>.$

###  II.1 Time evolution

The general form of a Gaussian state in the position representation is given
by

$\psi\left(x,t\right)=\left(\frac{u}{\pi}\right)^{\frac{1}{4}}\exp\left(-i\frac{\bar{x}\bar{p}}{2\hbar}+i\mu\right)\exp\left[-\frac{\left(x-\bar{x}\right)^{2}\left(u+iv\right)}{2}+i\frac{\bar{p}x}{\hbar}\right],$
(10)

where $\bar{x}$ and $\bar{p}$ are the coordinates of “center of mass” of the
distribution in the phase space and $u$ and $v$ give the form of this
distribution. Here, $u$ is the inverse square of the width of the Gaussian
package and $v$ is related to the curvature of the wave fronts. Different from
the general form of a Gaussian state in the position representation, defined
by Bialynicki-Birula (Birula1998, ), we define it in equation (10) with an
additional term $\mu$ that is a real function of time. This global phase, in
general neglected (see, e.g., (Birula1998, ; Piza, )), has the important role
of ensuring the consistency of the equations of motion.

The dynamics governed by a Hamiltonian which is quadratic in both position and
momentum keeps the Gaussian shape of a Gaussian initial state. This is the
case of the problem treated here. The atomic motion can be divided into two
stages: the first, the atom undergoes the action of an harmonic potential when
it crosses the region of electromagnetic field while, in the second part, the
atom evolves freely. In the two stages, the Hamiltonian governing the
evolution is quadratic in atomic position and momentum [cf. equation (9)].
Since the initial atomic state is Gaussian, we can consider that such state
will preserve the form given by equation (10) throughout time evolution. In
this case, the parameters $\bar{x}$, $\bar{p}$, $u$, $v$ and $\mu$ are
functions of time and their respective equations of motion can be derived from
Schrödinger equation.

Consider a particle of mass $m$ moving under the action of an harmonic
potential. The natural frequency of this movement is $\Omega_{n}$. The
Hamiltonian governing this dynamic is given by

$\hat{H}=\frac{\hat{p}_{x}^{2}}{2m}+\frac{1}{2}m\Omega_{n}^{2}\hat{x}^{2}.$
(11)

In the position representation, the evolution of the state $\psi$ of the
particle is governed by the Schrödinger equation

$i\hbar\frac{\partial}{\partial
t}\psi(x,t)=\left[-\frac{\hbar^{2}}{2m}\frac{\partial^{2}}{\partial
x^{2}}+\frac{1}{2}m\Omega_{n}^{2}x^{2}\right]\psi(x,t).$ (12)

Suppose that the initial state of the particle is Gaussian. We obtain the
equations of motion for the parameters $\bar{x}$, $\bar{p}$, $u$, $v$ and
$\mu$ by substituting the general form (10) in the equation above, grouping
the terms of same power in $\left(x-\bar{x}\right)$, and then separating the
real and imaginary parts. This procedure takes six equations for the five
parameters mentioned. The system is therefore, “super-complete”. Eliminating
such redundancy, the equations of motion are the following

$\displaystyle\dot{\bar{x}}$ $\displaystyle=\frac{\bar{p}}{m}\>,$ (13a)
$\displaystyle\dot{\bar{p}}$ $\displaystyle=-m\Omega_{n}^{2}\bar{x}\>,$ (13b)
$\displaystyle\dot{K}$
$\displaystyle=i\frac{m\Omega_{n}^{2}}{\hbar}-i\frac{\hbar}{m}K^{2}\>,$ (13c)
$\displaystyle\dot{\mu}$ $\displaystyle=-\frac{\hbar}{2m}u,$ (13d)

where we define $K=u+iv$. Here, the dots indicate time derivative. Note that
the equations of motion for the coordinates of the centroid of the
distribution are equivalent to the classical equations of movement for the
position and momentum of a particle moving in an harmonic potential. Equation
(13d) relates the Gouy phase with the inverse square of the beam width. The
same result was obtained for light waves confined in the transverse direction
in Ref. (feng01, ). This equation does not carry any analogy with the equation
of motion for classical particles and it is an effect of the wave behavior. If
the general state (10) does not have the parameter $\mu$, we obtain $u=0$.
This makes no sense, since $u$ represents the inverse square of the width of
the Gaussian package. Therefore, since the Gaussian shape of the state has to
be maintained because the dynamic is governed by a Hamiltonian quadratic in
position and momentum, the Gouy phase term has to appear in the evolution to
guarantee the consistency of the equations of motion that represent the
Gaussian shape of the packet at a given time. The absence of the Gouy phase
term implies that the shape of the packet at a given time is a plane wave with
infinity width and not Gaussian with a finite width.

###  II.2 The Focusing Process

Here we give details of the focusing process. We consider that a stationary
electromagnetic field of wavelength $\lambda$ is produced in an optical cavity
where the relation of the wavelength of the field and the initial width of the
wavepacket in transverse direction is such that the harmonic approximation is
guaranteed. In Fig. 2 we consider that a initial coherent Gaussian state
compressed in momentum (region I) enters in a cavity where a stationary
electromagnetic field is maintained (region II). The atoms interact
dispersively with one mode of the quantized electromagnetic field inside the
cavity. Dispersive coupling is actually one necessary condition to produce a
quantum lens, since transitions cause aberration at the focus (Schleich2001, ;
Berman, ). We note that a key ingredient for the focusing problem is to
construct inside the cavity a compressed (squeezed) state, since the harmonic
interaction between atom and field do not produces compression and only
rotates the atomic state. When the atomic beam leaves the region of the
electromagnetic field, the atomic state evolves freely and the compression is
transferred to the position (region III).

Let us assume, as an initial atomic state, the compressed vacuum state

$\langle
x|\psi_{n}(t=0)\rangle=\psi_{n}(x,t=0)=\left(\frac{1}{b_{0}\sqrt{\pi}}\right)^{1/2}\exp\left(-\frac{x^{2}}{2b_{0}^{2}}\right)\>,$
(14)

where $b_{0}$ is the initial collimation width of the packet, which has to be
collimated in a such way to guarantee the dispersive limit for the entire
beam, i.e, $4\pi^{2}n\Omega_{0}^{2}b_{0}^{2}/(\Delta\lambda^{2})\ll 1$, so
that we can avoid the aberration caused by the transitions and obtain a focus
with good resolution. The state above will be compressed in momentum if
$b_{0}>b_{n}=\sqrt{\hbar/\left(m\Omega_{n}\right)}$, where $b_{n}$ is the
width of the distribution in position of the ground state of the harmonic
oscillator.

Figure 2: Initial atomic compressed state in momentum . The evolution inside
the cavity rotates the state and transfer the compression to the position.

For the parameters $\bar{x}$, $\bar{p}$, $K$ and $\mu$, we get

$\bar{x}(t<t_{L})=-x_{f}\cos\Omega_{n}t\>,$ (15)
$\bar{p}(t<t_{L})=m\Omega_{n}x_{f}\sin\Omega_{n}t\>,$ (16)

and

$K(t<t_{L})=\left(\cos\Omega_{n}t+i\frac{b_{n}^{2}}{b_{0}^{2}}\sin\Omega_{n}t\right)^{-1}\left(\frac{1}{b_{0}^{2}}\cos\Omega_{n}t+i\frac{1}{b_{n}^{2}}\sin\Omega_{n}t\right)\>,$
(17)

for the initial conditions $\bar{x}_{0}=-x_{f},\bar{p}_{0}=0,u=b_{0}^{-2}$ and
$v=0$. Also, from equation (17) we obtain

$u(t<t_{L})=\left[b_{0}^{2}\left(\cos^{2}\Omega_{n}t+\frac{b_{n}^{4}}{b_{0}^{4}}\sin^{2}\Omega_{n}t\right)\right]^{-1}.$
(18)

Now $u^{-1}$ is the width of the Gaussian wavepacket squared. At this stage

$\mu_{n}(t<t_{L})=-\frac{1}{\Omega_{n}\tau_{n}}\arctan\left[\frac{b_{n}^{2}}{b_{0}^{2}}\tan(\Omega_{n}t)\right].$
(19)

When the atomic beam leaves the region of the electromagnetic field, the
atomic state evolves freely. The equations of motion can be obtained
analogously and we get for $t>t_{L}$

$\bar{x}(t>t_{L})=-x_{f}\cos\phi_{n}+\Omega_{n}(t-t_{L})x_{f}\sin\phi_{n},$
(20) $\bar{p}(t>t_{L})=m\Omega_{n}x_{f}\sin\phi_{n},$ (21)
$K(t>t_{L})=\frac{\frac{b_{n}^{2}}{b_{0}^{2}}\cos\phi_{n}+i\sin\phi_{n}}{b_{n}^{2}\left[\cos\phi_{n}+i\frac{b_{n}^{2}}{b_{0}^{2}}\sin\phi_{n}+i\frac{t-t_{L}}{\tau_{n}}\left(\frac{b_{n}^{2}}{b_{0}^{2}}\cos\phi_{n}+i\sin\phi_{n}\right)\right]},$
(22)

and

$b_{0}^{2}u(t>t_{L})=\left[\left(\cos\phi_{n}-\frac{t-t_{L}}{\tau_{n}}\sin\phi_{n}\right)^{2}+\frac{b_{n}^{4}}{b_{0}^{4}}\left(\sin\phi_{n}+\frac{t-t_{L}}{\tau_{n}}\cos\phi_{n}\right)^{2}\right]^{-1}\>,$
(23)

where $\phi_{n}=\Omega_{n}t_{L}$ and $\tau_{n}=mb^{2}_{n}/\hbar$. The focus
will be located in the atomic beam region where the width of the wavepacket is
minimal. In other words, when $u(t>t_{L})$ be a maximum there will be the
focus. This will happen when the function

$D(t)=\left(\cos\phi_{n}-\frac{t-t_{L}}{\tau_{n}}\sin\phi_{n}\right)^{2}+\frac{b_{n}^{4}}{b_{0}^{4}}\left(\sin\phi_{n}+\frac{t-t_{L}}{\tau_{n}}\cos\phi_{n}\right)^{2},$
(24)

attains its minimum value. The time for which its derivative vanishes is given
by

$t^{n}_{f}=\frac{z_{f}+L}{v_{z}}=t_{L}+\tau_{n}\frac{\left(1-\frac{b_{n}^{4}}{b_{0}^{4}}\right)\sin\phi_{n}\cos\phi_{n}}{\frac{b_{n}^{4}}{b_{0}^{4}}\cos^{2}\phi_{n}+\sin^{2}\phi_{n}},$
(25)

therefore the focus is located at

$z^{n}_{f}=v_{z}\tau_{n}\frac{\left(1-\frac{b_{n}^{4}}{b_{0}^{4}}\right)\tan\phi_{n}}{\frac{b_{n}^{4}}{b_{0}^{4}}+\tan^{2}\phi_{n}}.$
(26)

Note that different Fock state $n$ of the EM field focuses the atom beam in
different positions.

The width of the Gaussian beam that passed through the lens,
$B_{n}(t>t_{L})=1/\sqrt{u(t>t_{L})}$, can be written as

$B_{n}(t>t_{L})=b^{\prime}_{0}\left[1+\left(\frac{t-t^{n}_{f}}{\tau^{\prime}_{0}}\right)^{2}\right]^{\frac{1}{2}},$
(27)

where we define

$b^{\prime}_{0}=M_{n}b_{0},$ (28) $\tau^{\prime}_{0}=M_{n}^{2}\tau_{0},$ (29)

and

$M_{n}=\frac{1}{\sqrt{\cos^{2}\phi_{n}+\frac{b_{0}^{4}}{b_{n}^{4}}\sin^{2}\phi_{n}}}.$
(30)

The prime was used here to differentiate the beam parameters after the
focusing and their parameters before the focusing. We see that the waist of
the beam is increased by factor $M_{n}$ and the time scale $\tau_{0}$ (the
analogous of the Rayleigh range for optical beams Paz1 ) is increased by the
$M_{n}^{2}$. In optics, the amount $M_{n}$ is known as magnification factor
(Saleh, ). If the state is not initially compressed, i.e., if $b_{n}=b_{0}$,
$M_{n}=1$ and we do not have focusing. If the state is initially compressed in
momentum, i.e., if $b_{n}<b_{0}$, $M_{n}<1$ and we have a convergent lens. If
the state is initially compressed in position, i.e., if $b_{n}>b_{0}$,
$M_{n}>1$ and we have a divergent lens.

##  III Focusing by a Coherent State: The Generalized Uncertainty Principle
and Entanglement

In this section we will assume the field state to be in a coherent state. Due
to the interaction with the atom the atom-field wavefunction will be an
entangled state. Tracing out the field degrees of freedom will yield a mixed
density matrix for the atom. In this case a convenient tool to describe
entanglement is the purity of this density matrix since in this case the
purity loss is directly related with the information shared between the two
degrees of freedom. Consequently the purity of this density matrix
characterize the quantum properties of the field and in practise permit us to
choose a field that focusing an atom beam and not affect its purity. Another
important parameter to define here for the atomic beam is the analogous of the
quality factor that measure the spatial coherence of optical beam. In optics
this parameter can be defined through a covariance matrix Qiu  and for atomic
beam we will define it in the same way. The change in the initial coherence
and purity of the atomic beam manifested respectively by the quality factor
and atomic density matrix is a consequence of the quantum nature of the field.

The density matrix corresponding to the state (4) is given by

$\hat{\rho}\equiv|\psi(t)\rangle\langle\psi(t)|=\sum_{n_{1},n_{2}}w_{n_{1}}w^{*}_{n_{2}}\int
dx_{1}\int
dx_{2}\psi_{n_{1}}(x_{1},t)\psi^{*}_{n_{2}}(x_{2},t)|x_{1}\rangle\langle
x_{2}|\otimes|n_{1}\rangle\langle n_{2}|.$ (31)

The corresponding atomic density matrix is given by

$\hat{\rho}_{A}\equiv\sum^{\infty}_{n=0}\langle
n|\hat{\rho}|n\rangle=\sum^{\infty}_{n=0}|w_{n}|^{2}\int dx_{1}\int
dx_{2}\psi_{n}(x_{1},t)\psi^{*}_{n}(x_{2},t)|x_{1}\rangle\langle x_{2}|.$ (32)

Next we discuss the covariance matrix of the atomic beam so that we can obtain
the analogous of the beam quality factor. The covariance matrix is defined as
follows

$M_{C}=\left(\begin{array}[]{cc}\sigma_{xx}^{2}&\sigma_{xp}\\\
\sigma_{xp}&\sigma_{pp}^{2}\end{array}\right),$ (33)

where $\sigma_{xx}^{2}=\Delta
x^{2}=\langle\hat{x}^{2}\rangle-\langle\hat{x}\rangle^{2}$,
$\sigma_{pp}^{2}=\Delta
p^{2}=\langle\hat{p}^{2}\rangle-\langle\hat{p}\rangle^{2}$ are the squared
variances in position and momentum, respectively, and
$\sigma_{xp}=\frac{1}{2}\langle\hat{x}\hat{p}+\hat{p}\hat{x}\rangle-\langle\hat{x}\rangle\langle\hat{p}\rangle$
is the position-momentum covariance. Here we obtain for these quantities the
following results

$\sigma_{xx}^{2}=\sum^{\infty}_{n=0}|w_{n}|^{2}\frac{B_{n}^{2}}{2},$ (34)
$\sigma_{pp}^{2}=\frac{\hbar^{2}}{2b_{0}^{2}}\sum_{n}\frac{|w_{n}|^{2}}{M_{n}^{2}},$
(35)

and

$\sigma_{xp}=-\frac{\hbar}{2}\sum_{n}\frac{|w_{n}|^{2}}{M_{n}^{2}}\left(\frac{t-t_{f}^{n}}{\tau_{0}}\right).$
(36)

The determinant of the matrix in equation (33) is the generalized Robertson-
Schrödinger uncertainty relation and is given by

$\sigma_{xx}^{2}\sigma_{pp}^{2}-\sigma_{xp}^{2}=\mathcal{C}\frac{\hbar^{2}}{4},$
(37)

where

$\mathcal{C}=\sum_{n}\sum_{m}\frac{|w_{n}|^{2}|w_{m}|^{2}}{M_{m}^{2}}\left[M_{n}^{2}+\frac{1}{M_{n}^{2}\tau_{0}^{2}}(t_{f}^{n2}-t_{f}^{n}t_{f}^{m})\right].$
(38)

The constant $\mathcal{C}$ is a proportionality constant. In wave optics it is
referred to as the squared of quality factor of the beam $\mathcal{M}^{2}$
fator  and gives a measure of the spatial coherence of the laser beam. In the
matter wave context the situation is similar: when $\mathcal{C}=1$ we will
have a completely coherent and separable atomic beam since the determinant of
the covariance matrix attains its minimum value. It may be taken as an
indirect indication of entanglement loss. This constant contains the
ingredients of the beam focusing as e.g. the “focal time” and the field
distribution. Now let us interpret this constant and extract its physical
content. It is well known that coherent Gaussian states saturate the
generalized uncertainty principle to $\hbar^{2}/4$. In fact this is true for
any state subject to a quadratic dynamical evolution. We notice that the
constant $\mathcal{C}$ carriers ingredients originated from the atom-field
interaction. Therefore we expect that for a coherent field with a sufficiently
large average photon number $\bar{n}$, entanglement with atom will become
negligible and therefore this constant should tend to one as a function of
$\bar{n}$. This is shown in Fig. 3a for the thin lens regime. The numerical
calculation was performed using parameters corresponding to Cesium atoms in
the transition $6^{2}S_{1/2}-7^{2}P_{1/2}$ Schleich1994 : wave length inside
cavity $\lambda=459\;\mathrm{nm}$, atomic mass $m_{Cs}=2.2\times
10^{-25}\;\mathrm{kg}$, Rabi frequency $\Omega_{0}/2\pi=0.67\;\mathrm{MHz}$,
cavity length $L=100\;\mathrm{\mu m}$, longitudinal velocity
$v_{z}=300\;\mathrm{m/s}$, interaction time $t_{L}=0.3\;\mathrm{\mu s}$ and
collimation width $b_{0}/\lambda\sim 1/3$. For detuning we choose the value
$\Delta=4.2\times 10^{8}\;\mathrm{Hz}$. With these values we obtain the
following conditions

$\phi_{n}\ll 1,\;b_{n}/b_{0}\ll 1,$ (39)

for the average photon number $3<\bar{n}<30$. Now, neglecting in the cavity
the kinetic energy $\hat{p}_{x}^{2}/2m$ of the transverse motion of the atom
compared to the interaction energy $g(x)\hat{a}^{\dagger}\hat{a}$ and
considering the conditions above, we obtain the regime of a thin lens
Schleich1994  in which the “focal time” is given by

$t_{f}^{n}\approx t_{L}+\frac{m\Delta}{\hbar\Omega_{0}^{2}k^{2}t_{L}n},$ (40)

and the magnification factor by

$M_{n}\approx\frac{1}{\sqrt{1+\frac{b_{0}^{4}}{b_{n}^{4}}\phi_{n}^{2}}},$ (41)

where $k=2\pi/\lambda$. We see that for small values of $\bar{n}$ ($\sim 3$)
where the atom field interaction is viewed as a quantum process the values of
the constant $\mathcal{C}$ is larger than one and around $\bar{n}$ ($\sim 10$)
such quantum effects are washed out.

Now a direct measure of atom-field entanglement is given by

$Tr(\hat{\rho}_{A}^{2})=2\sum_{n,m}\frac{\sqrt{\tau_{0}^{\prime
m}\tau_{0}^{\prime n}}}{\sqrt{(\tau_{0}^{\prime m}+\tau_{0}^{\prime
n})^{2}+(t_{f}^{n}-t_{f}^{m})^{2}}}.$ (42)

This quantity, as well as $\mathcal{C}$, is time independent and reflects the
entanglement during the atom-field interaction time $t_{L}$. For the same
parameters as in Fig. 3a we obtain the curve in Fig. 3b for the thin lens
regime. Notice that the atomic subsystem becomes a pure state, i.e.,
uncorrelated with the electromagnetic field for sufficiently large values of
$\bar{n}$ ($\geq 10$).

The constant $\mathcal{C}$ in equation (38) may be experimentally obtained
from the quadratures of the atomic beam at the focus so that the theoretical
prediction can be tested. However the same is not true for the purity since it
depends on knowledge of the atomic state, which may in principle, be obtained
by quantum tomography. Although this represents an enormous challenge, the
impressive progress achieved in the area in the last decade may get us there
hopefully.

Figure 3: a) Quality factor of the atomic beam $\mathcal{M}^{2}$ as a function
of the average photon number $\bar{n}$ for focusing of a Cesium atom in the
thin lens regime. b) Trace of squared reduced density matrix of atom
$Tr(\hat{\rho}_{A}^{2})$ as a function of the average photon number $\bar{n}$
for focusing of a Cesium atom in the thin lens regime. We see that its purity
increases when the average photon number increases and this is a manifestation
of the atom-field disentanglement and represents the classical limit of the
field. In a similar way, the increasing of the coherence with an increasing
average photon number in (a) can also be considered as a manifestation of the
atom-field disentanglement and consequently represents the classical limit of
the field.

##  IV Conclusions

Encouraged by the recent success of the experimental measurement of the Gouy
phase for matter waves cond ; elec1 ; elec2  proposed in Paz2  for first time,
we revisit the focusing of the atomic beam, i.e., consider a quantum lens in
order to explore other essentially quantum features of the process. One of
then has to do with multiple foci which reflect the granular nature of the
cavity field, studied several years ago by Averbukh et al and Orzag et al
Schleich1994 . We therefore focus our attention in the atom-field entanglement
and discuss how this effect alters a measurable quantity, i.e., the atomic
beam covariance matrix and show that a direct consequence of this entanglement
is given by the purity loss of one of the degrees of freedom. We also show
that the entanglement properties disappear by the enhancement of the average
photon number, as to be expected. In the present example, for Cesium atoms the
“classical limit” is reached around $\bar{n}\geq 10$ depending on details of
the atom-field dynamics during the interaction time which preserve the
dispersive limit such as the detuning and the number of photon in the field
state.

###### Acknowledgements.

## Acknowledgments

We would like to thank the CNPq by financial support under grant numbers
486920/2012-7 and 306871/2012-2. JGPF thanks support from the program PROPESQ
(CEFET/MG) under grant number PROPESQ 10122-2012.

## References

  * (1) I.S. Averbukh, V.M. Akulin, W.P. Schleich, Phys. Rev. Lett. 72 (1994) 437; B. Rohwedder, M. Orszag, Phys. Rev. A 54 (1996) 5076.
  * (2) T.W. Hänsch, A. Schawlow, Opt. Commun. 13 (1975) 68; D. Wineland, H. Dehmelt, Bull. Am. Phys. Soc. 20 (1975) 637; A. Ashkin, Phys. Rev. Lett. 40 (1978) 729; C. S. Adams, E. Riis, Prog. Quant. Electr. 21 (1997) 1.
  * (3) F. Schmidt-Kaler, T. Pfau, P. Schmelcher, W. Schleich, New Journal of Phys. 12 (2010) 065014.
  * (4) L. G. Gouy, C. R. Acad. Sci. Paris 110 (1890) 1251; L. G. Gouy, Ann. Chim. Phys. Ser. 6 24 (1891) 145; H. C. Kandpal, S. Raman, R. Methrotra, Optics and Lasers in Eng. 45 (2007) 249; A. B. Ruffin, J. V. Rudd, J. F. Whitaker, S. Feng, H. G. Winful, Phys. Rev. Lett. 83 (1999) 341; T. Feurer, N. S. Stoyanov, D. W. Ward, K. A. Nelson, Phys. Rev. Lett. 88 (2002) 257402; F. Lindner, Phys. Rev. Lett. 92 (2004) 113001; T. Klaassen, A. Hoogeboom, M. P. van Exter, J. P. Woerdman, J. Opt. Soc. Am. A 21 (2004) 1689; W. Zhu, A. Agrawal, A. Nahata, Opt. Express 15 (2007) 1995; D. Kawase, Y. Miyamoto, M. Takeda, K. Sasaki, S. Takeuchi, Phys. Rev. Lett. 101 (2008) 050501; A. Wicht, J. M. Jensley, E. Sarajlic, S. Chu, Physica Scripta T102 (2002) 82; P. Cladé et al, Phys. Rev. A 74 (2006) 052109;
  * (5) I. G. da Paz, M. C. Nemes, S. Pádua, C. H. Monken, J. G. Peixoto de Faria, Phys. Lett. A 374 (2010) 1660; I. G. da Paz, M.C. Nemes, J. G. Peixoto de Faria, J. Phys.: Conference Series 84 (2007) 012016.
  * (6) I. G. da Paz, P. L. Saldanha, M. C. Nemes, J. G. Peixoto de Faria, New Journal of Phys. 13 (2011) 125005.
  * (7) A. Hansen, J. T. Schultz, N. P. Bigelow, Conference on Coherence and Quantum Optics Rochester, New York, United States, June 17-20, 2013.
  * (8) G. Guzzinati, P. Schattschneider, K. Y. Bliokh, F. Nori, Jo Verbeeck, Phys. Rev. Lett. 110 (2013) 093601.
  * (9) T. C. Petersen, D. M. Paganin, M. Weyland, T. P. Simula, S. A. Eastwood, M. J. Morgan, Phys. Rev. A 88 (2013) 043803.
  * (10) W.P. Schleich, Quantum Optics in Phase Space, Berlin, Wiley-VCH, 2001\.
  * (11) B. E. A. Saleh, M. C. Teich, Fundamentals of Photonics, New York, John Wiley et Sons, 1991.
  * (12) I. Bialynicki-Birula, Acta Phys. Polonica B. 29 (1998) 3569.
  * (13) A.F.R.T. Piza, Mecânica Quântica, São Paulo, Edusp, 2003.
  * (14) S. Fengn, H.G. Winful, Opt. Lett. 26 (2001) 485.
  * (15) P.R. Berman, Atom Interferometry, San Diego, Academic Press, 1997.
  * (16) Y. Qiu, H. Guo, Z. Chen, Optics Communications 245 (2005) 21.
  * (17) J.-F. Riou, W. Guerin, Y. L. Coq, M. Fauquembergue, V. Josse, P. Bouyer, A. Aspect, Phys. Rev. Lett. 96 (2006) 070404; F. Impens, Phys. Rev. A 77 (2008) 013619.


11institutetext: NYU Multimedia and Visual Computing Lab
NYU Tandon School of Engineering, New York University, USA
New York University Abu Dhabi, UAE
NYU Langone Health, USA

# Understanding the Impact of Image Quality and Distance of Objects to Object
Detection Performance

Yu Hao 1122 Haoyang Pei 22 Yixuan Lyu 22 Zhongzheng Yuan 22 John-Ross Rizzo
2244 Yao Wang 22 Yi Fang 112233

###### Abstract

Deep learning has made great strides for object detection in images, with
popular models including Faster R-CNN, YOLO, and SSD. The detection accuracy
and computational cost of object detection depend on the spatial resolution of
an image, which may be constrained by both the camera and storage
considerations. Furthermore, original images are often compressed and uploaded
to a remote server for object detection. Compression is often achieved by
reducing either spatial or amplitude resolution or, at times, both, both of
which have well-known effects on performance. Detection accuracy also depends
on the distance of the object of interest from the camera. Our work examines
the impact of spatial and amplitude resolution, as well as object distance, on
object detection accuracy and computational cost. As existing models are
optimized for uncompressed (or lightly compressed) images over a narrow range
of spatial resolution, we develop a resolution-adaptive variant of YOLOv5 (RA-
YOLO), which varies the number of scales in the feature pyramid and detection
head based on the spatial resolution of the input image. To train and evaluate
this new method, we created a dataset of images with diverse spatial and
amplitude resolutions by combining images from the TJU [1] and Eurocity [2]
datasets and generating different resolutions by applying spatial resizing and
compression. We first show that RA-YOLO achieves a good trade-off between
detection accuracy and inference time over a large range of spatial
resolutions. We then evaluate the impact of spatial and amplitude resolutions
on object detection accuracy using the proposed RA-YOLO model. We demonstrate
that the optimal spatial resolution that leads to the highest detection
accuracy depends on the ’tolerated’ image size (constrained by the available
bandwidth or storage). We further assess the impact of the distance of an
object to the camera on the detection accuracy and show that higher spatial
resolution enables a greater detection range. These results provide important
guidelines for choosing the image spatial resolution and compression settings
predicated on available bandwidth, storage, desired inference time, and/or
desired detection range, in practical applications.

##  1 Introduction

Figure 1: We show three main factors that influence the detection accuracy:
spatial resolution, amplitude resolution and object distance to camera. The
amplitude resolution is controlled by the quantization step size of the image
coder. The original spacial resolution captured by the camera may be decreased
to reduce the file size.

Recently, learning-based data-driven methods have demonstrated great success
in object detection, such as R-CNN [3], YOLO [4] and SSD [5]. In real-world
applications, images are inevitably captured with different spatial
resolutions due to the differences in camera hardware and settings.
Furthermore, the captured images are often compressed and uploaded to remote
servers to speed up the computation. The compression can be achieved by
reducing spatial resolution and/or amplitude resolution (controlled by the
quantization step size). The degree of compression depends on the available
bandwidth. Inference time also plays an important role in real-time object
detection. Although significant efforts have been devoted to improving the
accuracy and speed of object detection, limited work, e.g. [6], explores how
the image quality (controlled by the spatial and amplitude resolution) impacts
object detection accuracy and inference time. Another important factor that
affects the detection accuracy is the distance of the object to the camera.
Close-by objects are easier to detect than far-away objects. In the
literature, object detection accuracy is usually measured by mean accuracy for
all objects regardless of their distances. In practical applications, such as
autonomous driving [7] or navigation for visually impaired persons [8], the
detection range, defined by the maximum distance at which an object can be
reliably detected, may be more relevant. Based on the above observations, in
this paper, as shown in Fig. 1, we aim to conduct studies to comprehensively
evaluate how do image spatial resolution, amplitude resolution, and object
distance impacts detection accuracy, and how these constraints affect
inference time.

One challenge in evaluating the impact of image resolution using existing
object detection models is that they are not designed to operate on images
over a large resolution range, rather separate models are optimized for
different spatial resolutions. A common element among all object detectors is
that it uses a multi-scale feature extractor (e.g. the feature pyramid in
YOLO) to extract features at multiple scales, and detect objects at these
scales using different detectors, and then combine all the detected bounding
boxes using a non-maximum suppression step. This enables the detection of the
same type of object appearing at different sizes, with fine-scale features
facilitating the detection of small objects, and coarse-scale features
enabling the recognition of large objects. Note that the size of an object
(i.e. the bounding box size) depends on the distance of the object to the
camera, as well as the image resolution. The necessary number of scales
depends on the expected image resolution(s). For example, for low-resolution
images (e.g. $640\times 640$), 3 scales may be sufficient (such as the widely
used pre-trained YOLO model [9]; whereas for high-resolution images (e.g.
$2560\times 2560$), 5 scales is necessary, in order to detect objects that
appear from very small to very large in size (such as the pre-trained model in
[10]). Although the 5-scale model will also work well for low-resolution
images, it forces unnecessary computation and extends inference time.
Furthermore, in practice, it may not be efficient to store multiple models and
switch them based on the input resolution.

Figure 2: Comparison between current typical object detection methods and our
proposed resolution adaptive model.

In this paper, we first present a resolution-adaptive variant of the YOLOv5
architecture (called RA-YOLO), which varies the number of scales in the
feature pyramid based on the spatial resolution of the input image, as shown
in Fig. 2. RA-YOLO contains five scales, however being mindful of inference
time, some of the coarser scales can be dropped for lower-resolution images.
For images at higher spatial resolutions, RA-YOLO utilizes all the scales. For
images at lower resolutions, RA-YOLO drops the last one or two scales to seek
a balance between detection accuracy and computational complexity. To improve
the robustness of the model to the quantization artifact due to compression,
we further refine the model by including training samples with varying
amplitude resolutions. We then present evaluation results using RA-YOLO on
images with different spatial and amplitude resolutions. Our contribution is
summarized as follows:

  * •

We present a resolution-adaptive variant of the YOLOv5 model (RA-YOLO) that is
designed to handle images of varying resolutions over a large range. It adapts
the number of feature scales and detection heads based on the image resolution
to achieve a good trade-off between detection accuracy and computational
complexity.

  * •

We conduct a comprehensive study to evaluate the impact of the image quality
(spatial resolution and amplitude resolution) on detection accuracy. We find
that the detection accuracy decreases significantly when the spatial
resolution reduces, as expected. Surprisingly, the detection accuracy is
robust with respect to the amplitude resolution, until the amplitude
resolution drops very low. We further show how to select the spatial
resolution to maximize the detection accuracy for a given constraint on image
file size.

  * •

We also evaluate the impact of the object distance on detection accuracy and
show how that higher spatial resolution enables a longer detection range for
pedestrians.

  * •

We investigate the trade-off between detection accuracy and inference speed
under different image resolutions and the number of scales in the detector.

  * •

We contribute a new dataset that contains images compressed to different
spatial and amplitude resolutions using the BPG codec. This dataset utilizes
lightly compressed images from the TJU [1], Eurocity [2], and BDD [11]
datasets. The link to the dataset will be published alongside the paper.

##  2 Resolution-Adaptive YOLO

###  2.1 Related Work in Deep Learning for Object Detection

A great number of successful deep learning models such as YOLO [4], SSD [5]
and Fast R-CNN [12] have been developed to advance object detection. These
pioneering works introduced a standard machine learning framework for object
detection, which contains two basic modules: Feature Extractor and Detection
Head, as shown in Fig. 2. The Feature Extractor module is often implemented
with multiple groups of convolution layers, between which the feature maps are
down-sampled, to extract feature representation at multiple scales. The
Detection Head module is usually implemented with a few convolution layers or
multiple layer perception (MLP) to predict the location (e.g. the object
bounding box) of visual instances present in the image. Multiple detection
heads are typically used, each acting on the feature representation at one
scale. The bounding boxes detected at different scales are finally merged
using a non-maximal suppression step. A deep object detection model is often
defined with two levels of parameters: the network hyper-parameter and network
parameters. The network hyper-parameter, also referred as meta-architecture,
defines the neural network architecture by specifying the number of network
layers and the number of hidden neural nodes in each layer. The network
parameters define the weights of neurons in the neural network. Many works
(e.g., [13][12][14]) have modified the standard pipeline with additional
modules for better performance of object detection in different applications.
Those works usually develop an advanced meta-architecture of deep neural
networks whose neurons weights are often well-trained using large-scale
datasets. After training, the detection model is deployed to test datasets
without additional network hyper-parameter and parameters adjustments.
However, existing detection models are not designed to operate on images over
a large range of image resolutions, rather separate models are optimized for
different spatial resolutions. The input images of varying resolutions are
typically resized to the expected input size for the adopted model. In
practice, it may not be efficient to store multiple models and switch them
based on the input resolution. Further downsampling a high-resolution image to
an expected low-resolution representation can remove the high-frequency
details necessary to detect small objects and consequently reduce the
detection accuracy.

###  2.2 The Proposed RA-YOLO Model

To overcome the above challenges, we have developed a resolution-adaptive
variant of the YOLOv5 architecture (called RA-YOLO), which adaptively chooses
the most effective meta-architecture of the detection network by varying the
number of scales in the feature pyramid and consequently in the detection head
based on the input image spatial resolution, as shown in Fig. 2. RA-YOLO is
designed based on the observation that the apparent size (in terms of the size
of the bounding box) of an object at a fixed distance to the camera is
proportional to the image resolution. For images at the higher spatial
resolution, RA-YOLO utilizes more scales (corresponding to a deeper feature
extractor and more detection heads) in order to detect objects that may appear
from very small to very big. For images at the lower resolution, RA-YOLO
utilizes a shallow feature extractor and fewer detection heads to seek a
balance between detection accuracy and computational complexity. Moreover, the
model operates on the input image directly without resizing, which avoids
information loss due to down-sampling. To improve the robustness of the model
to the quantization artifact due to compression, we further refine the model
by including training samples with varying amplitude resolutions.

Figure 3: The RA-YOLO model architecture under different numbers of scales.

Implementation of RA-YOLO: We adopt the representative single-stage YOLO model
[15] as our meta-framework for object detection since it has the advantage of
being faster than two-stage networks and still maintains promising accuracy.
The proposed RA-YOLO is shown in Fig. 3. The left-most column is the same as a
YOLO model with 5 scales. Given an input image, YOLO first generates multiple
feature maps at different scales using a DarkNet backbone. The Feature Pyramid
Network is utilized as the neck for feature aggregation at different scales.
The aggregated features at each scale are then sent to a detection head to
extract candidate bounding boxes and furthermore determine whether each
candidate box contains an object and predicts the confidence score (or
probability) for each possible object category. The non-maximum suppression
method is finally applied to the output from all detection heads, to select
the bounding box with the highest confidence score for an object category
among overlapping candidates. The final output of the model includes detected
bounding boxes, detected object category, and detection confidence.

With RA-YOLO, if the input image height $H$ is higher than a preset threshold
(e.g. $H>H_{5}$ lines), the model will use all the 5 scales as illustrated in
the left column of Fig.3. If the input resolution is intermediate (e.g.
$H_{4}\leq H\leq H_{5}$), the model will skip the lowest scale (scale 5) as
illustrated in the middle column. Here we replace the “concatenate” block in
scale 4 with a “tile’ block, which duplicates the features from scale 4.
Finally, if the input resolution is low (e.q. $H<H_{4}$), the model will
further skip scale 4. We train the model using images with various resolutions
and adapt the number of scales as indicated above for each training image. We
use a batch size of 1 to accommodate varying image sizes per training sample.
If a batch sample has low resolution, only the model weights for the top 3
scales are updated. On the other hand, if a batch sample has a high
resolution, the model weights for all scales are updated. We use the same loss
function as the original YOLO model, which includes the loss for bounding box
coordinates and dimensions, the loss for the confidence of the object in the
bounding box, and the classification loss for the detected objects [9].

##  3 Experiments

###  3.1 Model Setting and Running Environment

For a fair comparison, we test our RA-YOLO model and all baseline models in a
machine with an RTX 8000 GPU. For RA-YOLO, we set $H_{4}=810$ and
$H_{5}=1620$. That is, we consider three levels of resolution: low resolution
(image height less than 810), middle resolution (image height between 810 and
1620), and high resolution (image height more than 1620). We use DarkNet [15]
as backbone and PANet [16] as neck for the feature extractor. For determining
the size of anchor boxes, we apply the autoanchor method to calculate the
optimal anchor size for each scale based on the original image resolution.

###  3.2 Image Compression

As shown in Fig. 1, images can be compressed by reducing the spatial
resolution and/or amplitude resolution. Given a particular spatial resolution,
the amplitude resolution is controlled by the quantization step size of the
image coder. We choose to use the BPG codec [17], which implements the HEVC
intraframe coding method and has the leading coding efficiency among all
standard codecs, significantly better than the more popular JPEG and JPEG2000
standards. It performs orthogonal transforms over variable-size blocks to
exploit the correlation among adjacent pixels and then applies quantization on
resulting transform coefficients. A larger quantization parameter (QP) leads
to smaller file sizes but more noticeable quantization artifacts.

Table 1: Dataset Summary Dataset | Spatial Resolution |  Amplitude Resolution
---|---|---
TJU Original | 2000P-4000P |  QP=[0-51]
TJU Down2 | 1000P - 2000P |  QP=[0-51]
TJU Down4 | 500P - 1000P |  QP=[0-51]
EuroCity Original | 1920$\times$1024 |  QP=[0-51]
EuroCity Down1.42 | 1350$\times$720 |  QP=[0-51]
BDD | 1280$\times$720 |  Original data are compressed at around 0.648 bits/pixel

###  3.3 Dataset Preparation

Standard benchmarks such as Imagenet [18] and COCO [19] have been well used in
recent years for the object detection task. However, these mainstream
benchmark datasets only consist of low-resolution images. Thus, we evaluate
our proposed model on 3 object detection datasets with high, middle and low
resolution: TJU [1], EuroCity[2] and BDD[11]. We choose two overlapping and
representative categories (pedestrian, rider) in the three datasets as our
object categories. A summary of all datasets is shown in Table.1. Note that
the rider category was annotated differently across the datasets. In TJU, the
rider box includes both the person and the bicycle or motorcycle; whereas in
EuroCity and BDD, the rider box only covers the person. Such inconsistency
leads to lower detection performance for “rider” than for “pedestrian”. The
detection accuracy reported in this section is the mean average precision
(mAP) over both categories. The AP for “pedestrian” is much higher.

TJU: The dataset contains 115,354 high-resolution images (90% images have a
resolution over 2000×2000 pixels) and 709,330 labeled objects in total with a
large variance in size and appearance.

EuroCity: The dataset contains a large number of middle-resolution images
(1920×1024 pixels) in urban traffic scenes. The images for this dataset were
collected on-board a moving vehicle in 31 cities of 12 European countries with
over 238,200 person instances manually labeled in over 47,300 images. This
dataset also has the object distance annotation.

BDD: BDD is a road scene benchmark consisting of 7,000 low-resolution images
(1280x720) for training and 1,000 images for validation. The dataset possesses
geographic, environmental, and weather diversity. For a fair comparison, we
only use daylight images. The images in this dataset are already compressed
with an average bit rate of 0.647 bits/pixel, with noticeable but not severe
compression artifacts.

Figure 4: Data preparation for training and testing. First, all data from TJU
and EuroCity datasets are converted to other spatial resolutions to have a
wide range of spatial resolutions from 720P to 4000P. Data are then compressed
by the BPG encoder to alter their amplitude resolution.

Generation of a Dataset with Mixed Spatial and Amplitude Resolutions: In
addition to the original images from the TJU and EuroCity datasets, we
downsampled the EuroCity and TJU images using FFmpeg[20] with the ‘bicubic’
filter. We utilized the BPG (Better Portable Graphics) codec [17] to compress
and decompress the TJU and Eurocity datasets under different resolutions. The
BDD data were compressed already at an average bpp of 0.647. This process is
illustrated in Fig.4. Figure 6 provide sample images with different spatial
and amplitude resolutions. We used subsets of this dataset for different
studies reported in the remainder of this section.

###  3.4 Evaluation Metric

For evaluation of object detection performance, we use mean Average Precision
(mAP) which is computed using the area under the precision-recall curve with a
range of confidence thresholds, and a fixed threshold on the intersection of
union (IOU) of 0.5 between the detected boxes and the ground truth boxes.

Table 2:  Speed/accuracy trade-offs under different spatial resolutions and
number of scales. mAP in%, inference time in ms, FLOP in Giga Flops.

| YOLO(3) | YOLO(4) | YOLO(5) | RA-YOLO
---|---|---|---|---
Resolution | mAP | Time | FLOP | mAP | Time | FLOP | mAP | Time | FLOP | mAP | Time | FLOP
Low(BDD) | 45.7 | 8.5 | 37.1 | 47.9 | 10.7 | 37.9 | 48.5 | 12.1 | 39.5 | 48.0 | 8.8 | 36.8
Mid(EuroCity) | 72.7 | 17.8 | 75.0 | 74.4 | 19.2 | 76.7 | 75.2 | 22.5 | 84.2 | 74.9 | 19.1 | 76.4
High(TJU) | 74.9 | 71.3 | 423.1 | 76.7 | 75.8 | 432.5 | 77.5 | 81.0 | 450.3 | 77.7 | 80.6 | 450.3
Average | 64.4 | 32.5 | 178.4 | 66.3 | 35.5 | 182.4 | 67.0 | 38.4 | 191.3 | 66.9 | 36.1 | 187.9

###  3.5 Speed vs. Accuracy Trade-Offs Under Different Image Resolution and
Network Scales

Experimental Setting: In this section, we study the speed/accuracy trade-offs
of our RA-YOLO model as well as baseline models using different numbers of
network scales under different spatial resolution levels. We prepare training
and testing samples by sampling the images from the datasets of TJU Original,
EuroCity Original, EuroCity Down1.42, and BDD as listed in Table 1. For the
high-resolution images, we collect images from the TJU dataset with resolution
higher than 2000 lines. We randomly select 22K images, with 20k images used
for model training and 2K used for testing. The medium-resolution images are
chosen from the EuroCity dataset, with original resolution of 1920x1024. We
select 700 images from each city in the Eurocity training set as training data
and 74 images from each city in the Eurocity validation set as testing data.
For the low-resolution images, we sample 700 images from each city in the
training set of EuroCity Down1.42 as training data, and we randomly select 2k
images from the BDD dataset as testing data. All training data collected at
three different resolutions above are then combined to form the final mixed-
resolution data for model training. For testing, we evaluate the model
performance on testing images with different resolutions separately. Note that
for this study, the training and testing data are not compressed (except the
BDD testing data, which are compressed).

Recall that the RA-YOLO model takes an image in its original resolution and
adaptively determines the number of scales in the feature extractor and
detection heads according to the image resolution. We compare the RA-YOLO
model with three baseline models: YOLO(3), YOLO(4), YOLO(5), which are
standard YOLO models with 3, 4, and 5 scales, respectively. For example,
YOLO(5) denotes that the YOLOv5 model that uses 5 scales for the feature
extractor and detection head. Each baseline model is trained using the same
mixed-resolution training set, and uses the original resolution of each image
directly (i.e. without resizing) both during model training and testing.

Results: In Table 2, we compare RA-YOLO with the three baseline models in
terms of detection accuracy (in terms of mAP) and complexity (in terms of
inference time and FLOP count per image) for testing images at different
spatial resolutions. The results in Table 2 show that increasing spatial
resolution can greatly improve the detection accuracy either with a fixed
network scale or adaptive scale. There is a substantial increase in mAP from
the low resolution to the medium resolution. When the resolution changed from
medium to high, there is still significant accuracy gain. We should note that
the low-resolution BDD data was not included in the training set and was
compressed, and hence had far worse accuracy than the other low-resolution
EuroCity Down 1.42 images. However, Fig. 5(a) and Fig. 5(b) show that even
between Eurocity Original and Eurocity Down1.42, or between TJU Down2 and TJU
Down4, there is a large gap in the detection detection accuracy between these
two resolutions.

In addition, the experimental results also show that scale selection is
critical for object detection. Generally, more scales will give more accurate
detection. However, using RA-YOLO, which uses fewer scales for lower
resolution images, we can achieve very similar mAP as always using 5 scales,
but with faster computation speed. As shown in Table 2, for low-resolution
images, our RA-YOLO (which uses 3 scales for this resolution) achieves better
detection accuracy and similar inference time and FLOPs in comparison with
YOLO(3). For the medium-resolution image, RA-YOLO (using 4 scales), achieves a
slightly better accuracy and similar speed and FLOPs compared to YOLO(4).
Finally, for the high-resolution images, the accuracy of RA-YOLO (using 5
scales) is on par with YOLO(5) and has similar inference time and FLOPs. On
average over all three resolutions, using more scales always provides more
accurate detection, but at the expense of computation speed and complexity.
RA-YOLO achieves similar average detection accuracy as YOLO(5) with faster
speed and lower complexity, albeit the reduction in complexity is limited.
Overall, we conclude that the RA-YOLO has a great speed and accuracy trade-off
for images at various spatial resolutions, compared to using the standard YOLO
model with a fixed number of scales.

It is expected that for the same image resolution and using the same number of
scales, the YOLO model and the RA-YOLO should have similar running time and
complexity. It was a bit surprising that RA-YOLO achieves slightly higher
detection accuracy. We suspect this is because the training strategy for RA-
YOLO optimizes the performance for each resolution by using the corresponding
number of scales. For example, YOLO(3) is trained to optimize the average
performance over training images with both low and high resolutions using 3
scales always, so the performance for low-resolution images may be a bit
compromised, so as not to degrade the performance for high-resolution images.
On the other hand, RA-YOLO is trained to optimize the performance over
training images with the number of scales appropriate for their resolutions.
The anchor sizes chosen at each scale with RA-YOLO may also be appropriate for
that scale.

###  3.6 Impact of Spatial and Amplitude Resolution

Experimental Setting: In this section, we first evaluate the detection
accuracy of the RA-YOLO model trained using the uncompressed mixed-resolution
data, described in Sec. 3.5 on compressed testing images in TJU and EuroCity
with different spatial and amplitude resolutions. Because Eurocity images
typically have fewer instances of objects of interest, we randomly choose 1000
images from TJU and 2163 images from EuroCity, to maintain similar number of
object instances from these two datasets in the testing set. In order to
improve the model performance on the low amplitude resolution images, we
further finetuned the RA-YOLO model with 9000 decompressed images evenly
chosen from TJU(Original), EuroCity(Original), Eurocity(Down) training set
with QP from 34 to 51.

(a) mAP@50 vs Image Size for TJU

(b) mAP@50 vs Image Size for EuroCity

(c) mAP@50 vs PSNR for TJU

(d) mAP@50 vs PSNR for EuroCity

Figure 5: Detection accuracy vs (a,b) Image Size and (c,d) PSNR under
different spatial resolutions.

Results: The dash curves in Fig. 5(a) and Fig. 5(b) are results of the model
trained using uncompressed images (original images and downsampled ones). As
expected, the spatial resolution significantly affects the detection accuracy,
with higher resolution typically giving much higher mAP. Somewhat
surprisingly, compression does not reduce the detection accuracy until the
images are reduced by half (corresponding to QP of 24-28 for TJU and 16 for
Eurocity). When QP is further increased, the detection accuracy starts to
gradually drop. This means that our object detector is robust to modest levels
of quantization. When QP exceeds a certain threshold (34 for TJU, 28 for
Eurocity), the quantization artifact makes it harder to recognize the object,
leading to a rapid decrease in the detection performance.

The solid curves show the results using the fine-tuned model with additional
examples with heavy quantization. Overall, such fine-tuning achieves only
slight improvement, roughly 0.01 in mAP. Surprisingly, fine-tuning using
heavily quantized samples (QP from 34 to 51) not only improves detection
accuracy for images at those quantization levels but also lifted the
performance of images at lower quantization levels. We suspect that such
additional training examples helped the trained model to be more robust to not
only quantization noise but also other artifacts such as those due to low
lighting and motion blur. Top two rows in Fig. 6 show sample images and their
detection results under different spatial and amplitude resolutions.

Because PSNR is commonly used to assess the image quality under the same
spatial resolution and is a good quantitative metric to evaluate the
quantization-induced artifacts, Fig. 5(c) and Fig. 5(d) show how does the
detection accuracy correlates with PSNR (or image quality). Here we clearly
see that the mAP saturates after PSNR reaches a relatively high level, but
drops sharply when PSNR decreases below a relatively low level. The particular
thresholds depend on the spatial resolution and scene content. This is an
interesting result as it tells us that one can compress images in amplitude
quite substantially without affecting the detection accuracy, even when the
images themselves have degraded quality.

Importantly, Fig. 5(a) and Fig. 5(b) provide a guideline on how to choose the
spatial resolution for a given constraint on the image file size. It shows
that, above a certain image size constraint, it is better to compress a high-
resolution image, than to use an uncompressed or lightly compressed low-
resolution image. Only when the average file size needs to be below a certain
threshold, we should switch to a lower resolution. For example, for TJU
images, we should downsample the images by a factor of 2 when the network
bandwidth limits the image size to be below 0.1 Megabytes. For EuroCity, even
though the down2 resolution gives similar mAP at a very small image size,
using the down2 resolution can reduce the computation cost without sacrificing
the detection accuracy.

Figure 6: Sample detection results for images under different spatial
resolution, amplitude resolution, and object distance. The first row shows the
effect of reducing the spatial resolution. The second row shows the effect to
reducing the amplitude resolution (by increasing QP). The third row shows the
difficulty when the object is farther away. Dashed yellow arrows show the
objects that were miss-detected, compared to the left image. Dashed blue
arrows show the objects that were misclassified.

###  3.7 Impact of the Object Distance

Experimental Setting: In this section, we evaluate the impact of the object
distance on the detection accuracy under different spatial resolutions.
Because only the EuroCity dataset provides distance information, we perform
this evaluation using only the original images in the EuroCity dataset and
their down-sampled versions. We use the RA-YOLO model refined using compressed
data as discussed in Sec.3.6. Although we do not include compressed images for
the testing, we expect the results to be similar for QP up to 20. The object
distance in EuroCity data covers a wide range from 0m to 80m. We quantize the
distance to 8 bins of 10 m intervals and measure the detection accuracy. For
this evaluation, we associate the predicted box with the ground truth box that
has the highest IOU with the detected box and evaluates the recall of all
ground truth boxes within each distance bin under a chosen confidence
threshold. For a fair comparison between each spatial resolution, the
confidence score is set to 0.36 and 0.23 respectively for the original and
down2 resolution to maintain the same precision of 0.82. Because the “rider”
category does not have sufficient instances in certain distance bins, we only
perform this evaluation on the “pedestrian” category.

Figure 7: (a) Recall vs distance under the precision of 0.82 for Pedestrian;
(b) The detection range to achieve recall of 0.77 and precision of 0.8.

Results: Fig. 7(a) reveals how the recall decreases as the object distance
increase under different spatial resolution using RA-YOLO. Notice that at the
short distance, even the down1.42 images enjoy a descent detection accuracy
for the pedestrian category, much higher than the average detection accuracy
shown in Fig. 5(a) for both pedestrian and rider. As the distance increases,
the recall decreases and the drop is slower for the higher resolution. This is
as expected since the same object in the higher resolution image is rendered
with more pixels or correspondingly higher clarity than that in the lower
resolution. Fig. 6 presents example object detection results under different
object distances in the third row. In this example, a person that is 63.8m
away was detected successfully, even though it was hard to discern with our
naked eye.

For practical applications, we want to know what is the farthest distance at
which an object of interest can be detected reliably. Fig. 7(b) shows the
detection range defined as the farthest distance when the precision is 0.8 and
recall is 0.77. We can see that the original spatial resolution with 1024
lines enables reliable detection up to 40 m while reducing the resolution to
720 lines decreases the range to 10 m only. Therefore high resolution is
critical for applications such as autonomous driving.

##  4 Conclusion

In this paper, we provide a comprehensive study to evaluate how image quality
(in terms of spatial resolution and amplitude resolution) and the distance of
objects in the image affect detection accuracy. Given that existing object
detection models are generally not optimized for images over a large range of
spatial resolutions, we propose a new variant of the YOLOv5 model, which
adaptively selects the most effective meta-architecture (including the number
of feature scales and correspondingly the number of detection heads) according
to the spatial resolution of the input image. We show that this resolution-
adaptive model (RA-YOLO) provides a good trade-off between the detection
accuracy and computational complexity, reaching a similar average AP over a
large range of spatial resolutions as compared to the generic YOLOv5, while
enjoying a faster inference speed. Using RA-YOLO on a mixed resolution dataset
that we created from 3 open datasets of different spatial resolutions, we
evaluated the impact of spatial resolution and compression (affecting the
amplitude resolution) on the detection accuracy. We show that high spatial
resolution is critical for achieving high average detection accuracy over a
large range of object sizes (which is affected by both the physical size of
the object and the distance of the object from the camera). For example, for
the TJU data, the mAP decreased from 77.7% to 58.2%, when we reduced the
original high-resolution images (2000P-4000P) by a factor of 4 (500P-1000P).
However, when the original high-resolution images need to be delivered to a
remote edge server for computing, the images need to be compressed to fit
bandwidth constraints. We demonstrate that the RA-YOLO model is fairly robust
to compression artifacts until the amplitude resolution is significantly
reduced. Further refinement of the model using compressed images will help
boost the detection performance. The optimal spatial resolution that leads to
the highest detection accuracy depends on the desired image size (constrained
by the available bandwidth). We further show that using high-resolution images
can substantially extend the reliable detection range for pedestrians: from
10m using 720P resolution to 40m using 1024P resolution. We expect that
similar results hold for riders, and that using higher resolution images (e.g.
greater than 2000P) can further extend the range. This suggests that using
high-resolution images is critically important for applications that require
reliable detection of objects that are far away, such as autonomous driving or
smart health applications.

## References

  * [1] Pang, Y., Cao, J., Li, Y., Xie, J., Sun, H., Gong, J.:  Tju-dhd: A diverse high-resolution dataset for object detection.  IEEE Transactions on Image Processing 30 (2020) 207–219
  * [2] Braun, M., Krebs, S., Flohr, F., Gavrila, D.M.:  The eurocity persons dataset: A novel benchmark for object detection.  arXiv preprint arXiv:1805.07193 (2018)
  * [3] Girshick, R., Donahue, J., Darrell, T., Malik, J.:  Rich feature hierarchies for accurate object detection and semantic segmentation.  In: Proceedings of the IEEE conference on computer vision and pattern recognition. (2014) 580–587
  * [4] Redmon, J., Divvala, S., Girshick, R., Farhadi, A.:  You only look once: Unified, real-time object detection.  In: Proceedings of the IEEE conference on computer vision and pattern recognition. (2016) 779–788
  * [5] Liu, W., Anguelov, D., Erhan, D., Szegedy, C., Reed, S., Fu, C.Y., Berg, A.C.:  Ssd: Single shot multibox detector.  In: European conference on computer vision, Springer (2016) 21–37
  * [6] Aqqa, M., Mantini, P., Shah, S.K.:  Understanding how video quality affects object detection algorithms.  In: VISIGRAPP (5: VISAPP). (2019) 96–104
  * [7] Zhu, J., Fang, Y.:  Learning object-specific distance from a monocular image.  In: Proceedings of the IEEE/CVF International Conference on Computer Vision. (2019) 3839–3848
  * [8] Li, X., Cui, H., Rizzo, J.R., Wong, E., Fang, Y.:  Cross-safe: A computer vision-based approach to make all intersection-related pedestrian signals accessible for the visually impaired.  In: Science and Information Conference, Springer (2019) 132–146
  * [9] Redmon, J., Divvala, S., Girshick, R., Farhadi, A.:  You only look once: Unified, real-time object detection.  In: Proceedings of the IEEE conference on computer vision and pattern recognition. (2016) 779–788
  * [10] YOLOv5:  Yolov5 model with 5 scales.  https://github.com/ultralytics/yolov5 (2020)
  * [11] Yu, F., Chen, H., Wang, X., Xian, W., Chen, Y., Liu, F., Madhavan, V., Darrell, T.:  Bdd100k: A diverse driving dataset for heterogeneous multitask learning.  In: Proceedings of the IEEE/CVF conference on computer vision and pattern recognition. (2020) 2636–2645
  * [12] Girshick, R.:  Fast r-cnn.  In: Proceedings of the IEEE international conference on computer vision. (2015) 1440–1448
  * [13] He, K., Zhang, X., Ren, S., Sun, J.:  Spatial pyramid pooling in deep convolutional networks for visual recognition.  IEEE transactions on pattern analysis and machine intelligence 37 (2015) 1904–1916
  * [14] Ren, S., He, K., Girshick, R., Sun, J.:  Faster r-cnn: Towards real-time object detection with region proposal networks.  Advances in neural information processing systems 28 (2015) 91–99
  * [15] Redmon, J., Farhadi, A.:  Yolov3: An incremental improvement.  arXiv preprint arXiv:1804.02767 (2018)
  * [16] Liu, S., Qi, L., Qin, H., Shi, J., Jia, J.:  Path aggregation network for instance segmentation.  In: Proceedings of the IEEE conference on computer vision and pattern recognition. (2018) 8759–8768
  * [17] BPG project:  BPG Image format.  https://bellard.org/bpg/ (2018)
  * [18] Deng, J., Dong, W., Socher, R., Li, L.J., Li, K., Fei-Fei, L.:  Imagenet: A large-scale hierarchical image database.  In: 2009 IEEE conference on computer vision and pattern recognition, Ieee (2009) 248–255
  * [19] Lin, T.Y., Maire, M., Belongie, S., Hays, J., Perona, P., Ramanan, D., Dollár, P., Zitnick, C.L.:  Microsoft coco: Common objects in context.  In: European conference on computer vision, Springer (2014) 740–755
  * [20] FFmpeg project:  FFmpeg.  https://ffmpeg.org/ (2013)