Modeling circuit mechanisms of opposing cortical responses to visual flow perturbations