A rapid method to detect and/or remove mobile insects inside granular material is presented. The core of this method is to heat grain samples to the desired temperatures (about 55 C) using microwave or radio frequency energy to force insects to move out of the granular material.