and it satisfies $g(a)=g^{\prime}_{r}(a)=0$. If $\int_{a}^{b}gd\mu=0$, then
$p=\ell$ and we may choose $\overline{p}=p$. Otherwise
$0<\int_{a}^{b}gd\mu\leqslant 1$, since $\ell$ is nonnegative on $[a,b]$, and
we may apply our previous result to $g$. This leads to a $D$-linear
interpolation $\overline{g}$ of $g$ from which we may define
$\overline{p}=\overline{g}-\ell(x)$ which is a $D$-linear interpolation of $p$
on $[a,b]$. Inequality (57) follows from (73) and the facts that
$\left|{p-\overline{p}}\right|=\left|{g-\overline{g}}\right|$ and
$g^{\prime}_{l}(b)=p^{\prime}_{l}(b)-p^{\prime}_{r}(a)$.

In order to prove Proposition 7 in the other cases, we use transformations
defined by (59). We can note that if $\ell$ is a $D$-linear interpolation of
$f$, ${\mathcal{T}}_{j}(\ell)$ is $D$-linear interpolation of
${\mathcal{T}}_{j}(f)$ (based on the same subdivision).

If $p$ is convex and nonincreasing, we apply the transformation
${\mathcal{T}}_{1}$. Then $g={\mathcal{T}}_{1}(p)$ is a convex, nondecreasing
sub-density on $[a,b]$ and our previous result applies. We may find a
$D$-linear interpolation $\overline{g}$ on $[a,b]$ such that

(74)
$\int_{a}^{b}\left|{g-\overline{g}}\right|d\mu\leqslant\frac{4}{3}\left[{\left({1+L\sqrt{\left|{g_{l}^{\prime}(b)-g_{r}^{\prime}(a)}\right|}}\right)^{1/D}-1}\right]^{2},$

and the function $\overline{p}={\mathcal{T}}_{1}(\overline{g})$ is a
$D$-linear interpolation of $p={\mathcal{T}}_{1}(g)$ that satisfies (57). The
result is therefore proven for all convex continuous monotone sub-density on
$[a,b]$.

If $p$ is a concave continuous sub-density, we apply the transformation
${\mathcal{T}}_{2}$ with $m=2S/(b-a)$ and $S=\int_{a}^{b}pd\mu\leqslant 1$.
Since $p$ is concave and monotone, $(p(a)\vee p(b))(b-a)/2\leqslant S$, hence
$p(x)\leqslant m$ for all $x\in[a,b]$, and $g={\mathcal{T}}_{2}(p)=m-p$ is a
monotone convex sub-density since

$\int_{a}^{b}\left({m-p}\right)d\mu=\frac{2S}{b-a}\times(b-a)-S=S\leqslant 1.$

Applying the previous result, we may find a $D$-interpolation $\overline{g}$
of $g$ that satisfies (74) and $\overline{p}={\mathcal{T}}_{2}(\overline{g})$
satisfies (57). This completes the proof of Proposition 7. ∎

###### Proof of Proposition 8.

We start with the following lemma.

######  Lemma 7.

If $f$ and $g$ are two continuous increasing or decreasing functions from on
interval $I$ onto an interval $J$,

(75) $\int_{I}|f-g|d\mu=\int_{J}|f^{-1}-g^{-1}|d\mu.$

Moreover, if $\inf I=0$ and $f$ is nonnegative, continuous and decreasing

$\int_{J}f^{-1}d\mu\leqslant\int_{I}fd\mu.$

###### Proof.

Let us first assume that $f,g$ are both increasing. For all $(t,y)\in I\times
J$

$1\hskip-2.6pt{\rm l}_{g(t)\leqslant y\leqslant f(t)}+1\hskip-2.6pt{\rm
l}_{f(t)\leqslant y\leqslant g(t)}=1\hskip-2.6pt{\rm l}_{f^{-1}(y)\leqslant
t\leqslant g^{-1}(y)}+1\hskip-2.6pt{\rm l}_{g^{-1}(y)\leqslant t\leqslant
f^{-1}(y)}.$

By integrating this equality on $I\times J$ and using Fubini’s theorem, we
obtain that

$\displaystyle\int_{I}\left|{f(t)-g(t)}\right|d\mu(t)$
$\displaystyle=\int_{I}\left[{\int_{J}\left[{1\hskip-2.6pt{\rm
l}_{g(t)\leqslant y\leqslant f(t)}+1\hskip-2.6pt{\rm l}_{f(t)\leqslant
y\leqslant g(t)}}\right]d\mu(y)}\right]d\mu(t)$
$\displaystyle=\int_{J}\left[{\int_{I}\left[{1\hskip-2.6pt{\rm
l}_{f^{-1}(y)\leqslant t\leqslant g^{-1}(y)}+1\hskip-2.6pt{\rm
l}_{g^{-1}(y)\leqslant t\leqslant f^{-1}(y)}}\right]d\mu(t)}\right]d\mu(y)$
$\displaystyle=\int_{J}\left|{f^{-1}(y)-g^{-1}(y)}\right|d\mu(y).$

When $f$ and $g$ are both decreasing, we may apply the above equality to
$\overline{f}=f(-\cdot)$ and $\overline{g}=g(-\cdot)$ from $K=\\{-x,\;x\in
I\\}$ to $J$ then $\overline{f}^{-1}=-f^{-1},\overline{g}^{-1}=-g^{-1}$ and
the result follows from the facts

$\int_{I}\left|{f-g}\right|d\mu=\int_{K}\left|{\overline{f}-\overline{g}}\right|d\mu\text{
and
}\int_{J}\left|{\overline{f}^{-1}-\overline{g}^{-1}}\right|d\mu=\int_{J}\left|{f^{-1}-g^{-1}}\right|d\mu.$

Let us now turn to the proof of the second part of the lemma. Since $\inf I=0$
and $f$ is decreasing and continuous from $I$ onto $J$, for all $t\in J$

$\mu\left({\left\\{{x\in I,\;f(x)\geqslant
t}\right\\}}\right)=\mu\left({\left\\{{x\in I,\;x\leqslant
f^{-1}(t)}\right\\}}\right)=f^{-1}(t).$

Besides, $f$ being nonnegative, the interval $J\subset{\mathbb{R}}_{+}$ and it
follows from Fubini’s theorem that

$\displaystyle\int_{J}f^{-1}(t)d\mu(t)$
$\displaystyle=\int_{J}\mu\left({\left\\{{x\in I,\;f(x)\geqslant
t}\right\\}}\right)d\mu(t)$
$\displaystyle=\int_{J}\left[{\int_{I}1\hskip-2.6pt{\rm l}_{t\leqslant
f(x)}d\mu(x)}\right]d\mu(t)=\int_{I}\left[{\int_{J}1\hskip-2.6pt{\rm
l}_{t\leqslant f(x)}d\mu(t)}\right]d\mu(x)$
$\displaystyle\leqslant\int_{I}\left[{\int_{0}^{+\infty}1\hskip-2.6pt{\rm
l}_{t\leqslant f(x)}d\mu(t)}\right]d\mu(x)=\int_{I}f(x)d\mu(x).$

∎

Let us now turn to the proof of (58). We first claim that it is sufficient to
establish (58) when $p$ is decreasing. If $p$ were increasing, we could apply
the result to $q={\mathcal{T}}_{1}(p)$ defined by (59), which is then
decreasing, and find a $D$-linear interpolation of $q$ on $[a,b]$ that
satisfies

$\int_{a}^{b}\left|{q-\overline{q}}\right|d\mu\leqslant\frac{4}{3}\left[{\left({1+V\sqrt{\left|{\frac{1}{q^{\prime}_{r}(a)}-\frac{1}{q^{\prime}_{l}(b)}}\right|}}\right)^{1/D}-1}\right]^{2}.$

We then conclude by using the facts that ${\mathcal{T}}_{1}$ is an
${\mathbb{L}}_{1}$-isometry, the function
$\overline{p}={\mathcal{T}}_{1}(\overline{q})$ which is a $D$-linear
interpolation of $p$, and $q^{\prime}_{r}(a)=-p_{l}^{\prime}(b)$ and
$q^{\prime}_{l}(b)=-p_{r}^{\prime}(a)$.

We may therefore assume that $p$ is decreasing and changing $p$ into
$p(\cdot-a)$, which amounts to translate the sub-density $p$, we may also
assume with no loss of generality that $a=0$. By Lemma 7, $s=p^{-1}$ is then a
sub-density on $[p(b),p(0)]$ which is furthermore decreasing, continuous and
convex-concave. Since the right and left derivatives of $p$ at $0$ and $b$
respectively are not zero, $s$ admits a right derivative at $p(b)$ and a left
derivative at $p(0)$ given by $1/p^{\prime}_{l}(b)$ and $1/p^{\prime}_{r}(0)$
(with our convention $1/(+\infty)=0$. We may therefore apply Proposition 7 and
find a $D$-linear interpolation $\overline{s}$ of $s$ on $[p(b),p(0)]$ that
satisfies

$\int_{p(b)}^{p(0)}\left|{s-\overline{s}}\right|d\mu\leqslant\frac{4}{3}\left[{\left({1+V\sqrt{\left|{\frac{1}{p^{\prime}_{r}(0)}-\frac{1}{p^{\prime}_{l}(b)}}\right|}}\right)^{1/D}-1}\right]^{2}.$

Since $s$ is continuous and decreasing from $[p(b),p(0)]$ onto $[0,b]$, so is
$\overline{s}$, and we may set
$\overline{p}=\overline{s}^{-1}:[0,b]\to[p(b),p(0)]$. The function
$\overline{p}$ is a $D$-linear interpolation of $p$ on $[0,b]$ and we conclude
by using the equality
$\int_{p(b)}^{p(0)}\left|{s-\overline{s}}\right|d\mu=\int_{0}^{b}\left|{p-\overline{p}}\right|d\mu$
which is a consequence of Lemma 7. ∎

###  7.5. Proofs of Section 6

###### Proof of Proposition 4.

Let $p=\exp\phi\in\overline{\mathcal{M}}^{\text{LC}}$,
$\overline{p}=\exp\overline{\phi}\in\overline{{\mathcal{O}}}_{D}^{\text{LC}}$
and $A\in{\mathcal{A}}(D)$ associated to $\overline{p}$. There exists a
partition ${\mathcal{I}}$ of ${\mathbb{R}}$ into at most $D+1$ intervals such
that the restriction of $\overline{\phi}$ to $I$ with $I\in{\mathcal{I}}$ is
either affine or takes the value $-\infty$. Let $J$ be the interval
$\\{\phi>-\infty\\}$. Let $I\in{\mathcal{I}}$, either $\overline{\phi}$ is
finite on $I$ and $I\cap J\cap\\{\phi>\overline{\phi}\\}$ is an interval since
$\phi-\overline{\phi}$ is a concave function on the interval $I\cap J$ when it
is not empty. Otherwise, $\overline{\phi}$ takes the value $-\infty$ on $I$
and $I\cap J\cap\\{\phi>\overline{\phi}\\}=I\cap J$ remains an interval. The
set $I\cap J^{c}\cap\\{\phi>\overline{\phi}\\}$ is empty since $\phi$ takes
the value $-\infty$ on $J^{c}$. Hence

$I\cap\left\\{{\phi>\overline{\phi}}\right\\}=\left({I\cap
J\cap\left\\{{\phi>\overline{\phi}}\right\\}}\right)\cup\left({I\cap
J^{c}\cap\left\\{{\phi>\overline{\phi}}\right\\}}\right)$

is an interval and

$\left\\{{p>\overline{p}}\right\\}=\left\\{{\phi>\overline{\phi}}\right\\}=\bigcup_{I\in{\mathcal{I}}}\left({I\cap\left\\{{\phi>\overline{\phi}}\right\\}}\right)$

the union of at most $D+1$ intervals.

Let us now turn to the set $\\{\phi<\overline{\phi}\\}$ and define $K=(a,b)$
as the open interval $\\{\phi>-\infty\\}\cap\\{\overline{\phi}>-\infty\\}$
with $a\in{\mathbb{R}}\cup\\{-\infty\\}$, $b\in{\mathbb{R}}\cup\\{+\infty\\}$,
$a\leqslant b$. If $K=\varnothing$, i.e. $a=b$,
${\mathbb{R}}=\\{\phi=-\infty\\}\cup\\{\overline{\phi}=-\infty\\}$ are
disjoint and

$\\{\phi<\overline{\phi}\\}=\\{\overline{\phi}>-\infty\\}$

is an interval. Otherwise $K$ is not empty, $\psi=\phi-\overline{\phi}$ is a
continuous function on $K$ which is either concave on the whole interval $K$
or only piecewise concave on each element of $I\cap K$ with
$I\in{\mathbf{I}}(A\cap K)$ when $A\cap K\neq\varnothing$. In any case,

$\left\\{{x\in K,\;\phi(x)<\overline{\phi}(x)}\right\\}=\left\\{{x\in
K,\;\phi(x)-\overline{\phi}(x)<0}\right\\}$

is a union of at most $|A\cap K|$ intervals plus, possibly, an additional one
with endpoint $a$ and another one with endpoint $b$. If $b<+\infty$, either
$\overline{\phi}(b)=-\infty$ or $\phi(b)=-\infty$ and the set $\\{x\geqslant
b,\;\phi(x)<\overline{\phi}(x)\\}$ is either empty or is an interval that
contains $b$. We may argue similarly to establish that $\\{x\leqslant
a,\;\phi(x)<\overline{\phi}(x)\\}$ is either empty or an interval that
contains $a$. This means that the set

$\left\\{{\phi<\overline{\phi}}\right\\}=\left({K\cap\left\\{{\phi<\overline{\phi}}\right\\}}\right)\cup\left({K^{c}\cap\left\\{{\phi<\overline{\phi}}\right\\}}\right)$

is a union of at most $|A\cap K|+2\leqslant D+2$ intervals. We conclude by
using Lemma 1 of Baraud and Birgé (2016). ∎

###### Proof of Proposition 5.

Let us first assume that $p=\exp\phi>0$ on ${\mathbb{R}}$. Then $\phi$ is
continuous, concave on ${\mathbb{R}}$ and since $p$ is integrable, $\phi$
tends to $-\infty$ at $\pm\infty$ and reaches its maximum at a point
$m\in{\mathbb{R}}$. The sets $\overline{\mathcal{M}}^{\text{LC}}$ and
$\overline{\mathcal{O}}_{D}^{\text{LC}}$ are both location and scale invariant
and the ${\mathbb{L}}_{1}$-distance between two densities remains unchanged
under such transformations. By changing $p$ into

$x\mapsto\sigma p\left({m+\sigma x}\right)=\exp\left[{\phi\left({m+\sigma
x}\right)+\log\sigma}\right]$

with $\sigma=1/p(m)$, if ever necessary, we may assume with no loss of
generality that $m=0$ and $0<\phi(x)\leqslant\phi(0)=0$ for all
$x\in{\mathbb{R}}$, what we shall do. We use the following approximation
result.

######  Proposition 9.

Let $D$ be some positive integer and $f$ a convex-concave function on a non-
trivial interval $[a,b]$ such that

$\Delta=\frac{f(b)-f(a)}{b-a}\neq 0.$

  1. (i)

If $f$ admits a right derivative at $a$ and a left derivative at $b$, there
exists a $D$-linear interpolation $\ell_{1}$ of $f$ such that

(76) $\displaystyle\int_{a}^{b}\left|{f-\ell_{1}}\right|d\mu$
$\displaystyle\leqslant\frac{(b-a)^{2}}{2D^{2}}\frac{\left|{f_{r}^{\prime}(a)-\Delta}\right|\left|{\Delta-f^{\prime}_{l}(b)}\right|}{\left|{f^{\prime}_{r}(a)-f^{\prime}_{l}(b)}\right|}$
$\displaystyle\leqslant\frac{(b-a)^{2}}{8D^{2}}\left|{f^{\prime}_{r}(a)-f^{\prime}_{l}(b)}\right|.$

  2. (ii)

If $\phi$ is strictly monotone on $[a,b]$ with $f_{r}^{\prime}(a)\neq 0$ and
$f_{r}^{\prime}(b)\neq 0$, there exists a $D$-linear interpolation $\ell_{2}$
of $f$

(77)
$\int_{a}^{b}\left|{f-\ell_{2}}\right|d\mu\leqslant\frac{\left({f(a)-f(b)}\right)^{2}}{8D^{2}}\left|{\frac{1}{f^{\prime}_{r}(a)}-\frac{1}{f^{\prime}_{l}(b)}}\right|$

with the convention $1/\pm\infty=0$.

###### Proof.

If $f$ is a concave function on $[0,1]$ satisfying $f(0)=0$ and $f(1)=1$, with
a right derivative at 0 and a left derivative at 1, Guérin et al (2006) proved
that there exist a $D$-linear interpolation $\ell$ of $f$ on $[0,1]$ such that

(78)
$\int_{0}^{1}\left|{f-\ell}\right|d\mu\leqslant\frac{1}{2D^{2}}\frac{\left({f^{\prime}_{r}(0)-1}\right)\left({1-f_{l}^{\prime}(1)}\right)}{f^{\prime}_{r}(0)-f^{\prime}_{l}(1)}.$

The results established in Proposition 9 are deduced from (78) by arguing as
in the proof of Proposition 6. ∎

Let $t=2.3$, $a_{0}=b_{0}=0$ and $a_{1},b_{1}$ be numbers such that
$a_{1}<0<b_{1}$ and $|\phi(a_{1})|=|\phi(b_{1})|=t>0$. Since $\phi$ is
concave,

$\phi(x)\geqslant
t\left({\frac{x}{|a_{1}|}\wedge\frac{-x}{b_{1}}}\right)\quad\text{for
$x\in[a_{1},b_{1}]$.}$

In particular,

$\displaystyle 1$
$\displaystyle=\int_{{\mathbb{R}}}e^{\phi}d\mu>\int_{a_{1}}^{0}e^{tx/|a_{1}|}d\mu+\int_{0}^{b_{1}}e^{-tx/b_{1}}d\mu,$

and consequently,

(79) $\displaystyle
1>\frac{\left({|a_{1}|+b_{1}}\right)\left({1-e^{-t}}\right)}{t},\text{i.e.}\quad|a_{1}|+b_{1}\leqslant\frac{t}{1-e^{-t}}.$

Let us now define for all $j\geqslant 2$,

$a_{j}=\inf\left\\{{x\leqslant a_{1},\phi(x)\geqslant-
jt}\right\\}\quad\text{and}\quad b_{j}=\sup\left\\{{x\geqslant
b_{1},\phi(x)\geqslant-jt}\right\\}.$

Since $\phi$ is continuous, concave and tends to $-\infty$ at $\pm\infty$,
$a_{j}$ and $b_{j}$ exist, satisfy $\phi(a_{j})=\phi(b_{j})=-jt$ and for all
$j\geqslant 1$.

Let $J\geqslant 2$ and $D_{1},\ldots,D_{J}$ be positive integers. Applying
Proposition 9 to $\phi$, we can find two $D_{1}$-linear interpolations
$\ell_{1}^{-}$ and $\ell_{1}^{+}$ of $\phi$ on $[a_{1},0]$ and $[0,b_{1}]$
respectively that satisfy (76) and for all $j\in\\{2,\ldots,J\\}$, we can find
two $D_{j}$-linear interpolations $\ell_{j}^{-}$ and $\ell_{j}^{+}$ of $\phi$
on $[a_{j},a_{j-1}]$ and $[b_{j-1},b_{j}]$ respectively that satisfy (77). The
function

$\overline{\phi}=\sum_{i=1}^{J}\left[{\ell_{j}^{-}1\hskip-2.6pt{\rm
l}_{[a_{j},a_{j-1})}+\ell_{j}^{+}1\hskip-2.6pt{\rm
l}_{[b_{j-1},b_{j})}}\right]+(-\infty)1\hskip-2.6pt{\rm
l}_{{\mathbb{R}}\setminus[a_{J},b_{J}]}$

is $(2\sum_{j=1}^{J}D_{j})$-linear interpolation of $\phi$ on $[a_{J},b_{J}]$
and the function $\overline{p}=\exp\overline{\phi}$ is integrable and
satisfies

$1\geqslant
p(x)=e^{\phi(x)}\geqslant\overline{p}=e^{\overline{\phi}(x)}\quad\text{for all
$x\in{\mathbb{R}}$}.$

Since $\phi$ is concave and nondecreasing on $[a_{1},0]$,
$\phi^{\prime}_{l}(0)\geqslant 0$ and

$\displaystyle 0$
$\displaystyle\leqslant\frac{a_{1}^{2}}{\phi^{\prime}_{r}(a_{1})-\phi_{l}^{\prime}(0)}\left({\phi^{\prime}_{r}(a_{1})-\frac{\phi(0)-\phi(a_{1})}{|a_{1}|}}\right)\left({\frac{\phi(0)-\phi(a_{1})}{|a_{1}|}-\phi^{\prime}_{l}(0)}\right)$
$\displaystyle\leqslant\frac{a_{1}^{2}}{\phi^{\prime}_{r}(a_{1})-\phi_{l}^{\prime}(0)}\left({\phi^{\prime}_{r}(a_{1})-\frac{t}{|a_{1}|}}\right)\left({\frac{t}{|a_{1}|}-\phi^{\prime}_{l}(0)}\right)$
$\displaystyle\leqslant\frac{a_{1}^{2}}{\phi^{\prime}_{r}(a_{1})}\left({\phi^{\prime}_{r}(a_{1})-\frac{t}{|a_{1}|}}\right)\frac{t}{|a_{1}|}=t\left({|a_{1}|-\frac{t}{\phi_{r}^{\prime}(a_{1})}}\right).$

By arguing similarly on the interval $[0,b_{1}]$ and using the fact that
$\phi^{\prime}_{r}(0)\leqslant 0$, we obtain that

$\displaystyle 0$
$\displaystyle\leqslant\frac{b_{1}^{2}}{\phi_{r}^{\prime}(0)-\phi_{l}^{\prime}(b)}\left({\phi^{\prime}_{r}(0)-\frac{\phi(b_{1})-\phi(0)}{b_{1}}}\right)\left({\frac{\phi(b_{1})-\phi(0)}{b_{1}}-\phi^{\prime}_{l}(b_{1})}\right)$
$\displaystyle\leqslant
t\left({b_{1}-\frac{t}{|\phi_{l}^{\prime}(b_{1})|}}\right).$

Applying Proposition 9-(i), we obtain that

(80)
$\displaystyle\int_{a_{1}}^{b_{1}}\left|{\phi-\overline{\phi}}\right|d\mu\leqslant\frac{t}{2D_{1}^{2}}\left[{\left({|a_{1}|-\frac{t}{\phi_{r}^{\prime}(a_{1})}}\right)+\left({b_{1}-\frac{t}{|\phi_{l}^{\prime}(b_{1})|}}\right)}\right].$

Applying Proposition 9-(ii) on the intervals $[a_{j},a_{j-1}]$ and
$[b_{j-1},b_{j}]$ respectively with $j\in\\{2,\ldots,J\\}$, we obtain that

(81)
$\displaystyle\int_{a_{j}}^{a_{j-1}}\left|{\phi-\overline{\phi}}\right|d\mu$
$\displaystyle\leqslant\frac{t^{2}}{8D_{j}^{2}}\left({\frac{1}{\phi^{\prime}_{l}(a_{j-1})}-\frac{1}{\phi^{\prime}_{r}(a_{j})}}\right)$
(82)
$\displaystyle\int_{b_{j-1}}^{b_{j}}\left|{\phi-\overline{\phi}}\right|d\mu$
$\displaystyle\leqslant\frac{t^{2}}{8D_{j}^{2}}\left({\frac{1}{\phi^{\prime}_{l}(b_{j})}-\frac{1}{\phi^{\prime}_{r}(b_{j-1})}}\right).$

Choosing $K=\sqrt{t/(1-e^{-t})}$,

$D_{1}=\left\lceil KD\sqrt{t/2}\right\rceil\quad\text{and for all $j\geqslant
2$}\quad D_{j}=\left\lceil KDe^{-(j-1)t/2}\sqrt{t/8}\right\rceil,$

we deduce from (80) that

$\displaystyle\int_{a_{1}}^{b_{1}}\left|{p-\overline{p}}\right|d\mu$
$\displaystyle=\int_{a_{1}}^{b_{1}}e^{\phi}\left({1-e^{-(\phi-\overline{\phi})}}\right)d\mu\leqslant
e^{\phi(0)}\int_{a_{1}}^{b_{1}}\left({\phi-\overline{\phi}}\right)d\mu$
$\displaystyle\leqslant\frac{t}{2D_{1}^{2}}\left[{\left({|a_{1}|-\frac{t}{\phi_{r}^{\prime}(a_{1})}}\right)+\left({b_{1}-\frac{t}{|\phi_{l}^{\prime}(b_{1})|}}\right)}\right]$
(83)
$\displaystyle\leqslant\frac{1}{K^{2}D^{2}}\left[{\left({|a_{1}|-\frac{t}{\phi_{r}^{\prime}(a_{1})}}\right)+\left({b_{1}-\frac{t}{|\phi_{l}^{\prime}(b_{1})|}}\right)}\right]$

and from (81) and (82) that for all $j\in\\{2,\ldots,J\\}$,

$\displaystyle\int_{a_{j}}^{a_{j-1}}\left|{p-\overline{p}}\right|d\mu+\int_{b_{j-1}}^{b_{j}}\left|{p-\overline{p}}\right|d\mu$
$\displaystyle\leqslant
e^{\phi(a_{j-1})}\int_{a_{j}}^{a_{j-1}}\left({\phi-\overline{\phi}}\right)d\mu+e^{\phi(b_{j-1})}\int_{b_{j-1}}^{b_{j}}\left({\phi-\overline{\phi}}\right)d\mu$
$\displaystyle\leqslant\frac{e^{-(j-1)t}t^{2}}{8D_{j}^{2}}\left[{\frac{1}{\phi^{\prime}_{l}(a_{j-1})}-\frac{1}{\phi^{\prime}_{r}(a_{j})}+\frac{1}{\phi^{\prime}_{l}(b_{j})}-\frac{1}{\phi^{\prime}_{r}(b_{j-1})}}\right]$
(84)
$\displaystyle\leqslant\frac{1}{K^{2}D^{2}}\left[{\frac{t}{\phi^{\prime}_{l}(a_{j-1})}-\frac{t}{\phi^{\prime}_{r}(a_{j})}+\frac{t}{\phi^{\prime}_{l}(b_{j})}-\frac{t}{\phi^{\prime}_{r}(b_{j-1})}}\right].$

Summing up the inequalities (83) and (84) for $j\in\\{1,\ldots,J\\}$ and using
the fact that $\phi_{r}^{\prime}(x)\leqslant\phi^{\prime}_{l}(x)$ for all
$x\in{\mathbb{R}}$, we obtain

(85) $\displaystyle\int_{a_{J}}^{b_{J}}\left|{p-\overline{p}}\right|d\mu$
$\displaystyle\leqslant\frac{1}{K^{2}D^{2}}\left[{|a_{1}|+b_{1}-\frac{1}{\phi^{\prime}_{r}(a_{J})}-\frac{1}{\phi^{\prime}_{l}(b_{J})}}\right].$

For $j\geqslant J+1$ and $x\in[a_{j},a_{j-1}]$, $\overline{p}(x)=0\leqslant
p(x)\leqslant\phi(a_{j-1})+\phi^{\prime}_{l}(a_{j-1})(x-a_{j-1})$ and
consequently,

$\displaystyle\int_{a_{j}}^{a_{j-1}}\left|{p-\overline{p}}\right|d\mu$
$\displaystyle\leqslant\int_{a_{j}}^{a_{j-1}}\exp\left({\phi(a_{j-1})+\phi^{\prime}_{l}(a_{j-1})(x-a_{j-1})}\right)d\mu$
$\displaystyle\leqslant\frac{e^{-t(j-1)}}{\phi_{l}^{\prime}(a_{j-1})}\left({1-e^{-\phi^{\prime}_{l}(a_{j-1})(a_{j-1}-a_{j})}}\right)\leqslant\frac{e^{-t(j-1)}}{\phi_{l}^{\prime}(a_{j-1})}\leqslant\frac{e^{-t(j-1)}}{\phi_{l}^{\prime}(a_{J})}.$

Similarly, using that $\overline{p}(x)=0\leqslant
p(x)\leqslant\phi(b_{j-1})+\phi^{\prime}_{r}(b_{j-1})(x-b_{j-1})$ for all
$x\in[b_{j-1},b_{j}]$ with $j\geqslant J+1$ we obtain that

$\displaystyle\int_{b_{j-1}}^{b_{j}}\left|{p-\overline{p}}\right|d\mu$
$\displaystyle\leqslant\int_{b_{j-1}}^{b_{j}}\exp\left({\phi(b_{j-1})+\phi^{\prime}_{r}(b_{j-1})(x-b_{j-1})}\right)d\mu$
$\displaystyle\leqslant\frac{e^{-t(j-1)}}{\phi_{r}^{\prime}(b_{j-1})}\leqslant\frac{e^{-t(j-1)}}{\phi_{r}^{\prime}(b_{J})}.$

We deduce that

$\displaystyle\int_{{\mathbb{R}}\setminus[a_{J},b_{J}]}\left|{p-\overline{p}}\right|d\mu$
$\displaystyle=\sum_{j\geqslant
J+1}\left[{\int_{a_{j}}^{a_{j-1}}\left|{p-\overline{p}}\right|d\mu+\int_{b_{j-1}}^{b_{j}}\left|{p-\overline{p}}\right|d\mu}\right]$
$\displaystyle\leqslant\left[{\frac{1}{\phi_{l}^{\prime}(a_{J})}+\frac{1}{\phi_{r}^{\prime}(b_{J})}}\right]\sum_{j\geqslant
J+1}e^{-t(j-1)}$
$\displaystyle=\left[{\frac{1}{\phi_{l}^{\prime}(a_{J})}+\frac{1}{\phi_{r}^{\prime}(b_{J})}}\right]\frac{e^{-tJ}}{1-e^{-t}}.$

Let us choose $J$ such that

$J=\left\lceil\frac{1}{t}\log\left({\frac{K^{2}D^{2}}{1-e^{-t}}}\right)\right\rceil\geqslant\left({\frac{1}{t}\log\left({\frac{K^{2}D^{2}}{1-e^{-t}}}\right)}\right).$

Note that $J\geqslant 2$ since $D\geqslant 6>D_{0}=e^{t}\sqrt{1-e^{-t}}/K$.
With this choice of $J$

(86)
$\displaystyle\int_{{\mathbb{R}}\setminus[a_{J},b_{J}]}\left|{p-\overline{p}}\right|d\mu$
$\displaystyle\leqslant\left[{\frac{1}{\phi_{l}^{\prime}(a_{J})}+\frac{1}{\phi_{r}^{\prime}(b_{J})}}\right]\frac{1}{K^{2}D^{2}}.$

Adding inequalities (85) and (86), using (79) and Lemma 3 we obtain that the
density $q=\overline{p}/\int_{{\mathbb{R}}}\overline{p}d\mu$ satisfies

$\displaystyle\int_{{\mathbb{R}}}\left|{p-q}\right|d\mu\leqslant
2\int_{{\mathbb{R}}}\left|{p-\overline{p}}\right|d\mu\leqslant\frac{2\left({|a_{1}|+b_{1}}\right)}{K^{2}D^{2}}\leqslant\frac{2t}{(1-e^{-t})K^{2}D^{2}}=\frac{2}{D^{2}}$

and belongs to $\overline{\mathcal{O}}^{\text{LC}}_{D^{\prime}}$ with

$\displaystyle D^{\prime}$ $\displaystyle\leqslant
2\sum_{j=1}^{J}D_{j}+1\leqslant
KD\sqrt{2t}\left[{1+\frac{1}{2}\sum_{j=2}^{J}e^{-(j-1)t/2}}\right]+2J+1$
$\displaystyle\leqslant
D\left[{K\sqrt{2t}\left({1+\frac{e^{-t/2}}{2(1-e^{-t/2})}}\right)+\frac{2}{tD_{0}}\log\left({\frac{K^{2}D_{0}^{2}}{1-e^{-t}}}\right)+\frac{3}{D_{0}}}\right]$
$\displaystyle\leqslant 6D.$

Consequently,

$\inf_{q\in\overline{\mathcal{O}}^{\text{LC}}_{6D}}\int_{{\mathbb{R}}}\left|{p-q}\right|d\mu\leqslant\frac{2}{D^{2}}.$

This inequality, which holds for all positive log-concave densities, extend to
nonnegative ones by using the fact that the set gathering of the former are
dense in the set gathering the latter for the ${\mathbb{L}}_{1}$-norm. ∎

## References

  * Balabdaoui and Wellner, (2007) Balabdaoui, F. and Wellner, J. A. (2007).  A Kiefer-Wolfowitz theorem for convex densities.  In Asymptotics: particles, processes and inverse problems, volume 55 of IMS Lecture Notes Monogr. Ser., pages 1–31. Inst. Math. Statist., Beachwood, OH.
  * Baraud, (2016) Baraud, Y. (2016).  Bounding the expectation of the supremum of an empirical process over a (weak) vc-major class.  Electron. J. Statist., 10(2):1709–1728.
  * Baraud, (2021) Baraud, Y. (2021).  Tests and estimation strategies associated to some loss functions.  Probab. Theory Relat. Fields, 180(3):799–846.
  * Baraud and Birgé, (2016) Baraud, Y. and Birgé, L. (2016).  Rho-estimators for shape restricted density estimation.  Stochastic Process. Appl., 126(12):3888–3912.
  * Baraud and Birgé, (2018) Baraud, Y. and Birgé, L. (2018).  Rho-estimators revisited: General theory and applications.  Ann. Statist., 46(6B):3767–3804.
  * Birgé, (1987) Birgé, L. (1987).  On the risk of histograms for estimating decreasing densities.  Ann. Statist., 15(3):1013–1022.
  * Birgé, (1989) Birgé, L. (1989).  The Grenander estimator: a nonasymptotic approach.  Ann. Statist., 17(4):1532–1549.
  * Birgé, (1997) Birgé, L. (1997).  Estimation of unimodal densities without smoothness assumptions.  The Annals of Statistics, pages 970–981.
  * Chan et al., (2014) Chan, S. O., Diakonikolas, I., Servedio, R. A., and Sun, X. (2014).  Efficient density estimation via piecewise polynomial approximation.  Proceedings of the forty-sixth annual ACM symposium on Theory of computing.
  * Cule and Samworth, (2010) Cule, M. and Samworth, R. (2010).  Theoretical properties of the log-concave maximum likelihood estimator of a multidimensional density.  Electron. J. Stat., 4:254–270.
  * Devroye and Lugosi, (2001) Devroye, L. and Lugosi, G. (2001).  Combinatorial methods in density estimation.  Springer Series in Statistics. Springer-Verlag, New York.
  * Diakonikolas et al., (2016) Diakonikolas, I., Kane, D. M., and Stewart, A. (2016).  Efficient robust proper learning of log-concave distributions.  ArXiv, abs/1606.03077.
  * Diakonikolas et al., (2017) Diakonikolas, I., Kane, D. M., and Stewart, A. (2017).  Learning multivariate log-concave distributions.  In Kale, S. and Shamir, O., editors, Proceedings of the 2017 Conference on Learning Theory, volume 65 of Proceedings of Machine Learning Research, pages 711–727. PMLR.
  * Doss and Wellner, (2016) Doss, C. R. and Wellner, J. A. (2016).  Global rates of convergence of the MLEs of log-concave and $s$-concave densities.  Ann. Statist., 44(3):954–981.
  * Dümbgen and Rufibach, (2009) Dümbgen, L. and Rufibach, K. (2009).  Maximum likelihood estimation of a log-concave density and its distribution function: basic properties and uniform consistency.  Bernoulli, 15(1):40–68.
  * Feng et al., (2021) Feng, O. Y., Guntuboyina, A., Kim, A. K. H., and Samworth, R. J. (2021).  Adaptation in multivariate log-concave density estimation.  Ann. Statist., 49(1):129 – 153.
  * (17) Gao, F. and Wellner, J. A. (2009a).  On the rate of convergence of the maximum likelihood estimator of a $k$-monotone density.  Sci. China Ser. A, 52(7):1525–1538.
  * (18) Gao, F. and Wellner, J. A. (2009b).  On the rate of convergence of the maximum likelihood estimator of a k-monotone density.  Science in China Series A: Mathematics, 52(7):1525–1538.
  * Grenander, (1956) Grenander, U. (1956).  On the theory of mortality measurement. II.  Skand. Aktuarietidskr., 39:125–153 (1957).
  * Grenander, (1981) Grenander, U. (1981).  Abstract inference.  John Wiley & Sons, Inc., New York.  Wiley Series in Probability and Mathematical Statistics.
  * Groeneboom, (1985) Groeneboom, P. (1985).  Estimating a monotone density.  In Proceedings of the Berkeley conference in honor of Jerzy Neyman and Jack Kiefer, Vol. II (Berkeley, Calif., 1983), Wadsworth Statist./Probab. Ser., pages 539–555. Wadsworth, Belmont, CA.
  * Groeneboom et al., (2001) Groeneboom, P., Jongbloed, G., and Wellner, J. A. (2001).  A canonical process for estimation of convex functions: the “invelope” of integrated Brownian motion $+t^{4}$.  Ann. Statist., 29(6):1620–1652.
  * Guérin et al., (2006) Guérin, J., Marcotte, P., and Savard, G. (2006).  An optimal adaptive algorithm for the approximation of concave functions.  Mathematical Programming, 107(3):357–366.
  * Kim et al., (2018) Kim, A. K. H., Guntuboyina, A., and Samworth, R. J. (2018).  Adaptation in log-concave density estimation.  Ann. Statist., 46(5):2279–2306.
  * Kim and Samworth, (2016) Kim, A. K. H. and Samworth, R. J. (2016).  Global rates of convergence in log-concave density estimation.  Ann. Statist., 44(6):2756 – 2779.
  * Kur et al., (2019) Kur, G., Dagan, Y., and Rakhlin, A. (2019).  Optimality of maximum likelihood for log-concave density estimation and bounded convex regression.  arXiv preprint arXiv:1903.05315.
  * Rao, (1969) Rao, B. P. (1969).  Estimation of a unimodal density.  Sankhyā: The Indian Journal of Statistics, Series A, pages 23–36.
  * Wegman, (1970) Wegman, E. J. (1970).  Maximum likelihood estimation of a unimodal density, ii.  The Annals of Mathematical Statistics, pages 2169–2174.


# TimEHR: Image-based Time Series Generation for
Electronic Health Records

Hojjat Karami
EPFL
<EMAIL_ADDRESS>
&Mary-Anne Hartley
Yale, EPFL
&David Atienza
EPFL
&Anisoara Ionescu
EPFL

###### Abstract

Time series in Electronic Health Records (EHRs) present unique challenges for
generative models, such as irregular sampling, missing values, and high
dimensionality. In this paper, we propose a novel generative adversarial
network (GAN) model, TimEHR, to generate time series data from EHRs. In
particular, TimEHR treats time series as images and is based on two
conditional GANs. The first GAN generates missingness patterns, and the second
GAN generates time series values based on the missingness pattern.
Experimental results on three real-world EHR datasets show that TimEHR
outperforms state-of-the-art methods in terms of fidelity, utility, and
privacy metrics.

##  1 Introduction

Electronic health records (EHRs) chart patients’ interactions with the health
system and contain critical information for improving services and supporting
research. Data from these systems are routinely incorporated into machine
learning and statistical models for clinical decision support on diagnostic
and prognostic predictions, as well as for monitoring health and evaluating
treatment response [1]. However, access to large-scale EHR datasets is
challenging and governed by strict regulations on privacy and security (e.g.
HIPAA and GDPR), meaning that many models are based on unicentric data with a
high risk of poor generalizability [2].

Traditional approaches for anonymization can be complex and costly, often
compromising the data’s statistical integrity and failing to provide robust
privacy guarantees [3, 4]. The use of synthetic data is thus emerging as a
promising solution for optimizing the trade-off between privacy and
statistical utility [5, 6].

Generative models, particularly Generative Adversarial Networks (GANs) [7],
have shown great potential in producing distribution-preserving synthetic EHR
data. Their effectiveness spans various data modalities, including images [8,
9], clinical text [10, 11], discrete tabular EHRs (e.g. diagnoses and billing
ICD codes) [12, 13], and time series [14, 15].

Time series data is a sequence of observations of one or multiple variables
over a span of time. It can be regularly sampled (e.g., hourly temperature
measurements) or irregularly sampled, such as spontaneous observation of
clinical variables in the hospital. Sampling patterns introduce structured
missingness that can be predictive of the outcome and thus create an important
risk of ‘shortcut learning’ (predicting outcomes from the presence/absence of
data rather than its value). We can regard this as informative or biased
sampling because clinicians order tests based on a prior probability that the
patient has a certain condition, as drawn from their experience. In many real-
world applications, missingness is not random and might depend on some
unobserved factors (MNAR). However, many models assume that the missingness is
completely random (MCAR) or missing at random (MAR) [16, 17]. Understanding
these real-world patterns of missingness, is essential to differentiate signal
from the noise.

The commonly used deep learning architectures for time series are Recurrent
Neural Networks (RNNs) [18, 19], attention mechanism [20, 21], or one-
dimensional Convolutional Neural Networks (1D-CNNs) [22, 23, 24] where 1D
convolutional operations are applied over the time dimension to capture
temporal patterns and relationships. However, image-based time series modeling
based on 2D-CNNs has also been employed for time series forecasting [25, 26],
classification [27, 28, 29], and anomaly detection [30]. Especially for
irregularly sampled time series, ViTST aims to transform irregularly sampled
time series into line graphs and employ the Vision Transformer (ViT) for the
subsequent classification task [31].

We propose a novel GAN-based model, TimEHR, to generate synthetic EHR’s time
series data with irregular sampling and missing values. In particular, we
treat each patient’s time series as a 2-channel image (mask and values) and we
use 2D-CNN architecture. TimEHR consists of two modules that are trained
independently. The first module is a conditional Wasserstein GAN with gradient
penalty (CWGAN-GP) that generates missing patterns (mask channel) from the
noise and static data (e.g. demographics and outcome) as the conditional
vector [32]. The second module is a Pix2Pix GAN [33] that generates time
series values from the missing pattern and the static data as the conditional
vector. Once the two modules are trained, we can use pre-trained generators to
generate time series data. The main contributions of this paper are as
follows:

  * •

TimEHR 111The code will be available on github after acceptance. for more
information, please email the corresponding author. can generate irregularly
sampled time series with non-random missing values (MNAR). It is the first
work to use image-based time series generation for EHRs.

  * •

Our experiments on three large Electronic Health Record (EHR) datasets
demonstrate that TimEHR outperforms state-of-the-art methods in terms of
fidelity, utility, and privacy metrics.

  * •

Our evaluation on simulated sinusoidal time series reveals that TimEHR is
scalable to multivariate time series of up to length 128 and a number of
variables up to 128, accommodating various missingness rates.

##  2 Related Works

Most works on time series generation focus on regularly sampled time series
with no missingness. TimeGAN [34] is one of the early works that is based on
an AutoEncoder and a GAN module (AE-GAN) with RNN architectures to obtain a
dense latent space within which to generate samples. DoppelGANger [35] is
another RNN-based model that also handles metadata in a conditional GAN
framework. Here, we do not review the details of these works as they are not
inherently compatible with irregularly sampled time series.

Generating irregularly sampled time series with missing values is an under-
explored area. T-CGAN [22] uses a conditional GAN framework with 1D-CNN
architecture to generate irregularly sampled time series values conditioned on
the timestamps vector. However, the timestamp vector is randomly generated and
cannot handle missing values. RTSGAN [36] is a GRU-based AE-GAN model in which
an observation embedding and a novel decide-and-generate decoder are proposed
to handle irregular sampling and missingness. GT-GAN [37] is also an AE-GAN
method that utilizes various components, ranging from GRU-based neural
ordinary/controlled differential equations to continuous time-flow processes.
However, it can only generate irregularly sampled time series without missing
values. EHR-Safe [14] is based on a two-stage model consisting of sequential
encoder-decoder networks and GANs with stochastic normalization and explicit
mask modeling ideas to improve utility and privacy. Another line of research
explores the use of diffusion models for time series generation. TimeDIFF [15]
uses Denoising Diffusion Probabilistic Models (DDPM) and outperforms various
real-world EHR datasets in terms of data utility and privacy. TS-Diffusion
[38] integrates the inhomogeneous Poisson process and observation probability
into a diffusion model to overcome sample irregularity and missingness.

Among the mentioned works, RTSGAN, EHR-Safe, and TimeDIFF are the only models
that can handle both irregular sampling and missingness and have been
evaluated on EHR time series.

##  3 TimEHR

We begin by introducing the notation used in this paper. We then describe our
proposed model in detail.

###  3.1 Problem Formulation

An EHR dataset can be denoted as $\mathcal{D}=\\{(s_{i},T_{i})\\}_{i=1}^{N}$
where $N$ is the number of patients, $s_{i}$ is the static data (e.g.
demographics, outcomes), and $T_{i}$ is the time series data such as vital
signs and laboratory variables. The vector-based representation of each time
series $T_{i}$ is denoted by
$T_{i}=\\{(t_{j},\mathbf{x}_{j},\mathbf{m}_{j})\\}_{j=1}^{L}$. Here, $L$ is
the number of observations, $t_{j}\in\mathbb{R}_{\geq 0}$ is the time stamp,
$\mathbf{x}_{j}\in\mathbb{R}^{d}$ is the vector of time series values ($d$
variables) and $\mathbf{m}_{j}\in\\{0,1\\}^{d}$ is the mask vector (1 if
measured, 0 otherwise). The missing values in $\mathbf{x}_{j}$ are replaced by
zero. Our objective is to generate a synthetic EHR dataset $\mathcal{D}_{syn}$
that is similar to the real EHR dataset $\mathcal{D}$. We make the following
assumption:

######  Assumption 3.1.

We assume that the time series data $T_{i}$ causally depends on the static
data $s_{i}$, i.e., $P(s_{i},T_{i})=P(s_{i})P(T_{i}|s_{i}).$

Based on this assumption, instead of jointly generating static and time series
data, we first use a tabular GAN to generate static data and then use the
static data as the conditional vector to generate time series data using
TimEHR. This is similar to RCGAN[39] and DoppelGANger[35] where the authors
proposed to first generate metadata and then generate time series conditioned
on the generated metadata.

###  3.2 Time Series to Image

As we will treat time series data as images, we reshape each patient’s time
series data ($T_{i}$) into a two-channel image ($I_{i}$). For the first
channel ($I_{i,value}$), we convert $\\{(t_{j},\mathbf{x}_{j})\\}_{j=1}^{L}$
into a matrix of shape $[d,H]$ where $d$ is the number of variables and $H$ is
the number of time bins based on a desired time resolution ($r$). Here,
$I_{i,value}[m,n]$ is the last available observation of $m$-th variable in the
$\left((n-1)r,nr\right]$ interval (or zero if there is no observation). The
value channel is min-max normalized to the [-1,1] range. The second channel
($I_{i,mask}$) is the corresponding mask matrix (-1 for missing values
otherwise 1). It should be noted that our image is invariant to the order of
variables and we can shuffle the variables to obtain a different image. Figure
1 illustrates the image-view of an example patient’s time series data. This is
a compact form of representing time series data that highlights the non-random
missingness pattern.

Figure 1: An image-based representation of a patient’s time series data.
Colors are for visualization purposes only.

###  3.3 Overall Architecture

The overall architecture of TimEHR is shown in Figure 2. The first module is a
conditional Wasserstein GAN with Gradient Penalty (CWGAN-GP) that generates
synthetic samples (mask and values) from noise and a conditional vector
(static data and label). The second module is a Pix2Pix GAN [33] that
generates synthetic samples (only values) from the conditional vector and the
mask channel from the training data. In the inference step (Figure 2-III), we
use a Tabular GAN to generate static data, and the two trained generators to
generate synthetic time series data.

Figure 2: Model architecture. Module 1: CWGAN-GP for generating mask, Module
2: Pix2Pix for generating values, and Inference: generating synthetic time
series.

###  3.4 Module 1: CWGAN-GP

We use a conditional Wasserstein GAN architecture with gradient penalty
(CWGAN-GP) for generating images from noise and static data [32]. The
generator $G_{1}$ is a convolutional neural network (CNN) that takes as input
a Gaussian noise vector $z$ ($z\sim\mathcal{N}(0,1)$) and static data $s$, and
outputs an image $\tilde{I}$. The discriminator $D_{1}$ is also a CNN that
assigns scores for the generated and real images. The objective function of
the CWGAN-GP is given by:

$\displaystyle\min_{G}\max_{D}V(G_{1},D_{1})=\mathbb{E}_{I\sim
P_{I}}[D_{1}(I,s)]$ $\displaystyle-\mathbb{E}_{z\sim
P_{z}}[D_{1}(G_{1}(z,s),s)]$
$\displaystyle+\lambda_{GP}\mathbb{E}_{\hat{I}}\left[(\|\nabla_{\hat{I}}D_{1}(\hat{I},s)\|_{2}-1)^{2}\right],$

where $\hat{I}=\epsilon I+(1-\epsilon)G_{1}(z,s)$ and $\epsilon\sim U(0,1)$.
The first two terms represent the Wasserstein distance or Earth Mover’s
Distance (EMD) between the distribution of real and generated data. The last
term is the gradient penalty that enforces the Lipschitz constraint on the
discriminator. $\lambda_{GP}$ is the gradient penalty coefficient.

Architecture The generator $G_{1}$ consists of a series of convolutional
layers with batch normalization and ReLU activation. We apply an embedding
layer to the static data $s$ and concatenate it with the noise vector $z$. The
discriminator $D_{1}$ consists of a series of convolutional layers with batch
normalization and LeakyReLU activation. We apply another embedding layer for
the static data $s$ and add it as an additional channel to the input image.

###  3.5 Module 2: Pix2Pix

We use a conditional Pix2Pix architecture to generate the value channel from
the mask channel [33]. The generator $G_{2}$ takes as input a mask channel
($I_{mask}$) and static data $s$ and outputs a value channel
($\tilde{I}_{value}=G_{2}(I_{mask},s)$). The discriminator $D_{2}$ takes as
input a value channel ($I_{value}$ or $\tilde{I}_{value}$) and static data $s$
and outputs a scalar value $D_{2}(I_{value},s)$ that indicates the probability
that the image is real. The objective function of the Pix2Pix is given by:

$\displaystyle\mathcal{L}_{2}(G_{2},D_{2})=\mathbb{E}_{I_{value}}[\log
D_{2}(I_{value},s)]$
$\displaystyle+\mathbb{E}_{\tilde{I}_{value}}[\log(1-D_{2}(\tilde{I}_{value},s))].$

The first and second terms are the log probability the discriminator correctly
classifies the real data as real and the generated data as fake, respectively.
Our primary experiments showed that including noise as input to the generator
does not help generate diverse value channels from a fixed mask channel which
is consistent with the findings in [40, 33].

Earlier methods have discovered that it is advantageous to combine the GAN
objective with a reconstruction loss such as the L2 distance [41]. While the
role of the discriminator remains the same, the generator is now assigned the
dual task of deceiving the discriminator and closely matching the actual
output in terms of L2 similarity. We explore this idea by adding L2 loss to
the objective function:

$\displaystyle\mathcal{L}_{rec}(G_{2})=\mathbb{E}_{I_{value},\tilde{I}_{value}}[\|I_{value}-\tilde{I}_{value}\|_{2}].$

Our final objective is:

$\displaystyle\min_{G_{2}}\max_{D_{2}}V(G_{1},D_{1})=\mathcal{L}_{2}(G_{2},D_{2})+\lambda\mathcal{L}_{rec}(G_{2}).$

Architecture The generator has a U-Net architecture with skip connections [42]
with LeakyReLU activation in the down-sampling path and ReLU activation in the
up-sampling path. The discriminator is a PatchGAN classifier similar to [33]
that consists of several CNN layers of 2D convolutions, batch normalization
and LeakyReLU activation. This discriminator attempts to classify each
$P\times P$ patch in an image as real or fake, and only penalizes structure at
the patch scale.

###  3.6 Inference (Time Series Generation)

Once the models in the previous steps are trained, we can use the trained
generators ($G_{1}$ and $G_{2}$) to generate time series data from noise and
static data. Based on 3.1, we are flexible to use any conditional tabular GAN
such as CTGAN in [43] to generate static data. As the distribution of the
label is important in downstream evaluation, we use the label as a conditional
to generate other static variables. While the CWGAN-GP can independently
generate realistic time series with missing data, we use only the mask channel
as the input to the $G_{2}$. The inference procedure is shown in Algorithm 1.

Algorithm 1 Generating Synthetic Time Series

Input: Size $N$, Generators $G_{1}$ and $G_{2}$

Output: synthetic dataset
$\mathcal{D}_{syn}=\\{(\tilde{s}_{i},\tilde{T}_{i})\\}_{i=1}^{N}$

Generate $N$ static vectors $\\{\tilde{s}_{i}\\}_{i=1}^{N}$ using CTGAN

$\mathcal{D}_{syn}=\\{\\}$

for $i=1$ to $N$ do

generate noise $z_{i}$ from $\mathcal{N}(0,1)$

Generate mask pattern using $G_{1}$:

$\tilde{I}_{i,mask}=G_{1}(z_{i},\tilde{s_{i}}).mask$

Generate values from mask pattern using $G_{2}$:

$\tilde{I}_{i,value}=G_{2}(\tilde{I}_{i,mask},\tilde{s_{i}})$

Reshape $\tilde{I}_{i,mask}$ and $\tilde{I}_{i,value}$ into $\tilde{T}_{i}$

$\mathcal{D}_{syn}.append((\tilde{s}_{i},\tilde{T}_{i}))$

end for

##  4 Experiments

### Datasets

We use three publicly available EHR datasets to evaluate TimEHR: (1) Medical
Information Mart for Intensive Care III (MIMIC-III) [44], (2) the Physionet
Challenge 2012 (P12) [45], and (3) the Physionet Challenge 2019 (P19) [46].
The overall missing rates are 80.37%, 74.58%, and 79.40% for P12, P19, and
MIMIC-III, respectively and the main characteristics of the datasets are shown
in Table 1. We employ 5-fold cross-validation to evaluate the models. Since
the number of variables and observations is less than 64, we pad time series
images with zero to have an image of size $[2,64,64]$ (refer to Section 6 for
more details on data preprocessing).

Table 1: Datasets description Dataset | $N$ | $d$ | $L_{max}$ | Outcome(Prevalence)
---|---|---|---|---
MIMIC-III | 51k | 48 | 48 | Mortality(16.1%)
P12 | 12k | 35 | 48 | Mortality(14.2%)
P19 | 38k | 32 | 62 | Sepsis (7.2%)
Table 2: Fidelity Metrics: ($\uparrow$) higher is better, ($\downarrow$) lower is better. Dataset | Model | precision ($\uparrow$) | recall ($\uparrow$) | density ($\uparrow$) | coverage ($\uparrow$) | TCD ($\downarrow$)
---|---|---|---|---|---|---
P12 | RTSGAN | 0.441(0.036) | 0.428(0.018) | 0.237(0.025) | 0.381(0.025) | 0.055(0.008)
TimEHR | 0.775(0.02) | 0.651(0.05) | 0.657(0.054) | 0.782(0.024) | 0.019(0.001)
BL | 0.855(0.015) | 0.854(0.006) | 0.94(0.051) | 0.967(0.006) | 0.01(0.001)
P19 | RTSGAN | 0.633(0.048) | 0.602(0.015) | 0.407(0.053) | 0.581(0.031) | 0.031(0.019)
TimEHR | 0.791(0.026) | 0.657(0.03) | 0.814(0.104) | 0.77(0.051) | 0.021(0.002)
BL | 0.852(0.006) | 0.849(0.003) | 0.959(0.037) | 0.964(0.005) | 0.007(0.001)
MIMIC-III | RTSGAN | 0.687(0.041) | 0.539(0.022) | 0.488(0.066) | 0.611(0.047) | 0.052(0.007)
TimEHR | 0.762(0.027) | 0.622(0.039) | 0.759(0.111) | 0.798(0.055) | 0.035(0.001)
BL | 0.778(0.052) | 0.719(0.079) | 0.642(0.192) | 0.839(0.074) | 0.03(0.004)

### Evaluation Metrics

We need a reasonable embedding of each time series data ($T_{i}$) to compute
metrics. For each variable, we compute the common statistics (mean, standard
deviation, min, max) and the missing rate, and concatenate them into a vector
($\mathbf{e}_{i}\in\mathbb{R}^{5d}$). We briefly describe the evaluation
metrics below (more details on how these metrics are calculated are provided
in Section 8).

Fidelity We report precision, recall, density, and coverage (PRDC) metrics
between the estimated manifold of real and generated data distributions [47].
Additionally, we define a new metric called Temporal Correlation Difference
(TCD), which is the L1 norm of the difference between the correlation matrices
of the real and generated data normalized by $d(d-1)/2$. To compute each
correlation matrix, we first forward-fill time series value of each sample
($T_{i}$) and then compute the correlation matrix of the concatenated matrix
of all samples along the time axis. We neglect the pairs if at least one of
the variables is missing.

Utility Following the Train on Synthetic, Test on Real (TSTR) protocol [39],
we train a LightGBM Classifier on the synthetic data and evaluate its
performance on the test data. We report the area under the receiver operating
characteristic curve (AUROC) as well as the area under the precision-recall
curve (AUPRC) due to the high class imbalance of the datasets [48].

Privacy (1) Membership inference attack (MIA): This metric measures the
probability of data belonging to the training set [14]. We fit a K-Nearest
Neighbors (kNN) classifier on the synthetic data and calculate the nearest
distances of train and test splits to the fitted model. Any differences
between the distributions of the nearest distances of train and test splits
indicate that the synthetic data is not private. We report the Jensen-Shannon
Divergence ($JSD_{MIA}$) between the two distributions, as well as the AUROC
of a binary classifier that predicts whether a sample is from the training set
or not ($AUROC_{MIA}$).

(2) Nearest Neighbor Adversarial Accuracy Risk (NNAA): This score measures the
degree to which a generative model overfits the real training data, a factor
that could raise privacy-related concerns [49]. It is the difference between
two adversarial accuracies,
$AA_{test}(AA(\mathcal{D}_{gen},\mathcal{D}_{test}))$ and
$AA_{train}(AA(\mathcal{D}_{gen},\mathcal{D}_{train}))$ (see Section 8).

### Baselines

We use RTSGAN [36] as the baseline because it is the only model with available
code for generating irregularly sampled time series with missingness. Although
models such as TimeGAN can be adapted to irregularly sampled time series with
missingness (e.g. by defining mask matrix as additional features), we refrain
from this approach as it leads to very poor performance in prior works [36,
14, 15].

In addition to computing the metrics for TimEHR and the RTSGAN, we report the
metrics for the Train-Test pair as an ideal baseline (BL). This is a valid
idea, as we can consider the test data as highly authentic synthetic data. In
addition, it can reveal an expected value for each metric. We use a 5-fold
train-test split and report the mean and standard deviation of the metrics.

Figure 3: Top: Image-based visualization of three examples in P12. Bottom:
Temporal Correlation comparison in P12. The NaN values are shown in yellow.

###  4.1 Overall Performance

Fidelity Table 2 shows the fidelity metrics for TimEHR and RTSGAN, as well as
the test split (BL). We observe that TimEHR outperforms RTSGAN in terms of
PRDC and TCD. Although the ideal value is typically 1 for PRDC and 0 for TCD,
it is evident that this is not the case even for the test split (BL).

Figure 3 illustrates image-based visualization of three examples (Top) and the
correlation matrix (Bottom) from real data, TimEHR, and RTSGAN for the P12
dataset. Not only can TimEHR generate more realistic time series data than
RTSGAN (especially the missingness pattern), but it can better preserve the
temporal correlation structure of the variables. Notably, the RTSGAN
correlation matrix has many NaN values (in yellow), which implies that many
variable pairs (especially those with very high missingness rates) have not
been generated together. Although the input images to our model are invariant
with respect to the order of variables, our model is still capable of
capturing correlations between variables that are far from each other in the
input image.

Figure 4-top illustrates the t-SNE visualization of the real data, and the
generated data from TimEHR and RTSGAN for P12, P19, and MIMIC-III. We can see
that the generated samples by TimEHR demonstrate a notably better overlap with
the real data, which is also reflected in the PRDC metrics in Table 2. The
histogram of the length of Stay (LOS) is also shown in Figure 4-bottom.
Although TimEHR does not explicitly utilize any strategy for handling
variable-length time series, it can generate realistic LOS distribution.

Figure 4: t-SNE visualization (top) and length of stay (bottom) for P12, P19
and MIMIC-III datasets.

Utility Table 3 shows the utility metrics for TimEHR and RTSGAN in the
downstream task of binary classification. Here, we have also reported the
Train on Real and Test on Real (TRTR) case, where we train a classifier on the
training data and evaluate it on the test data. We see that TimEHR outperforms
RTSGAN in terms of AUROC and AUPRC for all datasets. The performance gain is
even higher in larger datasets (P19 and MIMIC-III), however, the AURPC is
considerably lower than the TRTR case.

Table 3: Utility Metrics Dataset | Model | AUROC | AUPRC
---|---|---|---
P12 | RTSGAN | 0.745(0.015) | 0.331(0.03)
TimEHR | 0.785(0.015) | 0.424(0.035)
TRTR | 0.832(0.008) | 0.475(0.023)
P19 | RTSGAN | 0.677(0.037) | 0.141(0.022)
TimEHR | 0.853(0.014) | 0.452(0.017)
TRTR | 0.908(0.011) | 0.618(0.011)
MIMIC-III | RTSGAN | 0.766(0.025) | 0.427(0.036)
TimEHR | 0.82(0.01) | 0.536(0.024)
TRTR | 0.863(0.012) | 0.621(0.028)

Privacy Table 4 shows the privacy metrics for TimEHR and RTSGAN. In general,
none of the metrics shows any privacy issues. The AUROC and JSD metrics for
MIA are close to the baseline for both models and show that the synthetic data
is private. The adversarial accuracy (AA) metrics ($AA_{train}$, $AA_{test}$)
are significantly higher than the baseline for both models. This is because
these metrics are sensitive to mode collapse or mode generation, and any
mismatch between the real and generated distributions can increase the
adversarial accuracy (this can also be seen in PRDC metrics). Since the AA
metrics do not show any privacy issues, we can conclude that the low NNAA
metrics for both models only indicate the asymmetry between $AA_{train}$ and
$AA_{test}$ rather than the privacy risk.

Table 4: Privacy Metrics. None of the metrics show privacy issues. Dataset | Model | $AUROC_{MIA}$ | $JSD_{MIA}$ | $AA_{train}$ | $AA_{test}$ | $NNAA$
---|---|---|---|---|---|---
P12 | RTSGAN | 0.496(0.008) | 0.001(0.001) | 0.882(0.008) | 0.887(0.007) | -0.006(0.002)
TimEHR | 0.494(0.01) | 0.001(0.0) | 0.735(0.017) | 0.747(0.015) | -0.012(0.016)
BL | 0.5 | 0 | 0.512(0.01) | 0.512(0.01) | 0
P19 | RTSGAN | 0.5(0.009) | 0.001(0.0) | 0.767(0.01) | 0.779(0.009) | -0.012(0.01)
TimEHR | 0.499(0.008) | 0.001(0.0) | 0.721(0.025) | 0.736(0.029) | -0.015(0.012)
BL | 0.5 | 0 | 0.518(0.012) | 0.518(0.012) | 0
MIMIC-III | RTSGAN | 0.491(0.025) | 0.005(0.002) | 0.777(0.021) | 0.856(0.057) | -0.079(0.04)
TimEHR | 0.488(0.024) | 0.004(0.002) | 0.733(0.041) | 0.837(0.061) | -0.104(0.062)
BL | 0.5 | 0 | 0.669(0.092) | 0.669(0.092) | 0

###  4.2 Ablation Study

We can further investigate whether the use of each of the proposed modules
improves the performance of the model. We conducted an ablation study by
removing each module and comparing the results with the full model. The
percent deviation of each metric from its baseline is shown in Figure 5. We
observe that TimEHR w/o Pix2Pix ($\square$ ) and TimEHR wo L2 ($\square$ )
have the worst fidelity and utility scores while preserving privacy. On the
other hand, TimEHR w/o CWGAN ($\square$ ) seems to have a perfect fidelity and
utility score. However, low privacy metrics ($AUROC_{MIA}$ and $AA_{train}$)
show that it is not a privacy-preserving model and it is memorizing the
training data. This can be attributed to the deterministic nature of Pix2Pix
module as it ignores the input noise. Additionally, we can argue that having
fidelity scores that are better than the baseline is associated with privacy
issues. Finally, TimEHR ($\times$ ) has the best performance in terms of
fidelity and utility while preserving privacy. Based on these results, we can
conclude that the CWGAN module improves the privacy of the model by generating
the missingness pattern, and the Pix2Pix module with L2 reconstruction loss
improves the fidelity and utility of the model by preserving the temporal
correlation structure.

Figure 5: Ablation study. Values are percent deviation from the baseline.

###  4.3 Simulated Data

We further investigate TimEHR on simulated sinusoidal time series data to
understand its capabilities. We generate 10,000 time series with $L=64$ and
$d\in\\{16,32,64\\}$, as well as a longer time series with $L=128$ and
$d=128$. A $128\times 128$ image seems to be a reasonable proxy for most of
the EHR datasets as it can capture a time horizon of around 5 days (hourly
data) and 128 variables. For each variable,
$x_{d}(t)=A_{d}\sin(\frac{2\pi}{P_{d}}t+\phi_{d})+\epsilon$ (full data
generating process in Section 6). Additionally, the missing pattern follows a
homogenous Poisson process with intensity function $\lambda^{*}(t)=\lambda$.
We use $\lambda\in\\{0.2,0.5,1,2\\}$ which corresponds to an overall missing
rate of 81.85%, 60.66%, 36.78%, and 13.64% respectively. Figure 6 shows the
TCD metric for different number of variables ($d$) and values of $\lambda$.
The maximum TCD value is still less than 0.035, which shows that TimEHR can
preserve the temporal correlation structure of the variables even for a large
number of variables and a high missing rate.

Figure 6: TCD for simulated data.

##  5 Conclusion

We have proposed TimEHR to generate irregularly sampled time series with
missingness from EHR datasets. It shows promising results in terms of
fidelity, utility, and privacy metrics on three large EHR datasets.

Limitations and Future Works Although our model exhibits acceptable privacy
metrics, it is not a privacy-preserving model as we have not considered any
privacy constraints in the training process. Thus, we leave it to future work
to incorporate privacy-preserving frameworks such as differential privacy into
the training process [50]. It is also interesting to explore other CNN-based
architectures to see if they can improve the performance of our model in terms
of model utility. In this work, we have experimented TimEHR on time series
images of size $64\times 64$ in EHR datasets and $128$ in the simulated
datasets. However, it would be interesting to see how the model performs on
datasets with longer time series and more variables.

Why we have used 2D-CNNs for time series? Our primary innovation lies in the
utilization of the reshape operation, transforming the time series into a two-
channel image. Retaining the missing pattern as an additional channel
facilitates the CWGAN-GP module in generating realistic missingness patterns.
Despite employing a kernel size of 4, the extensive layering in our CNN
architecture ensures that the model’s receptive field is sufficiently large to
capture the temporal correlation structure of the variables.

Is our model suitable for regularly sampled time series? In this work, we have
used the missingness pattern to generate realistic time series. As a result,
our second module (Pix2Pix) is unuseful for regularly sampled time series, as
it generates values based on the missingness pattern. However, the CWGAN
module can still be used to generate the values. We leave it for future work
to investigate the performance of our model on regularly sampled time series.

## References

  * [1] Maryam Tayefi, Phuong Ngo, Taridzo Chomutare, Hercules Dalianis, Elisa Salvi, Andrius Budrionis, and Fred Godtliebsen.  Challenges and opportunities beyond structured data in analysis of electronic health records.  WIREs Computational Statistics, 13(6):e1549, 2021.
  * [2] Ismail Keshta and Ammar Odeh.  Security and privacy of electronic health records: Concerns and challenges.  Egyptian Informatics Journal, 22(2):177–183, July 2021.
  * [3] Clete A. Kushida, Deborah A. Nichols, Rik Jadrnicek, Ric Miller, James K. Walsh, and Kara Griffin.  Strategies for de-identification and anonymization of electronic health record data for use in multicenter research studies.  Medical care, 50(Suppl):S82–101, July 2012.
  * [4] Mana Azarm-Daigle, Craig Kuziemsky, and Liam Peyton.  A Review of Cross Organizational Healthcare Data Sharing.  Procedia Computer Science, 63:425–432, January 2015.
  * [5] Arno Appenzeller, Moritz Leitner, Patrick Philipp, Erik Krempel, and Jürgen Beyerer.  Privacy and Utility of Private Synthetic Data for Medical Data Analyses.  Applied Sciences, 12(23):12320, January 2022.
  * [6] Mauro Giuffrè and Dennis L. Shung.  Harnessing the power of synthetic data in healthcare: Innovation, application, and privacy.  npj Digital Medicine, 6(1):1–8, October 2023.
  * [7] Ian J. Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio.  Generative Adversarial Networks, June 2014.
  * [8] Nripendra Kumar Singh and Khalid Raza.  Medical Image Generation using Generative Adversarial Networks, May 2020.
  * [9] Youssef Skandarani, Pierre-Marc Jodoin, and Alain Lalande.  GANs for Medical Image Synthesis: An Empirical Study.  Journal of Imaging, 9(3):69, March 2023.
  * [10] Scott H. Lee.  Natural language generation for electronic health records.  npj Digital Medicine, 1(1):1–7, November 2018.
  * [11] Kexin Huang, Jaan Altosaar, and Rajesh Ranganath.  ClinicalBERT: Modeling Clinical Notes and Predicting Hospital Readmission, November 2020.
  * [12] Mrinal Kanti Baowaly, Chia-Ching Lin, Chao-Lin Liu, and Kuan-Ta Chen.  Synthesizing electronic health records using improved generative adversarial networks.  Journal of the American Medical Informatics Association, 26(3):228–241, March 2019.
  * [13] Amirsina Torfi and Edward A. Fox.  CorGAN: Correlation-Capturing Convolutional Generative Adversarial Networks for Generating Synthetic Healthcare Records, March 2020.
  * [14] Jinsung Yoon, Michel Mizrahi, Nahid Farhady Ghalaty, Thomas Jarvinen, Ashwin S. Ravi, Peter Brune, Fanyu Kong, Dave Anderson, George Lee, Arie Meir, Farhana Bandukwala, Elli Kanal, Sercan Ö Arık, and Tomas Pfister.  EHR-Safe: Generating high-fidelity and privacy-preserving synthetic electronic health records.  npj Digital Medicine, 6(1):1–11, August 2023.
  * [15] Muhang Tian, Bernie Chen, Allan Guo, Shiyi Jiang, and Anru R. Zhang.  Fast and Reliable Generation of EHR Time Series via Diffusion Models, October 2023.
  * [16] Amelia L. M. Tan, Emily J. Getzen, Meghan R. Hutch, Zachary H. Strasser, Alba Gutiérrez-Sacristán, Trang T. Le, Arianna Dagliati, Michele Morris, David A. Hanauer, Bertrand Moal, Clara-Lea Bonzel, William Yuan, Lorenzo Chiudinelli, Priam Das, Harrison G. Zhang, Bruce J. Aronow, Paul Avillach, Gabriel. A. Brat, Tianxi Cai, Chuan Hong, William G. La Cava, He Hooi Will Loh, Yuan Luo, Shawn N. Murphy, Kee Yuan Hgiam, Gilbert S. Omenn, Lav P. Patel, Malarkodi Jebathilagam Samayamuthu, Emily R. Shriver, Zahra Shakeri Hossein Abad, Byorn W. L. Tan, Shyam Visweswaran, Xuan Wang, Griffin M. Weber, Zongqi Xia, Bertrand Verdy, Qi Long, Danielle L. Mowery, and John H. Holmes.  Informative missingness: What can we learn from patterns in missing laboratory data in the electronic health record?  Journal of Biomedical Informatics, 139:104306, March 2023.
  * [17] Emily Getzen, Lyle Ungar, Danielle Mowery, Xiaoqian Jiang, and Qi Long.  Mining for equitable health: Assessing the impact of missing data in electronic health records.  Journal of Biomedical Informatics, 139:104269, March 2023.
  * [18] Edward Choi, Mohammad Taha Bahadori, Andy Schuetz, Walter F. Stewart, and Jimeng Sun.  Doctor AI: Predicting Clinical Events via Recurrent Neural Networks.  In Proceedings of the 1st Machine Learning for Healthcare Conference, pages 301–318. PMLR, December 2016.
  * [19] Edward Choi, Mohammad Taha Bahadori, Joshua A. Kulas, Andy Schuetz, Walter F. Stewart, and Jimeng Sun.  RETAIN: An Interpretable Predictive Model for Healthcare using Reverse Time Attention Mechanism.  arXiv:1608.05745 [cs], February 2017.
  * [20] Max Horn, Michael Moor, Christian Bock, Bastian Rieck, and Karsten Borgwardt.  Set Functions for Time Series.  In Proceedings of the 37th International Conference on Machine Learning, pages 4353–4363. PMLR, November 2020.
  * [21] Xiang Zhang, Marko Zeman, Theodoros Tsiligkaridis, and Marinka Zitnik.  Graph-Guided Network for Irregularly Sampled Multivariate Time Series, March 2022.
  * [22] Giorgia Ramponi, P. Protopapas, M. Brambilla, and Ryan Janssen.  T-CGAN: Conditional Generative Adversarial Network for Data Augmentation in Noisy Time Series with Irregular Sampling.  arXiv.org, November 2018.
  * [23] Steven Cheng-Xian Li and Benjamin Marlin.  Learning from Irregularly-Sampled Time Series: A Missing Data Perspective.  In Proceedings of the 37th International Conference on Machine Learning, pages 5937–5946. PMLR, November 2020.
  * [24] Chrysoula Kosma, Giannis Nikolentzos, and Michalis Vazirgiannis.  Time-Parameterized Convolutional Neural Networks for Irregularly Sampled Time Series, August 2023.
  * [25] Srijan Sood, Zhen Zeng, Naftali Cohen, Tucker Balch, and Manuela Veloso.  Visual Time Series Forecasting: An Image-driven Approach.  In Proceedings of the Second ACM International Conference on AI in Finance, pages 1–9, November 2021.
  * [26] Artemios-Anargyros Semenoglou, Evangelos Spiliotis, and Vassilios Assimakopoulos.  Image-based time series forecasting: A deep convolutional neural network approach.  Neural Networks, 157:39–53, January 2023.
  * [27] Zhiguang Wang and Tim Oates.  Imaging Time-Series to Improve Classification and Imputation, May 2015.
  * [28] Nima Hatami, Yann Gavet, and Johan Debayle.  Classification of Time-Series Images Using Deep Convolutional Neural Networks, October 2017.
  * [29] Omolbanin Yazdanbakhsh and Scott Dick.  Multivariate Time Series Classification using Dilated Convolutional Neural Network, May 2019.
  * [30] Tailai Wen and Roy Keyes.  Time Series Anomaly Detection Using Convolutional Neural Networks and Transfer Learning, May 2019.
  * [31] Zekun Li, Shiyang Li, and Xifeng Yan.  Time Series as Images: Vision Transformer for Irregularly Sampled Time Series, October 2023.
  * [32] Ishaan Gulrajani, Faruk Ahmed, Martin Arjovsky, Vincent Dumoulin, and Aaron Courville.  Improved Training of Wasserstein GANs, December 2017.
  * [33] Phillip Isola, Jun-Yan Zhu, Tinghui Zhou, and Alexei A. Efros.  Image-to-Image Translation with Conditional Adversarial Networks.  In 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 5967–5976, July 2017.
  * [34] Jinsung Yoon, Daniel Jarrett, and Mihaela van der Schaar.  Time-series Generative Adversarial Networks.  September 2019.
  * [35] Zinan Lin, Alankar Jain, Chen Wang, Giulia Fanti, and Vyas Sekar.  Using GANs for Sharing Networked Time Series Data: Challenges, Initial Promise, and Open Questions.  In Proceedings of the ACM Internet Measurement Conference, pages 464–483, Virtual Event USA, October 2020. ACM.
  * [36] Hengzhi Pei, Kan Ren, Yuqing Yang, Chang Liu, Tao Qin, and Dongsheng Li.  Towards Generating Real-World Time Series Data.  December 2021.
  * [37] Jinsung Jeon, Jeonghak Kim, Haryong Song, Seunghyeon Cho, and Noseong Park.  GT-GAN: General Purpose Time Series Synthesis with Generative Adversarial Networks, October 2022.
  * [38] Yangming Li.  TS-Diffusion: Generating Highly Complex Time Series with Diffusion Models, November 2023.
  * [39] Cristóbal Esteban, Stephanie L. Hyland, and Gunnar Rätsch.  Real-valued (Medical) Time Series Generation with Recurrent Conditional GANs.  arXiv: Machine Learning, June 2017.
  * [40] Michael Mathieu, Camille Couprie, and Yann LeCun.  Deep multi-scale video prediction beyond mean square error, February 2016.
  * [41] Deepak Pathak, Philipp Krahenbuhl, Jeff Donahue, Trevor Darrell, and Alexei A. Efros.  Context Encoders: Feature Learning by Inpainting, November 2016.
  * [42] Olaf Ronneberger, Philipp Fischer, and Thomas Brox.  U-Net: Convolutional Networks for Biomedical Image Segmentation, May 2015.
  * [43] Lei Xu, Maria Skoularidou, Alfredo Cuesta-Infante, and Kalyan Veeramachaneni.  Modeling Tabular data using Conditional GAN, October 2019.
  * [44] Alistair E. W. Johnson, Tom J. Pollard, Lu Shen, Li-wei H. Lehman, Mengling Feng, Mohammad Ghassemi, Benjamin Moody, Peter Szolovits, Leo Anthony Celi, and Roger G. Mark.  MIMIC-III, a freely accessible critical care database.  Scientific Data, 3(1):160035, May 2016.
  * [45] Ikaro Silva, George Moody, Daniel J Scott, Leo A Celi, and Roger G Mark.  Predicting In-Hospital Mortality of ICU Patients: The PhysioNet/Computing in Cardiology Challenge 2012.
  * [46] Matthew A. Reyna, Christopher S. Josef, Russell Jeter, Supreeth P. Shashikumar, M. Brandon Westover, Shamim Nemati, Gari D. Clifford, and Ashish Sharma.  Early Prediction of Sepsis From Clinical Data: The PhysioNet/Computing in Cardiology Challenge 2019.  Critical Care Medicine, 48(2):210–217, February 2020.
  * [47] Muhammad Ferjad Naeem, Seong Joon Oh, Youngjung Uh, Yunjey Choi, and Jaejun Yoo.  Reliable Fidelity and Diversity Metrics for Generative Models, June 2020.
  * [48] Matthew B. A. McDermott, Lasse Hyldig Hansen, Haoran Zhang, Giovanni Angelotti, and Jack Gallifant.  A Closer Look at AUROC and AUPRC under Class Imbalance, January 2024.
  * [49] Andrew Yale, Saloni Dash, Ritik Dutta, Isabelle Guyon, Adrien Pavao, and Kristin P. Bennett.  Generation and evaluation of privacy preserving synthetic health data.  Neurocomputing, 416:244–255, November 2020.
  * [50] Liyang Xie, Kaixiang Lin, Shu Wang, Fei Wang, and Jiayu Zhou.  Differentially Private Generative Adversarial Network, February 2018.
  * [51] Alistair E. W. Johnson, Tom J. Pollard, and Roger G. Mark.  Reproducibility in critical care: A mortality prediction case study.  In Proceedings of the 2nd Machine Learning for Healthcare Conference, pages 361–376. PMLR, November 2017.
  * [52] Takuya Akiba, Shotaro Sano, Toshihiko Yanase, Takeru Ohta, and Masanori Koyama.  Optuna: A Next-generation Hyperparameter Optimization Framework, July 2019.
  * [53] Tuomas Kynkäänniemi, Tero Karras, Samuli Laine, Jaakko Lehtinen, and Timo Aila.  Improved Precision and Recall Metric for Assessing Generative Models, October 2019.

##  6 Datasets

In this work, we use three publicly available EHR datasets and a simulated
dataset to evaluate TimEHR:

### MIMIC-III

Medical Information Mart for Intensive Care III (MIMIC-III) [44] is a
centralized database with an extensive set of electronic health record (EHR)
data for individuals admitted to critical care units at Beth Israel Deaconess
Medical Center from 2001 to 2012. The dataset encompasses details such as
patient demographics, laboratory results, vital signs, procedures, caregiver
notes, and outcomes. We used 48 time series and four static variables (age,
height, weight, mortality) using the reproducibility pipeline from [51]. This
led to 50,961 patients. The overall missingness rate is 79.40%.

### Physionet Challenge 2012 (P12)

This dataset [45] contains 35 time series and six static variables (age,
gender, height, weight, ICU type, and mortality) for 12,000 ICU patients. The
overall missingness rate is 80.37%.

### Physionet Challenge 2019 (P19)

This dataset [46] consists of 32 time series and four static variables (age,
gender, admission time, sepsis shock) for 40,333 patients. The overall
missingness rate is 74.58%.

### Simulated Data

The full algorithm for generating simulated data is shown in Algorithm 2.

Algorithm 2 Generating Simulated Time Series

Input: Size $N$, number of variables $d$, Poisson rate $\lambda$, Time series
length $L$, Period range $[T_{min},T_{max}]$ Data=np.zeros((N,L,d))

for $d=1$ to $D$ do

$\phi_{d}=uniform(0,2\pi)$

$T_{d}=rand(T_{min},T_{max})$

for $i=1$ to $N$ do

Generate Values:

$t=np.arange(L)$

$A=U(0.9,1)$

$b=U(-0.5,0.5)$

$\epsilon=Normal(0,0.1,L)$

$\epsilon_{T}=rand(1,5)$

$\epsilon_{T}=U(0,2\pi/50)$

$Data[i,:,d]=b+Asin(2\pi t/(T_{d}+\epsilon_{T})+\phi_{d})+\epsilon$

Set Missingness Pattern:

$poisson\\_counts=Poisson(\lambda,L)$

$mask=np.where(poisson\\_counts>0,1,0)$

$Data[i,mask==0,d]=NaN$

end for

end for

### Data Preprocessing

We use a 5-fold train-test split. We use the first 64 (48) hours of each
patient’s ICU stay for P19 (P12 and MIMIC-III) and the time series are
aggregated into 1-hour intervals. If we have multiple observations, we keep
the last one and in the case of no observation we use NaN. Then, they are
normalized to have zero mean and unit variance (NaN values are ignored), and
the outlier values (more than 3 standard deviations from the mean) are
clipped. Finally, we perform a min-max normalization to scale the values
between -1 and 1. For static variables, we use one-hot encoding for
categorical variables and standardization for continuous variables.

The next step is to reshape the time series into images. Each patient time
series is a matrix of shape $[L_{i},d]$ where $L_{i}$ is the length of the
time series and $d$ is the number of variables. We pad this matrix with zeros
to have a shape of $[64,64]$. We form a similar mask matrix where 1 indicates
a measured value and -1 indicates a missing value. We replace NaN values with
0 in the time series matrix. Finally, we concatenate the time series and mask
matrices along the channel axis to form a 2-channel image of shape
$[2,64,64]$.

##  7 Training Details

The training algorithms for CWGAN-GP and Pix2Pix are shown in Algorithm 3 and
Algorithm 4, respectively.

Algorithm 3 Training CWGAN-GP

Input: Training data $\mathcal{D}_{train}$, Batch size $B$

Initialize: $G_{1}$ and $D_{1}$.

for $epoch=1$ to $n_{epochs}$ do

sample minibatch of $B$ noise samples $\\{z_{1},\ldots,z_{B}\\}$ from $P_{z}$

sample minibatch of $B$ real data samples $\\{I_{1},\ldots,I_{B}\\}$ from
$P_{data}$

Training $D_{1}$:

$\tilde{I}_{i}=G_{1}(z_{i},s_{i})$

$\hat{I_{i}}=\epsilon I_{i}+(1-\epsilon)\tilde{I}_{i}$

$\mathcal{L}_{D_{1}}=-\frac{1}{B}\sum_{i=1}^{B}D_{2}(I_{i})+\frac{1}{B}\sum_{i=1}^{B}D_{2}(\tilde{I}_{i})$

$\mathcal{L}_{D_{1}}=\mathcal{L}_{D_{1}}+\lambda_{GP}\mathbb{E}_{\hat{I}\sim
P_{\hat{I}}}[(\|\nabla_{\hat{I}}D_{1}(\hat{I})\|_{2}-1)^{2}]$

Update $D_{1}$ using $\nabla_{D_{1}}\mathcal{L}_{D_{1}}$

Training $G_{1}$:

$\tilde{I}_{i}=G_{1}(z_{i},s_{i})$

$\mathcal{L}_{G_{1}}=-\frac{1}{B}\sum_{i=1}^{B}D_{1}(\tilde{I}_{i})$

Update $G_{1}$ using $\nabla_{G_{1}}\mathcal{L}_{G_{1}}$

end for

Algorithm 4 Training Pix2Pix

Input: Training data $\mathcal{D}_{train}$, Batch size $B$

Initialize: $G_{2}$ and $D_{2}$.

for $epoch=1$ to $n_{epochs}$ do

sample minibatch of $B$ real data missing pattern
$\\{I_{1,mask},\ldots,I_{B,mask}\\}$ from $\mathcal{D}_{train}$

Training $D_{2}$:

$\tilde{I}_{i,value}=G_{2}(I_{i,mask},s_{i})$

$\mathcal{L}_{D_{2}}=-\frac{1}{B}\sum_{i=1}^{B}[\log
D_{2}(I_{i,value},s_{i})]-\frac{1}{B}\sum_{i=1}^{B}[\log(1-D_{2}(\tilde{I}_{i,value},s_{i}))]$

Update $D_{2}$ using $\nabla_{D_{2}}\mathcal{L}_{D_{2}}$

Training $G_{2}$:

$\tilde{I}_{i,value}=G_{2}(I_{i,mask},s_{i})$

$\mathcal{L}_{G_{2}}=-\frac{1}{B}\sum_{i=1}^{B}[\log
D_{2}(\tilde{I}_{i,value},s_{i})]$

$\mathcal{L}_{rec}=\frac{1}{B}\sum_{i=1}^{B}[\|I_{i,value}-\tilde{I}_{i,value}\|_{2}]$

$\mathcal{L}_{G_{2}}=\mathcal{L}_{G_{2}}+\lambda\mathcal{L}_{rec}$

Update $G_{2}$ using $\nabla_{G_{2}}\mathcal{L}_{G_{2}}$

end for

### Hyperparameters

We used Optuna library [52] for hyperparameter tuning. We explored learning
rate in the range of $[1e-5,1e-2]$ and batch size in the range of $[32,256]$.
The kernel size is 4 for all datasets. For CWGAN-GP, we used an Adam optimizer
with a learning rate of 3e-4 and a batch size of 128. We train the model for
150 epochs. We use a gradient penalty coefficient ($\lambda_{GP}$) of 10 for
CWGAN-GP. For Pix2Pix, we used an Adam optimizer with a learning rate of 2e-3
and a batch size of 32. We train the model for 150 epochs. The reconstruction
loss coefficient ($\lambda_{L2}$) is 200 for P19 dataset and 100 for other
datasets. We use a linear decay learning rate scheduler for the first 50
epochs. We use a gradient penalty coefficient ($\lambda_{GP}$) of 10 for
CWGAN-GP.

##  8 Metrics

In this section, we describe the metrics used in the paper.

### Precision, Recall, Density, Coverage

Let X and Y be two sets of samples from the real and generated data
distributions. [53] first proposed to construct the manifold for $P(X)$ and
$Q(Y)$ separately. This object is nearly identical to the probabilistic
density function except that it does not sum to 1. Precision then measures the
expected likelihood of fake samples against the real manifold and recall
measures the expected likelihood of real samples against the fake manifold.
Density improves upon the precision metric by fixing the overestimation of the
manifold around real outliers. Coverage improves upon the recall metric to
better quantify this by building the nearest neighbor manifolds around the
real samples, instead of the fake samples, as they have fewer outliers [47].

Precision
$\displaystyle:=\frac{1}{M}\sum_{j=1}^{M}\mathbb{I}_{y\in\text{manifold}(X_{1},\ldots,X_{N})},$
Recall
$\displaystyle:=\frac{1}{N}\sum_{i=1}^{N}\mathbb{I}_{x\in\text{manifold}(Y_{1},\ldots,Y_{M})},$
Density
$\displaystyle:=\frac{1}{kM}\sum_{j=1}^{M}\sum_{i=1}^{N}\mathbb{I}{y_{j}\in
B(X_{i},NND_{k}(X_{i}))},$ Coverage
$\displaystyle:=\frac{1}{N}\sum{i=1}^{N}\mathbb{I}_{\exists j\text{ s.t.
}y_{j}\in B(X_{i},NND_{k}(X_{i}))},$

where $N$ and $M$ are the number of real and generated samples.
$\mathbb{I}_{(\cdot)}$ is the indicator function, and manifolds are defined
as:

$\text{manifold}(X_{1},\ldots,X_{N}):=\bigcup_{i=1}^{N}B(X_{i},\text{NND}(X_{i})),$

where $B(x,r)$ is the sphere in $\mathbb{R}^{D}$ around $x$ with radius $r$.
$\text{NND}_{k}(X_{i})$ denotes the distance from $X_{i}$ to the $k^{th}$
nearest neighbour among $\\{X_{j}\\}$ excluding itself.

### Nearest Neighbor Adversarial Accuracy (NNAA)

This metric was proposed in [49] to measure the degree to which a generative
model overfits the real training data. The Adversarial Accuracy (AA) between
two sets of samples X and Y is defined as:

$AA(X,Y)=\frac{1}{2}\left(\frac{1}{N}\sum_{i=1}^{N}\mathbb{I}\\{d_{XY}(i)>d_{XX}(i)\\}+\frac{1}{N}\sum_{i=1}^{N}\mathbb{I}\\{d_{YX}(i)>d_{YY}(i)\\}\right),$

where $\mathbb{I}\\{\cdot\\}$ is the indicator function, and the distances are
defined as:

$\displaystyle d_{XY}(i)=\min_{j}\lVert x_{X}^{(i)}-x_{Y}^{(j)}\rVert,\quad
d_{YX}(i)=\min_{j}\lVert x_{Y}^{(i)}-x_{X}^{(j)}\rVert,$ $\displaystyle\quad
d_{XX}(i)=\min_{\begin{subarray}{c}j,j\neq i\end{subarray}}\lVert
x_{X}^{(i)}-x_{X}^{(j)}\rVert,\quad d_{YY}(i)=\min_{\begin{subarray}{c}j,j\neq
i\end{subarray}}\lVert x_{Y}^{(i)}-x_{Y}^{(j)}\rVert,$

In principle, we expect that the nearest neighbors of a sample in either set
$X$ or $Y$ would be from the opposite set in 50 percent of cases. Thus, the
ideal value of $AA(X,Y)$ is 0.5. However, if the model overfits the training
data (i.e. the model memorizes the training data), the value of $AA(X,Y)$ will
be lower than 0.5 because the nearest neighbors of a sample in $X$ or $Y$
would be from the opposite set in most cases. Thus, we can interpret
$AA(X,Y)<0.5$ as a sign of overfitting or privacy issues. Considering three
sets of samples $X_{train}$, $X_{test}$, and $X_{synthetic}$, we can define
the the following metrics:

$\displaystyle AA_{train}=AA(X_{train},X_{synthetic}),$ $\displaystyle
AA_{test}=AA(X_{test},X_{synthetic}),$ $\displaystyle
AA_{baseline}=AA(X_{train},X_{test})$ $\displaystyle
NNAA=AA_{\text{test}}-AA_{\text{train}},$

##  9 Additional Results

### Statistical Similarity

Tables 5, 6 and 7 show the statistical similarity for P12, P19, and MIMIC
datasets, respectively. We report the mean and standard deviation of each
variable for the train and test data as well as the generated data from TimEHR
and RTSGAN. We use Cohen’s d to quantify the effect size of the difference
between two group means, indicating the magnitude of the observed difference
in standard deviation units. We can see that TimEHR has a better mean and
standard deviation for most of the variables especially for the variables with
a high missing rate.It is notable that in MIMIC-III dataset, RTSGAN has failed
to generate any data for three variables.

Table 5: Statistical Similarity for P12 dataset. (*) and (**) denote medium and large effect size, respectively. Variable (Missing Rate%) |  Train |  Test |  TimEHR |  RTSGAN
---|---|---|---|---
HR (4.3) |  86.4 (17.3) |  86.3 (17.5) | 88.8 (12.4) |  89 (17.6)
Urine (27.2) |  103 (99.9) |  108 (106) | 111 (80.3) |  116 (86.4)
SysABP (42.6) |  120 (22.2) |  120 (22.2) | 118 (17.6) |  118 (18.5)
DiasABP (42.8) |  59.4 (11.7) |  59.8 (11.9) | 60.9 (8.85) |  58.9 (9.39)
MAP (43) |  79.7 (14.3) |  80.1 (14.5) | 79.6 (10.9) |  79 (11.2)
ALP (98.3) |  108 (85.3) |  102 (70.5) | 97.4 (55.8) |  116 (74.4)
Albumin (98.7) |  2.88 (0.647) |  2.91 (0.656) | 3 (0.574) |  3.31 (0.604)**
TroponinT (98.9) |  0.814 (1.54) |  0.871 (1.58) | 0.787 (1.08) |  2.04 (2.25)**
TroponinI (99.8) |  7.22 (9.04) |  7.54 (10.8) | 7.26 (6.52) |  2.16 (1.14)**
Cholesterol (99.8) |  153 (40.9) |  154 (39.6) | 138 (37.4)* | 164 (28.2)*
Table 6: Statistical Similarity for P19 dataset. (*) and (**) denote medium and large effect size, respectively. Variable (Missing Rate%) |  Train |  Test |  TimEHR |  RTSGAN
---|---|---|---|---
HR (2.3) |  84.2 (16.8) |  83.8 (16.6) | 81.4 (12.3) |  85 (15.8)
MAP (5.4) |  81.9 (15.3) |  81.7 (15.1) | 80.5 (13.5) |  81.8 (14.2)
O2Sat (6.1) |  97.3 (2.41) |  97.4 (2.39) | 97.1 (2.1) |  97.6 (1.93)
SBP (7.4) |  123 (22.3) |  123 (22.3) | 123 (20.5) |  123 (19.9)
Resp (8.7) |  18.5 (4.6) |  18.4 (4.57) | 18 (3.81) |  18.1 (3.92)
AST (98.3) |  151 (342) |  150 (326) | 103 (238) |  144 (219)
Bilirubin total (98.4) |  1.45 (1.85) |  1.4 (1.64) | 1.27 (1.33) |  1.51 (1.46)
TroponinI (98.9) |  5.76 (13.1) |  5.73 (13.2) | 3.28 (6.59)* |  3.32 (5.14)*
Fibrinogen (99.3) |  277 (131) |  275 (130) | 252 (94.3)* |  221 (93.2)*
Bilirubin direct (99.8) |  1.3 (2.01) |  1.15 (1.94) | 1.01 (1.24) | 2.05 (2.21)*
Table 7: Statistical Similarity for MIMIC-III dataset. (*) and (**) denote medium and large effect size, respectively. NaN indicates that no data has been generated for that variable. Variable (Missing Rate%) |  Train |  Test |  TimEHR |  RTSGAN
---|---|---|---|---
heartrate (3.2) |  85.2 (16.9) |  85.2 (16.9) | 85.9 (13.6) |  84.6 (16.3)
resprate (5.3) |  19.3 (5.24) |  19.4 (5.27) | 19.5 (4.54) |  19.2 (4.68)
meanbp (7) |  78.1 (14.2) |  78.2 (14.2) | 78.8 (11.9) |  78.2 (14.2)
sysbp (7.1) |  120 (21) |  120 (20.9) | 122 (17.7) |  120 (19.4)
diasbp (7.3) |  60 (13.3) |  60 (13.3) | 60.4 (11.6) |  60 (13)
bg chloride (99.8) |  106 (5.94) |  107 (5.87) | 107 (5.92) |  104 (4.28)**
bands (99.8) |  7.85 (7.94) |  7.87 (7.69) | 7.62 (6.18) |  9.53 (7.02)*
bg methemoglobin (100) |  1.82 (3.51) |  3.2 (5.11)* | 7.49 (3.62)** |  NaN
bg carboxyhemoglobin (100) |  1.23 (0.531) |  1.31 (0.73) | 1.5 (0.355)** |  NaN
bg bicarbonate (100) |  23.4 (5.12) |  21.5 (4.46)* | 22.6 (4.99) | NaN

### Image-based Visualization

We visualize the image-based representation of a nine real and generated time
series in Figure 7. This representation has two advantages: (1) it can
highlight the missingness pattern, and (2) it can show all variables in a
single image. We observe that TimEHR samples are more realistic. In
particular, the missingness pattern of RTSGAN samples are visually different
from the real data.

Figure 7:  Image-based visualization of real and generated time series for
three EHR datasets.

### Correlation Matrix

Figures 8, and 9 show the correlation matrix for P19, and MIMIC-III datasets,
respectively. We observe that TimEHR has a better correlation matrix compared
to RTSGAN.

Figure 8: Correlation matrix for P19 dataset. The NaN values are shown in
yellow. Figure 9: Correlation matrix for MIMIC-III dataset. The NaN values are
shown in yellow.

### Ablation Study

In this section, we report the absolute metric values from Figure 5. Tables 8,
9, and 10 show the fidelity, utility, and privacy metrics, respectively. We
can see that TimEHR w/o CWGAN has fidelity scores that are better than the
baseline and privacy issues as well. The perfect utility score of TimEHR w/o
CWGAN is not desired as the model is memeorizing the training data.

Table 8: Fidelity metrics in the ablation study. Dataset | Model | precision ($\uparrow$) | recall ($\uparrow$) | density ($\uparrow$) | coverage ($\uparrow$) | TCD ($\downarrow$)
---|---|---|---|---|---|---
P12 | TimEHR wo CWGAN | 1(0.0) | 1.21(0.025) | 1(0.0) | 1(0.0) | 0.004(0.001)
TimEHR wo Pix2Pix | 0.392(0.049) | 0.309(0.074) | 0.431(0.053) | 0.212(0.037) | 0.072(0.006)
TimEHR wo L2 | 0.302(0.079) | 0.317(0.118) | 0.468(0.06) | 0.054(0.021) | 0.086(0.023)
TimEHR | 0.782(0.024) | 0.657(0.054) | 0.775(0.02) | 0.651(0.05) | 0.019(0.001)
BL | 0.967(0.006) | 0.94(0.051) | 0.855(0.015) | 0.854(0.006) | 0.01(0.001)
P19 | TimEHR wo CWGAN | 0.999(0.002) | 1.43(0.044) | 0.998(0.003) | 0.984(0.03) | 0.008(0.003)
TimEHR wo Pix2Pix | 0.297(0.074) | 0.25(0.076) | 0.361(0.066) | 0.273(0.087) | 0.042(0.004)
TimEHR wo L2 | 0.159(0.048) | 0.206(0.066) | 0.416(0.055) | 0.047(0.014) | 0.091(0.051)
TimEHR | 0.77(0.051) | 0.814(0.104) | 0.791(0.026) | 0.657(0.03) | 0.021(0.002)
BL | 0.964(0.005) | 0.959(0.037) | 0.852(0.006) | 0.849(0.003) | 0.007(0.001)
MIMIC-III | TimEHR wo CWGAN | 0.972(0.02) | 1.19(0.136) | 0.99(0.005) | 0.947(0.017) | 0.014(0.002)
TimEHR wo Pix2Pix | 0.377(0.051) | 0.322(0.14) | 0.431(0.105) | 0.358(0.1) | 0.065(0.003)
TimEHR wo L2 | 0.171(0.035) | 0.24(0.085) | 0.369(0.086) | 0.036(0.011) | 0.124(0.022)
TimEHR | 0.798(0.055) | 0.759(0.111) | 0.762(0.027) | 0.622(0.039) | 0.035(0.001)
BL | 0.839(0.074) | 0.642(0.192) | 0.778(0.052) | 0.719(0.079) | 0.03(0.004)
Table 9: Utility metrics in the ablation study. Dataset | Model | AUROC | AUPRC
---|---|---|---
P12 | TimEHR wo CWGAN | 0.826(0.012) | 0.462(0.029)
TimEHR wo Pix2Pix | 0.768(0.038) | 0.375(0.05)
TimEHR wo L2 | 0.654(0.043) | 0.265(0.036)
TimEHR | 0.785(0.015) | 0.424(0.035)
BL | 0.832(0.008) | 0.475(0.023)
P19 | TimEHR wo CWGAN | 0.888(0.01) | 0.592(0.024)
TimEHR wo Pix2Pix | 0.77(0.044) | 0.314(0.084)
TimEHR wo L2 | 0.602(0.048) | 0.113(0.02)
TimEHR | 0.853(0.014) | 0.452(0.017)
BL | 0.908(0.011) | 0.618(0.011)
MIMIC-III | TimEHR wo CWGAN | 0.829(0.009) | 0.553(0.025)
TimEHR wo Pix2Pix | 0.8(0.013) | 0.493(0.031)
TimEHR wo L2 | 0.66(0.049) | 0.291(0.051)
TimEHR | 0.82(0.01) | 0.536(0.024)
BL | 0.863(0.012) | 0.621(0.028)
Table 10: Privacy metrics in the ablation study. Bold values indicate privacy issues. Dataset | Model | $AUROC_{MIA}$ | $AA_{train}$ | $AA_{test}$
---|---|---|---|---
P12 | TimEHR wo CWGAN | 0.003(0.001) | 0.001(0.001) | 0.551(0.01)
TimEHR wo Pix2Pix | 0.497(0.009) | 0.935(0.009) | 0.937(0.013)
TimEHR wo L2 | 0.496(0.012) | 0.957(0.013) | 0.96(0.01)
TimEHR | 0.494(0.01) | 0.735(0.017) | 0.747(0.015)
BL | 0.5(0.0) | 0.512(0.01) | 0.512(0.01)
P19 | TimEHR wo CWGAN | 0.124(0.118) | 0.067(0.102) | 0.564(0.018)
TimEHR wo Pix2Pix | 0.5(0.006) | 0.936(0.022) | 0.941(0.018)
TimEHR wo L2 | 0.499(0.008) | 0.979(0.006) | 0.979(0.008)
TimEHR | 0.499(0.008) | 0.721(0.025) | 0.736(0.029)
BL | 0.5(0.0) | 0.518(0.012) | 0.518(0.012)
MIMIC-III | TimEHR wo CWGAN | 0.223(0.043) | 0.185(0.049) | 0.781(0.076)
TimEHR wo Pix2Pix | 0.493(0.019) | 0.9(0.019) | 0.945(0.03)
TimEHR wo L2 | 0.495(0.027) | 0.977(0.006) | 0.988(0.006)
TimEHR | 0.488(0.024) | 0.733(0.041) | 0.837(0.061)
BL | 0.5(0.0) | 0.669(0.092) | 0.669(0.092)