[Python] Time Series Anomaly Detection — How to Detect if Only the Most Recent Point is...

Discussão em 'Python' iniciado por Stack, Junho 20, 2025.

  1. Stack

    Stack Membro Participativo

    I'm working on a real-time anomaly detection system using time series data. The core requirement is not to detect all historical anomalies, but only to determine whether the most recent value (i.e., the last timestamp in the series) is anomalous.

    Context:

    We are using univariate time series, and our system is deployed in production with the following setup:

    1. Model 1: Global classifier (1D CNN)

    Determines whether the full series (or a window) contains any anomaly.

    1. Model 2: Localizer (1D CNN)

    Outputs a probability per time step, localizing where anomalies might be.

    We use this two-step system as follows:

    When the global model flags an anomaly, the local model highlights which points are responsible.

    If the flagged points are not the most recent, we: -Log them. -replace them with flat values (e.g., mean or neutral constant) to avoid repeated detection.

    Then we re-run detection: this cleaning ensures that only a new anomaly at the last point will ever be flagged.

    This daily process is repeated iteratively, day by day.

    Problem: We're looking to simplify or improve this setup. Specifically:


    Are there existing anomaly detection models — ideally state-of-the-art — that are designed to evaluate only the last point of a time series, without requiring heavy preprocessing or cleaning of the previous anomalies?
    ​

    Continue reading...

Compartilhe esta Página