Federated Contrastive Representation Learning for IoT Anomaly Detection Under Heterogeneous Data
This study proposes a federated contrastive learning based distributed anomaly detection framework to address privacy protection requirements in IoT environments. The framework builds local encoders on each node to embed high-dimensional time series and network behavior features, and uses representation alignment to reduce distribution differences across devices. Based on this, a contrastive learning objective is introduced to strengthen the compactness of normal patterns in the latent space and to enlarge the boundary between normal and abnormal features, which enhances discriminative ability under unsupervised conditions. To avoid sharing raw data, the framework adopts a federated learning strategy that constructs a global model by exchanging model updates, and further improves global representation consistency and robustness through cross-node consistency constraints and dynamic weighted aggregation. Experimental results show that the model achieves stable and accurate anomaly detection under heterogeneous, multi-source, and incomplete IoT data conditions, demonstrating strong adaptability to distribution shifts and noise disturbances. Overall, the proposed federated contrastive learning method provides an effective technical approach for building secure and reliable IoT anomaly detection systems and enables cross-device feature sharing and collaborative modeling without exposing any raw data.