 Our proposed deep learning-based approach using self-taught learning, STL, on NSLKDD dataset presents an efficient and flexible network intrusion detection system, NIDS, that outperforms previous work in terms of accuracy, precision, recall, and F-measure values.