Selective and early threat detection in large networked systems