Machine learning for security applications under dynamic and adversarial environments