The antennae contain cryptochrome, a photoreceptor protein sensitive to the violet-blue part of the light spectrum.
Yet, it has also been suggested that homing pigeons and other birds use the visually mediated cryptochrome receptor as a compass.
Activation of cryptochrome may affect the light-sensitivity of retinal neurons, with the overall result that the bird can see the magnetic field.
The surrounding magnetic field affects the kind of this correlation (parallel or anti-parallel), and this in turn affects the length of time cryptochrome stays in its activated state.