[1] https://www.recode.net/2017/10/15/16472896/alphabet-waymo-se...
Instead of recognizing the lights or something you could create a communication of some sort where the officer's vehicle provides a key that the car can then authenticate that it's a real police officer making the pull over request.
Heck you could even check with a police department system that the officer is on duty and in that area so a stolen police car or key couldn't be used.
1: https://www.quora.com/What-are-the-different-police-uniforms...