Intelligent collision detection