sift:sift_overview:anomaly_detection
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| sift:sift_overview:anomaly_detection [2026/03/31 15:35] – removed - external edit (Unknown date) 127.0.0.1 | sift:sift_overview:anomaly_detection [2026/03/31 15:35] (current) – ↷ Page name changed from sift:sift_overview:anomaly_detection_sift to sift:sift_overview:anomaly_detection wikisysop | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Anomaly Detection ====== | ||
| + | |||
| + | Sift provides a systematic approach for identifying and handling outliers in biomechanical data. The general workflow is: | ||
| + | |||
| + | - **Data cleaning**: exclude traces that clearly do not represent real movement, before any statistical analysis. | ||
| + | - **Outlier detection**: | ||
| + | - **Act on results**: exclude detected outliers, or treat them as traces of interest for further investigation. | ||
| + | |||
| + | {{: | ||
| + | |||
| + | //Anomaly Detection Using Dynamic Time Warping// | ||
| + | ===== Data Cleaning ===== | ||
| + | |||
| + | Before running any outlier detection, it is worth removing obvious data quality issues (e.g. missed markers, incorrect force plate assignments, | ||
| + | |||
| + | Follow the [[sift: | ||
| + | |||
| + | ===== Outlier Detection Methods ===== | ||
| + | ==== Mahalanobis Distance Test and SPE ==== | ||
| + | Two complementary methods for detecting outliers in PCA space. | ||
| + | |||
| + | * **Mahalanobis Distance** measures how far a data point is from the centre of the distribution, | ||
| + | * **Squared Prediction Error (SPE)** measures how well a data point is reconstructed by the PCA model. Use this to find points that are poorly represented by the retained components. These points contain variance that is not captured by the PCA model, even if they appear close to the group mean in PC space. | ||
| + | |||
| + | **When to use**: Use these methods to detect global outliers in the workspace scores after running PCA. | ||
| + | |||
| + | * Learn more: [[sift: | ||
| + | * Tutorial: [[sift: | ||
| + | ==== Local Outlier Factor ==== | ||
| + | Local Outlier Factor (LOF) detects outliers by comparing the local density of each point to that of its neighbours. Points in sparse regions relative to their surroundings are flagged as outliers. In Sift, LOF has been attached the PCA module. | ||
| + | |||
| + | **When to use**: Use this method to find local outliers in the PCA workspace scores, and the results contain clusters of varying density. | ||
| + | |||
| + | * Learn more: [[sift: | ||
| + | * Tutorial: [[sift: | ||
| + | ==== K-Means ==== | ||
| + | |||
| + | K-means groups PC scores into clusters based on Euclidean distance. Points that lie far from their cluster centroid are candidates for outliers. | ||
| + | |||
| + | **When to use**: Use this method when the data is expected to naturally fall into distinct groups in PC space, and to identify points that do not fit well within any group. Requires specifying the number of clusters in advance. | ||
| + | |||
| + | * Learn more: [[sift: | ||
| + | * Tutorial: [[sift: | ||
| + | |||
| + | ===== Other Methods of Outlier Detection ===== | ||
| + | ==== Dynamic Time Warping ==== | ||
| + | Dynamic Time Warping (DTW) measures the similarity between two time series traces by finding the point-to-point alignment that minimises total distance. The result is a cost function (the higher the cost, the less similar the two traces are). DTW does not require PCA. | ||
| + | |||
| + | For anomaly detection, each trace is compared to every other trace in the dataset. Traces whose median distance from all others exceeds a specified threshold are flagged as anomalies. | ||
| + | |||
| + | **When to use**: Use this method to detect outliers based on signal shape, without first running PCA. | ||
| + | |||
| + | * Learn more: [[sift: | ||
| + | * Dialog: [[sift: | ||
| + | ===== Excluding Detected Outliers ===== | ||
| + | |||
| + | Once outliers have been identified, they can be flagged for exclusion without deleting the underlying data. See [[sift: | ||
| + | |||
| + | ===== Method Comparison ===== | ||
| + | |||
| + | ^ Method ^ What it detects ^ When to use it ^ Requires PCA? ^ | ||
| + | | Mahalanobis Distance and SPE | Points that are global outliers in PC space | Detecting global outliers in PC scores after running PCA | Yes | | ||
| + | | Local Outlier Factor | Points that are unusually isolated from their neighbours in PC space | Outliers are suspected within subgroups, not just across the whole dataset | Yes | | ||
| + | | K-Means | Points that do not fit well within any natural grouping | A hypothesis exists about how many subgroups are in the data | Yes | | ||
| + | | Dynamic Time Warping | Traces dissimilar in shape to others in the dataset | Shape-based outlier detection without PCA | No | | ||
