Early non-invasive diagnosis of coronary heart disease (CHD) is critical. However, it is challenging to achieve accurate CHD diagnosis via detecting breath. In this work, heterostructured complexes of black phosphorus (BP) and two-dimensional carbide and nitride (MXene) with high gas sensitivity and photo responsiveness were formulated using a self-assembly strategy. A light-activated virtual sensor array (LAVSA) based on BP/Ti3C2Tx was prepared under photomodulation and further assembled into an instant gas sensing platform (IGSP). In addition, a machine learning (ML) algorithm was introduced to help the IGSP detect and recognize the signals of breath samples to diagnose CHD. Due to the synergistic effect of BP and Ti3C2Tx as well as photo excitation, the synthesized heterostructured complexes exhibited higher performance than pristine Ti3C2Tx, with a response value 26% higher than that of pristine Ti3C2Tx. In addition, with the help of a pattern recognition algorithm, LAVSA successfully detected and identified 15 odor molecules affiliated with alcohols, ketones, aldehydes, esters, and acids. Meanwhile, with the assistance of ML, the IGSP achieved 69.2% accuracy in detecting the breath odor of 45 volunteers from healthy people and CHD patients. In conclusion, an immediate, low-cost, and accurate prototype was designed and fabricated for the noninvasive diagnosis of CHD, which provided a generalized solution for diagnosing other diseases and other more complex application scenarios.