Deep learning method for improved anomaly detection