Contrastive learning for acoustic sensing