Anomaly detection is the identification of activity that deviates from normal patterns, used in security to spot potential attacks or compromised accounts.