Heterodimers of upconversion nanoparticles (UCNPs) and gold yolk–shell nanoparticles are fabricated for the quantification of polymyxin‐B‐resistant Escherichia coli. They produce two signals, circular dichroism (CD) and upconversion luminescence (UCL). Interestingly, due to the different affinity of polymyxin B for sensitive and resistant strain, as the concentration of polymyxin B increases, the amount of UCNPs in sensitive bacteria increases sharply, increasing the intracellular UCL signal at a low polymyxin B concentration immobilized on the UCNP. The CD intensity is correspondingly reduced as the amount of UCNPs in solution decreased. Meanwhile, for polymyxin‐B‐resistant strain, the intracellular UCL increases slowly even in a high polymyxin B concentration, and the CD intensity in solution is also enhanced because of the inefficient entering of UCNP. Therefore, based on the concentration of polymyxin B coupled to the UCNPs, the levels of polymyxin‐B‐resistant bacteria can be detected with dual signals. Importantly, with 980 nm irradiation, both polymyxin‐B‐sensitive strains and polymyxin‐resistant bacteria used to induce infection in mice are detected with UCL imaging in vivo and treated well with photodynamic therapy. This novel dual‐mode heterodimer has potential utility for the advanced surveillance and control of drug‐resistant bacteria.