there's a link at the bottom to the code (https://github.com/antiboredom/camera-motion-detector/). I use optical flow and then just count the percentage of pixels that appear to be moving away from the center. If that's bigger than ARBITRARY_THRESHOLD it's a zoom-in.
I'm sure it's not rocket science, but I don't know how to do this offhand.