Coherent anti-Stokes Raman scattering with phase-shaped pulses exploits interference effects for optical discrimination of molecules in complex mixtures. We present our approaches combining adaptive pulse shaping and closed-loop optimization strategies for chemically selective microscopy