Computer vision enabled oxygen sensing
Luminescence-based chemical sensors are almost universally read as point detectors with the signal inverted through a single calibration model. Here we reframe optical oxygen sensing as a computer vision problem, in which the sensing film acts as a spatially heterogeneous encoder and a pretrained Temporal Vision Transformer (TViT) as its decoder. The heterogeneity in film thickness, diffusion path length and illumination translate to pixels that provide complementary information on the underlying diffusion dynamics. We achieved up to 54% lower mean absolute error (MAE) by increasing the internal diversity in performance of a pixel group; a gain that linear models cannot reproduce. Using a low-cost platform comprising a Raspberry Pi camera, a UV LED and a porous PtOEP/polystyrene film in tandem with a TViT architecture yielded an MAE of ~6.7 μmol/L, a 96% reduction from the two-site Stern-Volmer (SV) model. We showed that this framework can computationally mitigate the fundamental trade-off between mechanical robustness and temporal response in diffusion limited oxygen sensing by reducing T90 response times by 91%, while exhibiting physically plausible dynamics under a Rauch-Tung-Striebel smoother (2.3% flag rate). The framework was applied across setups, environments and biofilm states, establishing an IoT-compatible paradigm for computationally compensated diffusion-limited chemical sensing.