With the increasing dependency of daily life over computer networks, the
importance of these networks security becomes prominent. Different intrusion
attacks to networks have been designed and the attackers are working on
improving them. Thus the ability to detect intrusion with limited number of
labeled data is desirable to provide networks with higher level of security. In
this paper we design an intrusion detection system based on a deep neural
network. The proposed system is based on self-supervised contrastive learning
where a huge amount of unlabeled data can be used to generate informative
representation suitable for various downstream tasks with limited number of
labeled data. Using different experiments, we have shown that the proposed
system presents an accuracy of 94.05% over the UNSW-NB15 dataset, an
improvement of 4.22% in comparison to previous method based on self-supervised
learning. Our simulations have also shown impressive results when the size of
labeled training data is limited. The performance of the resulting Encoder
Block trained on UNSW-NB15 dataset has also been tested on other datasets for
representation extraction which shows competitive results in downstream tasks