A device for detecting a group of offending objects and determining that the number of offending objects is above a predetermined threshold of offending objects. The device uses an image capturing system to scan areas to detect flying objects such as flying insects to detect a presence of a swarm of such flying objects. An action head on the device is configured to automatically respond once a swarm of objects is identified. The action head may disperse the swarm by expelling a substance such as a mist, smoke, repellant or insecticide.