By Song-Quan Ong, Ph.D.
Urban pest surveillance still relies on visual inspection or manually counting cockroaches one by one from a sticky trap or cockroach house. For pest control professionals and public health authorities, this labor-intensive process limits how often traps can be checked and how widely infestations can be monitored. However, new research suggests that artificial intelligence (AI) may soon change this. By applying computer vision to images of cockroaches captured on sticky traps, researchers are exploring how automated detection systems could transform how cities monitor one of the world’s most persistent urban pests.
Cockroaches are among the most common and troublesome insects in urban environments. In addition to being an unwelcome sight in homes and restaurants, they are widely regarded as indicators of poor sanitation and can contribute to food contamination and allergen exposure. Several species are particularly well adapted to human environments, including the German cockroach (Blattella germanica), American cockroach (Periplaneta americana), brownbanded cockroach (Supella longipalpa), and Australian cockroach (Periplaneta australasiae). Because these insects thrive where food and shelter are readily available, monitoring their presence can provide valuable information about sanitation conditions in urban food premises.
Traditionally, cockroach surveillance relies on baited sticky traps placed in kitchens, storage areas, or other locations where pests are likely to occur. After a set period, inspectors collect the traps and count the insects captured. While effective, this approach requires significant time and labor, especially when monitoring large numbers of locations.
Monitoring cockroach infestations still requires substantial manual work because inspectors must check traps and count insects individually, which can limit the frequency of surveillance activities.
To explore whether this process could be automated, my colleagues and I at the Universiti Malaysia Sabah investigated the use of computer vision, a form of artificial intelligence that enables computers to recognize objects in images, to detect and count cockroaches captured on sticky traps. The aim was to determine whether AI models could be trained to identify cockroaches in trap images and perform automated counting quickly and consistently. We reported our findings in a study published in March in the Journal of Integrated Pest Management.
We conducted surveys at 97 food premises across four areas—Gaya Street, Api-Api, KK Times Square, and Damai—in Kota Kinabalu, Sabah, North Borneo, Malaysia. These locations represent busy urban districts with a high concentration of food businesses and frequent human activity. Sticky traps baited to attract cockroaches were deployed in the premises, and the captured insects were imaged for analysis.
The images were then processed using deep-learning object-detection models. The team compared several versions of the widely used “You Only Look Once” (YOLO) detection framework, including YOLOv5, YOLOv8, and YOLOv12. These models are designed to locate and identify objects within images quickly and accurately.
Among the tested systems, YOLOv8 provided the most consistent and reliable detection results and was ultimately selected for automated counting. Once trained, the model could scan trap images and identify cockroaches captured on the adhesive surfaces.
Analysis of the trap images revealed four cockroach species in the surveyed premises. The German cockroach dominated, accounting for more than 95 percent of detections. This finding aligns with previous studies showing that this species is the most common cockroach pest in indoor environments such as restaurants and food preparation areas.
The automated detection results also enabled us to examine how infestations varied across the study areas. The highest infestation rates were found in KK Times Square and Gaya Street, locations known for their dense clusters of restaurants and high tourist activity. By combining detection data with geographic information, our team produced a heatmap visualizing infestation density across the surveyed districts. Such visualizations highlight one of the potential advantages of computer vision-based monitoring. Instead of simply recording counts from individual traps, digital detection systems can generate spatial maps of pest activity, giving authorities a clearer view of where infestations are concentrated.
If integrated into routine monitoring programs, this technology could enable pest management professionals and local authorities to track infestations more efficiently across large urban areas. The approach has the potential to transform traditional surveillance methods by allowing large numbers of traps to be analyzed quickly and systematically.
Although our study relied on images collected from traps during field surveys, future systems could become even more automated. One possible development involves traps equipped with small cameras that periodically capture images of the adhesive surface. These images could then be transmitted to a central server or cloud-based platform, where AI models would automatically analyze them. Alternatively, modular camera stations could be deployed to scan traps, enabling high-quality image acquisition and rapid detection across larger areas. Such approaches could bridge traditional trap-based sampling with computer vision, transforming routine monitoring into an automated surveillance system capable of identifying infestation hotspots much earlier.
Such systems could offer several advantages. Automated detection could significantly reduce the time required to analyze trap data, allowing hundreds of traps to be processed quickly. Pest management teams could deploy monitoring networks across larger urban areas, generating continuous data on pest activity instead of relying on occasional manual inspections. Additionally, digital monitoring could support more proactive pest management strategies. If infestation levels begin to rise in a particular location, authorities could respond earlier with sanitation inspections or targeted pest control measures.
Further work is needed before such systems are widely adopted. Larger datasets collected from diverse environments and higher-quality image data would help improve the robustness of AI models. Expanding the system to detect additional pest species could also increase its usefulness in integrated pest management programs.
Of course, despite the automated processes demonstrated in cockroach identification and counting, artificial intelligence (AI) is unlikely to replace pest control professionals. Effective pest management still requires human experts to confirm species identification, apply practical knowledge of treatment and intervention methods, and make adaptive adjustments and decisions in complex and unpredictable urban environments. Nonetheless, AI can provide powerful tools to support surveillance and decision-making in urban pest management. As cities continue to grow and food establishments become more concentrated in dense urban districts, efficient pest monitoring is increasingly important. Technologies that automate detection and analysis may help public health authorities and pest managers keep closer watch on urban pest populations and respond more quickly when infestations emerge.
“Practical use of computer vision for cockroach monitoring in food premises: a case study in North Borneo, Malaysia”
Journal of Integrated Pest Management
Song-Quan Ong, Ph.D., is a senior lecturer at the Institute for Tropical Biology and Conservation at Universiti Malaysia Sabah in Kota Kinabalu, Sabah, Malaysia. Email: songquan.ong@ums.edu.my.
Subscribe to get the latest posts sent to your email.
Pests and Diseases Threaten Crapemyrtle in U.S. Landscapes and Nurseries
Non-Repellent Insecticide Prevents Fire Ant Infestations in Nursery Plant Root Balls
A survey of state integrated pest management coordinators shows positive signs of IPM uptake in agricultural settings, but common barriers remain. In general, the more profitable, testable, and understandable the practices, the more likely growers are to adopt them. [Read more]
A new study finds zero evidence that flies and cockroaches can carry the virus that causes COVID-19 from one surface to another—adding to a chorus of studies finding no role among arthropods in coronavirus transmission. [Read more]
A study by researchers at North Carolina State University demonstrates that female cockroaches reproduce faster when they are touched by other cockroaches. In fact, they found that even the touch of artificial antennae in the [Read more]
This site uses Akismet to reduce spam. Learn how your comment data is processed.
Never miss a new post on Entomology Today! Enter your email address to subscribe.
Never miss a new post on Entomology Today! Enter your email address to subscribe.
RSS – Posts
© Copyright Entomological Society of America, Annapolis, Maryland, USA
Subscribe now to keep reading and get access to the full archive.
Continue reading

Leave a Reply