Unsupervised Anomaly Detection

David Guthrie, Louise Guthrie, Ben Allison, Yorick WilksIJCAI 2007

Abstract

This paper presents a fully unsupervised methodology for detecting anomalous text segments within a document. By analyzing over 200 stylistic and linguistic features—including readability metrics, part-of-speech distributions, and rank-based correlations—the proposed system identifies "foreign" text (such as different authors, genres, or machine translations) without requiring prior training on "normal" data.

Introduction

Traditional anomaly detection systems, often referred to as novelty detection, typically rely on semi-supervised learning. These models require a substantial corpus of "normal" data to establish a baseline for comparison. However, in practical applications like identifying a single plagiarized paragraph or a spam snippet on a niche forum, a pre-existing model of "normal" style is rarely available.

The core challenge lies in defining "usual" behavior solely based on the context of the document itself. Small text segments often lack the statistical regularity needed to form a distinct signature, making it difficult to distinguish subtle stylistic shifts from natural variance.

Methodology

The authors approach anomaly detection as a ranking problem, representing each text segment as a high-dimensional vector across three feature categories:

  1. Surface and Readability Features: Metrics such as average word/sentence length and the Flesch-Kincaid Grade Level.
  2. Lexical and Syntactic Distributions: Percentages of specific parts of speech (POS), adjective-to-noun ratios, and POS tri-gram diversity.
  3. Rank Features: A novel technique utilizing ranked lists of frequent prepositions, pronouns, and POS patterns. A segment's profile is compared to the rest of the document using Spearman Rank Correlation.

Comparison Strategy

For each segment, the algorithm compares its feature vector against a vector representing the "complement"—the entirety of the document excluding that segment. Segments are then ranked by their degree of deviation from this dynamic baseline. To prevent features with larger scales (e.g., readability scores) from dominating the analysis, all variables are standardized to a range between zero and one.

Experimental Setup

The method was evaluated across three distinct scenarios:

  • Authorship: Inserting segments from one Victorian author into another's 50,000-word text.
  • Fact vs. Opinion: Inserting newspaper editorials (opinion) into newswire text (fact).
  • Machine Translation: Inserting Chinese-to-English Google Translate segments into native English newswire.

Results and Analysis

The system's performance was evaluated by the frequency with which the true anomaly appeared within the "Top N" most anomalous segments.

The Impact of Segment Size

A critical finding was the strong correlation between segment length and detection accuracy. Larger segments provide a more stable statistical "fingerprint," whereas shorter segments are prone to noise.

Authorship detection performance across different segment sizes.

In authorship detection (Figure 2), the system identified the anomaly in the top 20 list 94.83% of the time for 1,000-word segments, compared to approximately 64.73% for 100-word segments.

Performance Across Domains

The system proved exceptionally robust in detecting machine-translated text.

Translation detection performance, showing high accuracy even for smaller segments.

As shown in Figure 3, the system achieved 100% accuracy in placing 1,000-word machine-translated segments within the top 10 results. Even at the 100-word level, it maintained a 74.51% success rate in the top 20. For the Fact vs. Opinion task, the system successfully identified 1,000-word editorial anomalies in the top 20 segments 91% of the time.

Discussion and Limitations

The study highlights that stylistics (how something is said) can be more effective than semantics (what is said) for tasks like plagiarism detection where the topic remains constant. The "complement" approach provides a dynamic, document-specific baseline that adapts to the text at hand.

However, several limitations remain:

  • Fixed Boundaries: The use of fixed-length segments may not align with natural transitions in writing.
  • Genuine Anomalies: Non-stylistic anomalies, such as tables or lists, can trigger false positives.
  • Computational Cost: The high dimensionality of the feature set and the iterative comparison process may be resource-intensive for very large corpora.

Future research will explore more flexible segmentation techniques, such as utilizing paragraph breaks, to better reflect natural document structures.

Summary updated

BibTeX
@inproceedings{guthrie2007unsupervised,
  author = {David Guthrie and Louise Guthrie and Ben Allison and Yorick Wilks},
  title = {{Unsupervised Anomaly Detection}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2007},
}
Figure