Step 1: Analyze the given equation.
We are given:
$$
z^8 - 20z^4 + 64 = 0.
$$
Let \( w = z^4 \). Then the equation becomes:
$$
w^2 - 20w + 64 = 0.
$$
Solve using the quadratic formula:
$$
w = \frac{20 \pm \sqrt{(-20)^2 - 4(1)(64)}}{2} = \frac{20 \pm \sqrt{400 - 256}}{2} = \frac{20 \pm \sqrt{144}}{2} = \frac{20 \pm 12}{2}.
$$
So:
$$
w = 16 \quad \text{or} \quad w = 4.
$$
Thus:
$$
z^4 = 16 \quad \text{and} \quad z^4 = 4.
$$
Step 2: Find the roots of \( z^4 = 16 \).
The fourth roots of 16 are:
$$
z = 2, \quad z = 2i, \quad z = -2, \quad z = -2i.
$$
Imaginary roots: \( z = 2i, -2i \)
Step 3: Find the roots of \( z^4 = 4 \).
The fourth roots of 4 are:
$$
z = \sqrt{2}, \quad z = i\sqrt{2}, \quad z = -\sqrt{2}, \quad z = -i\sqrt{2}.
$$
Imaginary roots: \( z = i\sqrt{2}, -i\sqrt{2} \)
Step 4: List all imaginary roots.
Imaginary roots are:
$$
z = 2i, -2i, i\sqrt{2}, -i\sqrt{2}
$$
Step 5: Compute the sum of their squares.
$$
(2i)^2 + (-2i)^2 + (i\sqrt{2})^2 + (-i\sqrt{2})^2 = -4 - 4 - 2 - 2 = -12.
$$
Step 6: Final Answer.
$$
\boxed{-12}
$$