Abstract
<title>Abstract</title> <p>Quantitative gas sensing in realistic, chemically complex environments, such as urban air, remains challenging because interferent species can competitively adsorb, deactivate sensor surfaces and cause cross-sensitivity. This limits many promising sensor technologies, especially where absolute quantification rather than classification is required. Here, we report a waveguide-based nanoplasmonic H₂ sensor comprising seven different physical metal nanoparticle arrays that are optically convolved into 64 virtual sensing materials. Combined with an encoder-only transformer deep-learning model, this architecture enables accurate H₂ quantification in a simulated Jakarta urban-air environment based on real weather data, with high and varying humidity and deactivating CO, CO₂ and NOx interferents. The same model also quantifies the interfering species throughout the measurement by actively exploiting cross-sensitivity. Finally, transformer attention maps identify which virtual sensing regions dominate under different sensing conditions, providing a future route to sensor-material optimization using information collected from devices deployed in realistic operating environments.</p>