Enhancing AI microscopy for foodborne bacterial classification via adversarial domain adaptation across optical and biological variability
Siddhartha Bhattacharya, Aarham Wasit, Mason Earles, Nitin Nitin, Luyao Ma, Jiyoon Yi
TL;DR
This study tackles rapid detection and classification of foodborne bacteria with AI-enabled microscopy under optical and biological variability, aiming to reduce culture-based incubation time. It uses EfficientNetV2 as the shared feature extractor and leverages adversarial domain adaptation via DANNs and MDANNs to learn domain-invariant features, optimizing a joint loss $L = \mathcal{L}_C + \lambda \mathcal{L}_D$ via a gradient reversal layer and an adaptive weight $\tau$. Results show target-domain accuracy gains up to $54.45\%$, $43.44\%$, and $31.67\%$ for different domains, with source degradation $<4.44\%$, and MDANNs offering strong generalization particularly in the BF domain; Grad-CAM and t-SNE confirm domain alignment. The few-shot learning approach enables scalable deployment with as few as $1$–$5$ labeled samples per species, reducing reliance on staining, extended incubation, and highly specialized equipment, making the framework suitable for decentralized and resource-limited settings. This work lays the groundwork for unsupervised domain adaptation and integration with cross-modality imaging to further enhance robustness and applicability.
Abstract
Rapid detection of foodborne bacteria is critical for food safety and quality, yet traditional culture-based methods require extended incubation and specialized sample preparation. This study addresses these challenges by i) enhancing the generalizability of AI-enabled microscopy for bacterial classification using adversarial domain adaptation and ii) comparing the performance of single-target and multi-domain adaptation. Three Gram-positive (Bacillus coagulans, Bacillus subtilis, Listeria innocua) and three Gram-negative (E. coli, Salmonella Enteritidis, Salmonella Typhimurium) strains were classified. EfficientNetV2 served as the backbone architecture, leveraging fine-grained feature extraction for small targets. Few-shot learning enabled scalability, with domain-adversarial neural networks (DANNs) addressing single domains and multi-DANNs (MDANNs) generalizing across all target domains. The model was trained on source domain data collected under controlled conditions (phase contrast microscopy, 60x magnification, 3-h bacterial incubation) and evaluated on target domains with variations in microscopy modality (brightfield, BF), magnification (20x), and extended incubation to compensate for lower resolution (20x-5h). DANNs improved target domain classification accuracy by up to 54.45% (20x), 43.44% (20x-5h), and 31.67% (BF), with minimal source domain degradation (<4.44%). MDANNs achieved superior performance in the BF domain and substantial gains in the 20x domain. Grad-CAM and t-SNE visualizations validated the model's ability to learn domain-invariant features across diverse conditions. This study presents a scalable and adaptable framework for bacterial classification, reducing reliance on extensive sample preparation and enabling application in decentralized and resource-limited environments.
