  For any fixed $d\geq1$ and subset $X$ of $\mathbb{N}^d$, let $r_X(n)$ be the
maximum cardinality of a subset $A$ of $\{1,\dots,n\}^d$ which does not contain
a subset of the form $\vec{b} + rX$ for $r>0$ and $\vec{b} \in \mathbb{R}^d$.
Such a set $A$ is said to be \emph{$X$-free}. The Multidimensional Szemer\'edi
Theorem of Furstenberg and Katznelson states that $r_X(n)=o(n^d)$. We show
that, for $|X|\geq 3$ and infinitely many $n\in\mathbb{N}$, the number of
$X$-free subsets of $\{1,\dots,n\}^d$ is at most $2^{O(r_X(n))}$. The proof
involves using a known multidimensional extension of Behrend's construction to
obtain a supersaturation theorem for copies of $X$ in dense subsets of $[n]^d$
for infinitely many values of $n$ and then applying the powerful hypergraph
container lemma. Our result generalizes work of Balogh, Liu, and Sharifzadeh on
$k$-AP-free sets and Kim on corner-free sets.
