Algorithm Can Detect When Cars Are About to Run a Red Light