Rule-based Out-Of-Distribution Detection