The role of local interactions in behavioral contrast