Two series of long wavelength excitable near infrared (NIR) fluorescent molecules with aggregation-induced emission characteristics are developed to prepare NIR AIE nanoparticles for accurate tumor detection and image-guided tumor resection.