Outlier detection in the Internet of Things (IoT) is crucial for ensuring the reliability and security of interconnected devices. This paper presents a novel approach for unsupervised outlier detection using Autoencoder-based models with Contrastive Loss. The method leverages the representation learning capability of autoencoders and the discriminative power of contrastive learning to effectively distinguish between normal and anomalous data points. The training procedure involves optimizing the encoder and decoder to minimize the total loss, which is a combination of reconstruction loss and contrastive loss. A detailed algorithm for determining the threshold for outlier detection based on statistical analysis of reconstruction errors is also proposed. Experimental results using the Statlog dataset demonstrate the effectiveness of the proposed method in identifying outliers, with performance evaluated using metrics such as precision, recall, and F1-score.