Gokula explains the process of detecting and handling adversarial attacks. By passing the input through a discriminator and setting a threshold, users can control the sensitivity of their predictions. The cleaning procedure involves bringing the adversarial sample back into the data manifold, guided by the discriminator score. The susceptibility of neural networks to adversarial attacks is attributed to the linear surfaces they learn.