Foodborne bacterial contamination creates significant public health and economic challenges. In the United States, the CDC estimates that foodborne illness causes approximately 48 million illnesses and 3000 deaths annually. Rapid screening is important because conventional confirmation methods are time- and labor-intensive. Microscopy-based analysis of early bacterial microcolonies can enable detection within hours rather than days, yet manual inspection is slow, subjective, and impractical at scale. Although deep learning object detectors such as YOLO offer a promising solution, the impact of architectural design choices on microscopy-based bacterial detection has not been systematically characterized under controlled conditions. In this work, we conducted a controlled architectural evaluation of YOLOv8 for detecting bacterial microcolonies in high-resolution microscopy images. We replaced the CSP-Darknet backbone with EfficientNetV2 variants and evaluated three feature fusion designs: no neck, the original PAN-FPN neck, and a NAS-FPN-inspired neck. All experiments were performed under identical conditions on a two-class dataset of Salmonella and E. coli. Our results show that EfficientNetV2 architectures consistently outperform the YOLOv8x baseline, which achieved 0.891 precision, 0.867 recall, and 0.898 mAP@50. The best overall performance was obtained with EfficientNetV2-S and the original YOLOv8 neck, reaching 0.976 precision, 0.968 recall, and 0.987 mAP@50, with comparable performance of 0.986 mAP@50 achieved by EfficientNetV2-S + NAS-FPN. The highest precision was obtained with EfficientNetV2-L + NAS-FPN, reaching 0.978. These findings demonstrate that effective bacterial detection depends on the interaction between backbone capacity and feature fusion design rather than backbone scaling alone.
Instance segmentation of small, dense, low-contrast microcolonies against confounding food matrices limits early microscopy-based screening for Salmonella and E. coli. We present BactSegNet, combining EfficientNetV2, BiFPN, selective-kernel attention, and growth-stage FiLM conditioning based on a learnable embedding of recorded acquisition stage. BE-NAS explored a 2304-configuration search space and evaluated 71 unique architectures. Across twelve retrained candidates, proxy and full-training rankings agreed (Spearman for mAP@50 and for mAP@50–95). Across the 71 architectures evaluated in the BE-NAS proxy search, three-seed proxy fitness showed high reliability (; 213 seed-level evaluations), while phenotype caching reduced 180 scheduled evaluations to 71 unique trainings (213 rather than 540 seed-level proxy runs). On expert-verified polygon instances spanning six stages, two species, and onion-present/absent conditions, BactSegNet-L achieved mask mAP@50 = and mAP@50–95 = , percentage points above a multi-seed YOLOv8 baseline and higher mAP@50 than sixteen class-aware single-run references across three paradigms. A capacity-preserving stage-perturbation control reduced mAP@50 from with correct stage assignments to after shuffling image–stage correspondence across three seeds. Gains reached pp for Salmonella at h and pp on onion. Across 2756 matched instances, area MAPE was with , dominated by the largest instances. BactSegNet-Efficient retained mAP@50 with fewer FLOPs at fps. The main dataset comprises pure-culture frames; an independent, expert-annotated mixed-culture evaluation (400 images, 3.5 and 4.0 h) yielded mask mAP@50= across three seeds without retraining. Recorded growth-stage metadata are required at inference, unlike the image-only comparison models. These results support early, physically calibrated microcolony segmentation while distinguishing the original pure-culture evaluation from the additional mixed-culture test.