Intrusion detection in cyberspace is an important field for today's research on the scope of the security of computer networks. The purpose of designing and implementing the systems of intrusion detection is to accurately categorize the virtual users, the hackers and the network intruders based on their normal or abnormal behavior. Due to the significant increase in the volume of the exchanged data in cyberspace, the identification and the reduction of inappropriate data characteristics will play a significant role in the increment of accuracy and speed of intrusion detection systems. The most advanced systems for intrusion detection are designed for the detection of an attack with the inspection of the full data of an attack. It means that a system of detection will be able to recognize the attack only after the execution of the attack on the attacked computer. In this paper, a system for end-to-end early intrusion detection is presented for the prevention of attacks on the network before these attacks cause further detriment to the system. The proposed method uses a classifier based on the network of the deep neural for the detection of an attack. The proposed network on a supervised method is trained for the exploitation of the related features by the raw data of the traffic of the network. Experimentally, the proposed approach has been evaluated on the dataset of NSL-KDD. The extensive experiments show that the presented approach performs better than the advanced approaches based on the accuracy, the rate of detection and the rate of the false positive, and also, the proposed system betters the rate of detection for the classes of the minority.