# Introduction

Albert Einstein famously commented, "What really interests me is whether God had any choice in the creation of the world" . Within the context of local Lagrangian field theory the answer seems to be that powerful restrictions exist but some freedom still remains regarding the choice of dynamical variables and symmetries. By far the greatest restriction is the obstacle to including higher time derivatives which is implied by Ostrogradsky's construction of a canonical formalism for nondegenerate higher derivative Lagrangians .

Mikhail Vasilevich Ostrogradsky lived from 1801 to 1862. He was born to a poor family of Ukrainian ethnicity in Pashennaya, which is now in Ukraine but was at that time part of the vast Russian Empire. These were momentous years for Russia, bracketed by its rise to become the predominant military power during the Napoleonic Wars, and its humiliating collapse before Britain and France during the Crimean War. Russian society was riven by the struggle between the forces of reaction and reform. Indeed, Ostrogradsky was denied his doctorate at the University of Kharkov because the mathematics professor who had examined him was considered insufficiently religious. Later on, Ostrogradsky was placed under police surveillance at the start of his career in the Imperial Russian capital of St. Petersburg .

Ostrogradsky studied and worked in Paris from 1822 through 1827. He knew the leading French mathematicians of the time, including Cauchy, who paid off his debts and secured him a teaching job. In 1826 Ostrogradsky stated and proved the divergence theorem, which was later re-discovered by Gauss in the 1830's. Ostrogradsky paid a much shorter visit to Paris in 1830. However, most of his professional life was spent in St. Petersburg where he was elected to the Imperial Academy of Sciences and played an important role in the teaching of mathematical sciences. Ostrogradsky wrote in French and Russian .

Ostrogradsky's higher derivative generalization of Hamilton's construction was published in 1850 . Ostrogradsky's construction implies that there is a linear instability in the Hamiltonians associated with Lagrangians which depend upon more than one time derivative in such a way that the higher derivatives cannot be eliminated by partial integration. This is probably why Newton was right to assume the laws of physics take the form of second differential equations when expressed in terms of fundamental dynamical variables.

It might seem curious that Ostrogradsky did not appreciate the importance of his construction to fundamental theory. However, one must recall that the researchers of his time were just beginning to make the connection between energy functionals and the concept of stability — which in those days meant the absence of growing perturbations. The notion of quantum fluctuations exploring all perturbations was decades away, and the key insight that all dynamics is described by interacting continuum field theories was even further in the future.

Section presents Ostrogradsky's construction in the context of point particle whose position is $x(t)$. Section 3 discusses the consequences of this result for fundamental theory. Sections 4 and 5 deal with quantization and degeneracy, respectively. Section 6 contains some concluding remarks.

# The Construction of Ostrogradsky

This section presents Ostrogradsky's construction. First, the usual case of a first derivative Lagrangian is reviewed to fix concepts and notation. Then the case of second derivatives is presented. The section closes with a review of the general case of $N$ time derivatives.

## Hamilton's Construction

In the usual case of $L = L(x,\dot{x})$, the Euler-Lagrange equation is, $$\frac{\partial L}{\partial x} - \frac{d}{dt} \frac{\partial L}{\partial
\dot{x}} = 0 \; . \label{ELE1}$$ The assumption that $\frac{\partial^2 L}{\partial \dot{x}^2} \neq 0$ is known as *nondegeneracy*. If the Lagrangian is nondegenerate one can write () in the form Newton assumed so long ago for the laws of physics, $$\ddot{x} = \mathcal{F}(x,\dot{x}) \qquad \Longrightarrow \qquad x(t) =
\mathcal{X}(t,x_0,\dot{x}_0) \; . \label{newt}$$ From this form it is apparent that solutions depend upon two pieces of initial value data: $x_0 = x(0)$ and $\dot{x}_0 = \dot{x}(0)$.

The fact that solutions require two pieces of initial value data means that there must be two canonical coordinates, $X$ and $P$. They are traditionally taken to be, $$X \equiv x \qquad {\rm and} \qquad P \equiv \frac{\partial L}{\partial \dot{x}}
\; . \label{ctrans}$$ The assumption of nondegeneracy implies one can invert the phase space transformation () to solve for $\dot{x}$ in terms of $X$ and $P$. That is, there exists a velocity $V(X,P)$ such that, $$\frac{\partial L}{\partial \dot{x}} \Biggl\vert_{x = X \atop \dot{x} = V}
= P \; . \label{invct}$$

The canonical Hamiltonian is obtained by Legendre transforming on $\dot{x}$, $$\begin{aligned}
H(X,P) & \equiv & P \dot{x} - L \; , \\
& = & P V(X,P) - L\Bigl(X,V(X,P)\Bigr) \; .
\end{aligned}$$ It is easy to check that the canonical evolution equations reproduce the inverse phase space transformation () and the Euler-Lagrange equation (), $$\begin{aligned}
\dot{X} & \equiv & \frac{\partial H}{\partial P} = V + P \frac{\partial V}{
\partial P} - \frac{\partial L}{\partial \dot{x}} \frac{\partial V}{\partial P}
= V \; , \\
\dot{P} & \equiv & -\frac{\partial H}{\partial X} = -P \frac{\partial V}{
\partial X} + \frac{\partial L}{\partial x} + \frac{\partial L}{\partial
\dot{x}} \frac{\partial V}{\partial X} = \frac{\partial L}{\partial x} \; .
\end{aligned}$$ This is the meaning of the statement, *the Hamiltonian generates time evolution.* When the Lagrangian has no explicit time dependence, $H$ is also the associated conserved quantity. Hence it possesses the key properties physicists want for the energy, and is unique up to canonical transformations.

A familiar example is the simple harmonic oscillator of mass $m$ and frequency $\omega$ whose Lagrangian is, $$L = \frac12 m \dot{x}^2 - \frac12 m \omega^2 x^2 \; . \label{SHO}$$ The equation of motion and its general solution are, $$\ddot{x}(t) = -\omega^2 x(t) \qquad \Longrightarrow \qquad x(t) = x_0
\cos(\omega t) + \frac{ \dot{x}_0}{\omega} \sin(\omega t) \; .
\label{freesol}$$ The canonical variables for this system are, $$X = x \qquad {\rm and} \qquad P = m \dot{x} \qquad \Longrightarrow \qquad
V(X,P) = \frac{P}{m} \; .$$ And the Hamiltonian is, $$H = \frac{P^2}{2 m} + \frac12 m \omega^2 X^2 \; .$$ Because it is quadratic in both $X$ and $P$, the Hamiltonian $H(X,P)$ is bounded below by zero.

## Ostrogradsky's Construction for Two Derivatives

Now consider a system whose Lagrangian $L(x,\dot{x},\ddot{x})$ depends nondegenerately upon $\ddot{x}$. The Euler-Lagrange equation is, $$\frac{\partial L}{\partial x} - \frac{d}{dt} \frac{\partial L}{\partial
\dot{x}} + \frac{d^2}{dt^2} \frac{\partial L}{\partial \ddot{x}} = 0 \; .
\label{ELE2}$$ Now nondegeneracy means $\frac{\partial^2 L}{\partial \ddot{x}^2} \neq 0$, which implies that the Euler-Lagrange equation () can be cast in a form radically different from Newton's, $$\ddddot{x} = \mathcal{F}(x,\dot{x},\ddot{x},\dddot{x}) \qquad
\Longrightarrow \qquad x(t) = \mathcal{X}(t,x_0,\dot{x}_0,\ddot{x}_0,
\dddot{x}_0) \; .$$

Because solutions now depend upon four pieces of initial value data there must be four canonical coordinates. Ostrogradsky's choices for these are, $$\begin{aligned}
X_1 \equiv x \qquad & , & \qquad P_1 \equiv \frac{\partial L}{\partial \dot{x}}
- \frac{d}{dt} \frac{\partial L}{\partial \ddot{x}} \; , \label{ct1} \\
X_2 \equiv \dot{x} \qquad & , & \qquad P_2 \equiv \frac{\partial L}{\partial
\ddot{x}} \; . \label{ct2}
\end{aligned}$$ The assumption of nondegeneracy implies one can invert the phase space transformation (-) to solve for $\ddot{x}$ in terms of $X_1$, $X_2$ and $P_2$. That is, there exists an acceleration $A(X_1,X_2,P_2)$ such that, $$\frac{\partial L}{\partial \ddot{x}} \Biggl\vert_{{x = X_1 \atop \dot{x} =
X_2} \atop \ddot{x} = A} = P_2 \; . \label{invct2}$$ Note that the acceleration $A(X_1,X_2,P_2)$ does nor depend upon $P_1$. The momentum $P_1$ is only needed for the third time derivative.

Ostrogradsky's Hamiltonian is obtained by Legendre transforming on $\dot{x} = x^{(1)}$ and $\ddot{x} = x^{(2)}$, $$\begin{aligned}
\lefteqn{H(X_1,X_2,P_1,P_2) \equiv \sum_{i=1}^2 P_i x^{(i)} - L \; , } \\
& & = P_1 X_2 + P_2 A(X_1,X_2,P_2) - L\Bigl(X_1,X_2,A(X_1,X_2,P_2)\Bigr) \; .
\label{Host}
\end{aligned}$$ The time evolution equations are those suggested by the notation, $$\dot{X_i} \equiv \frac{\partial H}{\partial P_i} \qquad {\rm and} \qquad
\dot{P}_i \equiv - \frac{\partial H}{\partial X_i} \; .$$ To check that they generate time evolution, note first that the evolution equation for $X_1$ is, $$\dot{X}_1 = \frac{\partial H}{\partial P_1} = X_2 \; .$$ Of course this reproduces the phase space transformation $\dot{x} = X_2$ in (). The evolution equation for $X_2$ similarly reproduces (), $$\dot{X}_2 = \frac{\partial H}{\partial P_2} = A + P_2 \frac{\partial A}{
\partial P_2} - \frac{\partial L}{\partial \ddot{x}} \frac{\partial A}{\partial
P_2} = A \; .$$ The phase space transformation $P_1 = \frac{\partial L}{\partial
\dot{x}} - \frac{d}{dt} \frac{\partial L}{\partial \ddot{x}}$ () comes from the evolution equation for $P_2$, $$\dot{P}_2 = -\frac{\partial H}{\partial X_2} = -P_1 - P_2 \frac{\partial A}{
\partial X_2} + \frac{\partial L}{\partial \dot{x}} + \frac{\partial L}{
\partial \ddot{x}} \frac{\partial A}{\partial X_2} = -P_1 + \frac{\partial L}{
\partial \dot{x}} \; .$$ And the Euler-Lagrange equation () follows from the evolution equation for $P_1$, $$\dot{P}_1 = -\frac{\partial H}{\partial X_1} = -P_2 \frac{\partial A}{\partial
X_1} + \frac{\partial L}{\partial x} + \frac{\partial L}{\partial \ddot{x}}
\frac{\partial A}{\partial X_1} = \frac{\partial L}{\partial x} \; .$$ Hence Ostrogradsky's Hamiltonian generates time evolution. When the Lagrangian contains no explicit dependence upon time it is also the conserved Noether current. It is therefore the energy, again up to canonical transformation.

Ostrogradsky's Hamiltonian () is linear in the canonical momentum $P_1$, which means that no system of this form can be stable. In fact, there is not even any barrier to decay. Note the power and generality of the result: it applies to every Lagrangian $L(x,\dot{x},\ddot{x})$ which depends nondegenerately upon $\ddot{x}$, independent of the details. The only assumption is nondegeneracy, and that simply means one cannot eliminate $\ddot{x}$ by partial integration.

It is useful to consider a higher derivative example which depends upon a dimensionless parameter $\epsilon$ that quantifies its deviation from the simple harmonic oscillator (), $$L = -\frac{\epsilon m}{2 \omega^2} \ddot{x}^2 + \frac{m}2 \dot{x}^2
- \frac{m\omega^2}2 x^2 \; . \label{HDO}$$ The Euler-Lagrange equation and its general solution are, $$\begin{aligned}
0 & = & -m \Bigl[ \frac{\epsilon}{\omega^2} \ddddot{x} + \ddot{x} +
\omega^2 x\Bigr] \; , \label{HDE} \\
x(t) & = & C_+ \cos(k_+ t) + S_+ \sin(k_+ t) + C_- \cos(k_- t) + S_-
\sin(k_- t) \; . \label{gensol} \qquad
\end{aligned}$$ Here the two frequencies are, $$k_{\pm} \equiv \omega \sqrt{ \frac{1 \mp \sqrt{1 \!-\! 4 \epsilon}}{2
\epsilon} } \; , \label{kpm}$$ and the constants $C_{\pm}$ and $S_{\pm}$ are functions of the initial value data, $$\begin{aligned}
C_+ = \frac{k_-^2 x_0 \!+\! \ddot{x}_0}{k_-^2 \!-\! k_+^2} \qquad & , & \qquad
S_+ = \frac{k_-^2 \dot{x}_0 \!+\! \dddot{x}_0}{k_+ (k_-^2 \!-\! k_+^2)} \; , \\
C_- = \frac{k_+^2 x_0 \!+\! \ddot{x}_0}{k_+^2 \!-\! k_-^2} \qquad & , & \qquad
S_- = \frac{k_+^2 \dot{x}_0 \!+\! \dddot{x}_0}{k_- (k_+^2 \!-\! k_-^2)} \; .
\end{aligned}$$ For this model Ostrogradsky's two conjugate momenta (-) are, $$\begin{aligned}
P_1 = m \dot{x} + \frac{\epsilon m}{\omega^2} \dddot{x} \qquad & \Leftrightarrow &
\qquad \dddot{x} = \frac{\omega^2 P_1 \!-\! m \omega^2 X_2}{\epsilon m} \; , \\
P_2 = - \frac{\epsilon m}{\omega^2} \ddot{x} \qquad & \Leftrightarrow &
\qquad \ddot{x} \equiv A = -\frac{\omega^2 P_2}{\epsilon m} \; .
\end{aligned}$$ The Hamiltonian can be expressed alternatively in terms of canonical variables, configuration space variables, or the constants $C_{\pm}$ and $S_{\pm}$, $$\begin{aligned}
H & = & P_1 X_2 - \frac{\omega^2}{2 \epsilon m} P_2^2 - \frac{m}2 X_2^2 +
\frac{m\omega^2}2 X_1^2 \; , \label{H1} \\
& = & \frac{\epsilon m}{\omega^2} \dot{x} \dddot{x} - \frac{\epsilon m}{2 \omega^2}
\ddot{x}^2 + \frac{m}2 \dot{x}^2 + \frac{m \omega^2}2 x^2 \; , \label{H2} \\
& = & \frac{m}2 \sqrt{1 \!-\! 4 \epsilon} \, k_+^2 (C_+^2 \!+\! S_+^2) -
\frac{m}2 \sqrt{1 \!-\! 4 \epsilon} \, k_-^2 (C_-^2 \!+\! S_-^2) \; . \label{H3}
\end{aligned}$$ The last form () makes it clear that the $+$ modes carry positive energy and the $-$ modes carry negative energy.

## Ostrogradsky's Construction for $N$ Derivatives

Consider a Lagrangian $L\left(x,\dot{x},\dots,x^{(N)}\right)$ which depends upon the first $N$ derivatives of $x(t)$. If this Lagrangian depends nondegenerately upon the $N$-th derivative $x^{(N)}$ then the Euler-Lagrange equation is linear in the $2N$-th derivative $x^{(2N)}$, $$\sum_{i=0}^N \left(-{d \over dt}\right)^i {\partial L \over \partial x^{(i)}}
= 0 \; . \label{ELEN}$$ The canonical phase space must therefore possess $2N$ coordinates which Ostrogradsky chooses to be, $$X_i \equiv x^{(i-1)} \qquad {\rm and} \qquad P_i \equiv \sum_{j=i}^N \Bigl(-
\frac{d}{dt}\Bigr)^{j-i} \frac{\partial L}{\partial x^{(j)}} \; . \label{Ncts}$$ Nondegeneracy means one can solve for $x^{(N)}$ in terms of $P_N$ and the $X_i$'s. That is, there exists a function $\mathcal{A}(X_1,\ldots,X_N,P_N)$ such that, $$\frac{\partial L}{\partial q^{(N)}} \Biggl\vert_{x^{(i-1)} = X_i \atop
x^{(N)} = \mathcal{A}} = P_N \; . \label{nondeg}$$

For general $N$ Ostrogradsky's Hamiltonian takes the form, $$\begin{aligned}
H & \equiv & \sum_{i=1}^N P_i x^{(i)} - L \; , \\
& = & P_1 X_2 + P_2 X_3 + \cdots + P_{N-1} X_N + P_N \mathcal{A} -
L\Bigl(X_1,\ldots,X_N,\mathcal{A}\Bigr) \; . \label{HN}
\end{aligned}$$ The evolution equations are, $$\dot{X}_i \equiv \frac{\partial H}{\partial P_i} \qquad {\rm and} \qquad
\dot{P}_i \equiv -\frac{\partial H}{\partial X_i} \; .$$ It is simple to check that these evolution equations reproduce the canonical relations () and the Euler-Lagrange equation (). The first $(N-1)$ equations for $X_i$ verify the definition of $X_{i+1}$, $$i=1,\dots,(N-1) \qquad \Longrightarrow \qquad \dot{X}_i = X_{i+1} \; .$$ The evolution equation for $X_N$ is similar, $$\dot{X}_N = \mathcal{A} + P_N \frac{\partial \mathcal{A}}{\partial P_N}
- \frac{\partial L}{\partial x^{(N)}} \frac{\partial \mathcal{A}}{
\partial P_N} = \mathcal{A} \; .$$ The last $(N-1)$ equations for $P_i$ reproduce the definition of $P_{i-1}$, $$\begin{aligned}
i=2,\dots,N \quad \Longrightarrow \quad \dot{P}_i & = & -P_{i-1} - P_N
\frac{\partial \mathcal{A}}{\partial X_i} + \frac{\partial L}{\partial
x^{(i-1)}} + \frac{\partial L}{\partial x^{(N)}} \frac{\partial
\mathcal{A}}{\partial X_i} \; , \qquad \\
& = & -P_{i-1} + \frac{\partial L}{\partial x^{(i-1)}} \; .
\end{aligned}$$ And the evolution equation for $P_1$ gives the Euler-Lagrange eqaution (), $$\dot{P}_1 = -P_N \frac{\partial \mathcal{A}}{\partial X_1} +
\frac{\partial L}{\partial x} + \frac{\partial L}{\partial x^{(N)}}
\frac{\partial \mathcal{A}}{\partial X_1} =
\frac{\partial L}{\partial x} \; .$$ Hence () generates time evolution. It is also the Noether current for the case where the Lagrangian contains no explicit time dependence. The Hamiltonian () is therefore what any physicist would call the energy, up to canonical transformation.

The Hamiltonian () is linear in $P_1, P_2, \ldots P_{N-1}$. Only with respect to $P_N$ might it be bounded from below. For large $N$ the fraction of linear directions approaches $\frac12$, so adding more higher derivatives makes the instability worse rather than better.

# Nature of the Instability

Ostrogradsky's result implies that the Hamiltonian of a nondegenerate higher derivative theory is unbounded below, and also above. This section discusses the manner in which the instability manifests, and what it implies for fundamental theory. Six short subsections make the points:

1.  The Ostrogradskian instability drives the dynamical variable to a special kind of time dependence, not a special numerical value.

2.  The same Ostrogradskian dynamical variable carries both positive and negative energy creation and annihilation operators.

3.  If a system which suffers from the Ostrogradskian instability interacts, then the empty state can decay into a collection of positive and negative energy excitations.

4.  If a system which suffers from the Ostrogradskian instability is a continuum field theory, the vast entropy at infinite 3-momentum will make the decay instantaneous.

5.  For interacting systems which suffer from the Ostrogradskian instability, degrees of freedom with large 3-momentum do not decouple from low energy physics.

6.  The imposition of a single, global constraint on the energy functional does not ameliorate the Ostrogradskian instability.

## Kinetic Instability

Physicists are familiar with instabilities of the potential energy. In this case energy is released as the dynamical variable approaches some special value. The Ostrogradskian instability is instead a problem with the kinetic energy, and it manifests by the dynamical variable developing a special time dependence. Checking that the energy is bounded below for constant values of the dynamical variable in no way establishes that a system is free of the Ostrogradskian instability. Consider, for example, the higher derivative oscillator (). Expression () shows that its energy is bounded below by zero for any constant value of $x(t)$. Negative energies are attained by making $\ddot{x}(t)$ large and/or making $\dddot{x}(t)$ large while keeping the combination $\dot{x}(t) \!+\! \frac{\epsilon}{\omega^2}
\dddot{x}(t)$ fixed.

## Double Duty for Dynamical Variables

Physicists are used to resolving linearized dynamical variables into creation and annihilation operators. For the harmonic oscillator solution () this is done by using the Euler relation to identify a lowering operator proportional to $e^{-i\omega t}$ and a raising operator proportional to $e^{i \omega t}$, $$x_0 \cos(\omega t) + \frac{ \dot{x}_0}{\omega} \sin(\omega t) =
\frac12 \Bigl[ x_0 + \frac{i}{\omega} \dot{x}_0\Bigr] e^{-i \omega t}
+ \frac12 \Bigl[ x_0 - \frac{i}{\omega} \dot{x}_0\Bigr] e^{i \omega t}
\; .$$ The usual rule is that each dynamical variable harbors either zero or one set of creation and annihilation operators at linearized order. From expression () one can see that the same higher derivative dynamical variable carries both positive and negative energy creation and annihilation operators. This means that local interactions which involve the dynamical variable necessarily couple the two sectors.

## The Vacuum Can Decay

Now consider an interacting, continuum field theory which possesses the Ostrogradskian instability. In particular consider its likely particle spectrum about some "empty" solution in which the field is constant. Because the Hamiltonian is linear in all but one of the conjugate momenta it is possible to arbitrarily increase or decrease the energy by moving different directions in phase space. Hence there must be both positive energy and negative energy particles — just as there are in the higher derivative oscillator (). As in that point particle model, the same continuum field must carry the creation and annihilation operators of both the positive and the negative energy particles. If the theory is interacting at all — that is, if its Lagrangian contains a higher than quadratic power of the field — then there will be interactions between positive and negative energy particles. Depending upon the interaction, the empty state can decay into some collection of positive and negative energy particles.

## Entropy Drives Vacuum Decay

Recall the reason that excited states of atoms decay in nature. It is certainly not to reduce the energy of the full system — including the interaction with electromagnetism — but rather to redistribute the constant total energy into the largest possible class of states. There is one way for the atom not to decay, compared with an infinite number of ways the atom can decay and emit one or more recoil photons. Note also that explicit computations of the decay time employ vacuum fluctuations of the electromagnetic field to provide the necessary perturbation.

Atomic decays have just the fixed energy difference between the two states to apportion, so they are chiefly driven by the arbitrary directions which can be taken by the decay products. In contrast, the decay of an interacting, nondegenerate higher derivative field theory can involve particles of *any* energy, as long as the total sums to zero. So one should think of the decay rate as having the same sort of angular factors as an atomic decay at some fixed energy, followed by one or more integrals — all the way to infinity — over the magnitudes of the various energies. The volume of phase space is so large that these integrations cause the decay to be instantaneous. Indeed, the only way people derive finite decay rates for particles with a kinetic instability is by cutting off the phase space at some point, in which case the rate is dominated by the cutoff, for example . Such a cutoff might make sense if the kinetic instability appeared in some nonlocal effective field theory, but it has no place in fundamental physics.

Note that the decay does not just happen once. It is even more entropicly favored for there to be two decays, and better yet for more. In fact the system instantly evaporates into a maelstrom of positive and negative energy particles. Whether or not such a state has a proper mathematical representation, it certainly does not describe the universe of human experience in which all particles have positive energy and empty space remains empty.

Note also that this conclusion only follows if the higher derivative theory possesses both interactions and continuum particles. The point particle oscillator () has no interactions, so its negative energy degree of freedom is unobservable. However, it is conceivable that this higher derivative oscillator could be coupled to a discrete system without engendering any instability. The feature which drives explosive vacuum decay is the vast entropy of phase space. Without that it becomes an open question whether or not there is anything wrong with a higher derivative theory. Of course the physical universe seems to be described by continuum field theory down to at least $2.8 \times
10^{-19}$ meters , and any observable degree of freedom must interact, or else it could not be observed, so these seem to be safe assumptions.

## Large $\Vert \vec{k}\Vert$ Modes Do Not Decouple

Physicists are used to ignoring very high energy modes, except for renormalizations of low energy parameters. This procedure is quite correct for positive energy modes in a stable theory because exciting a mode requires energy which must be drawn from de-exciting other modes, and any given state only has some fixed amount of energy. However, that justification fails for a theory which suffers from the Ostrogradskian instability because even a very high (positive or negative) energy mode can be excited by also exciting modes with the opposite energy. Instead of these large $k$ modes decoupling, they couple ever more strongly as $k$ grows, because more and more ways open up to balance its energy by exciting lower modes of the opposite sign.

## Constraints on $H$ Accomplish Nothing

It is sometimes imagined that the energy of a higher derivative theory decays with time. That is not true. Provided one is dealing with a complete system, and provided there is no external time dependence, the energy of a higher derivative system is conserved, just as it would be under those conditions for a lower derivative theory. This conservation is apparent for the higher derivative oscillator () from expression ().

The physical problem with nondegenerate higher derivative theories is not that their energies decay to lower and lower values. The problem is rather that certain sectors of the theory become arbitrarily highly excited when one is dealing with an interacting, continuum field theory which has nondegenerate higher derivatives. For example, Boulware, Horowitz and Strominger showed that the energy is zero for any asymptotically flat solution of the higher derivative field equations derived from the Lagrangian, $$\mathcal{L} = -\frac14 \alpha C_{\mu\nu\rho\sigma} C^{\mu\nu\rho\sigma}
\sqrt{-g} -\frac14 \beta R^2 \sqrt{-g} \; , \label{zeroE}$$ where $C_{\mu\nu\rho\sigma}$ is the Weyl tensor and $R$ is the Ricci scalar. However, this model is still unstable for $\alpha \neq 0$, as its creators realized.[^1]

# Quantization

Quantization is very important to understanding the Ostrogradskian instability because 0-point fluctuations provide the perturbations needed to ensure that the potential for vacuum decay is actually realized. However, a quantum higher derivative system has some peculiarities. For example, it is obvious from relations (-) that position and velocity commute! Further, the wave function of a higher derivative theory depends upon position and velocity. This section argues first that the classical instability survives *canonical* quantization. After presenting a worked-out example, the curious noncanonical quantizations which sometimes appear in the literature are discussed.

## A Large Phase Space Instability

It is often imagined that quantization might protect a higher derivative system against the Ostrogradskian instability the same way that quantization prevents the collapse of atoms coupled to electromagnetism. This is a failure to understand correspondence limits. In the Heisenberg picture the equations of classical mechanics are identical to those of quantum mechanics. It also means the very same thing to solve these equations: one expresses the dynamical variable in terms of time and the allowed initial value data, as in expressions () and (). The only difference between classical and quantum mechanics is that the classical initial value data are numbers which can take any value whereas the quantum initial value data include noncommuting conjugate operators which obey the Uncertainty Principle. The only classical phenomena that can be affected by quantization are those whose realization requires localizing conjugate variables to some volume of the classical phase space smaller than $\hbar$. So quantum atoms are stable because localizing the electrons too near the nucleus necessarily induces a large kinetic energy.

In contrast, the Ostrogradskian instability derives from the fact that $P_1 X_2$ can be made arbitrarily negative by taking $P_1$ either very negative, for positive $X_2$, or else very positive, for negative $X_2$. *This covers essentially half the classical phase space!* Further, the variables $X_2$ and $P_1$ commute with one another in Ostrogradskian quantum mechanics. So there is no reason to expect that the Ostrogradskian instability is unaffected by quantization.

## Quantum Higher Derivative Oscillator

Consider the second derivative oscillator () discussed in section 2.2. There can be no ground state in the presence of the Ostrogradskian instability but one might define an "empty" state wavefunction, $\Omega(X_1,X_2)$ which has the minimum excitation in both the positive and negative energy degrees of freedom. The procedure for doing this is simple: first identify the positive and negative energy lowering operators $\alpha_{\pm}$, and then solve the equations, $$\alpha_+ \vert \Omega \rangle = 0 = \alpha_- \vert \Omega \rangle \; .
\label{wavef}$$ One can recognize the raising and lowering operators by expressing the general solution () in terms of exponentials, $$\begin{aligned}
\lefteqn{x(t) = \frac12 (C_+ \!+\! i S_+) e^{-ik_+ t} + \frac12 (C_+ \!-\!
i S_+) e^{ik_+ t} } \nonumber \\
& & \hspace{2cm} + \frac12 (C_- \!+\! i S_-) e^{-ik_-t } + \frac12 (C_- \!-\!
i S_-) e^{ik_- t} \; .
\end{aligned}$$ Recall that the $k_+$ mode carries positive energy, so its lowering operator must be proportional to the $e^{-ik_+ t}$ term, $$\begin{aligned}
\alpha_+ & \sim & C_+ + i S_+ \; , \\
& \sim & \frac{m k_+}2 \Bigl(1 \!+\! \sqrt{1 \!-\! 4\epsilon}\Bigr) X_1 +
i P_1 - k_+ P_2 - \frac{i m}2 \Bigl(1 \!-\! \sqrt{1 \!-\! 4\epsilon}\Bigr)
X_2 \; .
\end{aligned}$$ The $k_-$ mode carries negative energy, so its lowering operator must be proportional to the $e^{+i k_- t}$ term, $$\begin{aligned}
\alpha_- & \sim & C_- - i S_- \; , \\
& \sim & \frac{m k_-}2 \Bigl(1 \!-\! \sqrt{1 \!-\! 4\epsilon}\Bigr) X_1 -
i P_1 - k_- P_2 + \frac{i m}2 \Bigl(1 \!+\! \sqrt{1 \!-\! 4\epsilon}\Bigr)
X_2 \; .
\end{aligned}$$ Writing $P_i = -i\hbar \frac{\partial}{\partial X_i}$ reveals that the unique solution to () has the form, $$\Omega(X_1,X_2) = N \exp\Biggl[-\frac{m \sqrt{1 \!-\! 4\epsilon}}{2 \hbar(k_+
\!+\! k_-)} \Bigl(k_+ k_- X_1^2 + X_2^2\Bigr) - \frac{i \sqrt{\epsilon} m}{\hbar}
X_1 X_2\Biggr] \; . \label{true}$$

The empty wave function () is obviously normalizable, so it gives a state of the quantum system. One can build a complete set of normalized stationary states by acting arbitrary numbers of $+$ and $-$ raising operators on it, $$\vert N_+ , N_-\rangle \equiv \frac{(\alpha_+^{\dagger})^N_+}{\sqrt{N_+ !}}
\frac{(\alpha_-^{\dagger})^N_-}{\sqrt{N_- !}} \vert \Omega \rangle \; .$$ On this space of states the Hamiltonian operator is unbounded below, just as in the classical theory, $$H \vert N_+ , N_- \rangle = \hbar \Bigl(N_+ k_+ - N_- k_-\Bigr) \vert N_+ , N_-
\rangle \; .$$ This is the correct way to quantize a higher derivative theory. One evidence of this fact is that classical configurations of negative energy correspond to quantum negative energy states.

## Unitarity versus Instability

Particle physicists who quantize higher derivative theories do not typically recognize a problem with stability; they instead discuss a breakdown of unitarity, for example . This is accomplished by regarding the negative energy lowering operator as a positive energy raising operator. So one defines a "ground state" $\vert \overline{\Omega} \rangle$ which obeys the equations, $$\alpha_+ \vert \overline{\Omega} \rangle = 0 = \alpha_-^{\dagger} \vert
\overline{\Omega} \rangle \; . \label{falsewave}$$ The unique wave function which solves these equations is, $$\overline{\Omega}(X_1,X_2) = N \exp\Biggl[-\frac{m \sqrt{1 \!-\!
4\epsilon}}{2 \hbar (k_- \!-\! k_+)} \Bigl(k_+ k_- X_1^2 - X_2^2\Bigr) +
\frac{i \sqrt{\epsilon} m}{\hbar} X_1 X_2 \Biggr] \; . \label{wrong}$$ The wave function () is not normalizable, so it does not correspond to a state of the quantum system . However, particle physicists define a formal "space of states" based upon $\vert\overline{\Omega} \rangle$, $$\vert \overline{N_+ , N_-}\rangle \equiv \frac{(\alpha_+^{\dagger})^{N_+}}{
\sqrt{N_+ !}} \frac{(\alpha_-)^{N_-}}{\sqrt{N_- !}} \vert \overline{\Omega}
\rangle \; .$$ Although these wave functions are no more normalizable than $\overline{\Omega}(X_1,X_2)$, they are all positive energy eigenfunctions, $$H \vert \overline{N_+ , N_-} \rangle = \hbar \Bigl(N_+ k_+ + N_- k_-\Bigr)
\vert \overline{N_+ , N_-} \rangle \; .$$

The problem with unitarity emerges because $\vert \overline{\Omega}\rangle$ is defined to have unit norm, but the commutation relations are unchanged, $$[\alpha_+,\alpha_+^{\dagger}] = 1 = [\alpha_-,\alpha_-^{\dagger}] \; .$$ Hence the norm of any state with odd $N_-$ is negative. The first of these negative norm states is, $$\langle \overline{0,1} \vert \overline{0,1}\rangle =
\langle \overline{\Omega} \vert \alpha_-^{\dagger} \alpha_- \vert \overline{
\Omega} \rangle = - \langle \overline{\Omega} \vert \overline{\Omega} \rangle
\; .$$ The next step is to invoke the probabilistic interpretation of quantum mechanics which requires norms to be positive because probabilities are. Therefore, the negative norm states must be excised from the space of states. However, doing that results in a nonunitary S-matrix because scattering processes inevitably mix positive and negative norm states, just as the correctly-quantized, indefinite-energy theory allows processes which mix positive and negative energy particles.

It is important to note that the potential for invoking noncanonical quantization schemes to change the range of allowed energies is present even in the usual, first derivative systems. The Schrodinger equation $H \psi(X) = E \psi(X)$ is a second order differential equation, which possesses two linearly independent solutions for every value of the energy $E$. It is only by insisting upon normalizable wave functions that quantized energies emerge. Many other peculiar things happen if one abandons normalizability . In particular, the Correspondence Principle fails, so that taking $\hbar$ to zero gives a different classical system from the one which originally motivated the analysis. That is the case for $PT$-symmetric quantizations of higher derivative systems .

# Degeneracy

The only way anyone has ever found to avoid the Ostrogradskian instability is by violating the assumption of nondegeneracy upon which it is based. This section discusses three ways this can happen: through partial integration, through gauge invariance, and by imposing constraints by fiat .

## Trivial Degeneracy

The simplest form of degeneracy derives from adding a total derivative to a first order system. Examples include the Hilbert action of general relativity, Lovelock gravity and Galileons . In that case one simply performs a partial integration, and discards the surface term to obtain a Lagrangian which contains only first time derivatives. For example, the 3rd Lagrangian for a scalar Galileon $\pi(t,\vec{x})$ reduces to first order form as, $$\begin{aligned}
\partial_{\mu} \pi \partial^{\mu} \pi \partial^2 \pi & = &
\frac{\partial}{\partial t} \Bigl[\frac13 \dot{\pi}^3 \!-\! \dot{\pi}
\vec{\nabla} \pi \!\cdot\! \vec{\nabla} \pi\Bigr] + 2 \dot{\pi}
\vec{\nabla} \pi \!\cdot\! \vec{\nabla} \dot{\pi} + \nabla^2 \pi
\vec{\nabla} \pi \!\cdot\! \vec{\nabla} \pi \; , \qquad \\
& \longrightarrow & 2 \dot{\pi} \vec{\nabla} \pi \!\cdot\! \vec{\nabla}
\dot{\pi} + \nabla^2 \pi \vec{\nabla} \pi \!\cdot\! \vec{\nabla} \pi \; .
\end{aligned}$$ Note that it is only necessary to eliminate higher *time* derivatives; there is no problem if the Lagrangian contains higher spatial derivatives, or mixed first time and space derivatives.

## Gauge Degeneracy

All theories which possess continuous symmetries are degenerate, irrespective of whether or not they possess higher derivatives. A familiar example is the relativistic point particle, whose dynamical variable is $X^{\mu}(\tau)$ and whose Lagrangian is, $$L = -m \sqrt{-\eta_{\mu\nu} \dot{X}^{\mu} \dot{X}^{\nu}} \; .$$ The conjugate momentum is, $$P_{\mu} \equiv \frac{m \dot{X}_{\mu}}{\sqrt{-\dot{X}^2}} \; . \label{RPE}$$ One cannot solve () for $\dot{X}^{\mu}$ in terms of $X^{\mu}$ and $P_{\mu}$ because the equation is homogeneous of degree zero. The continuous symmetry associated with this degeneracy is invariance under changes of the parameter $\tau \longrightarrow \tau'$, $$X^{\mu}(\tau) \longrightarrow X^{\prime \mu}(\tau) \equiv X^{\mu}\Bigl({\tau'
}^{-1}(\tau)\Bigr) \; .$$

The cure for symmetry-induced degeneracy is simply to fix the symmetry by imposing gauge conditions. Then the gauge-fixed Lagrangian should no longer be degenerate in terms of the remaining variables. For example, one might fix the parameter $\tau$ to obey $\tau = X^0(\tau)$. In that case the gauge-fixed particle Lagrangian is, $$L_{\rm GF} = -m \sqrt{1 - \dot{\vec{X}} \cdot \dot{\vec{X}} } \; ,$$ and the relations for the momenta are simple to invert, $$P_i \equiv \frac{m \dot{X}_i}{\sqrt{1 - \dot{\vec{X}} \cdot \dot{\vec{X}} }}
\qquad \Longleftrightarrow \qquad \dot{X}^i = \frac{P^i}{\sqrt{m^2 + \vec{P}
\cdot \vec{P}}} \; .$$

When a continuous symmetry is used to eliminate a dynamical variable, the equation of motion of this variable typically becomes a *constraint*. For symmetries enforced by means of a compensating field — such as making the Hilbert action local Lorentz invariant using the antisymmetric components of the vierbein , or Weyl invariant using a scalar — the associated constraints are tautologies of the form $0 = 0$. Sometimes the constraints are nontrivial, but implied by the equations of motion. An example of this kind is the relativistic particle considered above. In synchronous gauge ($\tau = X^0(\tau)$) the equation of the gauge-fixed zero-component implies that the Hamiltonian is conserved, $$\frac{d}{d\tau} \Biggl( \frac{m \dot{X}_0}{\sqrt{-\eta_{\mu\nu} \dot{X}^{\mu}
\dot{X}^{\nu}}} \Biggr) = 0 \longrightarrow \frac{d}{dt} \Bigl(
\sqrt{m^2 + \vec{P} \!\cdot\! \vec{P} } \Bigr) = 0 \; .$$ And sometimes the constraints give nontrivial relations between the canonical variables that generate residual, time-independent symmetries. In this case another degree of freedom can be removed. An example of this kind of constraint is Gauss' Law in temporal gauge electrodynamics.

When constraints of the third type are present one must check whether or not they affect the instability. This obviously depends on the particular model being studied but a necessary condition for avoiding the Ostrogradskian instability is that the number of gauge constraints must equal or exceed the number of unstable directions in the canonical phase space. Because the number of constraints for any given symmetry is fixed, whereas the number of unstable directions increases with the number of higher derivatives, it follows that gauge constraints can at best avoid instability for some fixed number of higher derivatives.

A good example of gauge degeneracy is provided by the quadratic curvature model () which was exhibited at the end of section 3 to show the irrelevance of a global constraint on the Hamiltonian. As long as $\alpha$ and $\beta$ are both nonzero, there are six independent, higher derivative momenta at each space point, whereas there are only four local constraints. If $\beta
= 0$ the model acquires a new local symmetry — Weyl invariance —- which adds another local constraint. Hence there are either one or two unconstrained instabilities per space point for $\alpha \neq 0$. There are an infinite number of space points, so the addition of a single, global constraint does not change anything.

The case of $\alpha = 0$ is special. If $\beta$ has the right sign the resulting model has long been known to have positive energy . This result in no way contradicts the previous analysis. When $\alpha = 0$, the terms which carry second derivatives are contracted in such way that only a single component of the metric carries higher derivatives. So the counting is one unstable direction per space point versus four local constraints, which means the constraints can prevent the Ostrogradskian instability.

## Imposed Degeneracy

Many attempts to evade the Ostrogradskian instability are based on segregating higher derivatives to interaction terms so that the free theory possesses no extra solutions. This renders the instability invisible to perturbative scrutiny but does not avoid it. One can see from the construction of section 2 that the sole assumption needed to derive the instability is nondegeneracy, irrespective of how one organizes any approximation technique. On the other hand, there is a way of imposing constraints so as to make the theory agree with its perturbative development. When this is done there are no more higher derivative degrees of freedom, but this constrained version of the theory cannot serve to define an acceptable model unless the perturbative solution converges.

The technique is to regard higher derivative parts of the Euler-Lagrange equation as a perturbation and then use the unperturbed equation to reduce the order . Of course this produces a remainder with even more higher derivatives, but this remainder is also higher order in perturbation theory. By iterating the procedure infinitely, and then neglecting the remainder, one obtains a lower order equation.

The technique can be illustrated for the higher derivative oscillator () by regarding the parameter $\epsilon$ as a coupling constant so that the Euler-Lagrange equation () takes the form, $$\ddot{x} + \omega^2 x = -\epsilon \Bigl( \frac{d}{d \omega t}\Bigr)^2
\ddot{x} \equiv -\epsilon D^2 \ddot{x} \; . \label{step1}$$ The first iteration gives, $$\ddot{x} + \omega^2 x = + \epsilon \ddot{x} + \epsilon^2 D^4 \ddot{x}
= -\epsilon \omega^2 x - \epsilon^2 (1 \!-\! D^2) D^2 \ddot{x}
\; . \label{step2}$$ After another iteration one obtains, $$\begin{aligned}
\lefteqn{\ddot{x} + \omega^2 x = -\epsilon \Bigl[1 \!+\! \epsilon (1 \!+\!
\epsilon)^2 (2 \!+\! \epsilon)\Bigr] \omega^2 x } \nonumber \\
& & \hspace{3cm} - \epsilon^4 \Bigl[(2 \!+\! \epsilon)(1\!+\! \epsilon) -
(2\!+\!\epsilon) D^2 + D^4\Bigr] (1 \!-\! D^2) D^2 \ddot{x} \; . \qquad
\label{step3}
\end{aligned}$$ Continuing in this fashion, *and ignoring the remainder*, gives, $$\ddot{x} + k_+^2 x = 0 \; . \label{pertsol}$$ From the full theory, the perturbative development has retained only the solution whose frequency is well behaved for $\epsilon \rightarrow
0$, $$k_+^2 = \omega^2 \Bigl[1 + \epsilon + 2 \epsilon^2 +
O(\epsilon^3) \Bigr] \; . \label{lowk}$$ It has discarded the solution whose frequency blows up as $\epsilon
\rightarrow 0$, $$k_-^2 = \omega^2 \Bigl[\frac1{\epsilon} - 1 - \epsilon - 2 \epsilon^2
+ O(\epsilon^3)\Bigr] \; . \label{highk}$$

The perturbative development () is what results if one changes the original theory by imposing the constraints, $$\begin{aligned}
\ddot{q}(t) = - k_+^2 q(t) \qquad & \Longleftrightarrow & \qquad P_2 =
\frac{m}2 \Bigl(1 \!-\! \sqrt{1 \!-\! 4\epsilon}\Bigr) X_1 \; , \label{C1} \\
q^{(3)}(t) = - k_+^2 \dot{q}(t) \qquad & \Longleftrightarrow & \qquad X_2 =
\frac1{2 \epsilon m} \Bigl(1 \!-\! \sqrt{1 \!-\! 4\epsilon}\Bigr) P_1 \; .
\label{C2}
\end{aligned}$$ Under these constraints the Hamiltonian becomes, $$H_{\rm pert} = \sqrt{1 \!-\! 4\epsilon} \Bigl( \frac{m}2 X_2^2 +
\frac{m k_+^2}2 X_1^2 \Bigr) \; ,$$ which is that of a positive energy harmonic oscillator with mass $\sqrt{1 - 4\epsilon} m$ and frequency $k_+$. If the constraints (-) are imposed at one instant, they remain valid for all times as a consequence of the full equation of motion (), so the constrained model is consistent. This is ultimately a consequence of the fact that, for this model, the perturbatve expansion converges. That is what ensures that the discarded remainder term really goes to zero when the expansion is carried to infinite order.

For nonlinear Euler-Lagrange equations it is more difficult to reach a second order form, but one can still do it. As before, the ultimate consistency of the reduced system depends upon the convergence of the perturbative expansion. For certain mechanical systems it does converge, for example, a higher derivative generalization of a particle moving in a uniform gravitational acceleration $g$ is, $$L = \frac12 m \dot{x}^2 + m g x + \frac{\epsilon m}{6 g} x \ddot{x}^2
\qquad \Longrightarrow \qquad \ddot{x} = g + \frac{\epsilon}{6 g}
\ddot{x}^2 + + \frac{\epsilon}{3 g} \frac{d^2}{dt^2} \Bigl( x \ddot{x}
\Bigr) \; . \label{nongrav}$$ Reducing to second order transforms the higher derivative corrections into a distortion of the acceleration, $$\ddot{x} = \frac{g}{2 \epsilon} \Bigl[1 - \sqrt{1 \!-\! 2 \epsilon}\Bigr]
= g \Bigl[1 + \frac12 \epsilon + \frac12 \epsilon^2 + O(\epsilon^3)\Bigr]
\; . \label{reduced}$$ However, there are no known, interacting, $3+1$-dimensional field theories for which the perturbative expansion converges. Nor has anyone ever found a consistent way of imposing constraints which avoids the Ostrogradskian instability for an interacting, $(3 + 1)$-dimensional, higher derivative field theory.

# Conclusions

Although it was not apparent in 1850, Ostrogradsky's theorem can today be recognized as the strongest restriction on what sorts of interacting local quantum field theories can describe fundamental physics. No symmetry principle has a broader scope or comparable power. Its applications include:

-   Demonstrating that higher derivative counterterms cannot be a fundamental solution to the problem of quantum gravity ;

-   Establishing $f(R)$ models as the only metric-based, local and potentially stable modifications of gravity ; and

-   Discussing the problems of nonlocal models which can be viewed as the limits of an infinite sequence of higher derivatives .

One should also note the recent generalization by Motohashi and Suyama of Ostrogradsky's result to Lagrangian-based systems (such as fermions) whose Euler-Lagrange equations involve an odd number of time derivatives .

Acknowledgements

It is a pleasure to acknowledge correspondence on this subject with K. Anagnostopoulos, S. Deser, M. Fasiello, T. A. Jacobson, B. P. Kosyakov, H. Motohashi and T. Suyama. This work was partially supported by NSF grant PHY-1205591 and PHY-1506513, and by the Institute for Fundamental Theory at the University of Florida.

[^1]: It is also worth noting that the requirement of asymptotic flatness in this model would preclude the response to normal matter, and that imposing the correct asymptotic condition gives rise to nonzero energy .


abstract: Caffe provides multimedia scientists and practitioners with a clean and modifiable framework for state-of-the-art deep learning algorithms and a collection of reference models. The framework is a BSD-licensed C++ library with Python and MATLAB bindings for training and deploying general-purpose convolutional neural networks and other deep models efficiently on commodity architectures. Caffe fits industry and internet-scale media needs by CUDA GPU computation, processing over 40 million images a day on a single K40 or Titan GPU ($\approx$ 2.5 ms per image). By separating model representation from actual implementation, Caffe allows experimentation and seamless switching among platforms for ease of development and deployment from prototyping machines to cloud environments.
  .
  Caffe is maintained and developed by the Berkeley Vision and Learning Center (BVLC) with the help of an active community of contributors on GitHub. It powers ongoing research projects, large-scale industrial applications, and startup prototypes in vision, speech, and multimedia.
author: Yangqing Jia$^*$, Evan Shelhamer$^*$, Jeff Donahue, Sergey Karayev,
Jonathan Long, Ross Girshick, Sergio Guadarrama, Trevor Darrell

bibliography: sigproc.bib
title: Caffe: Convolutional Architecture
  for Fast Feature Embedding

\[Applications–Computer vision\] \[Design Tools and Techniques–Software libraries\] \[Models–Neural Nets\]

# Introduction

A key problem in multimedia data analysis is discovery of effective representations for sensory inputs—images, soundwaves, haptics, etc. While performance of conventional, handcrafted features has plateaued in recent years, new developments in deep compositional architectures have kept performance levels rising . Deep models have outperformed hand-engineered feature representations in many domains, and made learning possible in domains where engineered features were lacking entirely.

We are particularly motivated by large-scale visual recognition, where a specific type of deep architecture has achieved a commanding lead on the state-of-the-art. These *Convolutional Neural Networks*, or CNNs, are discriminatively trained via back-propagation through layers of convolutional filters and other operations such as rectification and pooling. Following the early success of digit classification in the 90's, these models have recently surpassed all known methods for large-scale visual recognition, and have been adopted by industry heavyweights such as Google, Facebook, and Baidu for image understanding and search.

While deep neural networks have attracted enthusiastic interest within computer vision and beyond, replication of published results can involve months of work by a researcher or engineer. Sometimes researchers deem it worthwhile to release trained models along with the paper advertising their performance. But trained models alone are not sufficient for rapid research progress and emerging commercial applications, and few toolboxes offer truly off-the-shelf deployment of state-of-the-art models—and those that do are often not computationally efficient and thus unsuitable for commercial deployment.

To address such problems, we present Caffe, a fully open-source framework that affords clear access to deep architectures. The code is written in clean, efficient C++, with CUDA used for GPU computation, and nearly complete, well-supported bindings to Python/Numpy and MATLAB. Caffe adheres to software engineering best practices, providing unit tests for correctness and experimental rigor and speed for deployment. It is also well-suited for research use, due to the careful modularity of the code, and the clean separation of network definition (usually the novel part of deep learning research) from actual implementation.

In Caffe, multimedia scientists and practitioners have an orderly and extensible toolkit for state-of-the-art deep learning algorithms, with reference models provided out of the box. Fast CUDA code and GPU computation fit industry needs by achieving processing speeds of more than 40 million images per day on a single K40 or Titan GPU. The same models can be run in CPU or GPU mode on a variety of hardware: Caffe separates the representation from the actual implementation, and seamless switching between heterogeneous platforms furthers development and deployment—Caffe can even be run in the cloud.

While Caffe was first designed for vision, it has been adopted and improved by users in speech recognition, robotics, neuroscience, and astronomy. We hope to see this trend continue so that further sciences and industries can take advantage of deep learning.

Caffe is maintained and developed by the BVLC with the active efforts of several graduate students, and welcomes open-source contributions at <http://github.com/BVLC/caffe>. We thank all of our contributors for their work!

# Highlights of Caffe

Caffe provides a complete toolkit for training, testing, finetuning, and deploying models, with well-documented examples for all of these tasks. As such, it's an ideal starting point for researchers and other developers looking to jump into state-of-the-art machine learning. At the same time, it's likely the fastest available implementation of these algorithms, making it immediately useful for industrial deployment.

**Modularity.** The software is designed from the beginning to be as modular as possible, allowing easy extension to new data formats, network layers, and loss functions. Lots of layers and loss functions are already implemented, and plentiful examples show how these are composed into trainable recognition systems for various tasks.

**Separation of representation and implementation.** Caffe model definitions are written as config files using the Protocol Buffer language. Caffe supports network architectures in the form of arbitrary directed acyclic graphs. Upon instantiation, Caffe reserves exactly as much memory as needed for the network, and abstracts from its underlying location in host or GPU. Switching between a CPU and GPU implementation is exactly one function call.

**Test coverage.** Every single module in Caffe has a test, and no new code is accepted into the project without corresponding tests. This allows rapid improvements and refactoring of the codebase, and imparts a welcome feeling of peacefulness to the researchers using the code.

**Python and MATLAB bindings.** For rapid prototyping and interfacing with existing research code, Caffe provides Python and MATLAB bindings. Both languages may be used to construct networks and classify inputs. The Python bindings also expose the solver module for easy prototyping of new training procedures.

**Pre-trained reference models.** Caffe provides (for academic and non-commercial use—not BSD license) reference models for visual tasks, including the landmark "AlexNet" ImageNet model  with variations and the R-CNN detection model . More are scheduled for release. We are strong proponents of reproducible research: we hope that a common software substrate will foster quick progress in the search over network architectures and applications.

## Comparison to related software

We summarize the landscape of convolutional neural network software used in recent publications in Table . While our list is incomplete, we have included the toolkits that are most notable to the best of our knowledge. Caffe differs from other contemporary CNN frameworks in two major ways:

\(1\) The implementation is completely C++ based, which eases integration into existing C++ systems and interfaces common in industry. The CPU mode removes the barrier of specialized hardware for deployment and experiments once a model is trained.

\(2\) Reference models are provided off-the-shelf for quick experimentation with state-of-the-art results, without the need for costly re-learning. By finetuning for related tasks, such as those explored by , these models provide a warm-start to new research and applications. Crucially, we publish not only the trained models but also the recipes and code to reproduce them.

# Architecture

## Data Storage

Caffe stores and communicates data in 4-dimensional arrays called *blobs*.

Blobs provide a unified memory interface, holding batches of images (or other data), parameters, or parameter updates. Blobs conceal the computational and mental overhead of mixed CPU/GPU operation by synchronizing from the CPU host to the GPU device as needed. In practice, one loads data from the disk to a blob in CPU code, calls a CUDA kernel to do GPU computation, and ferries the blob off to the next layer, ignoring low-level details while maintaining a high level of performance. Memory on the host and device is allocated on demand (lazily) for efficient memory usage.

Models are saved to disk as Google Protocol Buffers[^1], which have several important features: minimal-size binary strings when serialized, efficient serialization, a human-readable text format compatible with the binary version, and efficient interface implementations in multiple languages, most notably C++ and Python.

Large-scale data is stored in LevelDB[^2] databases. In our test program, LevelDB and Protocol Buffers provide a throughput of 150MB/s on commodity machines with minimal CPU impact. Thanks to layer-wise design (discussed below) and code modularity, we have recently added support for other data sources, including some contributed by the open source community.

## Layers

A Caffe layer is the essence of a neural network layer: it takes one or more blobs as input, and yields one or more blobs as output. Layers have two key responsibilities for the operation of the network as a whole: a *forward pass* that takes the inputs and produces the outputs, and a *backward pass* that takes the gradient with respect to the output, and computes the gradients with respect to the parameters and to the inputs, which are in turn back-propagated to earlier layers.

Caffe provides a complete set of layer types including: convolution, pooling, inner products, nonlinearities like rectified linear and logistic, local response normalization, element-wise operations, and losses like softmax and hinge. These are all the types needed for state-of-the-art visual tasks. Coding custom layers requires minimal effort due to the compositional construction of networks.

## Networks and Run Mode

Caffe does all the bookkeeping for any directed acyclic graph of layers, ensuring correctness of the forward and backward passes. Caffe models are end-to-end machine learning systems. A typical network begins with a data layer that loads from disk and ends with a loss layer that computes the objective for a task such as classification or reconstruction.

The network is run on CPU or GPU by setting a single switch. Layers come with corresponding CPU and GPU routines that produce identical results (with tests to prove it). The CPU/GPU switch is seamless and independent of the model definition.

## Training A Network

Caffe trains models by the fast and standard stochastic gradient descent algorithm. Figure shows a typical example of a Caffe network (for MNIST digit classification) during training: a data layer fetches the images and labels from disk, passes it through multiple layers such as convolution, pooling and rectified linear transforms, and feeds the final prediction into a classification loss layer that produces the loss and gradients which train the whole network. This example is found in the Caffe source code at `examples/lenet/lenet_train.prototxt`. Data are processed in mini-batches that pass through the network sequentially. Vital to training are learning rate decay schedules, momentum, and snapshots for stopping and resuming, all of which are implemented and documented.

Finetuning, the adaptation of an existing model to new architectures or data, is a standard method in Caffe. From a snapshot of an existing network and a model definition for the new network, Caffe finetunes the old model weights for the new task and initializes new weights as needed. This capability is essential for tasks such as knowledge transfer , object detection , and object retrieval .

# Applications and Examples

In its first six months since public release, Caffe has already been used in a large number of research projects at UC Berkeley and other universities, achieving state-of-the-art performance on a number of tasks. Members of Berkeley EECS have also collaborated with several industry partners such as Facebook and Adobe , using Caffe or its direct precursor (Decaf) to obtain state-of-the-art results.

**Object Classification** Caffe has an online demo[^3] showing state-of-the-art object classification on images provided by the users, including via mobile phone. The demo takes the image and tries to categorize it into one of the 1,000 ImageNet categories[^4]. A typical classification result is shown in Figure .

Furthermore, we have successfully trained a model with all 10,000 categories of the full ImageNet dataset by fine-tuning this network. The resulting network has been applied to open vocabulary object retrieval .

**Learning Semantic Features** In addition to end-to-end training, Caffe can also be used to extract semantic features from images using a pre-trained network. These features can be used "downstream" in other vision tasks with great success . Figure shows a two-dimensional embedding of all the ImageNet validation images, colored by a coarse category that they come from. The nice separation testifies to a successful semantic embedding.

Intriguingly, this learned feature is useful for a lot more than object categories. For example, Karayev et al. have shown promising results finding images of different styles such as "Vintage" and "Romantic" using Caffe features (Figure ) .

**Object Detection** Most notably, Caffe has enabled us to obtain **by far** the best performance on object detection, evaluated on the hardest academic datasets: the PASCAL VOC 2007-2012 and the ImageNet 2013 Detection challenge .

Girshick et al.  have combined Caffe together with techniques such as Selective Search to effectively perform simultaneous localization and recognition in natural images. Figure shows a sketch of their approach.

**Beginners' Guides** To help users get started with installing, using, and modifying Caffe, we have provided instructions and tutorials on the Caffe webpage. The tutorials range from small demos (MNIST digit recognition) to serious deployments (end-to-end learning on ImageNet).

Although these tutorials serve as effective documentation of the functionality of Caffe, the Caffe source code additionally provides detailed inline documentation on all modules. This documentation will be exposed in a standalone web interface in the near future.

# Availability

Source code is published BSD-licensed on GitHub.[^5] Project details, step-wise tutorials, and pre-trained models are on the homepage.[^6] Development is done in Linux and OS X, and users have reported Windows builds. A public Caffe Amazon EC2 instance is coming soon.

# Acknowledgements

We would like to thank NVIDIA for GPU donation, the BVLC sponsors (<http://bvlc.eecs.berkeley.edu/>), and our open source community.

[^1]: <https://code.google.com/p/protobuf/>

[^2]: <https://code.google.com/p/leveldb/>

[^3]: <http://demo.caffe.berkeleyvision.org/>

[^4]: <http://www.image-net.org/challenges/LSVRC/2013/>

[^5]: <https://github.com/BVLC/caffe/>

[^6]: <http://caffe.berkeleyvision.org/>