  We prove that if $M$ is a CW-complex and $*$ is a 0-cell of $M$, then the
crossed module $\Pi_2(M,M^1,*)$ does not depend on the cellular decomposition
of $M$ up to free products with $\Pi_2(D^2,S^1,*)$, where $M^1$ is the
1-skeleton of $M$. From this it follows that if $G$ is a finite crossed module
and $M$ is finite, then the number of crossed module morphisms $\Pi_2(M,M^1,*)
\to G$ (which is finite) can be re-scaled to a homotopy invariant $I_G(M)$ (i.
e. not dependent on the cellular decomposition of $M$). We describe an
algorithm to calculate $\pi_2(M,M^{(1)},*)$ as a crossed module over
$\pi_1(M^{(1)},*)$, in the case when $M$ is the complement of a knotted surface
in $S^4$ and $M^{(1)}$ is the 1-handlebody of a handle decomposition of $M$,
which, in particular, gives a method to calculate the algebraic 2-type of $M$.
In addition, we prove that the invariant $I_G$ yields a non-trivial invariant
of knotted surfaces.
